Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 year ago
parent
commit
2940311797

+ 8 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/components/chooseSomeone.vue

@@ -219,6 +219,14 @@ export default {
       console.log(this.treeVal)
       console.log(this.$refs.tree.getCheckedNodes())
       let arr = this.$refs.tree.getCheckedNodes()
+      arr = arr.filter(item => {
+        return !item.children
+      })
+      console.log(arr)
+      if(arr.length <= 0) {
+        this.$toast('请选择人员');
+        return
+      }
       let newArr = arr.map(item => {
         return {
           id: item.id,

+ 7 - 5
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/index/index.vue

@@ -90,11 +90,13 @@ export default {
         }
         console.log(this.user, '====>')
 
-        if(this.user.beDeptList && this.user.beDeptList.length > 0) {
-            localStorage.setItem('beDeptList', true)
-        } else {
-            localStorage.setItem('beDeptList', false)
-        }
+        setTimeout(() => {
+            if(this.user.beDeptList && this.user.beDeptList.length > 0) {
+                localStorage.setItem('beDeptList', true)
+            } else {
+                localStorage.setItem('beDeptList', false)
+            }
+        }, 1000)
     },
     components: {
         Footer

+ 11 - 11
fhKeeper/formulahousekeeper/timesheet-workshop/config/index.js

@@ -1,20 +1,20 @@
 var path = require('path')
 
 //  var ip = '192.168.2.12'
-//var ip = '47.101.180.183'
+// var ip = '47.101.180.183'
 // var ip = '47.100.37.243'
 // var ip = '192.168.10.2'
-// var ip = '192.168.2.12' 
+var ip = '192.168.2.12' 
 
-var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-for (var i in ifaces) {
-    for (var j in ifaces[i]) {
-        var val = ifaces[i][j]
-        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-            ip = val.address
-        }
-    }
-}
+// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+// for (var i in ifaces) {
+//     for (var j in ifaces[i]) {
+//         var val = ifaces[i][j]
+//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+//             ip = val.address
+//         }
+//     }
+// }
 // 1196735749
 module.exports = {
   build: {

+ 58 - 21
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -19,17 +19,18 @@
           </div>
         </div>
         <div class="OutSide_right">
-              <el-link type="primary" :underline="false" @click="(deptSetDialog = true), getPlanDeptSet()">{{ "部门设置"
-              }}</el-link>
-              <el-link type="primary" :underline="false" @click="addPlan()">{{
-                `新增${titleText}`
-              }}</el-link>
-              <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
-                <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
-              </el-upload>
-              <el-link type="primary" :underline="false" @click="exportData()"
-                :download="this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '' + '.xlsx'">{{ "导出"
-                }}</el-link>
+          <el-link type="primary" :underline="false" @click="(deptSetDialog = true), getPlanDeptSet()">{{ "部门设置"
+          }}</el-link>
+          <el-link type="primary" :underline="false" @click="addPlan()">{{
+            `新增${titleText}`
+          }}</el-link>
+          <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
+            <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
+          </el-upload>
+          <el-link type="primary" :underline="false" @click="exportData()"
+            :download="this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '' + '.xlsx'">{{
+              "导出"
+            }}</el-link>
         </div>
       </div>
     </div>
@@ -97,7 +98,7 @@
             </el-select>
           </el-form-item>
           <el-form-item label="项目代码" style="width: 100%" prop="projectCode">
-            <el-input v-model="todayPlanForm.projectCode"  maxlength="50"></el-input>
+            <el-input v-model="todayPlanForm.projectCode" maxlength="50"></el-input>
           </el-form-item>
           <el-form-item label="钢印号" style="width: 100%" prop="steelStampNumberStart">
             <el-input class="w45" v-model="todayPlanForm.steelStampNumberStart" maxlength="20"></el-input>
@@ -213,7 +214,7 @@ export default {
         steelStampNumberEnd: "",
         num: "",
         mainProcess: "",
-        progress:"",
+        progress: "",
         stationId: "",
         foremanId: "",
         foremanName: "",
@@ -315,7 +316,7 @@ export default {
         this.departmentIdArray,
         JSON.stringify(this.departmentIdArray)
       );
-      // return
+      return
       let arr = [];
       for (var i in this.departmentIdArray) {
         arr.push(
@@ -357,8 +358,15 @@ export default {
             for (var i in arr) {
               arr[i] = +arr[i];
             }
-            console.log(arr);
-            this.departmentIdArray = arr;
+            // console.log(arr)
+            // let newArr = []
+            // for(let j in arr) {
+            //   console.log(arr[j])
+            //   newArr.push(this.findAncestorsById(this.departmentList, arr[j]))
+            // }
+            // console.log(newArr)
+            // this.departmentIdArray = arr;
+            this.handleDepartmentIdArray(arr)
           } else {
             this.$message({
               message: res.msg,
@@ -374,6 +382,34 @@ export default {
         }
       );
     },
+    handleDepartmentIdArray(arr) {
+      console.log(arr, '过来的值')
+      let newArr = []
+      for (var i in arr) {
+        newArr.push(this.findAncestorsById(this.departmentList, arr[i]))
+      }
+      console.log(this.departmentIdArray, '===>')
+      this.departmentIdArray = newArr;
+    },
+    // 递归回显人员
+    findAncestorsById(tree, value, result = []) {
+      for (const node of tree) {
+        if (node.value === value) {
+          return [...result, node.value];
+        }
+
+        if (node.children) {
+          const temp = this.findAncestorsById(node.children, value, [
+            ...result,
+            node.value,
+          ]);
+          if (temp) {
+            return temp;
+          }
+        }
+      }
+      return null;
+    },
     getHasSetPlanDeptList() {
       this.http.post(
         "/plan/hasSetDeptDetail",
@@ -471,8 +507,8 @@ export default {
             this.todayPlanForm.stationId[
             this.todayPlanForm.stationId.length - 1
             ];
-          this.$delete(this.todayPlanForm, 'product')  
-          this.$delete(this.todayPlanForm, 'planProcedureTotals')  
+          this.$delete(this.todayPlanForm, 'product')
+          this.$delete(this.todayPlanForm, 'planProcedureTotals')
           this.http.post(
             "/plan/addOrUpdatePlan",
             {
@@ -488,8 +524,8 @@ export default {
                   type: "success",
                 });
                 this.editPlanDiaLog = false;
-                this.todayPlanForm=[];
-                 this.getTableData(this.hasChooseDept);
+                this.todayPlanForm = [];
+                this.getTableData(this.hasChooseDept);
               } else {
                 this.$message({
                   message: res.msg,
@@ -632,7 +668,7 @@ export default {
           if (res.code == "ok") {
             var filePath = res.data;
             const a = document.createElement('a'); // 创建a标签
-            a.setAttribute('download',(this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '')+ '.xlsx');// download属性
+            a.setAttribute('download', (this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '') + '.xlsx');// download属性
             a.setAttribute('href', filePath);// href链接
             a.click(); //自执行点击事件
             a.remove();
@@ -767,6 +803,7 @@ export default {
     .OutSide_right {
       display: flex;
       align-items: center;
+
       .el-link {
         margin-right: 15px;
       }