From d953e40c7badd8be505d133ae1bb410e4024229f Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期四, 09 四月 2026 11:05:16 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html |  475 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 357 insertions(+), 118 deletions(-)

diff --git a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
index 6f0c7e1..da90a99 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"
@@ -216,7 +241,7 @@
 			class="detail-dialog"
 			@close="closeDetailDialog">
 		<div v-if="currentRow">
-			<h3>缁勮揣鍗曚富琛� (璁㈠崟鍙�: {{ currentRow.orderNo }})</h3>
+			<h3>璁㈠崟涓昏〃 (璁㈠崟鍙�: {{ currentRow.orderNo }})</h3>
 			<el-descriptions :column="2" border>
 				<el-descriptions-item label="瀹㈡埛鍚嶇О">{{ currentRow.cstmrName }}</el-descriptions-item>
 				<el-descriptions-item label="鐘舵��">{{ formatStatus(currentRow)}}</el-descriptions-item>
@@ -224,10 +249,42 @@
 				<el-descriptions-item label="澶囨敞">{{ currentRow.memo || '鏃�' }}</el-descriptions-item>
 			</el-descriptions>
 
-			<h3 style="margin-top: 20px;">缁勮揣鍗曟槑缁�</h3>
+			<h3 style="margin-top: 20px;">璁㈠崟鏄庣粏</h3>
+			<!-- 鏄庣粏琛ㄦ牸鎼滅储鏍� -->
+			<div class="search-container" style="margin: 20px 0; padding: 15px; background: #f5f7fa; border-radius: 4px;">
+				<el-form :inline="true" class="search-form">
+					<div class="search-item">
+						<span class="search-label">瀹㈡埛SKU:</span>
+						<el-input
+								v-model="detailSearch.standby3"
+								placeholder="璇疯緭鍏ュ鎴稴KU"
+								clearable
+								style="width: 180px;"
+								@input="handleDetailSearch"
+								@keyup.enter.native="handleDetailSearch"
+						></el-input>
+					</div>
+					<div class="search-item">
+						<span class="search-label">閲囪喘鍗曞彿:</span>
+						<el-input
+								v-model="detailSearch.boxType3"
+								placeholder="璇疯緭鍏ラ噰璐崟鍙�"
+								clearable
+								style="width: 180px;"
+								@input="handleDetailSearch"
+								@keyup.enter.native="handleDetailSearch"
+						></el-input>
+					</div>
+<!--					<div class="search-actions" style="margin-left: auto;">-->
+<!--						<el-button type="primary" icon="el-icon-search" @click="handleDetailSearch">鎼滅储</el-button>-->
+<!--						<el-button icon="el-icon-refresh" @click="handleDetailReset">閲嶇疆</el-button>-->
+<!--					</div>-->
+				</el-form>
+			</div>
 			<el-table
 					border
-					:data="tableDataB"
+					ref="detailTable"
+					:data="filteredTableDataB"
 					style="width: 100%"
 					v-loading="detailLoading">
 				<el-table-column prop="id" label="id" min-width="50" align="center"></el-table-column>
@@ -240,7 +297,7 @@
 				<el-table-column prop="anfme" label="鏁伴噺" min-width="80" align="center">
 					<template slot-scope="scope">
 						<el-input-number
-								v-model="scope.row.anfme"
+								v-model="scope.row.anfmeRow"
 								:min="0"
 								:precision="0"
 								controls-position="right"
@@ -250,8 +307,9 @@
 						></el-input-number>
 					</template>
 				</el-table-column>
-				<el-table-column prop="erpAnfme" label="erp涓嬪彂鏁伴噺" min-width="80" align="center"></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>
 				<!-- 淇敼涓哄垹闄ゅ垪 -->
@@ -294,7 +352,7 @@
 						@size-change="handleDetailSizeChange"
 						@current-change="handleDetailCurrentChange"
 						:current-page="detailCurrentPage"
-						:page-sizes="[5, 10, 20]"
+						:page-sizes="[5, 10, 20, 50, 100]"
 						:page-size="detailPageSize"
 						layout="total, sizes, prev, pager, next, jumper"
 						:total="detailTotal">
@@ -324,6 +382,13 @@
 				cstmrName: '',
 				settle: ''
 			},
+			selectedDate: '',
+			detailSearch: {
+				standby3: '',
+				boxType3: ''
+			},
+			// 鏂板锛氱敤浜庣紦瀛樺師濮嬫槑缁嗘暟鎹紙鍒嗛〉鍔犺浇鍚庣殑瀹屾暣褰撳墠椤垫暟鎹級
+			originalTableDataB: [],
 			// 鎺掑簭鐩稿叧
 			orderByField: '',
 			orderByType: 'asc',
