From 2ce9436d64aaee5d9743e34f89e64f2207cc8583 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 11 十一月 2025 13:30:47 +0800
Subject: [PATCH] *

---
 src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html |  610 +++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 455 insertions(+), 155 deletions(-)

diff --git a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
index 964797c..401945f 100644
--- a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
+++ b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
@@ -66,6 +66,34 @@
 			gap: 10px;
 			margin-left: auto;
 		}
+		/* 纭涓婃姤鎸夐挳鏍峰紡 */
+		.confirm-report-btn {
+			border: 2px solid #F56C6C;
+			color: #F56C6C;
+			font-weight: bold;
+			background-color: transparent;
+			padding: 10px 20px;
+		}
+		.confirm-report-btn:hover {
+			background-color: #F56C6C;
+			color: white;
+		}
+		.dialog-footer {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			gap: 10px;
+			margin-top: 20px;
+		}
+		/* 浜屾纭瀵硅瘽妗嗘牱寮� */
+		.confirm-dialog .el-message-box__message {
+			text-align: center;
+			font-size: 16px;
+			line-height: 1.5;
+		}
+		.confirm-dialog .el-message-box__status {
+			font-size: 24px !important;
+		}
 	</style>
 </head>
 <body>
@@ -76,7 +104,7 @@
 			<div class="search-item">
 				<span class="search-label">缁勮揣鍗曞彿:</span>
 				<el-input
-						v-model="searchForm.A1"
+						v-model="searchForm.itemName"
 						placeholder="璇疯緭鍏ョ粍璐у崟鍙�"
 						clearable
 						style="width: 150px;"
@@ -86,7 +114,7 @@
 			<div class="search-item">
 				<span class="search-label">瀹㈡埛鍚嶇О:</span>
 				<el-input
-						v-model="searchForm.A2"
+						v-model="searchForm.cstmrName"
 						placeholder="璇疯緭鍏ュ鎴峰悕绉�"
 						clearable
 						style="width: 180px;"
@@ -95,23 +123,23 @@
 			</div>
 			<div class="search-item">
 				<span class="search-label">鐘舵��:</span>
-				<el-input
-						v-model="searchForm.A3"
-						placeholder="璇疯緭鍏ョ姸鎬�"
+				<el-select
+						v-model="searchForm.settle"
+						placeholder="璇烽�夋嫨鐘舵��"
 						clearable
 						style="width: 150px;"
-						@keyup.enter.native="handleSearch"
-				></el-input>
-			</div>
-			<div class="search-item">
-				<span class="search-label">灞炴�4:</span>
-				<el-input
-						v-model="searchForm.A4"
-						placeholder="璇疯緭鍏ュ睘鎬4"
-						clearable
-						style="width: 150px;"
-						@keyup.enter.native="handleSearch"
-				></el-input>
+				>
+					<el-option label="鍏ㄩ儴" value=""></el-option>
+					<el-option label="寰呭鐞�" value="10"></el-option>
+					<el-option label="妫�楠屼腑" value="11"></el-option>
+					<el-option label="鍑哄簱涓�" value="12"></el-option>
+					<el-option label="瀛樺湪涓嶅悎鏍�" value="13"></el-option>
+					<el-option label="寰呬笂鎶�" value="15"></el-option>
+					<el-option label="涓婃姤瀹屾垚" value="16"></el-option>
+					<el-option label="涓婃姤澶辫触" value="17"></el-option>
+					<el-option label="寮傚父" value="98"></el-option>
+					<el-option label="搴熷純" value="99"></el-option>
+				</el-select>
 			</div>
 			<div class="search-actions">
 				<el-button type="primary" icon="el-icon-search" @click="handleSearch">鎼滅储</el-button>
@@ -128,11 +156,11 @@
 				:data="tableDataA"
 				highlight-current-row
 				style="width: 100%"
