Jelajahi Sumber

作业票编辑推送

pm 1 tahun lalu
induk
melakukan
9c84885763

+ 4 - 3
src/components/separationPoint/index.vue

@@ -40,7 +40,8 @@ export default {
 
         }
       }
-    }
+    },
+
   },
   mounted() {
     this.initKonva()
@@ -145,8 +146,8 @@ export default {
       this.selectedText = []
 
       // const positions = JSON.parse(this.points.map);
-      const positions = this.getMapData
-      console.log(positions, 'positions')
+
+      let positions=this.getMapData
 
       // 检查 this.getSelectSopPoints 是否有内容
       const isLocked = this.getSelectSopPoints.length > 0

+ 2 - 1
src/store/modules/sopSelectPoints.js

@@ -7,6 +7,7 @@ const state = {
   ticketTitle: '',
   sopLook: false,
   MapData:null,
+
 };
 
 const mutations = {
@@ -30,7 +31,7 @@ const mutations = {
   },
   setMapData(state, points) {
     state.MapData = points;
-  }
+  },
 };
 
 const actions = {

+ 29 - 16
src/views/mes/job/jobm/NewOperations.vue

@@ -585,7 +585,8 @@ export default {
          this.ticketStartTimeChange(newVal)
         }
       }
-    }
+    },
+
   },
   computed: {
     ...mapGetters('sopSelectPoints', [
@@ -651,6 +652,8 @@ export default {
       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
     },
     getTicket() {
+      this.getUser()
+
       const ticketId = this.$route.query.ticketId
       getJobTicketInfo(ticketId).then((response) => {
         console.log(response, '编辑拿到路由参数')
@@ -693,7 +696,7 @@ export default {
           EditBool: true
         }
         this.jobProps = [this.form]
-        this.listUserOption = response.data.jobTicketUserList
+        // this.listUserOption = response.data.jobTicketUserList
         console.log(this.form, 'form')
       })
     },
@@ -743,7 +746,7 @@ export default {
     DeptChage(val) {
       console.log(val, ' 部门下拉')
       // 每次选中先清空用户下拉
-      this.listUserOption = []
+      // this.listUserOption = []
       this.dialogForm.nickName = null
       const query = {
         pageNum: 1,
@@ -911,17 +914,17 @@ export default {
     //   })
     // },
     // 共锁人下拉框删除事件
-    handleCoLockerChange(newValues) {
-      console.log(newValues, 'ticketUserDTOList-newsValue')
-
-      // 根据新值更新 this.form.ticketUserDTOList
-      this.form.ticketUserDTOList = this.form.ticketUserDTOList.filter((user) =>
-        newValues.includes(user.userName)
-      )
-
-      // 更新 coLocker 显示的内容
-      this.updateCoLocker()
-    },
+    // handleCoLockerChange(newValues) {
+    //   console.log(newValues, 'ticketUserDTOList-newsValue')
+    //
+    //   // 根据新值更新 this.form.ticketUserDTOList
+    //   this.form.ticketUserDTOList = this.form.ticketUserDTOList.filter((user) =>
+    //     newValues.includes(user.userName)
+    //   )
+    //
+    //   // 更新 coLocker 显示的内容
+    //   this.updateCoLocker()
+    // },
     handleClick(tab, event) {
       // console.log(tab, event);
     },
@@ -982,8 +985,18 @@ export default {
         const workshopId = await this.getWorkshopId(query1)
 
         // 合并 newticketUserDTOList 到 this.form.ticketUserDTOList
-        this.form.ticketUserDTOList.push(...this.newticketUserDTOList)
-
+        if (this.form.locker) {
+          const selectedUser = this.listUserOption.find(option => option.label === this.form.locker);
+          if (selectedUser) {
+            this.form.ticketUserDTOList.push({
+              userName: selectedUser.label,
+              userId: selectedUser.value,
+              userType: '0',
+              userRole: '0'
+            });
+          }
+        }
+        this.form.ticketUserDTOList.push(...this.newticketUserDTOList);
         const data = {
           pointIds: this.form.pointIds,
           sopId: this.form.sopId,

+ 7 - 0
src/views/mes/job/jobm/index.vue

@@ -360,6 +360,10 @@ export default {
       "setSopEdit",
       "setSopLook",
       "setJobLook",
+      "selectSopPoints",
+      "PointTableData",
+      "PointTableData",
+      "setMapData"
     ]),
     // 格式化日期查询数据
     formatDate(date) {
@@ -473,10 +477,13 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
+      this.selectSopPoints(null)
+      this.PointTableData(null)
       this.$router.push(`/mes/job/jobm/NewOperations?ticketId=null`);
       this.title = "添加隔离点";
       this.optType = "add";
       this.setSopLook(false);
+      this.setMapData(null)
     },
     // 查看
     handleLook(row) {