@@ -355,6 +420,34 @@
 		created() {
 			this.init();
 		},
+		computed: {
+			// 鏄庣粏琛ㄦ牸杩囨护鍚庣殑鏁版嵁
+			filteredTableDataB() {
+				if (!this.originalTableDataB || this.originalTableDataB.length === 0) {
+					return [];
+				}
+
+				let data = this.originalTableDataB;
+
+				// 瀹㈡埛SKU 妯$硦鎼滅储锛堜笉鍖哄垎澶у皬鍐欙級
+				if (this.detailSearch.standby3 && this.detailSearch.standby3.trim()) {
+					const keyword = this.detailSearch.standby3.trim().toLowerCase();
+					data = data.filter(item =>
+							item.standby3 && item.standby3.toLowerCase().includes(keyword)
+					);
+				}
+
+				// 閲囪喘鍗曞彿 妯$硦鎼滅储
+				if (this.detailSearch.boxType3 && this.detailSearch.boxType3.trim()) {
+					const keyword = this.detailSearch.boxType3.trim().toLowerCase();
+					data = data.filter(item =>
+							item.boxType3 && item.boxType3.toLowerCase().includes(keyword)
+					);
+				}
+
+				return data;
+			}
+		},
 		methods: {
 			init() {
 				this.getTableDataA();
@@ -363,6 +456,17 @@
 				setInterval(() => {
 					this.getTableDataA();
 				}, 10000);
+			},
+			handleDetailSearch() {
+				// 瑙﹀彂璁$畻灞炴�ч噸鏂拌绠楀嵆鍙紝鏃犻渶棰濆鎿嶄綔
+				this.$forceUpdate(); // 鍙�夛紝纭繚绔嬪嵆鍒锋柊锛堥�氬父涓嶉渶瑕侊級
+			},
+
+			// 鏄庣粏鎼滅储閲嶇疆
+			handleDetailReset() {
+				this.detailSearch.standby3 = '';
+				this.detailSearch.boxType3 = '';
+				// 閲嶇疆鍚庤〃鏍艰嚜鍔ㄦ仮澶嶅師鏁版嵁
 			},
 
 			// 鑾峰彇涓昏〃A鏁版嵁
@@ -378,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 => {
@@ -420,18 +528,15 @@
 					}
 				});
 			},
