From ef012984e2a1d92e4a35844c6dce92ebb66c7c87 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 23 十二月 2025 11:01:45 +0800
Subject: [PATCH] #getArmType$

---
 src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html |  686 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 406 insertions(+), 280 deletions(-)

diff --git a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
index 954b721..6f0c7e1 100644
--- a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
+++ b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
@@ -94,6 +94,19 @@
 		.confirm-dialog .el-message-box__status {
 			font-size: 24px !important;
 		}
+		/* 鏁伴噺杈撳叆妗嗘牱寮� */
+		.quantity-input {
+			width: 100px;
+		}
+		/* 鍒犻櫎鎸夐挳鏍峰紡 */
+		.delete-btn {
+			color: #F56C6C;
+			border-color: #F56C6C;
+		}
+		.delete-btn:hover {
+			background-color: #F56C6C;
+			color: white;
+		}
 	</style>
 </head>
 <body>
@@ -102,10 +115,10 @@
 	<div class="search-container" style="width: 100%;">
 		<el-form :inline="true" class="search-form">
 			<div class="search-item">
-				<span class="search-label">缁勮揣鍗曞彿:</span>
+				<span class="search-label">璁㈠崟鍙�:</span>
 				<el-input
 						v-model="searchForm.orderNo"
-						placeholder="璇疯緭鍏ョ粍璐у崟鍙�"
+						placeholder="璇疯緭鍏ヨ鍗曞彿"
 						clearable
 						style="width: 150px;"
 						@keyup.enter.native="handleSearch"
@@ -161,11 +174,11 @@
 				style="width: 100%"
 				v-loading="loading"
 				@sort-change="handleSortChange">
-			<el-table-column prop="orderNo" label="璁㈠崟鍙�" width="240" align="center" sortable="custom"></el-table-column>
+			<el-table-column prop="orderNo" label="璁㈠崟鍙�" width="120" align="center" sortable="custom"></el-table-column>
+<!--			<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="orderCount" label="缁勮揣鍗曟暟" width="80" 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="createTime" label="鏃ユ湡" min-width="100" align="center" :formatter="formatDateColumn"></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">
 				<template slot-scope="scope">
@@ -203,7 +216,7 @@
 			class="detail-dialog"
 			@close="closeDetailDialog">
 		<div v-if="currentRow">
-			<h3>缁勮揣鍗曚富琛� (缁勮揣鍗曞彿: {{ currentRow.itemName }})</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>
@@ -217,36 +230,62 @@
 					:data="tableDataB"
 					style="width: 100%"
 					v-loading="detailLoading">
+				<el-table-column prop="id" label="id" min-width="50" align="center"></el-table-column>
 				<el-table-column prop="matnr" label="鍟嗗搧缂栧彿" min-width="80" align="center"></el-table-column>
 				<el-table-column prop="maktx" label="鍚嶇О" min-width="80" align="center"></el-table-column>
-				<el-table-column prop="standby1" label="瀹㈡埛PO" min-width="80" align="center" ></el-table-column>
-				<el-table-column prop="standby2" label="UPC" min-width="80" align="center" ></el-table-column>
-				<el-table-column prop="standby3" label="瀹㈡埛SKU" min-width="80" align="center" ></el-table-column>
-<!--				<el-table-column prop="boxType1" label="璐т富" min-width="80" align="center" ></el-table-column>-->
-<!--				<el-table-column prop="boxType2" label="璐т富" min-width="80" align="center" ></el-table-column>-->
-				<el-table-column prop="boxType3" label="閲囪喘鍗曞彿" min-width="80" align="center" ></el-table-column>
-				<el-table-column prop="anfme" label="鏁伴噺" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="standby1" label="瀹㈡埛PO" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="standby2" label="UPC" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="standby3" label="瀹㈡埛SKU" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="boxType3" label="閲囪喘鍗曞彿" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="anfme" label="鏁伴噺" min-width="80" align="center">
+					<template slot-scope="scope">
+						<el-input-number
+								v-model="scope.row.anfme"
+								:min="0"
+								:precision="0"
+								controls-position="right"
+								size="small"
+								class="quantity-input"
+								@change="handleQuantityChange(scope.row, $event)"
+						></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="status" label="鐘舵��" min-width="80" align="center" :formatter="formatStatusB"></el-table-column>
-				<!-- 鏂板鎿嶄綔鍒楋紝鏍规嵁status鍊兼帶鍒舵樉绀� -->
+				<el-table-column prop="sortingAnfme" 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>
+				<!-- 淇敼涓哄垹闄ゅ垪 -->
 				<el-table-column label="鏄惁涓婃姤" width="120" align="center" fixed="right">
 					<template slot-scope="scope">
 						<div class="operation-cell">
