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

---
 pages/phyz/orderOut/orderOutSelectV2.vue |   81 +++++++++++++++++++++++++++++-----------
 1 files changed, 58 insertions(+), 23 deletions(-)

diff --git a/pages/phyz/orderOut/orderOutSelectV2.vue b/pages/phyz/orderOut/orderOutSelectV2.vue
index a0090c2..c332d78 100644
--- a/pages/phyz/orderOut/orderOutSelectV2.vue
+++ b/pages/phyz/orderOut/orderOutSelectV2.vue
@@ -21,6 +21,7 @@
 				<view>璁㈠崟鏁伴噺锛歿{orderDetl.anfme}}</view>
 				<view>搴撳瓨鏁伴噺锛歿{orderDetl.stock}}</view>
 				<view>宸插嚭鏁伴噺锛歿{orderDetl.qty}}</view>
+				<view>姝e湪浣滀笟鏁伴噺锛歿{orderDetl.workNum?orderDetl.workNum:0}}</view>
 			</view>
 			<view class="list-right" @click="goToLocDetl(orderDetl)">
 				<uni-icons type="right" size="25"  color="#fff"></uni-icons>
@@ -111,6 +112,7 @@
 					brand: '',
 					orderType: null
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -133,17 +135,17 @@
 						_this.data.orderType = []
 					}
 				}
-				
+				_this.baseUrl = uni.getStorageSync('baseUrl');
+				_this.token = uni.getStorageSync('token');
+				_this.searchValue = uni.getStorageSync('threeCode');
+				_this.getOrderDetlList(_this.searchValue,10)
+				console.log("onLoad");
 			})
-			this.baseUrl = uni.getStorageSync('baseUrl');
-			this.token = uni.getStorageSync('token');
-			this.searchValue1 = uni.getStorageSync('threeCodeOut193');
-			this.searchValue2 = uni.getStorageSync('threeCodeOut2');
-			this.getOrderDetlList(this.searchValue1,10)
 		},
 		methods: {
-			getOrderDetlList(threeCode,limit) {
-				// this.get(threeCode,limit)
+			 getOrderDetlList(threeCode,limit) {
+				 this.wrkingData= []
+				 this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -153,7 +155,7 @@
 					url: `${_this.baseUrl}/orderDetl/pakout/list/authV7`,
 					header: {'token': uni.getStorageSync('token')},
 					data: _this.data,
-					method: 'POST',
+					method: 'GET',
 					success(res) {
 						uni.hideLoading({})
 						res = res.data
@@ -168,6 +170,17 @@
 								}
 							}
 							let list = res.data.records
+							
+							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
+										}
+									}
+								}
+							}
 							_this.dataList =  _this.dataList.concat(list);
 							_this.data.curr = _this.data.curr + 1
 							_this.total = res.data.total
@@ -181,23 +194,45 @@
 					}
 				})
 			},
-			get(threeCode,limit) {
+			get() {
 				let _this = this
-				_this.mask = true
-				_this.data.three_code = threeCode
-				_this.data.limit = 10
-				for	(var i = 0; i < 30; i++) {
-					console.log(1);
-					uni.request({
-						url: `${_this.baseUrl}/orderDetl/pakout/list/authV3`,
-						header: {'token': uni.getStorageSync('token')},
-						data: _this.data,
-						method: 'GET',
-						success(res) {
+				let data = {limit:9999,curr: 1}
+				uni.request({
+					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.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
 							
+								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
+											}
+										}
+									}
+								}
 						}
-					})
-				}
+					}
+				})
 			},
 			searchValueInput1() {
 				this.dataList = []

--
Gitblit v1.9.1