浏览代码

拆解工单优化

wyh 1 年之前
父节点
当前提交
65265ba35e
共有 1 个文件被更改,包括 8 次插入24 次删除
  1. 8 24
      itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

+ 8 - 24
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

@@ -107,7 +107,7 @@
             placement="top"
             width="160"
             v-model="visible"
-            v-if="currentDbEdit.pid != null">
+            v-if="currentDbEdit.pid != null && this.typeButton != 1">
             <p>确定删除改任务吗?</p>
             <div style="text-align: right; margin: 0">
               <el-button size="mini" type="text" @click="visible = false">取消</el-button>
@@ -270,6 +270,8 @@ export default {
       currentIndex: null,
       // 删除判断
       visible: false,
+      // 点击按钮判断
+      typeButton: null,
       // 表单校验
       rules: {
       },
@@ -462,32 +464,11 @@ export default {
     },
     // 新增事件
     addRow(row, index){
+      this.typeButton = 1
       console.log(row, index)
-      // this.currentDbEdit = row
-      // this.currentDbEdit.parent = row.id
-      // this.currentDbEdit.pid = row.id
-
-
-      this.currentDbEdit = {}
-      // 灯箱部分
-      this.currentDbEdit.start_date = row.start_date
-      this.currentDbEdit.lastTime = row.lastTime
-      this.currentDbEdit.end_date = row.end_date
-      this.currentDbEdit.shebeiId = row.shebeiId
-      // this.currentDbEdit.reportNo = row.reportNo
-      this.currentDbEdit.chuanganqiArray = row.chuanganqiArray
-      // 灯箱虽不展示,但也要赋值
+      this.currentDbEdit = JSON.parse(JSON.stringify(row))
       this.currentDbEdit.parent = row.id
       this.currentDbEdit.pid = row.id
-      this.currentDbEdit.deviceName = row.deviceName
-      this.currentDbEdit.yangpinId = row.yangpinId
-      this.currentDbEdit.sampleName = row.sampleName
-      this.currentDbEdit.shijiStartDate = row.shijiStartDate
-      this.currentDbEdit.testItems = row.testItems
-      this.currentDbEdit.testItemsId = row.testItemsId
-      this.currentDbEdit.testPlanId = row.testPlanId
-      this.currentDbEdit.weituoId = row.weituoId
-      this.currentDbEdit.weituoNo = row.weituoNo
       this.dialogVisible = true
     },
     // 删除
@@ -502,6 +483,7 @@ export default {
             console.log("删除",res)
             if (res.success) {
               this.$message.success('删除成功');
+              this.typeButton = null
               this.dialogVisible = false
               this.currentDbEdit = {}
               this.getHjlist()
@@ -511,6 +493,7 @@ export default {
     },
     cancel(){
       this.currentDbEdit = {}
+      this.typeButton = null
       this.dialogVisible = false
     },
     submit(){
@@ -525,6 +508,7 @@ export default {
         console.log("提交返回",res)
         if (res.success) {
           this.$message.success('提交成功');
+          this.typeButton = null
           this.dialogVisible = false
           this.currentDbEdit = {}
           this.getHjlist()