-				v-loading="loading">
-			<el-table-column prop="A1" label="缁勮揣鍗曞彿" width="100" align="center"></el-table-column>
-			<el-table-column prop="A2" label="瀹㈡埛鍚嶇О" min-width="120" align="center"></el-table-column>
-			<el-table-column prop="A3" label="鐘舵��" min-width="120" align="center"></el-table-column>
-			<el-table-column prop="A4" label="灞炴�4" min-width="120" align="center"></el-table-column>
+				v-loading="loading"
+				@sort-change="handleSortChange">
+			<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 label="鎿嶄綔" width="150" align="center" fixed="right">
 				<template slot-scope="scope">
 					<div class="operation-cell">
@@ -169,11 +197,12 @@
 			class="detail-dialog"
 			@close="closeDetailDialog">
 		<div v-if="currentRow">
-			<h3>缁勮揣鍗曚富琛� (缁勮揣鍗曞彿: {{ currentRow.A1 }})</h3>
+			<h3>缁勮揣鍗曚富琛� (缁勮揣鍗曞彿: {{ currentRow.itemName }})</h3>
 			<el-descriptions :column="2" border>
-				<el-descriptions-item label="瀹㈡埛鍚嶇О">{{ currentRow.A2 }}</el-descriptions-item>
-				<el-descriptions-item label="鐘舵��">{{ currentRow.A3 }}</el-descriptions-item>
-				<el-descriptions-item label="灞炴�4">{{ currentRow.A4 }}</el-descriptions-item>
+				<el-descriptions-item label="瀹㈡埛鍚嶇О">{{ currentRow.cstmrName }}</el-descriptions-item>
+				<el-descriptions-item label="鐘舵��">{{ formatStatus(currentRow)}}</el-descriptions-item>
+				<el-descriptions-item label="鍒涘缓鏃堕棿">{{ formatDate(currentRow.createTime) }}</el-descriptions-item>
+				<el-descriptions-item label="澶囨敞">{{ currentRow.memo || '鏃�' }}</el-descriptions-item>
 			</el-descriptions>
 
 			<h3 style="margin-top: 20px;">缁勮揣鍗曟槑缁�</h3>
@@ -182,10 +211,32 @@
 					:data="tableDataB"
 					style="width: 100%"
 					v-loading="detailLoading">
-				<el-table-column prop="B2" label="瀹㈡埛鍚嶇О" min-width="120" align="center"></el-table-column>
-				<el-table-column prop="B3" label="鐘舵��" min-width="120" align="center"></el-table-column>
-				<el-table-column prop="B4" label="娴佹按鍙�" min-width="120" align="center"></el-table-column>
-				<!-- 鍙牴鎹疄闄呴渶姹傛坊鍔犳洿澶氬瓙琛ㄥ垪 -->
+				<el-table-column prop="matnr" label="瑙勬牸" min-width="120" align="center"></el-table-column>
+				<el-table-column prop="batch" label="绠卞彿" min-width="80" align="center"></el-table-column>
+				<el-table-column prop="model" label="鍗峰彿" min-width="100" align="center" ></el-table-column>
+				<el-table-column prop="origin" label="浣嶇疆" min-width="100" align="center"></el-table-column>
+				<el-table-column prop="danger" label="寰呭垽" min-width="100" align="center"></el-table-column>
+				<el-table-column prop="memo" label="澶囨敞" min-width="100" align="center"></el-table-column>
+				<el-table-column prop="status" label="鐘舵��" min-width="100" align="center" :formatter="formatStatusB"></el-table-column>
+				<!-- 鏂板鎿嶄綔鍒楋紝鏍规嵁status鍊兼帶鍒舵樉绀� -->
+				<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"
+									   type="primary"
+									   size="mini"
+									   @click="handleModifyN(scope.row)">
+								鍚�
+							</el-button>
+							<el-button v-if="scope.row.status === 1"
+									   type="primary"
+									   size="mini"
+									   @click="handleModifyY(scope.row)">
+								鏄�
+							</el-button>
+						</div>
+					</template>
+				</el-table-column>
 			</el-table>
 
 			<!-- 瀛愯〃鍒嗛〉 -->
