From 4efbf695ce0e0e6565e75305a57ea4c4bbc2c45d Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期一, 16 三月 2026 13:56:38 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html |  242 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 160 insertions(+), 82 deletions(-)

diff --git a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
index 353a1b2..56912ad 100644
--- a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
+++ b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
@@ -157,6 +157,18 @@
 					<el-option label="閲嶆柊涓嬪彂" value="99"></el-option>
 				</el-select>
 			</div>
+			<div class="search-item">
+				<span class="search-label">鍒涘缓鏃ユ湡:</span>
+				<el-date-picker
+						v-model="selectedDate"
+						type="date"
+						value-format="yyyy-MM-dd"
+						placeholder="閫夋嫨鏃ユ湡"
+						clearable
+						style="width: 150px;"
+						@change="handleDateChange"
+				></el-date-picker>
+			</div>
 			<div class="search-actions">
 				<el-button type="primary" icon="el-icon-search" @click="handleSearch">鎼滅储</el-button>
 				<el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
@@ -178,11 +190,24 @@
 <!--			<el-table-column prop="itemName" label="缁勮揣鍗曞彿" width="120" align="center" sortable="custom"></el-table-column>-->
 			<el-table-column prop="cstmrName" label="璐т富" min-width="120" align="center"></el-table-column>
 			<el-table-column prop="settle$" label="鐘舵��" min-width="100" align="center" :formatter="formatStatus"></el-table-column>
+			<el-table-column prop="issueComplete" label="涓嬪彂瀹屾垚" width="100" align="center">
+				<template slot-scope="scope">
+					<el-tag v-if="scope.row.issueComplete === 1" type="success">宸插叏涓嬪彂</el-tag>
+					<el-tag v-else type="info">鏈畬鎴�</el-tag>
+				</template>
+			</el-table-column>
 			<el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="100" align="center" :formatter="formatDateColumn"></el-table-column>
 			<el-table-column prop="updateTime" label="鏇存柊鏃ユ湡" min-width="100" align="center" :formatter="formatDateColumn"></el-table-column>
-			<el-table-column label="鎿嶄綔" width="150" align="center" fixed="right">
+			<el-table-column label="鎿嶄綔" width="220" align="center" fixed="right">
 				<template slot-scope="scope">
 					<div class="operation-cell">
+						<el-button
+								type="warning"
+								size="mini"
+								:disabled="scope.row.issueComplete === 1"
+								@click="oneKeyIssue(scope.row)">
+							涓�閿笅鍙�
+						</el-button>
 						<el-button
 								type="primary"
 								size="mini"
@@ -284,6 +309,7 @@
 				</el-table-column>
 				<el-table-column prop="anfme" label="erp涓嬪彂鏁伴噺" min-width="80" align="center"></el-table-column>
 				<el-table-column prop="sortingAnfme" label="寰呬笅鍙戞暟閲�" min-width="80" align="center"></el-table-column>
+					<el-table-column prop="beBatch" label="宸蹭笅鍙戞暟閲�" min-width="80" align="center"></el-table-column>
 <!--				<el-table-column prop="status" label="鐘舵��" min-width="100" align="center" :formatter="formatStatusB"></el-table-column>-->
 				<el-table-column prop="inspect" label="鐘舵��" min-width="100" align="center" :formatter="formatStatusC"></el-table-column>
 				<!-- 淇敼涓哄垹闄ゅ垪 -->
@@ -356,6 +382,7 @@
 				cstmrName: '',
 				settle: ''
 			},
