From 6336e782cdc1eb27ee7fb0dfbf27c909e02d9453 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 17 四月 2024 15:28:59 +0800
Subject: [PATCH] 工单事后报备:新增点位id

---
 src/views/system/work-order/distribute/index.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/views/system/work-order/distribute/index.vue b/src/views/system/work-order/distribute/index.vue
index 1db483d..142e0dc 100644
--- a/src/views/system/work-order/distribute/index.vue
+++ b/src/views/system/work-order/distribute/index.vue
@@ -112,6 +112,7 @@
             reserve-keyword
             placeholder="璇烽�夋嫨鏉ユ簮"
             :remote-method="remoteGetPoints"
+            @change="setPointId"
             :loading="selectLoading">
             <el-option
               v-for="item in pointList"
@@ -146,6 +147,10 @@
   name: 'index',
   data() {
     return {
+      selectedIdsDistributeForm: {
+        ids: [],
+        unitId: null
+      },
       unitList: [],
       settingForm: {
         // 绂荤嚎
@@ -243,6 +248,10 @@
     },
   },
   methods: {
+    setPointId(selectedValue) {
+      const selectedItem = this.pointList.find(item => item.value === selectedValue);
+      this.form.pointId = selectedItem.id
+    },
     submitSetting() {
       this.$refs['settingForm'].validate((valid) => {
         if (valid) {
@@ -278,7 +287,8 @@
     },
     // 鍏ㄩ儴涓嬪彂
     allDistribute() {
-      selectedIdsDistribute([], this.unitId).then(res => {
+      this.selectedIdsDistributeForm.unitId = this.unitId
+      selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
         this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
         this.page();
       })
@@ -304,8 +314,11 @@
         this.$message.warning("璇峰厛閫夋嫨瑕佷笅鍙戠殑宸ュ崟")
         return
       } 
-      selectedIdsDistribute(this.multipleSelection, this.unitId).then(res => {
+      this.selectedIdsDistributeForm.unitId = this.unitId;
+      this.selectedIdsDistributeForm.ids = this.multipleSelection;
+      selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
         this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
+        this.selectedIdsDistributeForm.ids = [];
         this.page();
       })
     },

--
Gitblit v1.8.0