-
-			// 鑾峰彇瀛愯〃B鏁版嵁
+// 鑾峰彇瀛愯〃B鏁版嵁
 			getTableDataB(orderNo) {
 				let that = this;
 				that.detailLoading = true;
-
 				let params = {
 					order_no: orderNo,
 					curr: that.detailCurrentPage,
 					limit: that.detailPageSize
 				};
-
 				$.ajax({
 					url: baseUrl + "/order/pakin/orderDetl/list/auth",
 					headers: {
@@ -445,13 +550,26 @@
 						if (res.code === 200 || res.success) {
 							that.tableDataB = res.data.records || [];
 							that.detailTotal = res.data.total || 0;
-
-							// 鍒濆鍖栨暟閲忕紦瀛�
-							that.modifiedQuantities = {};
+							that.originalTableDataB = [...res.data.records || []];  // 鏂板锛氫繚瀛樺師濮嬫暟鎹敤浜庤繃婊�
+							// ============ 鏂板锛氳缃暟閲忛粯璁ゅ�间负 ERP涓嬪彂鏁伴噺 - 寰呬笅鍙戞暟閲� ============
 							that.tableDataB.forEach(item => {
+								// 鍋囪鍚庣杩斿洖鐨勫瓧娈靛悕鏄� erpAnfme锛圗RP涓嬪彂鏁伴噺锛夊拰 sortingAnfme锛堝緟涓嬪彂鏁伴噺锛�
+								// 濡傛灉瀛楁鍚嶄笉鍚岋紝璇锋浛鎹㈡垚瀹為檯鐨�
+								const erpQty = parseInt(item.anfme) || 0;        // ERP涓嬪彂鏁伴噺
+								const pendingQty = parseInt(item.sortingAnfme) || 0; // 寰呬笅鍙戞暟閲�
+
+								// 璁$畻榛樿鏁伴噺锛欵RP鎬婚噺 - 宸插緟涓嬪彂 = 杩樺彲淇敼/涓嬪彂鐨勬暟閲�
+								const defaultQty = erpQty - pendingQty;
+
+								// 璁剧疆杈撳叆妗嗛粯璁ゅ�硷紙纭繚 >= 0锛�
+								that.$set(item, 'anfmeRow', Math.max(0, defaultQty));
+
+								// 鍚屾椂鍒濆鍖� modifiedQuantities 缂撳瓨
 								const itemKey = that.getItemKey(item);
-								that.$set(that.modifiedQuantities, itemKey, item.anfme);
+								that.$set(that.modifiedQuantities, itemKey, Math.max(0, defaultQty));
 							});
+							// ==========================================================================
+
 						} else {
 							that.$message.error(res.msg || '鑾峰彇鏁版嵁澶辫触');
 							that.tableDataB = [];
@@ -461,11 +579,57 @@
 					},
 					error: function() {
 						that.detailLoading = false;
-						// 妯℃嫙鏁版嵁
+						// 妯℃嫙鏁版嵁涔熷姞涓婇粯璁ゅ�奸�昏緫锛堝彲閫夛級
 						that.mockTableBData();
+						// 濡傛灉浣犳湁 mock 鏁版嵁锛屼篃寤鸿鍦ㄨ繖閲屽姞涓婂悓鏍风殑璁$畻閫昏緫
 					}
 				});
 			},
+			// // 鑾峰彇瀛愯〃B鏁版嵁
+			// getTableDataB(orderNo) {
+			// 	let that = this;
+			// 	that.detailLoading = true;
+			//
+			// 	let params = {
+			// 		order_no: orderNo,
+			// 		curr: that.detailCurrentPage,
+			// 		limit: that.detailPageSize
+			// 	};
+			//
+			// 	$.ajax({
+			// 		url: baseUrl + "/order/pakin/orderDetl/list/auth",
+			// 		headers: {
+			// 			'token': localStorage.getItem('token')
+			// 		},
+			// 		data: params,
+			// 		dataType: 'json',
+			// 		contentType: 'application/json;charset=UTF-8',
+			// 		method: 'get',
+			// 		success: function (res) {
+			// 			if (res.code === 200 || res.success) {
+			// 				that.tableDataB = res.data.records || [];
+			// 				that.detailTotal = res.data.total || 0;
+			//
+			// 				// 鍒濆鍖栨暟閲忕紦瀛�
+			// 				that.modifiedQuantities = {};
+			// 				that.tableDataB.forEach(item => {
+			// 					const itemKey = that.getItemKey(item);
+			// 					that.$set(that.modifiedQuantities, itemKey, item.anfme);
+			// 				});
+			// 			} else {
+			// 				that.$message.error(res.msg || '鑾峰彇鏁版嵁澶辫触');
+			// 				that.tableDataB = [];
+			// 				that.detailTotal = 0;
+			// 			}
+			// 			that.detailLoading = false;
+			// 		},
+			// 		error: function() {
+			// 			that.detailLoading = false;
+			// 			// 妯℃嫙鏁版嵁
+			// 			that.mockTableBData();
+			// 		}
+			// 	});c
+			// },
 
 			// 鑾峰彇鍟嗗搧鍞竴鏍囪瘑
 			getItemKey(item) {
@@ -544,7 +708,7 @@
 				}
 
 				// 楠岃瘉ERP涓嬪彂鏁伴噺
-				if (row.erpAnfme && newValue > parseInt(row.erpAnfme)) {
+				if (row.anfme && newValue > parseInt(row.anfme)) {
 					this.$message.warning('淇敼鏁伴噺涓嶈兘澶т簬ERP涓嬫灦鏁伴噺');
 					this.$set(row, 'anfme', oldValue);
 					this.modifiedQuantities[itemKey] = oldValue;
@@ -620,8 +784,7 @@
 			},
 
 			// 鎻愪氦淇敼鍒板悗鍙�
-			submitModify(orderNo, id, anfme,inspect) {
-				// 鏄剧ず鍔犺浇鐘舵��
+			submitModify(orderNo, id, anfme, inspect) {
 				const loadingInstance = this.$loading({
 					lock: true,
 					text: '鎻愪氦淇敼涓�...',
@@ -631,12 +794,12 @@
 
 				$.ajax({
 					url: baseUrl + "/order/pakin/orderDetl/batch/report/auth",
-					headers: {'token': localStorage.getItem('token')},
+					headers: { 'token': localStorage.getItem('token') },
 					data: top.reObject({
-						orderNo: orderNo, // 缁勮揣鍗曞彿
-						id: id, // 绠卞彿
-						anfme: anfme, // 绠卞彿
-						inspect: inspect // 绠卞彿
+						orderNo: orderNo,
+						id: id,
+						anfme: anfme,
+						inspect: inspect,  // 0 鎴� 1
 					}),
 					method: 'POST',
 					success: (res) => {
@@ -644,20 +807,32 @@
 
 						if (res.code === 200 || res.success) {
 							this.$message({
-								message: `淇敼鎴愬姛锛佺粍璐у崟鍙�: ${groupOrderNo}, 绠卞彿: ${batch}`,
+								message: `淇敼鎴愬姛锛佽鍗曞彿: ${orderNo}`,
 								type: 'success',
-								duration: 3000
+								duration: 2500
 							});
+							this.getTableDataB(orderNo);
+						}
+						else {
+							// 澶勭悊鍚庣杩斿洖鐨勮缁嗛敊璇俊鎭�
+							let errorMsg = res.msg || '淇敼澶辫触';
 
-							this.getTableDataB(groupOrderNo);
-						} else {
-							this.$message.error(res.msg || '淇敼澶辫触');
+							// 濡傛灉鍚庣杩斿洖浜� errors 鏁扮粍锛屽睍绀哄緱鏇存紓浜�
+							if (res.errors && Array.isArray(res.errors) && res.errors.length > 0) {
+								errorMsg = res.errors.join('\n');
+								this.$alert(errorMsg, '灏哄鏍¢獙澶辫触', {
+									confirmButtonText: '鐭ラ亾浜�',
+									type: 'error',
+									dangerouslyUseHTMLString: true  // 濡傛灉鎯虫崲琛屾洿鏄庢樉
+								});
+							} else {
+								this.$message.error(errorMsg);
+							}
 						}
 					},
 					error: (error) => {
 						loadingInstance.close();
-						console.error('淇敼澶辫触:', error);
-						this.$message.error('淇敼澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						this.$message.error('缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯');
 					}
 				});
 			},
@@ -696,7 +871,7 @@
 							beforeClose: (action, instance, done) => {
 								if (action === 'confirm') {
 									instance.confirmButtonLoading = true;
-									this.confirmReport(orderNo, done);
+									this.confirmReport(orderNo, instance, done);
 								} else {
 									done();
 								}
@@ -713,92 +888,85 @@
 			},
 
 			// 纭涓婃姤
-			confirmReport(orderNo, done) {
+			confirmReport(orderNo, instance, 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
-				// };
-
-				// 璋冪敤鍚庡彴API涓婃姤鏁版嵁
-				$.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('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+				const finish = () => {
+					this.reportLoading = false;
+					if (instance) {
+						instance.confirmButtonLoading = false;
 					}
+					if (typeof done === 'function') {
+						done();
+					}
+				};
+
+				const rowsToIssue = (this.tableDataB || []).filter(item => parseInt(item.inspect) === 1);
+				if (rowsToIssue.length === 0) {
+					finish();
+					this.$message.error('娌℃湁寰呬笅鍙戦」');
+					return;
+				}
+
+				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) {
+						finish();
+						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) => {
+							finish();
+							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) => {
+							finish();
+							console.error('涓嬪彂澶辫触:', error);
+							this.$message.error('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						}
+					});
 				});
 			},
 
@@ -823,6 +991,11 @@
 				this.getTableDataA();
 			},
 
+			handleDateChange() {
+				this.currentPage = 1;
+				this.getTableDataA();
+			},
+
 			// 閲嶇疆鎼滅储鏉′欢
 			handleReset() {
 				this.searchForm = {
@@ -830,10 +1003,72 @@
 					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 {
+								if (res.msg && (String(res.msg).indexOf('\n') !== -1 || String(res.msg).indexOf('锛�') !== -1)) {
+									this.$alert(res.msg, '灏哄鏍¢獙澶辫触', {
+										confirmButtonText: '鐭ラ亾浜�',
+										type: 'error',
+										dangerouslyUseHTMLString: false
+									});
+								} else {
+									this.$message.error(res.msg || '涓嬪彂澶辫触');
+								}
+							}
+						},
+						error: () => {
+							loadingInstance.close();
+							this.$message.error('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+						}
+					});
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堟搷浣�'
+					});
+				});
 			},
 
 			// 鏄剧ず璇︽儏寮圭獥
@@ -842,9 +1077,13 @@
 				this.detailDialogVisible = true;
 				this.detailCurrentPage = 1;
 				this.settleA = row.settle;
-				// 娓呯┖缂撳瓨
 				this.modifiedQuantities = {};
 				this.deletedRecords = [];
+
+				// 鏂板锛氭竻绌烘槑缁嗘悳绱�
+				this.detailSearch.standby3 = '';
+				this.detailSearch.boxType3 = '';
+
 				this.getTableDataB(row.orderNo);
 			},
 
@@ -1014,4 +1253,4 @@
 	});
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

--
Gitblit v1.9.1