Sfoglia il codice sorgente

拆解工单,计划排期优化

wyh 1 anno fa
parent
commit
0e3df66249

+ 15 - 33
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

@@ -78,9 +78,9 @@
             <el-select v-model="currentDbEdit.worker" placeholder="请选择操作员" style="width: 100%;">
               <el-option
                 v-for="item in worker"
-                :key="item.value"
+                :key="item.label"
                 :label="item.label"
-                :value="item.value">
+                :value="item.label">
               </el-option>
             </el-select>
           </el-form-item>
@@ -186,7 +186,7 @@ export default {
       ],
       // 注意:start_date(开始日期)和end_date(结束日期)和add(添加按钮)是固定死的参数名,不能更改
       // 注意:id和pid也是固定死的参数名,如果需要可以改组件
-      // id、content: 也是固定死的,如果需要可以改组件
+      // id、task_text: 也是固定死的,如果需要可以改组件
       taskLists: [],
       // taskLists: [{
       //     id: 0,
@@ -195,7 +195,7 @@ export default {
       //     start_date: '2023-07-03',
       //     end_date: '2023-07-04',
       //     statusC: '0',
-      //     content: '111'
+      //     task_text: '111'
       //   }, {
       //     id: 1,
       //     testItems: '测试',
@@ -393,36 +393,16 @@ export default {
         that.taskLists = []
         if (res.result.length > 0 ) {
           that.taskLists = res.result.map(res => {
-            return {
-              id: res.id,
-              pid: res.parent,
-
-              weituoId: res.weituoId,
-              testItemsId: res.testItemsId,
-              yangpinId:res.yangpinId,
-              shebeiId:res.shebeiId,
-              pm: res.pm,
-              reportNo: res.reportNo,
-              chuanganqiArray:res.chuanganqiArray,
-              testPlanId:res.testPlanId,
-              status:res.status,
-              pm: res.pm,
-
-              weituoNo: res.weituoNo,
-              neirong: res.neirong,
-              start_date: res.jihuaStartDate,
-              end_date: res.jihuaEndDate,
-              shiiyanTypeArray: res.shiiyanTypeArray,
-              shijiStartDate: res.shijiStartDate,
-              worker: res.worker,
-              yangpinCount:res.yangpinCount,
-
-              lastTime: res.lastTime,
-              sampleName: res.sampleName,
-              testItems: res.testItems,
-              deviceName: res.deviceName,
-              statusC: res.statusC
+            var obj = res
+            obj.pid = res.parent
+            obj.start_date = res.jihuaStartDate
+            obj.end_date = res.jihuaEndDate
+            if (obj.pid == null){
+              obj.task_text= res.deviceName+','+res.pm
+            } else {
+              obj.task_text= res.deviceName+','+res.worker
             }
+            return obj
           })
           console.log(that.taskLists)
         }
@@ -493,6 +473,8 @@ export default {
       console.log(current)
       this.currentDbEdit = current
       this.title = this.currentDbEdit.sampleName + '-' + this.currentDbEdit.testItems + '-' + this.currentDbEdit.pm
+      // 根据开始时间结束时间计算持续时间
+      this.currentDbEdit.lastTime = (new Date(this.currentDbEdit.end_date).getTime() - new Date(this.currentDbEdit.start_date).getTime()) / (1000 * 60 * 60 * 24)+1
       // this.currentIndex = this.taskLists.findIndex(res=>res.id === current.id)
       // this.currentDbEdit = this.taskLists[this.currentIndex]
       this.dialogVisible = true

+ 7 - 3
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt2.vue

@@ -122,7 +122,7 @@ export default {
       ],
       // 注意:start_date(开始日期)和end_date(结束日期)和add(添加按钮)是固定死的参数名,不能更改
       // 注意:id和pid也是固定死的参数名,如果需要可以改组件
-      // id、content: 也是固定死的,如果需要可以改组件
+      // id、task_text: 也是固定死的,如果需要可以改组件
       taskLists: [],
       // taskLists: [{
       //     id: 0,
@@ -131,7 +131,7 @@ export default {
       //     start_date: '2023-07-03',
       //     end_date: '2023-07-04',
       //     statusC: '0',
-      //     content: '111'
+      //     task_text: '111'
       //   }, {
       //     id: 1,
       //     testItems: '测试',
@@ -334,7 +334,9 @@ export default {
               testItems: res.testItems,
               deviceName: res.deviceName,
               statusC: res.statusC,
-              izShiji: res.izShiji
+              izShiji: res.izShiji,
+
+              task_text: res.deviceName+','+res.pm
             }
           })
         }
@@ -398,6 +400,8 @@ export default {
       console.log(current)
       this.currentDbEdit = current
       this.title = this.currentDbEdit.sampleName + '-' + this.currentDbEdit.testItems + '-' + this.currentDbEdit.pm
+      // 根据开始时间结束时间计算持续时间
+      this.currentDbEdit.lastTime = (new Date(this.currentDbEdit.end_date).getTime() - new Date(this.currentDbEdit.start_date).getTime()) / (1000 * 60 * 60 * 24)+1
       // this.currentIndex = this.taskLists.findIndex(res=>res.id === current.id)
       // this.currentDbEdit = this.taskLists[this.currentIndex]
       this.dialogVisible = true