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 |  861 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 762 insertions(+), 99 deletions(-)

diff --git a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
index 638f1cb..401945f 100644
--- a/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
+++ b/src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
@@ -1,9 +1,8 @@
 <!DOCTYPE html>
 <html lang="en">
-
 <head>
 	<meta charset="UTF-8">
-	<title>纭寲缃愯澶�</title>
+	<title>涓昏〃涓庡瓙琛ㄨ鎯呴〉闈�</title>
 	<link rel="stylesheet" href="../../static/css/element.css">
 	<link rel="stylesheet" href="../../static/css/element-ui.css">
 	<link rel="icon" href="../../static/images/favicon.ico" type="image/x-icon">
@@ -11,107 +10,771 @@
 	<script type="text/javascript" src="../../static/js/common.js"></script>
 	<script type="text/javascript" src="../../static/js/vue.min.js"></script>
 	<script type="text/javascript" src="../../static/js/element.js"></script>
+	<style>
+		.container {
+			padding: 20px;
+			width: 100%;
+			max-width: 1200px;
+			margin: 0 auto;
+		}
+		.table-container {
+			margin-bottom: 20px;
+			box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+			border-radius: 4px;
+			overflow: hidden;
+		}
+		.detail-dialog .el-dialog__body {
+			padding: 20px;
+		}
+		.pagination-container {
+			margin-top: 15px;
+			text-align: right;
+		}
+		.operation-cell {
+			display: flex;
+			justify-content: center;
+			gap: 8px;
+		}
+		/* 鎼滅储鏍忔牱寮� */
+		.search-container {
+			background: #f5f7fa;
+			padding: 15px;
+			margin-bottom: 20px;
+			border-radius: 4px;
+			box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+		}
+		.search-form {
+			display: flex;
+			flex-wrap: wrap;
+			align-items: center;
+			gap: 15px;
+		}
+		.search-item {
+			display: flex;
+			align-items: center;
+			margin-right: 15px;
+		}
+		.search-label {
+			min-width: 80px;
+			text-align: right;
+			margin-right: 10px;
+			font-size: 14px;
+			color: #606266;
+		}
+		.search-actions {
+			display: flex;
+			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>
-<style scoped>
-
-</style>
-
 <body>
-	<div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
-		<div style="width: 100%;">
-			<el-table border ref="singleTable" :data="tableData" highlight-current-row
-					  max-height="350" style="width: 100%">
-				<el-table-column property="category" label="绫诲埆">
-				</el-table-column>
-				<el-table-column property="equipmentNo" label="璁惧鍙�">
-				</el-table-column>
-				<el-table-column property="categoryOther" label="鐩稿叧璁惧绫诲埆">
-				</el-table-column>
-				<el-table-column property="equipmentNoOther" label="鐩稿叧璁惧鍙�">
-				</el-table-column>
-				<el-table-column property="errorM" label="寮傚父鎻忚堪">
-				</el-table-column>
-			</el-table>
-		</div>
-		<div style="width: 100%;">
-			<el-table border ref="singleTable" :data="adjacentLocMast" highlight-current-row
-					  max-height="350" style="width: 100%">
-				<el-table-column property="category" label="褰撳墠搴撲綅">
-				</el-table-column>
-				<el-table-column property="equipmentNo" label="褰撳墠搴撲綅鐘舵��">
-				</el-table-column>
-				<el-table-column property="categoryOther" label="鐩搁偦搴撲綅">
-				</el-table-column>
-				<el-table-column property="equipmentNoOther" label="鐩搁偦搴撲綅鐘舵��">
-				</el-table-column>
-				<el-table-column property="errorM" label="寮傚父鎻忚堪">
-				</el-table-column>
-			</el-table>
-		</div>
-
+<div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
+	<!-- 鎼滅储鏍� -->
+	<div class="search-container" style="width: 100%;">
+		<el-form :inline="true" class="search-form">
+			<div class="search-item">
+				<span class="search-label">缁勮揣鍗曞彿:</span>
+				<el-input
+						v-model="searchForm.itemName"
+						placeholder="璇疯緭鍏ョ粍璐у崟鍙�"
+						clearable
+						style="width: 150px;"
+						@keyup.enter.native="handleSearch"
+				></el-input>
+			</div>
+			<div class="search-item">
+				<span class="search-label">瀹㈡埛鍚嶇О:</span>
+				<el-input
+						v-model="searchForm.cstmrName"
+						placeholder="璇疯緭鍏ュ鎴峰悕绉�"
+						clearable
+						style="width: 180px;"
+						@keyup.enter.native="handleSearch"
+				></el-input>
+			</div>
+			<div class="search-item">
+				<span class="search-label">鐘舵��:</span>
+				<el-select
+						v-model="searchForm.settle"
+						placeholder="璇烽�夋嫨鐘舵��"
+						clearable
+						style="width: 150px;"
+				>
+					<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>
+				<el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
+			</div>
+		</el-form>
 	</div>
-	<script>
-		var app = new Vue({
-			el: '#app',
-			data: {
-				tableData: [],
-				adjacentLocMast: []
-			},
-			created() {
-				this.init()
-			},
-			watch: {
-			},
-			methods: {
-				init() {
-					this.getTableData()
-					this.getAdjacentLocMast()
 
-					setInterval(() => {
-						this.getTableData()
-						this.getAdjacentLocMast()
-						// this.demoStatus()
-					}, 1000)
-				},
-				confirmEvent() {
-				},
-				cancelEvent() {
-				},
-				getTableData() {
-					let that = this;
-					$.ajax({
-						url: baseUrl + "/error/device/task/depthAndShallowness",
-						headers: {
-							'token': localStorage.getItem('token')
-						},
-						data: {},
-						dataType: 'json',
-						contentType: 'application/json;charset=UTF-8',
-						method: 'post',
-						success: function (res) {
-							that.tableData = res.data
-						}
-					});
-				},
-				getAdjacentLocMast() {
-					let that = this;
-					$.ajax({
-						url: baseUrl + "/error/device/locSts/adjacentLocMast",
-						headers: {
-							'token': localStorage.getItem('token')
-						},
-						data: {},
-						dataType: 'json',
-						contentType: 'application/json;charset=UTF-8',
-						method: 'post',
-						success: function (res) {
-							that.adjacentLocMast = res.data
-						}
-					});
+	<!-- 涓昏〃A -->
+	<div class="table-container" style="width: 100%;">
+		<el-table
+				border
+				ref="mainTable"
+				:data="tableDataA"
+				highlight-current-row
+				style="width: 100%"
+				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">
+						<el-button
+								type="primary"
+								size="mini"
+								@click="showDetail(scope.row)">
+							鏄庣粏鏌ョ湅
+						</el-button>
+					</div>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<!-- 鍒嗛〉鎺т欢 -->
+		<div class="pagination-container">
+			<el-pagination
+					@size-change="handleSizeChange"
+					@current-change="handleCurrentChange"
+					:current-page="currentPage"
+					:page-sizes="[10, 20, 50, 100]"
+					:page-size="pageSize"
+					layout="total, sizes, prev, pager, next, jumper"
+					:total="total">
+			</el-pagination>
+		</div>
+	</div>
+
+	<!-- 瀛愯〃B璇︽儏寮圭獥 -->
+	<el-dialog
+			title="鏄庣粏"
+			:visible.sync="detailDialogVisible"
+			width="80%"
+			class="detail-dialog"
+			@close="closeDetailDialog">
+		<div v-if="currentRow">
+			<h3>缁勮揣鍗曚富琛� (缁勮揣鍗曞彿: {{ currentRow.itemName }})</h3>
+			<el-descriptions :column="2" border>
+				<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>
+			<el-table
+					border
+					:data="tableDataB"
+					style="width: 100%"
+					v-loading="detailLoading">
+				<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>
+
+			<!-- 瀛愯〃鍒嗛〉 -->
+			<div class="pagination-container">
+				<el-pagination
+						@size-change="handleDetailSizeChange"
+						@current-change="handleDetailCurrentChange"
+						:current-page="detailCurrentPage"
+						:page-sizes="[5, 10, 20]"
+						:page-size="detailPageSize"
+						layout="total, sizes, prev, pager, next, jumper"
+						:total="detailTotal">
+				</el-pagination>
+			</div>
+		</div>
+
+		<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>
+</div>
+
+<script>
+	var app = new Vue({
+		el: '#app',
+		data: {
+			// 鎼滅储琛ㄥ崟
+			searchForm: {
+				item_name: '',
+				cstmr_name: '',
+				settle: '',
+				order_no: ''
+			},
+			// 鎺掑簭鐩稿叧
+			orderByField: '',
+			orderByType: 'asc',
+			// 涓昏〃A鏁版嵁
+			tableDataA: [],
+			// 瀛愯〃B鏁版嵁
+			tableDataB: [],
+			// 鍒嗛〉鐩稿叧
+			currentPage: 1,
+			pageSize: 10,
+			total: 0,
+			// 璇︽儏寮圭獥鎺у埗
+			detailDialogVisible: false,
+			currentRow: null,
+			// 瀛愯〃鍒嗛〉
+			detailCurrentPage: 1,
+			detailPageSize: 5,
+			detailTotal: 0,
+			// 鍔犺浇鐘舵��
+			loading: false,
+			detailLoading: false,
+			reportLoading: false
+		},
+		created() {
+			this.init();
+		},
+		methods: {
+			init() {
+				this.getTableDataA();
+
+				// 姣�5绉掕嚜鍔ㄥ埛鏂版暟鎹�
+				setInterval(() => {
+					this.getTableDataA();
+				}, 10000);
+			},
+
+			// 鑾峰彇涓昏〃A鏁版嵁 - 浣跨敤鏂扮殑API
+			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;
 				}
-			}
-		})
-	</script>
-</body>
 
+				// 娣诲姞鎼滅储鍙傛暟
+				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 + "/order/pakout/order/cargo/grouping/auth/v1",
+					headers: {
+						'token': localStorage.getItem('token')
+					},
+					data: params,
+					dataType: 'json',
+					method: 'get',
+					success: function (res) {
+						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(xhr, status, error) {
+						that.loading = false;
+						that.$message.error('缃戠粶璇锋眰澶辫触');
+						console.error('API璋冪敤澶辫触:', error);
+						// 妯℃嫙鏁版嵁锛堝疄闄呴」鐩腑搴斿垹闄わ級
+						that.mockTableAData();
+					}
+				});
+			},
+
+			// 鑾峰彇瀛愯〃B鏁版嵁锛堟牴鎹疄闄呬笟鍔¤皟鏁达級
+			getTableDataB(itemName) {
+				let that = this;
+				that.detailLoading = true;
+
+				// 鏋勫缓璇锋眰鍙傛暟
+				let params = {
+					item_name: itemName,
+					curr: that.detailCurrentPage,
+					limit: that.detailPageSize
+				};
+
+				// 妯℃嫙API璋冪敤 - 鏍规嵁瀹為檯涓氬姟璋冩暣API鍦板潃
+				$.ajax({
+					url: baseUrl + "/order/pakout/orderDetl/cargo/grouping/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;
+						} else {
+							that.$message.error(res.message || '鑾峰彇鏁版嵁澶辫触');
+							that.tableDataB = [];
+							that.detailTotal = 0;
+						}
+						that.detailLoading = false;
+					},
+					error: function() {
+						that.detailLoading = false;
+						// 瀹為檯椤圭洰涓簲浣跨敤鐪熷疄API锛岃繖閲屼娇鐢ㄦā鎷熸暟鎹�
+						that.mockTableBData(itemName);
+					}
+				});
+			},
+
+			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
+			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: '宸插彇娑堜慨鏀�'
+					});
+				});
+			},
+
+			// 澶勭悊淇敼鎸夐挳鐐瑰嚮浜嬩欢
+			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 + "/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 || '淇敼澶辫触');
+						}
+					},
+					error: (error) => {
+						loadingInstance.close();
+						console.error('淇敼澶辫触:', error);
+						this.$message.error('淇敼澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+					}
+				});
+			},
+
+			// 琛ㄦ牸鎺掑簭鍙樺寲
+			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();
+			},
+
+			// 鏄剧ず浜屾纭瀵硅瘽妗�
+			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();
+			},
+
+			// 鏄剧ず璇︽儏寮圭獥
+			showDetail(row) {
+				this.currentRow = row;
+				this.detailDialogVisible = true;
+				this.detailCurrentPage = 1;
+				this.getTableDataB(row.itemName);
+			},
+
+			// 鍏抽棴璇︽儏寮圭獥
+			closeDetailDialog() {
+				this.detailDialogVisible = false;
+				this.currentRow = null;
+				this.tableDataB = [];
+				this.reportLoading = false;
+			},
+
+			// 涓昏〃鍒嗛〉澶у皬鏀瑰彉
+			handleSizeChange(val) {
+				this.pageSize = val;
+				this.currentPage = 1;
+				this.getTableDataA();
+			},
+
+			// 涓昏〃椤电爜鏀瑰彉
+			handleCurrentChange(val) {
+				this.currentPage = val;
+				this.getTableDataA();
+			},
+
+			// 瀛愯〃鍒嗛〉澶у皬鏀瑰彉
+			handleDetailSizeChange(val) {
+				this.detailPageSize = val;
+				this.detailCurrentPage = 1;
+				if (this.currentRow) {
+					this.getTableDataB(this.currentRow.itemName);
+				}
+			},
+
+			// 瀛愯〃椤电爜鏀瑰彉
+			handleDetailCurrentChange(val) {
+				this.detailCurrentPage = val;
+				if (this.currentRow) {
+					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 = [
+					{
+						itemName: 'zh20251110',
+						orderNo: 'ORDER2024001',
+						cstmrName: 'zh20251110',
+						settle: 10,
+						totalFee: 1500.00,
+						createTime: '2025-11-10T09:50:16.343+0000',
+						memo: '娴嬭瘯鏁版嵁'
+					}
+				];
+				this.total = 1;
+				this.loading = false;
+			},
+
+			// 妯℃嫙瀛愯〃鏁版嵁 - 瀹為檯椤圭洰涓簲鍒犻櫎
+			mockTableBData(itemName) {
+				this.tableDataB = [
+					{
+						matnr: '6渭m脳436mm',
+						batch: 'L241034114',
+						model: '24092501D01A6',
+						origin: '1',
+						danger: '1',
+						memo: '',
+						status: 1 // 鐘舵�佷负1锛屼細鏄剧ず淇敼鎸夐挳
+					}
+				];
+				this.detailTotal = 1;
+				this.detailLoading = false;
+			}
+		}
+	});
+</script>
+</body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1