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      |   49 +++++++++++-----
 pages/phyz/orderOut/orderOutSelectV2.vue    |   49 +++++++++++-----
 pages/phyz/orderOut/bcpOrderOutSelect.vue   |   36 ++++++++++++
 pages/phyz/orderOut/bcpOrderOutSelect_2.vue |   36 ++++++++++++
 4 files changed, 138 insertions(+), 32 deletions(-)

diff --git a/pages/phyz/orderOut/bcpOrderOutSelect.vue b/pages/phyz/orderOut/bcpOrderOutSelect.vue
index 0bc8b9a..30f40cb 100644
--- a/pages/phyz/orderOut/bcpOrderOutSelect.vue
+++ b/pages/phyz/orderOut/bcpOrderOutSelect.vue
@@ -104,6 +104,7 @@
 					order_no: '',
 					brand: ''
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -119,6 +120,8 @@
 		},
 		methods: {
 			getOrderDetlList(threeCode,limit) {
+				this.wrkingData = []
+				this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -143,6 +146,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
@@ -156,6 +166,32 @@
 					}
 				})
 			},
+			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
+						}
+					}
+				})
+			},
 			searchValueInput1() {
 				this.dataList = []
 				this.data.curr = 1
diff --git a/pages/phyz/orderOut/bcpOrderOutSelect_2.vue b/pages/phyz/orderOut/bcpOrderOutSelect_2.vue
index 17dd475..c50b002 100644
--- a/pages/phyz/orderOut/bcpOrderOutSelect_2.vue
+++ b/pages/phyz/orderOut/bcpOrderOutSelect_2.vue
@@ -104,6 +104,7 @@
 					order_no: '',
 					brand: ''
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -119,6 +120,8 @@
 		},
 		methods: {
 			getOrderDetlList(threeCode,limit) {
+				this.wrkingData = []
+				this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -143,6 +146,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
@@ -156,6 +166,32 @@
 					}
 				})
 			},
+			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
+						}
+					}
+				})
+			},
 			searchValueInput1() {
 				this.dataList = []
 				this.data.curr = 1
diff --git a/pages/phyz/orderOut/orderOutSelect.vue b/pages/phyz/orderOut/orderOutSelect.vue
index 5b42c18..49ec214 100644
--- a/pages/phyz/orderOut/orderOutSelect.vue
+++ b/pages/phyz/orderOut/orderOutSelect.vue
@@ -111,6 +111,7 @@
 					order_no: '',
 					brand: ''
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -126,7 +127,8 @@
 		},
 		methods: {
 			getOrderDetlList(threeCode,limit) {
-				// this.get(threeCode,limit)
+				this.wrkingData = []
+				this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -151,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
@@ -164,23 +173,31 @@
 					}
 				})
 			},
-			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}/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
 						}
-					})
-				}
+					}
+				})
 			},
 			searchValueInput1() {
 				this.dataList = []
diff --git a/pages/phyz/orderOut/orderOutSelectV2.vue b/pages/phyz/orderOut/orderOutSelectV2.vue
index 8ac2721..432e87a 100644
--- a/pages/phyz/orderOut/orderOutSelectV2.vue
+++ b/pages/phyz/orderOut/orderOutSelectV2.vue
@@ -112,6 +112,7 @@
 					brand: '',
 					orderType: null
 				},
+				wrkingData: []
 			}
 		},
 		onReachBottom() {
@@ -143,7 +144,8 @@
 		},
 		methods: {
 			getOrderDetlList(threeCode,limit) {
-				// this.get(threeCode,limit)
+				this.wrkingData = []
+				this.get()
 				uni.showLoading({})
 				let _this = this
 				_this.mask = true
@@ -168,6 +170,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
@@ -181,23 +190,31 @@
 					}
 				})
 			},
-			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}/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
 						}
-					})
-				}
+					}
+				})
 			},
 			searchValueInput1() {
 				this.dataList = []

--
Gitblit v1.9.1