From 2c81816264faf579143f8b17582248ce15f369ce Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期日, 09 三月 2025 13:48:35 +0800
Subject: [PATCH] 出库单添加正在作业中数量

---
 pages/phyz/orderOut/orderOutSelect.vue |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/pages/phyz/orderOut/orderOutSelect.vue b/pages/phyz/orderOut/orderOutSelect.vue
index 36a0e83..49ec214 100644
--- a/pages/phyz/orderOut/orderOutSelect.vue
+++ b/pages/phyz/orderOut/orderOutSelect.vue
@@ -21,6 +21,7 @@
 				<view>璁㈠崟鏁伴噺锛歿{orderDetl.anfme}}</view>
 				<view>搴撳瓨鏁伴噺锛歿{orderDetl.stock}}</view>
 				<view>宸插嚭鏁伴噺锛歿{orderDetl.qty}}</view>
+				<view v-if="orderDetl.workNum">姝e湪浣滀笟鏁伴噺锛歿{orderDetl.workNum}}</view>
 			</view>
 			<view class="list-right" @click="goToLocDetl(orderDetl)">
 				<uni-icons type="right" size="25"  color="#fff"></uni-icons>
@@ -110,6 +111,7 @@
 					order_no: '',
 					brand: ''
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -125,6 +127,8 @@
 		},
 		methods: {
 			getOrderDetlList(threeCode,limit) {
+				this.wrkingData = []
+				this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -149,6 +153,13 @@
 								}
 							}
 							let list = res.data.records
+							for (let item of list) {
+								for (let k of _this.wrkingData) {
+									if (k.matnr == item.matnr && k.orderNo == item.orderNo && k.threeCode == item.threeCode) {
+										item['workNum'] = k.anfme
+									}
+								}
+							}
 							_this.dataList =  _this.dataList.concat(list);
 							_this.data.curr = _this.data.curr + 1
 							_this.total = res.data.total
@@ -158,6 +169,32 @@
 							setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
 						} else {
 							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+						}
+					}
+				})
+			},
+			get() {
+				let _this = this
+				let data = {limit:9999,curr: 1}
+				uni.request({
+					url: `${_this.baseUrl}/agv/wrkDetl/list/auth`,
+					header: {'token': uni.getStorageSync('token')},
+					data: data,
+					method: 'GET',
+					success(res) {
+						var res = res.data
+						if (res.code === 200) {
+							const result = res.data.records.reduce((acc, curr) => {
+							    const key = `${curr.matnr}-${curr.orderNo}-${curr.threeCode}`;
+							    if (acc[key]) {
+							        acc[key].anfme += curr.anfme;
+							    } else {
+							        acc[key] = { ...curr };
+							    }
+							    return acc;
+							}, {});
+							const newArray = Object.values(result);
+							_this.wrkingData = newArray
 						}
 					}
 				})
@@ -225,7 +262,7 @@
 				this.data.curr = 1
 				this.data.maktx = this.maktx
 				this.data.matnr = this.matnr
-				this.data.order_no = this.order_no
+				this.data.order_no = this.orderNo
 				this.data.brand = this.brand
 				this.getOrderDetlList(this.searchValue1,10)
 				this.$refs.filter.close()

--
Gitblit v1.9.1