@@ -202,7 +253,13 @@
 			</div>
 		</div>
 
-		<div slot="footer">
+		<div slot="footer" class="dialog-footer">
+			<el-button
+					class="confirm-report-btn"
+					@click="showConfirmDialog"
+					:loading="reportLoading">
+				纭涓婃姤
+			</el-button>
 			<el-button @click="closeDetailDialog">鍏抽棴</el-button>
 		</div>
 	</el-dialog>
@@ -214,11 +271,14 @@
 		data: {
 			// 鎼滅储琛ㄥ崟
 			searchForm: {
-				A1: '',
-				A2: '',
-				A3: '',
-				A4: ''
+				item_name: '',
+				cstmr_name: '',
+				settle: '',
+				order_no: ''
 			},
+			// 鎺掑簭鐩稿叧
+			orderByField: '',
+			orderByType: 'asc',
 			// 涓昏〃A鏁版嵁
 			tableDataA: [],
 			// 瀛愯〃B鏁版嵁
@@ -237,166 +297,346 @@
 			// 鍔犺浇鐘舵��
 			loading: false,
 			detailLoading: false,
-			// 鍘熷鏁版嵁澶囦唤锛堢敤浜庢悳绱級
-			originalTableDataA: []
+			reportLoading: false
 		},
 		created() {
 			this.init();
 		},
 		methods: {
 			init() {
+				this.getTableDataA();
+
+				// 姣�5绉掕嚜鍔ㄥ埛鏂版暟鎹�
 				setInterval(() => {
 					this.getTableDataA();
-				}, 2000);
+				}, 10000);
 			},
 
-			// 鑾峰彇涓昏〃A鏁版嵁
+			// 鑾峰彇涓昏〃A鏁版嵁 - 浣跨敤鏂扮殑API
 			getTableDataA() {
 				let that = this;
 				that.loading = true;
 
-				// 妯℃嫙API璋冪敤 - 鏇挎崲涓哄疄闄匒PI
+				// 鏋勫缓璇锋眰鍙傛暟
+				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 {
+							params[key] = that.searchForm[key];
+						}
+					}
+				});
+
 				$.ajax({
-					url: baseUrl + "/api/tableA/data",
+					url: baseUrl + "/order/pakout/order/cargo/grouping/auth/v1",
 					headers: {
 						'token': localStorage.getItem('token')
 					},
-					data: {
-						page: that.currentPage,
-						size: that.pageSize
-					},
+					data: params,
 					dataType: 'json',
-					contentType: 'application/json;charset=UTF-8',
-					method: 'post',
+					method: 'get',
 					success: function (res) {
-						that.tableDataA = res.data || [];
-						that.originalTableDataA = JSON.parse(JSON.stringify(that.tableDataA)); // 澶囦唤鍘熷鏁版嵁
-						that.total = res.total || 0;
+						if (res.code === 200 || res.success) {
+							that.tableDataA = res.data.records || [];
+							that.total = res.data.total || 0;
+						} else {
+							that.$message.error(res.message || '鑾峰彇鏁版嵁澶辫触');
+							that.tableDataA = [];
+							that.total = 0;
+						}
 						that.loading = false;
 					},
-					error: function() {
+					error: function(xhr, status, error) {
 						that.loading = false;
-						// 瀹為檯椤圭洰涓簲浣跨敤鐪熷疄API锛岃繖閲屼娇鐢ㄦā鎷熸暟鎹�
+						that.$message.error('缃戠粶璇锋眰澶辫触');
+						console.error('API璋冪敤澶辫触:', error);
+						// 妯℃嫙鏁版嵁锛堝疄闄呴」鐩腑搴斿垹闄わ級
 						that.mockTableAData();
 					}
 				});
 			},
 