-							<el-button v-if="scope.row.status === 2"
+							<el-button v-if="scope.row.inspect === 1"
 									   type="primary"
 									   size="mini"
 									   @click="handleModifyN(scope.row)">
-								鍚�
+								鍙栨秷涓嬪彂椤�
 							</el-button>
-							<el-button v-if="scope.row.status === 1"
+							<el-button v-if="scope.row.inspect === 0"
 									   type="primary"
 									   size="mini"
 									   @click="handleModifyY(scope.row)">
-								鏄�
+								鍔犲叆涓嬪彂椤�
 							</el-button>
 						</div>
 					</template>
 				</el-table-column>
+<!--				<el-table-column label="鎿嶄綔" width="100" align="center" fixed="right">-->
+<!--					<template slot-scope="scope">-->
+<!--						<div class="operation-cell">-->
+<!--							<el-button-->
+<!--									class="delete-btn"-->
+<!--									type="danger"-->
+<!--									size="mini"-->
+<!--									icon="el-icon-delete"-->
+<!--									@click="handleDelete(scope.row)"-->
+<!--							></el-button>-->
+<!--						</div>-->
+<!--					</template>-->
+<!--				</el-table-column>-->
 			</el-table>
 
 			<!-- 瀛愯〃鍒嗛〉 -->
@@ -268,8 +307,7 @@
 					class="confirm-report-btn"
 					@click="showConfirmDialog"
 					:loading="reportLoading">
-				<!-- 鐩存帴鍦ㄦā鏉夸腑鍒ゆ柇 -->
-				{{ settleA === 17 ? '鍐嶆涓婃姤' :  '纭涓婃姤' }}
+				{{ settleA === 17 ? '鍐嶆涓嬪彂' : '纭涓嬪彂' }}
 			</el-button>
 			<el-button @click="closeDetailDialog">鍏抽棴</el-button>
 		</div>
@@ -282,10 +320,9 @@
 		data: {
 			// 鎼滅储琛ㄥ崟
 			searchForm: {
-				item_name: '',
-				cstmr_name: '',
-				settle: '',
-				order_no: ''
+				orderNo: '',
+				cstmrName: '',
+				settle: ''
 			},
 			// 鎺掑簭鐩稿叧
 			orderByField: '',
@@ -309,7 +346,11 @@
 			// 鍔犺浇鐘舵��
 			loading: false,
 			detailLoading: false,
-			reportLoading: false
+			reportLoading: false,
+			// 瀛樺偍淇敼鍚庣殑鏁伴噺
+			modifiedQuantities: {},
+			// 瀛樺偍鍒犻櫎鐨勮褰�
+			deletedRecords: []
 		},
 		created() {
 			this.init();
@@ -324,30 +365,25 @@
 				}, 10000);
 			},
 
-			// 鑾峰彇涓昏〃A鏁版嵁 - 浣跨敤鏂扮殑API
+			// 鑾峰彇涓昏〃A鏁版嵁
 			getTableDataA() {
 				let that = this;
 				that.loading = true;
 
-				// 鏋勫缓璇锋眰鍙傛暟
 				let params = {
 					curr: that.currentPage,
 					limit: that.pageSize
 				};
 
-				// 娣诲姞鎺掑簭鍙傛暟
 				if (that.orderByField) {
 					params.orderByField = that.orderByField;
 					params.orderByType = that.orderByType;
 				}
 
-				// 娣诲姞鎼滅储鍙傛暟
 				Object.keys(that.searchForm).forEach(key => {
 					if (that.searchForm[key] !== '') {
 						if (key === 'orderNo'){
 							params['order_no'] = that.searchForm[key];
-						} else if (key === 'itemName'){
-							params['item_name'] = that.searchForm[key];
 						} else if (key === 'cstmrName'){
 							params['cstmr_name'] = that.searchForm[key];
 						} else {
@@ -369,7 +405,7 @@
 							that.tableDataA = res.data.records || [];
 							that.total = res.data.total || 0;
 						} else {
-							that.$message.error(res.message || '鑾峰彇鏁版嵁澶辫触');
+							that.$message.error(res.msg || '鑾峰彇鏁版嵁澶辫触');
 							that.tableDataA = [];
 							that.total = 0;
 						}
@@ -379,25 +415,23 @@
 						that.loading = false;
 						that.$message.error('缃戠粶璇锋眰澶辫触');
 						console.error('API璋冪敤澶辫触:', error);
-						// 妯℃嫙鏁版嵁锛堝疄闄呴」鐩腑搴斿垹闄わ級
+						// 妯℃嫙鏁版嵁
 						that.mockTableAData();
 					}
 				});
 			},
 
