humingbo hace 1 año
padre
commit
ab84e28fff
Se han modificado 1 ficheros con 17 adiciones y 28 borrados
  1. 17 28
      src/views/statistics/performance.vue

+ 17 - 28
src/views/statistics/performance.vue

@@ -5,14 +5,14 @@
         <div class="block">
           <el-date-picker
             v-model="yearValue"
-            type="year"
-            placeholder="选择年查询" size="small">
+            type="year" value-format="yyyy" format="yyyy"
+            placeholder="选择年查询" size="small" @change="queryPerformanceDate">
           </el-date-picker>
-          <el-button style="margin-left: 5px;" type="primary" @click="queryPerformanceDate">查询</el-button>
-          <el-button style="margin-left: 5px;" type="success" @click="addScoreWin">创建评分</el-button>
+          <el-button style="margin-left: 5px;" v-if="false" type="primary" @click="queryPerformanceDate">查询</el-button>
+          <el-button style="margin-left: 25px;" type="success" @click="addScoreWin">创建评分</el-button>
         </div>
         <div style="margin-top: 15px">
-          <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
+          <el-tree :default-expand-all="true" :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
         </div>
 
       </el-col>
@@ -81,7 +81,7 @@
 </template>
 
 <script>
-import { addPerformanceScoreSet, getDateDataList } from '@/api/performance/performance'
+import { addPerformanceScoreSet, getDateDataList, getDateListByYear } from '@/api/performance/performance'
 import { getDeptUserTree } from '@/api/system/user'
 
 export default {
@@ -112,26 +112,7 @@ export default {
       userList:[],
       dateDatas:[],
       monthDatas:[],
-      data: [{
-        label: '一级 1',
-        children: [{
-          label: '二级 1-1'
-        }]
-      }, {
-        label: '一级 2',
-        children: [{
-          label: '二级 2-1'
-        }, {
-          label: '二级 2-2'
-        }]
-      }, {
-        label: '一级 3',
-        children: [{
-          label: '二级 3-1'
-        }, {
-          label: '二级 3-2'
-        }]
-      }],
+      data: [],
       defaultProps: {
         children: 'children',
         label: 'label'
@@ -140,6 +121,7 @@ export default {
   },
   mounted() {
     this.getUsers()
+    this.getData()
   },
   methods: {
     getUsers(){
@@ -147,11 +129,18 @@ export default {
         this.userList = res.data
       });
     },
+    getData(){
+      let year=this.yearValue
+      getDateListByYear(year).then(res =>{
+        this.data=res.data
+      });
+    },
     handleNodeClick(data) {
       console.log(data);
     },
     queryPerformanceDate(){
-      alert('查询日期');
+      let year=this.yearValue
+      this.getData()
     },
     addScoreWin(){
       this.getDateDataLists();
@@ -251,7 +240,7 @@ export default {
       addPerformanceScoreSet(editForm).then(res=>{
         this.$message.success("操作成功!")
         this.editFormVisible=false;
-        this.getDateDataLists();
+        this.getData()
       });
 
     },