-			// 鑾峰彇瀛愯〃B鏁版嵁
-			getTableDataB(A1) {
+			// 鑾峰彇瀛愯〃B鏁版嵁锛堟牴鎹疄闄呬笟鍔¤皟鏁达級
+			getTableDataB(itemName) {
 				let that = this;
 				that.detailLoading = true;
 
-				// 妯℃嫙API璋冪敤 - 鏇挎崲涓哄疄闄匒PI
+				// 鏋勫缓璇锋眰鍙傛暟
+				let params = {
+					item_name: itemName,
+					curr: that.detailCurrentPage,
+					limit: that.detailPageSize
+				};
+
+				// 妯℃嫙API璋冪敤 - 鏍规嵁瀹為檯涓氬姟璋冩暣API鍦板潃
 				$.ajax({
-					url: baseUrl + "/api/tableB/data",
+					url: baseUrl + "/order/pakout/orderDetl/cargo/grouping/auth",
 					headers: {
 						'token': localStorage.getItem('token')
 					},
-					data: {
-						A1: A1,
-						page: that.detailCurrentPage,
-						size: that.detailPageSize
-					},
+					data: params,
 					dataType: 'json',
 					contentType: 'application/json;charset=UTF-8',
-					method: 'post',
+					method: 'get',
 					success: function (res) {
-						that.tableDataB = res.data || [];
-						that.detailTotal = res.total || 0;
+						if (res.code === 200 || res.success) {
+							that.tableDataB = res.data.records || [];
+							that.detailTotal = res.data.total || 0;
+						} else {
+							that.$message.error(res.message || '鑾峰彇鏁版嵁澶辫触');
+							that.tableDataB = [];
+							that.detailTotal = 0;
+						}
 						that.detailLoading = false;
 					},
 					error: function() {
 						that.detailLoading = false;
 						// 瀹為檯椤圭洰涓簲浣跨敤鐪熷疄API锛岃繖閲屼娇鐢ㄦā鎷熸暟鎹�
-						that.mockTableBData(A1);
+						that.mockTableBData(itemName);
 					}
 				});
 			},
 
-			// 鎼滅储澶勭悊[1,5](@ref)
-			handleSearch() {
-				this.currentPage = 1;
-				this.loading = true;
-
-				// 濡傛灉鏈夊悗绔悳绱PI锛屽彲浠ヨ皟鐢ㄥ悗绔悳绱�
-				// 杩欓噷浣跨敤鍓嶇杩囨护浣滀负绀轰緥
-				if (this.isSearchFormEmpty()) {
-					// 濡傛灉鎼滅储鏉′欢涓虹┖锛屾樉绀烘墍鏈夋暟鎹�
-					this.getTableDataA();
-				} else {
-					// 浣跨敤鍓嶇杩囨护杩涜鎼滅储[2,4](@ref)
-					this.filterTableData();
+			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
+			handleModifyY(row) {
+				if (!this.currentRow) {
+					this.$message.error('娌℃湁閫夋嫨涓昏〃鏁版嵁');
+					return;
 				}
+
+				const groupOrderNo = this.currentRow.itemName; // 缁勮揣鍗曞彿
+				const batch = row.batch; // 绠卞彿
+				const status = 2; // 绠卞彿
+
+				this.$confirm(
+						`纭畾灏嗙粍璐у崟鍙凤細 <strong style="color: #409EFF;">${groupOrderNo}</strong> 銆佺鍙凤細 <strong style="color: #409EFF;">${batch}</strong> 娣诲姞鍒颁笂鎶ュ垪鍚楋紵`,
+						'纭淇敼',
+						{
+							confirmButtonText: '纭淇敼',
+							cancelButtonText: '鍙栨秷',
+							type: 'warning',
+							dangerouslyUseHTMLString: true
+						}
+				).then(() => {
+					this.submitModify(groupOrderNo, batch, status);
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堜慨鏀�'
+					});
+				});
 			},
 
-			// 鍓嶇杩囨护琛ㄦ牸鏁版嵁[2,4](@ref)
-			filterTableData() {
-				let that = this;
-				// 妯℃嫙API璋冪敤 - 瀹為檯椤圭洰涓彲浠ヨ皟鐢ㄥ悗绔悳绱㈡帴鍙�
+			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
+			handleModifyN(row) {
+				if (!this.currentRow) {
+					this.$message.error('娌℃湁閫夋嫨涓昏〃鏁版嵁');
+					return;
+				}
+
+				const groupOrderNo = this.currentRow.itemName; // 缁勮揣鍗曞彿
+				const batch = row.batch; // 绠卞彿
+				const status = 1; // 绠卞彿
+
+				this.$confirm(
+						`纭畾灏嗙粍璐у崟鍙凤細 <strong style="color: #409EFF;">${groupOrderNo}</strong> 銆佺鍙凤細 <strong style="color: #409EFF;">${batch}</strong> 娣诲姞鍒颁笂鎶ュ垪鍚楋紵`,
+						'纭淇敼',
+						{
+							confirmButtonText: '纭淇敼',
+							cancelButtonText: '鍙栨秷',
+							type: 'warning',
+							dangerouslyUseHTMLString: true
+						}
+				).then(() => {
+					this.submitModify(groupOrderNo, batch, status);
+				}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '宸插彇娑堜慨鏀�'
+					});
+				});
+			},
+
+			// 鎻愪氦淇敼鍒板悗鍙�
+			submitModify(groupOrderNo, batch, status) {
+				// 鏄剧ず鍔犺浇鐘舵��
+				const loadingInstance = this.$loading({
+					lock: true,
+					text: '鎻愪氦淇敼涓�...',
+					spinner: 'el-icon-loading',
+					background: 'rgba(0, 0, 0, 0.7)'
+				});
+
+				// 璋冪敤鍚庡彴API鎻愪氦淇敼
 				$.ajax({
-					url: baseUrl + "/api/tableA/search",
-					headers: {
-						'token': localStorage.getItem('token')
+					url: baseUrl + "/order/pakout/orderDetl/batch/report/auth",
+					headers: {'token': localStorage.getItem('token')},
+					data: top.reObject({
+						item_name: groupOrderNo, // 缁勮揣鍗曞彿
+						batch: batch, // 绠卞彿
+						status: status // 绠卞彿
+					}),
+					method: 'POST',
+					success: (res) => {
+						loadingInstance.close();
+
+						if (res.code === 200 || res.success) {
+							this.$message({
+								message: `淇敼鎴愬姛锛佺粍璐у崟鍙�: ${groupOrderNo}, 绠卞彿: ${batch}`,
+								type: 'success',
+								duration: 3000
+							});
+
+							// 淇敼鎴愬姛鍚庡彲浠ュ埛鏂板瓙琛ㄦ暟鎹�
+							this.getTableDataB(groupOrderNo);
+						} else {
+							this.$message.error(res.message || '淇敼澶辫触');
+						}
 					},
-					data: {
-						...that.searchForm,
-						page: that.currentPage,
-						size: that.pageSize
-					},
-					dataType: 'json',
-					contentType: 'application/json;charset=UTF-8',
-					method: 'post',
-					success: function (res) {
-						that.tableDataA = res.data || [];
-						that.total = res.total || 0;
-						that.loading = false;
-					},
-					error: function() {
-						that.loading = false;
-						// 濡傛灉API璋冪敤澶辫触锛屼娇鐢ㄥ墠绔繃婊や綔涓哄閫夋柟妗�
-						that.frontendFilter();
+					error: (error) => {
+						loadingInstance.close();
+						console.error('淇敼澶辫触:', error);
+						this.$message.error('淇敼澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
 					}
 				});
 			},
 
-			// 鍓嶇杩囨护澶囬�夋柟妗圼2,4](@ref)
-			frontendFilter() {
-				const filteredData = this.originalTableDataA.filter(item => {
-					// 妫�鏌ユ瘡涓悳绱㈡潯浠禰4](@ref)
-					const matchA1 = !this.searchForm.A1 ||
-							(item.A1 && item.A1.toString().toLowerCase().includes(this.searchForm.A1.toLowerCase()));
-					const matchA2 = !this.searchForm.A2 ||
-							(item.A2 && item.A2.toString().toLowerCase().includes(this.searchForm.A2.toLowerCase()));
-					const matchA3 = !this.searchForm.A3 ||
-							(item.A3 && item.A3.toString().toLowerCase().includes(this.searchForm.A3.toLowerCase()));
-					const matchA4 = !this.searchForm.A4 ||
-							(item.A4 && item.A4.toString().toLowerCase().includes(this.searchForm.A4.toLowerCase()));
-
-					return matchA1 && matchA2 && matchA3 && matchA4;
-				});
-
-				this.tableDataA = filteredData;
-				this.total = filteredData.length;
-				this.loading = false;
-			},
-
-			// 閲嶇疆鎼滅储鏉′欢[5](@ref)
-			handleReset() {
-				this.searchForm = {
-					A1: '',
-					A2: '',
-					A3: '',
-					A4: ''
-				};
+			// 琛ㄦ牸鎺掑簭鍙樺寲
+			handleSortChange(column) {
+				if (column.prop) {
+					this.orderByField = column.prop;
+					this.orderByType = column.order === 'ascending' ? 'asc' : 'desc';
+				} else {
+					this.orderByField = '';
+					this.orderByType = 'asc';
+				}
 				this.currentPage = 1;
 				this.getTableDataA();
 			},
 
-			// 妫�鏌ユ悳绱㈡潯浠舵槸鍚︿负绌�
-			isSearchFormEmpty() {
-				return !this.searchForm.A1 && !this.searchForm.A2 &&
-						!this.searchForm.A3 && !this.searchForm.A4;
+			// 鏄剧ず浜屾纭瀵硅瘽妗�
+			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 + "/api/report/confirm",
+					headers: {
+						'token': localStorage.getItem('token')
+					},
+					data: JSON.stringify({
+						item_name: groupOrderNo // 浼犻�掔粍璐у崟鍙�
+					}),
+					dataType: 'json',
+					contentType: 'application/json;charset=UTF-8',
+					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;
+				this.orderByField = '';
+				this.orderByType = 'asc';
+				this.getTableDataA();
+			},
+
+			// 閲嶇疆鎼滅储鏉′欢
+			handleReset() {
+				this.searchForm = {
+					item_name: '',
+					cstmr_name: '',
+					settle: '',
+					order_no: ''
+				};
+				this.orderByField = '';
+				this.orderByType = 'asc';
+				this.currentPage = 1;
+				this.getTableDataA();
 			},
 
 			// 鏄剧ず璇︽儏寮圭獥
@@ -404,7 +644,7 @@
 				this.currentRow = row;
 				this.detailDialogVisible = true;
 				this.detailCurrentPage = 1;
-				this.getTableDataB(row.A1);
+				this.getTableDataB(row.itemName);
 			},
 
 			// 鍏抽棴璇︽儏寮圭獥
@@ -412,6 +652,7 @@
 				this.detailDialogVisible = false;
 				this.currentRow = null;
 				this.tableDataB = [];
+				this.reportLoading = false;
 			},
 
 			// 涓昏〃鍒嗛〉澶у皬鏀瑰彉
@@ -432,7 +673,7 @@
 				this.detailPageSize = val;
 				this.detailCurrentPage = 1;
 				if (this.currentRow) {
-					this.getTableDataB(this.currentRow.A1);
+					this.getTableDataB(this.currentRow.itemName);
 				}
 			},
 
@@ -440,37 +681,96 @@
 			handleDetailCurrentChange(val) {
 				this.detailCurrentPage = val;
 				if (this.currentRow) {
-					this.getTableDataB(this.currentRow.A1);
+					this.getTableDataB(this.currentRow.itemName);
 				}
+			},
+
+			// 鏍煎紡鍖栫姸鎬佹樉绀�
+			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 || '鏈煡';
+				}
+			},
+
+			// 鏍煎紡鍖栫姸鎬佹樉绀�
+			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 {
+					return row.status || '鏈煡';
+				}
+			},
+
+			// 鏍煎紡鍖栭噾棰濇樉绀�
+			formatCurrency(row) {
+				if (row.totalFee) {
+					return '楼' + parseFloat(row.totalFee).toFixed(2);
+				}
+				return '楼0.00';
+			},
+
+			// 鏍煎紡鍖栨棩鏈熸樉绀�
+			formatDate(dateStr) {
+				if (!dateStr) return '';
+				// 绠�鍗曠殑鏃ユ湡鏍煎紡鍖栵紝鍙互鏍规嵁瀹為檯鏍煎紡璋冩暣
+				return dateStr;
 			},
 
 			// 妯℃嫙涓昏〃鏁版嵁 - 瀹為檯椤圭洰涓簲鍒犻櫎
 			mockTableAData() {
 				this.tableDataA = [
-					{ A1: '1001', A2: '绀轰緥鏁版嵁A2-1', A3: '绀轰緥鏁版嵁A3-1', A4: '绀轰緥鏁版嵁A4-1' },
-					{ A1: '1002', A2: '绀轰緥鏁版嵁A2-2', A3: '绀轰緥鏁版嵁A3-2', A4: '绀轰緥鏁版嵁A4-2' },
-					{ A1: '1003', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '10033', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '100333', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '10032', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '10031', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '100312', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '1003123', A2: '绀轰緥鏁版嵁A2-3', A3: '绀轰緥鏁版嵁A3-3', A4: '绀轰緥鏁版嵁A4-3' },
-					{ A1: '1004', A2: '绀轰緥鏁版嵁A2-4', A3: '绀轰緥鏁版嵁A3-4', A4: '绀轰緥鏁版嵁A4-4' }
+					{
+						itemName: 'zh20251110',
+						orderNo: 'ORDER2024001',
+						cstmrName: 'zh20251110',
+						settle: 10,
+						totalFee: 1500.00,
+						createTime: '2025-11-10T09:50:16.343+0000',
+						memo: '娴嬭瘯鏁版嵁'
+					}
 				];
-				this.originalTableDataA = JSON.parse(JSON.stringify(this.tableDataA)); // 澶囦唤鍘熷鏁版嵁
-				this.total = 4;
+				this.total = 1;
 				this.loading = false;
 			},
 
 			// 妯℃嫙瀛愯〃鏁版嵁 - 瀹為檯椤圭洰涓簲鍒犻櫎
-			mockTableBData(A1) {
+			mockTableBData(itemName) {
 				this.tableDataB = [
-					{ B2: `瀛愯〃鏁版嵁B2-${A1}-1`, B3: `瀛愯〃鏁版嵁B3-${A1}-1`, B4: `瀛愯〃鏁版嵁B4-${A1}-1` },
-					{ B2: `瀛愯〃鏁版嵁B2-${A1}-2`, B3: `瀛愯〃鏁版嵁B3-${A1}-2`, B4: `瀛愯〃鏁版嵁B4-${A1}-2` },
-					{ B2: `瀛愯〃鏁版嵁B2-${A1}-3`, B3: `瀛愯〃鏁版嵁B3-${A1}-3`, B4: `瀛愯〃鏁版嵁B4-${A1}-3` }
+					{
+						matnr: '6渭m脳436mm',
+						batch: 'L241034114',
+						model: '24092501D01A6',
+						origin: '1',
+						danger: '1',
+						memo: '',
+						status: 1 // 鐘舵�佷负1锛屼細鏄剧ず淇敼鎸夐挳
+					}
 				];
-				this.detailTotal = 3;
+				this.detailTotal = 1;
 				this.detailLoading = false;
 			}
 		}

--
Gitblit v1.9.1