Explorar o código

日报左边未填写调整

Lijy %!s(int64=3) %!d(string=hai) anos
pai
achega
fe678408b6

+ 59 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -32,7 +32,7 @@
                         <el-option value="3" label="待提交">待提交</el-option>
                         </el-select></div>
                     <div>
-                        <el-tree :data="data"  @node-click="handleNodeClick">
+                        <el-tree :data="data"  @node-click="handleNodeClick" >
                             <span class="custom-tree-node" slot-scope="{ node, data}">
                             <span>{{ node.label }}</span>
                             <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
@@ -68,7 +68,7 @@
                         <span v-if="targetUid == null">
                          - 已填写
                         <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
-                        未填写<el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length}}</span></el-link>人
+                        未填写<el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>人
                         </span>
                         </span>
                         <span style="float:right;">
@@ -1000,8 +1000,7 @@
                 zhoBaoIdx: '',
                 zhoBaoName: '',
                 zhis: {},
-                dataAn: [],
-                dataSelected: []
+                dealList: []
             };
         },
         filters: {
@@ -1018,6 +1017,13 @@
                 var dateArray = value.split("-");
                 var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
                 return "周" + "日一二三四五六".charAt(date.getDay());
+            },
+            // 过滤数字
+            numbers(value) {
+                if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
+                    return 0
+                }
+                return value
             }
         },
         methods: {
@@ -1995,7 +2001,8 @@
             },
             // 部门列表点击
             handleNodeClick(data) {
-                console.log(data, this.dataAn, this.dataSelected)
+                // this.dealList = data
+                // this.theValues(data.id, this.allData)
                 this.depData = data;
                 var list = [];
                 if (data.id == -1) {
@@ -2013,10 +2020,24 @@
                 this.getReportList();
                 if (list.length > 0) {
                     this.unFillList = this.getUserMembListFromDeptList(list, 0);
-                    this.fillList = this.getUserMembListFromDeptList(list, 1);
+                    this.fillList = this.getUserMembListFromDeptList(list, 1)
                 } 
-                
-            },
+                console.log(this.depData.isUser)
+                console.log(this.depData.membCount)
+                console.log(this.depData)
+            },
+            // theValues(id, item) {
+            //     for(var i in item) {
+            //         if(item[i].id == id) {
+            //             this.dealList = item[i]
+            //             return
+            //         } else {
+            //             if(item[i].children) {
+            //                 this.theValues(id, item[i].children)
+            //             } 
+            //         }
+            //     }
+            // },
 
             //获取可以选择的代填的人员列表
             getSubstitudeUserDeptList() {
@@ -2104,7 +2125,6 @@
                             }
                         }
                         this.stateChange()
-                        
                     } else {
                         this.$message({
                             message: res.msg,
@@ -2359,7 +2379,7 @@
                     if (res.code == "ok") {
                         this.reportList = res.data;
                         document.querySelector("#day"+this.choseDay).scrollIntoView(true);
-                        // this.stateChange()
+                        // this.dealWith()
                     } else {
                         this.$message({
                             message: res.msg,
@@ -2375,7 +2395,36 @@
                     });
                 });
             },
+            // 处理数据
+            // dealWith() {
+            //     var tianxie = 0
+            //     var weixtianxie = 0
+            //     if(this.selectState == -1) {
 
+            //     } else {
+            //         var arr = []
+            //         for (var i in this.reportList) {
+            //             arr.push(this.reportList[i].id)
+            //         }
+            //         this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
+            //     }
+            // },
+            // getDealWith(item, tx, wtx, arr) {
+            //     // console.log(item,12345)
+            //     for(var i in item) {
+            //         if(item[i].children) {
+            //             this.getDealWith(item[i].children, tx, wtx, arr)
+            //         } else {
+            //             console.log(arr.indexOf(item[i].id))
+            //             console.log(arr)
+            //             console.log(item[i].id)
+            //             if(arr.indexOf(item[i].id) != '-1') {
+            //                 tx = +tx + 1
+            //             }
+            //         }
+            //     }
+            //     console.log(tx, '看看值')
+            // },
             //导出日报
             exportReport() {
                 this.listLoading = true;