-			// 鑾峰彇瀛愯〃B鏁版嵁锛堟牴鎹疄闄呬笟鍔¤皟鏁达級
+			// 鑾峰彇瀛愯〃B鏁版嵁
 			getTableDataB(orderNo) {
 				let that = this;
 				that.detailLoading = true;
 
-				// 鏋勫缓璇锋眰鍙傛暟
 				let params = {
 					order_no: orderNo,
 					curr: that.detailCurrentPage,
 					limit: that.detailPageSize
 				};
 
-				// 妯℃嫙API璋冪敤 - 鏍规嵁瀹為檯涓氬姟璋冩暣API鍦板潃
 				$.ajax({
 					url: baseUrl + "/order/pakin/orderDetl/list/auth",
 					headers: {
@@ -411,8 +445,15 @@
 						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.message || '鑾峰彇鏁版嵁澶辫触');
+							that.$message.error(res.msg || '鑾峰彇鏁版嵁澶辫触');
 							that.tableDataB = [];
 							that.detailTotal = 0;
 						}
@@ -420,10 +461,101 @@
 					},
 					error: function() {
 						that.detailLoading = false;
-						// 瀹為檯椤圭洰涓簲浣跨敤鐪熷疄API锛岃繖閲屼娇鐢ㄦā鎷熸暟鎹�
-						that.mockTableBData(itemName);
+						// 妯℃嫙鏁版嵁
+						that.mockTableBData();
 					}
 				});
+			},
+
+			// 鑾峰彇鍟嗗搧鍞竴鏍囪瘑
+			getItemKey(item) {
+				return item.matnr + '_' + (item.batch || '') + '_' + (item.standby1 || '');
+			},
+
+			// 澶勭悊鍒犻櫎鎸夐挳鐐瑰嚮浜嬩欢
+			handleDelete(row) {
+				if (!this.currentRow) {
+					this.$message.error('娌℃湁閫夋嫨涓昏〃鏁版嵁');
+					return;
+				}
+
+				const groupOrderNo = this.currentRow.itemName;
+				const matnr = row.matnr;
+				const maktx = row.maktx;
+				const itemKey = this.getItemKey(row);
+
+				this.$confirm(
+						`纭畾瑕佸垹闄ょ粍璐у崟 <strong style="color: #409EFF;">${groupOrderNo}</strong> 涓殑鍟嗗搧 <strong style="color: #409EFF;">${matnr} - ${maktx}</strong> 鍚楋紵`,
+						'纭鍒犻櫎',
+						{
+							confirmButtonText: '纭鍒犻櫎',
+							cancelButtonText: '鍙栨秷',
+							type: 'warning',
+							dangerouslyUseHTMLString: true
+						}
+				).then(() => {
+					// 浠庤〃鏍间腑绉婚櫎璇ヨ
+					const index = this.tableDataB.findIndex(item =>
+							this.getItemKey(item) === itemKey
+					);
+					if (index !== -1) {
+						// 淇濆瓨鍒犻櫎璁板綍
+						this.deletedRecords.push({
+							...this.tableDataB[index],
+							deleteTime: new Date().toISOString()
+						});
+
+						// 浠庤〃鏍间腑鍒犻櫎
+						this.tableDataB.splice(index, 1);
+						this.detailTotal -= 1;
+
+						// 浠庝慨鏀圭紦瀛樹腑鍒犻櫎
+						if (this.modifiedQuantities[itemKey]) {
+							delete this.modifiedQuantities[itemKey];
+						}
+
+						this.$message({
+							message: '鍒犻櫎鎴愬姛',
+							type: 'success',
+							duration: 2000
+						});
+					}
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堝垹闄�'
+					});
+				});
+			},
+
+			// 澶勭悊鏁伴噺淇敼
+			handleQuantityChange(row, newValue) {
+				if (!row || !row.matnr) return;
+
+				const itemKey = this.getItemKey(row);
+				const oldValue = row.anfme;
+
+				// 楠岃瘉鏂板��
+				if (isNaN(newValue) || newValue < 0) {
+					this.$message.warning('璇疯緭鍏ユ湁鏁堢殑鏁伴噺');
+					this.$set(row, 'anfme', oldValue);
+					this.modifiedQuantities[itemKey] = oldValue;
+					return;
+				}
+
+				// 楠岃瘉ERP涓嬪彂鏁伴噺
+				if (row.erpAnfme && newValue > parseInt(row.erpAnfme)) {
+					this.$message.warning('淇敼鏁伴噺涓嶈兘澶т簬ERP涓嬫灦鏁伴噺');
+					this.$set(row, 'anfme', oldValue);
+					this.modifiedQuantities[itemKey] = oldValue;
+					return;
+				}
+
+				// 鏇存柊缂撳瓨
+				this.modifiedQuantities[itemKey] = parseInt(newValue);
+				this.$set(row, 'anfme', parseInt(newValue));
+
+				this.$message.success('鏁伴噺宸蹭慨鏀�');
 			},
 
 			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
