From e0ac51ff9a3369e118c449fcc8cefca4302b41b6 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期六, 18 十一月 2023 17:19:52 +0800
Subject: [PATCH] 	modified:   src/api/product/personboard.js 	modified:   src/views/product/workbench/batchproductout-form-new.vue

---
 src/views/product/workbench/batchproductout-form-new.vue |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/src/views/product/workbench/batchproductout-form-new.vue b/src/views/product/workbench/batchproductout-form-new.vue
index 66bd976..56aeb54 100644
--- a/src/views/product/workbench/batchproductout-form-new.vue
+++ b/src/views/product/workbench/batchproductout-form-new.vue
@@ -12,7 +12,7 @@
     title="姹囨姤浜у嚭"
     :visible.sync="innerVisible"
     append-to-body
-    @close="$emit('update:currshowlist', false)"
+    @close="handleClose"
     :show="currshowlist"
     :close-on-click-modal="false"
     class="batch-product-out-form"
@@ -359,6 +359,7 @@
   data() {
     return {
       innerVisible: false,
+      staffNameList: [],
       personSelection: [],
       saveDisabled: false,
       currDutyInitproducts: [], // 鐢ㄤ簬缂撳瓨椤甸潰涓師鏈夌殑staff浜у嚭璁板綍锛屽苟涓旀槸灞炰簬褰撳墠鐝涓嬬殑锛岀敤浜庡嬀閫変汉鍛樻椂浣滀负鍘熸暟鎹弬鐓�
@@ -374,6 +375,35 @@
     }
   },
   methods: {
+    initProductList(){
+      let val = this.personSelection
+      //鎸変汉鍛樻姤宸�
+      if(this.groupStatus){
+        this.products = []
+        this.addProductOutForPerson()
+      }else{
+        //鎸夌粍鎶ュ伐
+        let nameList = []
+        val.forEach(obj=>{
+          nameList.push(obj.staffName)
+        })
+        let staffName = Array.from(new Set(nameList)).join(",")
+        if(staffName!=''){
+          this.products = this.productList
+          this.products.forEach(item=>{
+            item.staffName = staffName
+          })
+        }else{
+          this.products = []
+        }
+      }
+    },
+    handleClose(){
+      this.$emit('update:currshowlist', false)
+      this.$nextTick(()=>{
+        this.$refs.productOutPersonList.clearSelection()
+      })
+    },
     isNumber(value) {
       var reg = /^[0-9]+(.[0-9]{1,4})?$/
       if (
@@ -419,6 +449,9 @@
       // 鍐嶅幓涓巔roducts(姝や负椤甸潰鐨勫疄鏃舵暟鎹紝鐢ㄦ埛鏈夋敼鍔ㄥ嵆鏇存柊)瀵规瘮锛屽皢鍏朵腑瀛樺湪鐨勭浉鍚屼汉鍛樼殑鐢熶骇鏁伴噺鍜岀敓浜ф壒娆″悓姝ヨ繃鏉ワ紝鑻roducts涓敓浜ф暟閲忔垨鐢熶骇鎵规涓嶅瓨鍦ㄥ�硷紝鍒欎笉杩涜鍚屾锛屾部鐢ㄥ師鏉ョ殑銆�
       // 鏈�鍚庯紝灏嗙粍瑁呭ソ鐨勯�変腑浜哄憳淇℃伅锛屾洿鏂板埌products(鎸夌収鐝杩涜)锛屾敞鎰忔洿鏂颁箣鍚庨�変腑浜哄憳淇℃伅鍦╬roducts浣嶇疆椤哄簭
       this.personSelection = val
+      if(this.currshowlist){
+        this.initProductList()
+      }
     },
     // 鏍规嵁閫変腑鐨勪汉鍛橈紝鐢熸垚浜哄憳浜у嚭淇℃伅锛屽苟涓旀斁鍦ㄥ彸杈瑰垪琛ㄧ殑鏈�鍓嶉潰
     addProductOutForPerson() {
@@ -502,20 +535,21 @@
 		saveProductOuts2() {
 			this.clickDateArr.push(new Date().getTime())
 			var productOutputList = []
-			this.productList.forEach(a=>{
+			this.products.forEach(a=>{
 				productOutputList.push({
 					partId: a.partId,
 					productQty: a.outNum,
 					outBatchNo: a.outBatchNo,
 					scrapQty: a.scrapQty,
 					remark: a.remark,
-          wdr: a.wdr,
+				  wdr: a.wdr,
 					staffNo: a.staffNo,
 					staffName: a.staffName,
 					status: a.status,
 					dutyRecordId: a.dutyRecordId,
 					productStaffIds: a.productStaffIds,
-					productStaffs: a.productStaffs
+					productStaffs: a.productStaffs,
+					sortNo: a.sortNo
 				})
 			})
 			var productMains = {
@@ -1055,14 +1089,14 @@
             this.products.push(this.productList[i])
           }
           this.$nextTick(() => {
-            this.$refs.productOutPersonList.clearSelection()
+            this.$refs.productOutPersonList.toggleAllSelection()
           })
         } else {
           for (let i = 0; i < this.productList.length; i++) {
             this.products.push(this.productList[i])
           }
           this.$nextTick(() => {
-            this.$refs.productOutPersonList.clearSelection()
+            this.$refs.productOutPersonList.toggleAllSelection()
           })
         }
       }

--
Gitblit v1.9.3