+			selectedDate: '',
 			detailSearch: {
 				standby3: '',
 				boxType3: ''
@@ -455,6 +482,10 @@
 				if (that.orderByField) {
 					params.orderByField = that.orderByField;
 					params.orderByType = that.orderByType;
+				}
+
+				if (that.selectedDate) {
+					params['create_time'] = that.selectedDate + ' 00:00:00 - ' + that.selectedDate + ' 23:59:59';
 				}
 
 				Object.keys(that.searchForm).forEach(key => {
@@ -860,89 +891,77 @@
 			confirmReport(orderNo, done) {
 				this.reportLoading = true;
 
-				// // 鏀堕泦瑕佷笂鎶ョ殑鏁版嵁
-				// const reportData = this.tableDataB.map(item => {
-				// 	const itemKey = this.getItemKey(item);
-				// 	return {
-				// 		orderNo: groupOrderNo,             // 缁勮揣鍗曞彿
-				// 		matnr: item.matnr,                 // 鍟嗗搧缂栧彿
-				// 		maktx: item.maktx,                 // 鍟嗗搧鍚嶇О
-				// 		standby1: item.standby1,           // 瀹㈡埛PO
-				// 		standby2: item.standby2,           // UPC
-				// 		standby3: item.standby3,           // 瀹㈡埛SKU
-				// 		boxType3: item.boxType3,           // 閲囪喘鍗曞彿
-				// 		anfme: this.modifiedQuantities[itemKey] || item.anfme, // 鏁伴噺(浣跨敤淇敼鍚庣殑鏁伴噺)
-				// 		erpAnfme: item.erpAnfme,           // ERP涓嬫灦鏁伴噺
-				// 		status: item.status,               // 鐘舵��
-				// 		batch: item.batch,                 // 绠卞彿
-				// 		// 鍏朵粬蹇呰鍙傛暟
-				// 		modified: this.modifiedQuantities[itemKey] !== undefined // 鏍囪鏄惁淇敼
-				// 	};
-				// });
-				//
-				// // 鏀堕泦鍒犻櫎璁板綍
-				// const deleteData = this.deletedRecords.map(record => ({
-				// 	orderNo: groupOrderNo,
-				// 	matnr: record.matnr,
-				// 	maktx: record.maktx,
-				// 	standby1: record.standby1,
-				// 	standby2: record.standby2,
-				// 	standby3: record.standby3,
-				// 	boxType3: record.boxType3,
-				// 	anfme: record.anfme,
-				// 	erpAnfme: record.erpAnfme,
-				// 	status: record.status,
-				// 	batch: record.batch,
-				// 	deleteTime: record.deleteTime
-				// }));
-				//
-				// // 鏋勫缓鎻愪氦鏁版嵁
-				// const submitData = {
-				// 	orderNo: groupOrderNo,
-				// 	details: reportData,
-				// 	deletedDetails: deleteData,
-				// 	totalCount: reportData.length,
-				// 	modifiedCount: Object.keys(this.modifiedQuantities).length,
-				// 	deletedCount: deleteData.length
-				// };
+				const rowsToIssue = (this.tableDataB || []).filter(item => parseInt(item.inspect) === 1);
+				if (rowsToIssue.length === 0) {
+					this.reportLoading = false;
+					if (typeof done === 'function') done();
+					this.$message.error('娌℃湁寰呬笅鍙戦」');
+					return;
+				}
 
-				// 璋冪敤鍚庡彴API涓婃姤鏁版嵁
-				$.ajax({
-					url: baseUrl + "/order/pakin/actual/shipment/order/report/auth",
-					headers: {'token': localStorage.getItem('token')},
-					data: {
-						orderNo: orderNo // 浼犻�掕鍗曞彿
-					},
-					method: 'POST',
-					success: (res) => {
+				const updates = rowsToIssue.map(item => {
+					const beBatchVal = Math.floor(parseFloat(item.sortingAnfme || 0));
+					return new Promise((resolve) => {
+						$.ajax({
+							url: baseUrl + "/order/pakin/orderDetl/beBatch/update/auth",
+							headers: { 'token': localStorage.getItem('token') },
+							data: {
+								id: item.id,
+								beBatch: beBatchVal
+							},
+							method: 'POST',
+							success: (res) => {
+								if (res.code === 200 || res.success) {
+									this.$set(item, 'beBatch', beBatchVal);
+									resolve({ ok: true });
+								} else {
+									resolve({ ok: false, msg: res.msg || '鏇存柊澶辫触' });
+								}
+							},
+							error: () => resolve({ ok: false, msg: '缃戠粶寮傚父' })
+						});
+					});
+				});
+
+				Promise.all(updates).then(results => {
+					const failed = results.find(r => !r.ok);
+					if (failed) {
 						this.reportLoading = false;
-						if (typeof done === 'function') {
-							done();
-						}
-						if (res.code === 200 || res.success) {
-							this.$message({
-								message: `璁㈠崟鍙� ${orderNo} 涓嬪彂鎴愬姛`,
-								type: 'success',
-								duration: 5000,
-								dangerouslyUseHTMLString: true
-							});
-							// 涓嬪彂鎴愬姛鍚庡叧闂脊绐楀苟鍒锋柊鏁版嵁
-							setTimeout(() => {
-								this.closeDetailDialog();
-								this.getTableDataA(); // 鍒锋柊涓昏〃鏁版嵁
-							}, 1500);
-						} else {
-							this.$message.error(res.msg || '涓嬪彂澶辫触');
-						}
-					},
-					error: (error) => {
-						this.reportLoading = false;
-						if (typeof done === 'function') {
-							done();
-						}
-						console.error('涓嬪彂澶辫触:', error);
-						this.$message.error('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						if (typeof done === 'function') done();
+						this.$message.error(failed.msg || '鍚屾beBatch澶辫触');
+						return;
 					}
+					// 鍚屾瀹屾垚鍚庤皟鐢ㄥ悗鍙癆PI杩涜涓嬪彂
+					$.ajax({
+						url: baseUrl + "/order/pakin/actual/shipment/order/report/auth",
+						headers: {'token': localStorage.getItem('token')},
+						data: { orderNo: orderNo },
+						method: 'POST',
+						success: (res) => {
+							this.reportLoading = false;
+							if (typeof done === 'function') done();
+							if (res.code === 200 || res.success) {
+								this.$message({
+									message: `璁㈠崟鍙� ${orderNo} 涓嬪彂鎴愬姛`,
+									type: 'success',
+									duration: 5000,
+									dangerouslyUseHTMLString: true
+								});
+								setTimeout(() => {
+									this.closeDetailDialog();
+									this.getTableDataA();
+								}, 1500);
+							} else {
+								this.$message.error(res.msg || '涓嬪彂澶辫触');
+							}
+						},
+						error: (error) => {
+							this.reportLoading = false;
+							if (typeof done === 'function') done();
+							console.error('涓嬪彂澶辫触:', error);
+							this.$message.error('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						}
+					});
 				});
 			},
 
@@ -967,6 +986,11 @@
 				this.getTableDataA();
 			},
 
+			handleDateChange() {
+				this.currentPage = 1;
+				this.getTableDataA();
+			},
+
 			// 閲嶇疆鎼滅储鏉′欢
 			handleReset() {
 				this.searchForm = {
@@ -974,10 +998,64 @@
 					cstmrName: '',
 					settle: ''
 				};
+				this.selectedDate = '';
 				this.orderByField = '';
 				this.orderByType = 'asc';
 				this.currentPage = 1;
 				this.getTableDataA();
+			},
+
+			oneKeyIssue(row) {
+				if (!row || !row.orderNo) {
+					this.$message.error('璁㈠崟鍙蜂负绌�');
+					return;
+				}
+				const orderNo = row.orderNo;
+				this.$confirm(
+						`纭涓�閿笅鍙戣鍗曞彿 <strong style="color: #F56C6C; font-size: 16px;">${orderNo}</strong> 鐨勫叏閮ㄦ槑缁嗗悧锛焋,
+						'涓�閿笅鍙�',
+						{
+							confirmButtonText: '纭涓嬪彂',
+							cancelButtonText: '鍙栨秷',
+							type: 'warning',
+							dangerouslyUseHTMLString: true
+						}
+				).then(() => {
+					const loadingInstance = this.$loading({
+						lock: true,
+						text: '涓嬪彂涓�...',
+						spinner: 'el-icon-loading',
+						background: 'rgba(0, 0, 0, 0.7)'
+					});
+					$.ajax({
+						url: baseUrl + "/order/pakin/order/oneKey/issue/auth",
+						headers: {'token': localStorage.getItem('token')},
+						data: { orderNo: orderNo },
+						method: 'POST',
+						success: (res) => {
+							loadingInstance.close();
+							if (res.code === 200 || res.success) {
+								this.$message({
+									message: `璁㈠崟鍙� ${orderNo} 涓嬪彂鎴愬姛`,
+									type: 'success',
+									duration: 3000
+								});
+								this.getTableDataA();
+							} else {
+								this.$message.error(res.msg || '涓嬪彂澶辫触');
+							}
+						},
+						error: () => {
+							loadingInstance.close();
+							this.$message.error('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						}
+					});
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堟搷浣�'
+					});
+				});
 			},
 
 			// 鏄剧ず璇︽儏寮圭獥
@@ -1162,4 +1240,4 @@
 	});
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

--
Gitblit v1.9.1