@@ -433,12 +565,12 @@
 					return;
 				}
 
-				const groupOrderNo = this.currentRow.itemName; // 缁勮揣鍗曞彿
-				const batch = row.batch; // 绠卞彿
-				const status = 2; // 绠卞彿
+				const orderNo = this.currentRow.orderNo; // 璁㈠崟鍙�
+				const anfme = row.anfme; // 鏁伴噺
+				const id = row.id; // 绠卞彿
 
 				this.$confirm(
-						`纭畾灏嗙粍璐у崟鍙凤細 <strong style="color: #409EFF;">${groupOrderNo}</strong> 涓殑绠卞彿锛� <strong style="color: #409EFF;">${batch}</strong> 娣诲姞鍒颁笂鎶ュ垪鍚楋紵`,
+						`纭畾灏嗚鍗曞彿锛� <strong style="color: #409EFF;">${orderNo}</strong> 涓殑id锛� <strong style="color: #409EFF;">${id}</strong> 娣诲姞鍒颁笅鍙戝垪鍚楋紵`,
 						'纭淇敼',
 						{
 							confirmButtonText: '纭淇敼',
@@ -447,7 +579,7 @@
 							dangerouslyUseHTMLString: true
 						}
 				).then(() => {
-					this.submitModify(groupOrderNo, batch, status);
+					this.submitModify(orderNo, id, anfme,1);
 				}).catch(() => {
 					this.$message({
 						type: 'info',
@@ -456,6 +588,7 @@
 				});
 			},
 
+
 			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
 			handleModifyN(row) {
 				if (!this.currentRow) {
@@ -463,12 +596,12 @@
 					return;
 				}
 
-				const groupOrderNo = this.currentRow.itemName; // 缁勮揣鍗曞彿
-				const batch = row.batch; // 绠卞彿
-				const status = 1; // 绠卞彿
+				const orderNo = this.currentRow.orderNo; // 璁㈠崟鍙�
+				const anfme = 0.0; // 鏁伴噺
+				const id = row.id; // 绠卞彿
 
 				this.$confirm(
-						`纭畾灏嗙粍璐у崟鍙凤細 <strong style="color: #409EFF;">${groupOrderNo}</strong> 銆佺鍙凤細 <strong style="color: #409EFF;">${batch}</strong> 娣诲姞鍒颁笂鎶ュ垪鍚楋紵`,
+						`纭畾灏嗚鍗曞彿锛� <strong style="color: #409EFF;">${orderNo}</strong> 涓殑id锛� <strong style="color: #409EFF;">${id}</strong> 鍙栨秷涓嬪彂鍒楀悧锛焋,
 						'纭淇敼',
 						{
 							confirmButtonText: '纭淇敼',
@@ -477,7 +610,7 @@
 							dangerouslyUseHTMLString: true
 						}
 				).then(() => {
-					this.submitModify(groupOrderNo, batch, status);
+					this.submitModify(orderNo, id, anfme,0);
 				}).catch(() => {
 					this.$message({
 						type: 'info',
@@ -487,7 +620,7 @@
 			},
 
 			// 鎻愪氦淇敼鍒板悗鍙�
-			submitModify(groupOrderNo, batch, status) {
+			submitModify(orderNo, id, anfme,inspect) {
 				// 鏄剧ず鍔犺浇鐘舵��
 				const loadingInstance = this.$loading({
 					lock: true,
@@ -497,12 +630,13 @@
 				});
 
 				$.ajax({
-					url: baseUrl + "/order/pakout/orderDetl/batch/report/auth",
+					url: baseUrl + "/order/pakin/orderDetl/batch/report/auth",
 					headers: {'token': localStorage.getItem('token')},
 					data: top.reObject({
-						item_name: groupOrderNo, // 缁勮揣鍗曞彿
-						batch: batch, // 绠卞彿
-						status: status // 绠卞彿
+						orderNo: orderNo, // 缁勮揣鍗曞彿
+						id: id, // 绠卞彿
+						anfme: anfme, // 绠卞彿
+						inspect: inspect // 绠卞彿
 					}),
 					method: 'POST',
 					success: (res) => {
@@ -517,13 +651,153 @@
 
 							this.getTableDataB(groupOrderNo);
 						} else {
-							this.$message.error(res.message || '淇敼澶辫触');
+							this.$message.error(res.msg || '淇敼澶辫触');
 						}
 					},
 					error: (error) => {
 						loadingInstance.close();
 						console.error('淇敼澶辫触:', error);
 						this.$message.error('淇敼澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+					}
+				});
+			},
+
+			// 鏄剧ず纭瀵硅瘽妗�
+			showConfirmDialog() {
+				if (!this.currentRow) {
+					this.$message.error('娌℃湁閫夋嫨瑕佷笂鎶ョ殑鏁版嵁');
+					return;
+				}
+
+				const orderNo = this.currentRow.orderNo;
+				const remainingCount = this.tableDataB.length;
+				const modifiedCount = Object.keys(this.modifiedQuantities).filter(key => {
+					const item = this.tableDataB.find(item => this.getItemKey(item) === key);
+					return item && item.anfme !== this.modifiedQuantities[key];
+				}).length;
+
+				let message = `鏄惁纭涓嬪彂璁㈠崟鍙� <strong style="color: #F56C6C; font-size: 16px;">${orderNo}</strong>?<br/><br/>`;
+				// message += `灏嗘彁浜や互涓嬫暟鎹細<br/>`;
+				// message += `- 鍓╀綑鍟嗗搧鏁伴噺: ${remainingCount} 涓�<br/>`;
+				// message += `- 淇敼鏁伴噺: ${modifiedCount} 涓�<br/>`;
+				// message += `- 鍒犻櫎鍟嗗搧: ${this.deletedRecords.length} 涓�<br/><br/>`;
+				message += `姝ゆ搷浣滀笉鍙�嗭紝纭缁х画鍚楋紵`;
+
+				this.$confirm(
+						message,
+						'纭涓嬪彂',
+						{
+							confirmButtonText: '纭涓嬪彂',
+							cancelButtonText: '鍙栨秷',
+							type: 'warning',
+							dangerouslyUseHTMLString: true,
+							customClass: 'confirm-dialog',
+							confirmButtonClass: 'confirm-report-btn',
+							beforeClose: (action, instance, done) => {
+								if (action === 'confirm') {
+									instance.confirmButtonLoading = true;
+									this.confirmReport(orderNo, done);
+								} else {
+									done();
+								}
+							}
+						}
+				).then(() => {
+					// 纭涓婃姤鍚庣殑澶勭悊鍦╞eforeClose涓畬鎴�
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堟搷浣�'
+					});
+				});
+			},
+
+			// 纭涓婃姤
+			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
+				// };
+
+				// 璋冪敤鍚庡彴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('涓嬪彂澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
 					}
 				});
 			},
@@ -541,86 +815,6 @@
 				this.getTableDataA();
 			},
 
-			showConfirmDialog() {
-				if (!this.currentRow) {
-					this.$message.error('娌℃湁閫夋嫨瑕佷笂鎶ョ殑鏁版嵁');
-					return;
-				}
-
-				const groupOrderNo = this.currentRow.itemName;
-
-				this.$confirm(
-						`鏄惁纭寮�濮嬩笂鎶ョ粍璐у崟鍙� <strong style="color: #F56C6C; font-size: 16px;">${groupOrderNo}</strong>?<br/><br/>灏嗙敓鎴愬疄闄呯粍璐у崟锛屽崟涓�缁勮揣鍗曞彿鍙兘鎿嶄綔涓�娆�!!!`,
-						'纭涓婃姤',
-						{
-							confirmButtonText: '纭涓婃姤',
-							cancelButtonText: '鍙栨秷',
-							type: 'warning',
-							dangerouslyUseHTMLString: true,
-							customClass: 'confirm-dialog',
-							confirmButtonClass: 'confirm-report-btn',
-							beforeClose: (action, instance, done) => {
-								if (action === 'confirm') {
-									instance.confirmButtonLoading = true;
-									this.confirmReport(groupOrderNo, done);
-								} else {
-									done();
-								}
-							}
-						}
-				).then(() => {
-					// 纭涓婃姤鍚庣殑澶勭悊鍦╞eforeClose涓畬鎴�
-				}).catch(() => {
-					this.$message({
-						type: 'info',
-						message: '宸插彇娑堟搷浣�'
-					});
-				});
-			},
-
-			// 纭涓婃姤
-			confirmReport(groupOrderNo, done) {
-				this.reportLoading = true;
-
-				// 璋冪敤鍚庡彴API涓婃姤鏁版嵁
-				$.ajax({
-					url: baseUrl + "/order/pakout/actual/shipment/order/report/auth",
-					headers: {'token': localStorage.getItem('token')},
-					data: {
-						itemName: groupOrderNo // 浼犻�掔粍璐у崟鍙�
-					},
-					method: 'POST',
-					success: (res) => {
-						this.reportLoading = false;
-						if (typeof done === 'function') {
-							done();
-						}
-						if (res.code === 200 || res.success) {
-							this.$message({
-								message: `缁勮揣鍗曞彿 ${groupOrderNo} 涓婃姤鎴愬姛`,
-								type: 'success',
-								duration: 3000
-							});
-							// 涓婃姤鎴愬姛鍚庡叧闂脊绐楀苟鍒锋柊鏁版嵁
-							setTimeout(() => {
-								this.closeDetailDialog();
-								this.getTableDataA(); // 鍒锋柊涓昏〃鏁版嵁
-							}, 1500);
-						} else {
-							this.$message.error(res.message || '涓婃姤澶辫触');
-						}
-					},
-					error: (error) => {
-						this.reportLoading = false;
-						if (typeof done === 'function') {
-							done();
-						}
-						console.error('涓婃姤澶辫触:', error);
-						this.$message.error('涓婃姤澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
-					}
-				});
-			},
-
 			// 鎼滅储澶勭悊
 			handleSearch() {
 				this.currentPage = 1;
@@ -632,10 +826,9 @@
 			// 閲嶇疆鎼滅储鏉′欢
 			handleReset() {
 				this.searchForm = {
-					item_name: '',
-					cstmr_name: '',
-					settle: '',
-					order_no: ''
+					orderNo: '',
+					cstmrName: '',
+					settle: ''
 				};
 				this.orderByField = '';
 				this.orderByType = 'asc';
@@ -649,6 +842,9 @@
 				this.detailDialogVisible = true;
 				this.detailCurrentPage = 1;
 				this.settleA = row.settle;
+				// 娓呯┖缂撳瓨
+				this.modifiedQuantities = {};
+				this.deletedRecords = [];
 				this.getTableDataB(row.orderNo);
 			},
 
@@ -658,6 +854,8 @@
 				this.currentRow = null;
 				this.tableDataB = [];
 				this.reportLoading = false;
+				this.modifiedQuantities = {};
+				this.deletedRecords = [];
 			},
 
 			// 涓昏〃鍒嗛〉澶у皬鏀瑰彉
@@ -678,7 +876,7 @@
 				this.detailPageSize = val;
 				this.detailCurrentPage = 1;
 				if (this.currentRow) {
-					this.getTableDataB(this.currentRow.itemName);
+					this.getTableDataB(this.currentRow.orderNo);
 				}
 			},
 
@@ -686,86 +884,69 @@
 			handleDetailCurrentChange(val) {
 				this.detailCurrentPage = val;
 				if (this.currentRow) {
-					this.getTableDataB(this.currentRow.itemName);
+					this.getTableDataB(this.currentRow.orderNo);
 				}
 			},
 
 			// 鏍煎紡鍖栫姸鎬佹樉绀�
 			formatStatus(row) {
-				if (row.settle === 10) {
-					return '寰呭鐞�';
-				} else if (row.settle === 11) {
-					return '妫�楠屼腑';
-				} else if (row.settle === 12) {
-					return '鍑哄簱涓�';
-				} else if (row.settle === 13) {
-					return '瀛樺湪涓嶅悎鏍�';
-				} else if (row.settle === 15) {
-					return '寰呬笂鎶�';
-				} else if (row.settle === 16) {
-					return '涓婃姤瀹屾垚';
-				} else if (row.settle === 17) {
-					return '涓婃姤澶辫触';
-				} else if (row.settle === 98) {
-					return '寮傚父';
-				} else if (row.settle === 99) {
-					return '搴熷純';
-				} else {
-					return row.settle || '鏈煡';
-				}
+				const statusMap = {
+					0: '鍒濆鍖�',
+					1: '寰呭鐞�',
+					2: '浣滀笟涓�',
+					3: '宸插彇娑�',
+					4: '宸插畬鎴�',
+					5: '鍑嗗鍙栨秷',
+					6: '涓婃姤瀹屾垚',
+					7: '鏁版嵁寮傚父',
+					8: '瀹℃牳瀹屾垚',
+					9: '鎻愪氦瀹屾垚',
+					10: '淇濆瓨瀹屾垚',
+					98: '寮傚父',
+					99: '搴熷純'
+				};
+				return statusMap[row.settle] || row.settle || '鏈煡';
 			},
 
 			// 鏍煎紡鍖栫姸鎬佹樉绀�
 			formatStatusB(row) {
-				if (row.status === 0) {
-					return '鍒濆鍖�';
-				} else if (row.status === 1) {
-					return '寰呭鐞�';
-				} else if (row.status === 2) {
-					return '浣滀笟涓�';
-				} else if (row.status === 3) {
-					return '宸插彇娑�';
-				} else if (row.status === 4) {
-					return '宸插畬鎴�';
-				} else if (row.status === 5) {
-					return '鍑嗗鍙栨秷';
-				} else if (row.status === 6) {
-					return '涓婃姤瀹屾垚';
-				} else if (row.status === 7) {
-					return '鏁版嵁寮傚父';
-				} else if (row.status === 8) {
-					return '瀹℃牳瀹屾垚';
-				} else if (row.status === 9) {
-					return '鎻愪氦瀹屾垚';
-				} else if (row.status === 10) {
-					return '淇濆瓨瀹屾垚';
-				} else if (row.status === 98) {
-					return '涓婃姤瀹屾垚鏈畬缁�';
-				} else if (row.status === 99) {
-					return '閲嶆柊涓嬪彂';
-				} else {
-					return row.status || '鏈煡';
-				}
+				const statusMap = {
+					0: '鍒濆鍖�',
+					1: '寰呭鐞�',
+					2: '浣滀笟涓�',
+					3: '宸插彇娑�',
+					4: '宸插畬鎴�',
+					5: '鍑嗗鍙栨秷',
+					6: '涓婃姤瀹屾垚',
+					7: '鏁版嵁寮傚父',
+					8: '瀹℃牳瀹屾垚',
+					9: '鎻愪氦瀹屾垚',
+					10: '淇濆瓨瀹屾垚',
+					98: '涓婃姤瀹屾垚鏈畬缁�',
+					99: '閲嶆柊涓嬪彂'
+				};
+				return statusMap[row.status] || row.status || '鏈煡';
 			},
 
-			// 鏍煎紡鍖栭噾棰濇樉绀�
-			formatCurrency(row) {
-				if (row.totalFee) {
-					return '楼' + parseFloat(row.totalFee).toFixed(2);
-				}
-				return '楼0.00';
+			// 鏍煎紡鍖栫姸鎬佹樉绀�
+			formatStatusC(row) {
+				const statusMap = {
+					0: '涓嶄笅鍙�',
+					1: '寰呬笅鍙�'
+				};
+				return statusMap[row.inspect] || row.inspect || '鏈煡';
 			},
 
-			// 妯℃嫙涓昏〃鏁版嵁 - 瀹為檯椤圭洰涓簲鍒犻櫎
+			// 妯℃嫙涓昏〃鏁版嵁
 			mockTableAData() {
 				this.tableDataA = [
 					{
-						itemName: 'zh20251110',
-						orderNo: 'ORDER2024001',
-						cstmrName: 'zh20251110',
-						settle: 10,
-						totalFee: 1500.00,
-						createTime: '2025-11-10T09:50:16.343+0000',
+						itemName: '890506',
+						orderNo: '111804',
+						cstmrName: '娴嬭瘯',
+						settle: 2,
+						createTime: '2025-11-18T16:01:11.000+0000',
+						updateTime: '2025-11-18T16:01:11.000+0000',
 						memo: '娴嬭瘯鏁版嵁'
 					}
 				];
@@ -773,21 +954,31 @@
 				this.loading = false;
 			},
 
-			// 妯℃嫙瀛愯〃鏁版嵁 - 瀹為檯椤圭洰涓簲鍒犻櫎
-			mockTableBData(itemName) {
+			// 妯℃嫙瀛愯〃鏁版嵁
+			mockTableBData() {
 				this.tableDataB = [
 					{
-						matnr: '6渭m脳436mm',
-						batch: 'L241034114',
-						model: '24092501D01A6',
-						origin: '1',
-						danger: '1',
-						memo: '',
-						status: 1 // 鐘舵�佷负1锛屼細鏄剧ず淇敼鎸夐挳
+						matnr: '娴嬭瘯',
+						maktx: '12inRealisticPlus',
+						standby1: 'hDogToy',
+						standby2: 'boarL',
+						standby3: '890506',
+						boxType3: '1',
+						anfme: 1,
+						erpAnfme: 1,
+						status: 2,
+						batch: 'L241034114'
 					}
 				];
 				this.detailTotal = 1;
 				this.detailLoading = false;
+
+				// 鍒濆鍖栨暟閲忕紦瀛�
+				this.modifiedQuantities = {};
+				this.tableDataB.forEach(item => {
+					const itemKey = this.getItemKey(item);
+					this.$set(this.modifiedQuantities, itemKey, item.anfme);
+				});
 			},
 
 			// 涓鸿〃鏍煎垪娣诲姞鏍煎紡鍖栨柟娉�
@@ -795,88 +986,23 @@
 				return this.formatDate(cellValue);
 			},
 
-
-
-			// // 鏍煎紡鍖栨棩鏈熸樉绀�
-			// formatDate(dateStr) {
-			// 	if (!dateStr) return '';
-			// 	// 绠�鍗曠殑鏃ユ湡鏍煎紡鍖栵紝鍙互鏍规嵁瀹為檯鏍煎紡璋冩暣
-			// 	return dateStr;
-			// },
-
-			// 鍦╒ue瀹炰緥鐨刴ethods涓坊鍔犳垨淇敼formatDate鏂规硶
+			// 鏍煎紡鍖栨棩鏈熸樉绀�
 			formatDate(dateStr) {
 				if (!dateStr) return '';
 
 				try {
-					// 鍒涘缓Date瀵硅薄
-					const date = new Date(dateStr);
-
-					// 妫�鏌ユ棩鏈熸槸鍚︽湁鏁�
-					if (isNaN(date.getTime())) {
-						return dateStr; // 濡傛灉瑙f瀽澶辫触锛岃繑鍥炲師瀛楃涓�
-					}
-
-					// 鑾峰彇鍚勪釜鏃堕棿缁勪欢
-					const year = date.getFullYear();
-					const month = String(date.getMonth() + 1).padStart(2, '0');
-					const day = String(date.getDate()).padStart(2, '0');
-					const hours = String(date.getHours()).padStart(2, '0');
-					const minutes = String(date.getMinutes()).padStart(2, '0');
-					const seconds = String(date.getSeconds()).padStart(2, '0');
-
-					// 杩斿洖鏍煎紡鍖栧悗鐨勫瓧绗︿覆锛歒YYY-MM-DD HH:mm:ss
-					return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
-				} catch (error) {
-					console.error('鏃ユ湡鏍煎紡鍖栭敊璇�:', error);
-					return dateStr; // 濡傛灉鍑洪敊锛岃繑鍥炲師瀛楃涓�
-				}
-			},
-
-//鏈湴鏃跺尯鐨勬椂闂�
-			formatDate2(dateStr) {
-				if (!dateStr) return '';
-
-				try {
 					const date = new Date(dateStr);
 
 					if (isNaN(date.getTime())) {
 						return dateStr;
 					}
 
-					// 浣跨敤鏈湴鏃跺尯
 					const year = date.getFullYear();
 					const month = String(date.getMonth() + 1).padStart(2, '0');
 					const day = String(date.getDate()).padStart(2, '0');
 					const hours = String(date.getHours()).padStart(2, '0');
 					const minutes = String(date.getMinutes()).padStart(2, '0');
 					const seconds = String(date.getSeconds()).padStart(2, '0');
-
-					return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
-				} catch (error) {
-					console.error('鏃ユ湡鏍煎紡鍖栭敊璇�:', error);
-					return dateStr;
-				}
-			},
-			//淇濇寔UTC鏃堕棿浣嗚浆鎹负鏇存槗璇荤殑鏍煎紡
-			formatDate3(dateStr) {
-				if (!dateStr) return '';
-
-				try {
-					// 鐩存帴瑙f瀽瀛楃涓诧紝涓嶈浆鎹㈡椂鍖�
-					const date = new Date(dateStr);
-
-					if (isNaN(date.getTime())) {
-						return dateStr;
-					}
-
-					// 浣跨敤UTC鏃堕棿缁勪欢
-					const year = date.getUTCFullYear();
-					const month = String(date.getUTCMonth() + 1).padStart(2, '0');
-					const day = String(date.getUTCDate()).padStart(2, '0');
-					const hours = String(date.getUTCHours()).padStart(2, '0');
-					const minutes = String(date.getUTCMinutes()).padStart(2, '0');
-					const seconds = String(date.getUTCSeconds()).padStart(2, '0');
 
 					return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 				} catch (error) {

--
Gitblit v1.9.1