From cd8d6ca53a2245252917f7c938299af9761e4423 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 11 三月 2025 08:15:50 +0800
Subject: [PATCH] 正在作业数量

---
 pages/phyz/orderOut/orderOutSelect.vue |   37 +++++++++++++++++++++++++++----------
 1 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/pages/phyz/orderOut/orderOutSelect.vue b/pages/phyz/orderOut/orderOutSelect.vue
index 49ec214..442e9bf 100644
--- a/pages/phyz/orderOut/orderOutSelect.vue
+++ b/pages/phyz/orderOut/orderOutSelect.vue
@@ -21,7 +21,7 @@
 				<view>璁㈠崟鏁伴噺锛歿{orderDetl.anfme}}</view>
 				<view>搴撳瓨鏁伴噺锛歿{orderDetl.stock}}</view>
 				<view>宸插嚭鏁伴噺锛歿{orderDetl.qty}}</view>
-				<view v-if="orderDetl.workNum">姝e湪浣滀笟鏁伴噺锛歿{orderDetl.workNum}}</view>
+				<view>姝e湪浣滀笟鏁伴噺锛歿{orderDetl.workNum||orderDetl.workNum==0?orderDetl.workNum:""}}</view>
 			</view>
 			<view class="list-right" @click="goToLocDetl(orderDetl)">
 				<uni-icons type="right" size="25"  color="#fff"></uni-icons>
@@ -126,8 +126,8 @@
 			this.getOrderDetlList(this.searchValue1,10)
 		},
 		methods: {
-			getOrderDetlList(threeCode,limit) {
-				this.wrkingData = []
+			 getOrderDetlList(threeCode,limit) {
+				this.wrkingData= []
 				this.get()
 				uni.showLoading({})
 				let _this = this
@@ -153,10 +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
+							if (_this.wrkingData&&_this.wrkingData.length >0){
+								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
+										}
 									}
 								}
 							}
@@ -177,16 +180,16 @@
 				let _this = this
 				let data = {limit:9999,curr: 1}
 				uni.request({
-					url: `${_this.baseUrl}/agv/wrkDetl/list/auth`,
+					url: `${_this.baseUrl}/orderDetl/pakout/workNum`,
 					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 result = res.data.reduce((acc, curr) => {
 							    const key = `${curr.matnr}-${curr.orderNo}-${curr.threeCode}`;
-							    if (acc[key]) {
+								if (acc[key]) {
 							        acc[key].anfme += curr.anfme;
 							    } else {
 							        acc[key] = { ...curr };
@@ -195,6 +198,20 @@
 							}, {});
 							const newArray = Object.values(result);
 							_this.wrkingData = newArray
+							
+							if (_this.dataList&&_this.dataList.length >0){
+								for (let item of _this.dataList) {
+									for (let k of _this.wrkingData) {
+										if (k.matnr == item.matnr && k.orderNo == item.orderNo && k.threeCode ==
+											item.threeCode) {
+											item['workNum'] = k.anfme
+											break
+										}else{
+											item['workNum'] = 0
+										}
+									}
+								}
+							}
 						}
 					}
 				})

--
Gitblit v1.9.1