From bb86fce09e61b0235d096b5ef42f4367df839a4b Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 12 一月 2025 16:56:39 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/task.html |  131 +++++++++++++++++++++++++++----------------
 1 files changed, 81 insertions(+), 50 deletions(-)

diff --git a/src/main/webapp/views/task.html b/src/main/webapp/views/task.html
index 2e3abc3..cd5fb35 100644
--- a/src/main/webapp/views/task.html
+++ b/src/main/webapp/views/task.html
@@ -10,6 +10,11 @@
 		<script type="text/javascript" src="../static/js/common.js"></script>
 		<script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
 		<script type="text/javascript" src="../static/vue/element/element.js"></script>
+		<style>
+			.el-table .success-row {
+				background: #b6ff8e;
+			}
+		</style>
 	</head>
 
 	<body>
@@ -74,32 +79,28 @@
 				</el-card>
 			</div>
 
-			<el-dialog :title="taskWrkFormTitle" :visible.sync="taskWrkFormVisible">
-				<el-form :model="taskWrkForm">
-					<el-form-item label="绔欑偣鐘舵��" :label-width="taskWrkFormLabelWidth">
-						<el-select v-model="taskWrkForm.siteStatus" placeholder="绔欑偣鐘舵��">
-							<el-option label="鏃犳墭鐩�" value="1"></el-option>
-							<el-option label="绌虹洏澶�" value="2"></el-option>
-							<el-option label="婊$洏澶�" value="3"></el-option>
-							<el-option label="绌烘墭鐩�" value="4"></el-option>
-							<el-option label="鎵樼洏鍏ョ珯涓�" value="5"></el-option>
-							<el-option label="鎵樼洏鍑虹珯涓�" value="6"></el-option>
-							<el-option label="绂佺敤" value="7"></el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item label="鐗╂枡鍙�" :label-width="taskWrkFormLabelWidth">
-						<el-input v-model="taskWrkForm.matnr" autocomplete="off"></el-input>
-					</el-form-item>
-					<el-form-item label="宸ヤ綔鍙�" :label-width="taskWrkFormLabelWidth">
-						<el-input v-model="taskWrkForm.wrkNo" autocomplete="off"></el-input>
-					</el-form-item>
-					<el-form-item label="鎵樼洏鐮�" :label-width="taskWrkFormLabelWidth">
-						<el-input v-model="taskWrkForm.barcode" autocomplete="off"></el-input>
-					</el-form-item>
-				</el-form>
+			<el-dialog :title="shuttleCommandTitle" :visible.sync="shuttleCommandVisible">
+				<el-table ref="singleTable" :data="shuttleCommandData.assignCommand.commands" style="width: 100%;" :row-class-name="tableRowClassName">
+					<el-table-column property="mode" label="鍛戒护绫诲瀷">
+					</el-table-column>
+					<el-table-column property="start" label="璧风偣">
+					</el-table-column>
+					<el-table-column property="target" label="缁堢偣">
+					</el-table-column>
+					<el-table-column property="taskId" label="taskId">
+					</el-table-column>
+					<el-table-column property="robotId" label="robotId">
+					</el-table-column>
+					<el-table-column property="complete" label="鏄惁瀹屾垚">
+					</el-table-column>
+					<el-table-column label="鎿嶄綔" width="100">
+						<template slot-scope="scope">
+							<el-button @click="shuttleCommandRollback(scope)" size="mini">鍥為��鎸囦护</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
 				<div slot="footer" class="dialog-footer">
-					<el-button @click="taskWrkFormVisible = false">鍙� 娑�</el-button>
-					<el-button type="primary" @click="taskWrkFormConfirm">纭� 瀹�</el-button>
+					<el-button @click="shuttleCommandVisible = false">鍏抽棴</el-button>
 				</div>
 			</el-dialog>
 
@@ -120,15 +121,16 @@
 					tableSearchParam: {
 						wrk_no: null,
 					},
-					taskWrkFormVisible: false,
-					taskWrkForm: {
-						siteStatus: '1',
-						matnr: '',
-						wrkNo: '',
-						barcode: '',
+					shuttleCommandVisible: false,
+					shuttleCommandData: {
+						assignCommand: {
+							commands: []
+						},
+						commandStep: 0
 					},
-					taskWrkFormLabelWidth: '80px',
-					taskWrkFormTitle: ''
+					shuttleCommandWrkNo: null,
+					shuttleCommandLabelWidth: '80px',
+					shuttleCommandTitle: ''
 				},
 				created() {
 					this.init()
@@ -196,7 +198,38 @@
 							case "cancel":
 								this.cancelTask(row)
 								break;
+							case "shuttleCommand":
+								this.showShuttleCommand(row.wrkNo)
+								break;
 						}
+					},
+					showShuttleCommand(wrkNo){
+						let that = this;
+						$.ajax({
+							url: baseUrl + "/shuttle/command/query",
+							headers: {
+								'token': localStorage.getItem('token')
+							},
+							data: {
+								wrkNo: wrkNo
+							},
+							method: 'GET',
+							success: function(res) {
+								if (res.code == 200) {
+									console.log(res)
+									that.shuttleCommandVisible = true;
+									that.shuttleCommandData = res.data;
+									that.shuttleCommandWrkNo = wrkNo;
+								} else if (res.code === 403) {
+									top.location.href = baseUrl + "/";
+								} else {
+									that.$message({
+										message: res.msg,
+										type: 'error'
+									});
+								}
+							}
+						});
 					},
 					completeTask(row) {
 						let that = this
@@ -280,30 +313,28 @@
 							// });
 						});
 					},
-					taskWrkFormConfirm() {
-						//淇敼鎸囧畾浠诲姟鏁版嵁
-						let that = this
+					tableRowClassName({row, rowIndex}) {
+						if (rowIndex === this.shuttleCommandData.commandStep) {
+							return 'success-row';
+						}
+						return '';
+					},
+					shuttleCommandRollback(scope) {
+						let that = this;
+						let idx = scope.$index;
 						$.ajax({
-							url: baseUrl + "/basCacheSite/update/auth",
+							url: baseUrl + "/shuttle/command/rollback",
 							headers: {
 								'token': localStorage.getItem('token')
 							},
 							data: {
-								id: this.taskWrkForm.id,
-								siteStatus: this.taskWrkForm.siteStatus,
-								matnr: this.taskWrkForm.matnr,
-								wrkNo: this.taskWrkForm.wrkNo,
-								barcode: this.taskWrkForm.barcode,
+								wrkNo: that.shuttleCommandWrkNo,
+								commandStep: idx
 							},
-							method: 'POST',
+							method: 'GET',
 							success: function(res) {
 								if (res.code == 200) {
-									that.taskWrkFormVisible = false
-									that.$message({
-										message: "鏇存柊鎴愬姛",
-										type: 'success'
-									});
-									that.getTableData()
+									that.showShuttleCommand(that.shuttleCommandWrkNo)
 								} else if (res.code === 403) {
 									top.location.href = baseUrl + "/";
 								} else {
@@ -314,7 +345,7 @@
 								}
 							}
 						});
-					},
+					}
 				},
 			})
 		</script>

--
Gitblit v1.9.1