From 45dd3bfd08d2c95ae284bae369507a19a2e524b7 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期一, 24 二月 2025 15:24:27 +0800
Subject: [PATCH] *
---
src/main/webapp/views/index.html | 45 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index c78054f..78ab26d 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -338,11 +338,18 @@
prop="status$"
label="鐘舵��">
</el-table-column>
-<!-- <el-table-column-->
-<!-- prop=""-->
-<!-- label="鎿嶄綔">-->
-<!-- <el-button type="primary" icon="el-icon-edit" circle></el-button>-->
-<!-- </el-table-column>-->
+ <el-table-column
+ label="鎿嶄綔"
+ type="template">
+ <template slot-scope="scope">
+ <el-button
+ :type="scope.row.status === 0 ? 'primary' : 'danger'"
+ size="small"
+ @click="toggleStatus(scope.$index, scope.row)">
+ {{ scope.row.status === 0 ? '绂佺敤' : '瑙i櫎绂佺敤' }}
+ </el-button>
+ </template>
+ </el-table-column>
</el-table>
</div>
</div>
@@ -444,6 +451,34 @@
}
}
},
+ toggleStatus(index, row) {
+ const currentStatus = row.status;
+ const targetStatus = currentStatus === 0 ? 1 : 0;
+
+ this.$confirm(`纭瑕�${currentStatus === 0 ? '绂佺敤' : '鍚敤'}璇ヨ澶囧悧?`, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ $.ajax({
+ url: baseUrl + "/rgv/disable/rgv/status",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'POST',
+ data: {
+ rgvId: row.rgvNo,
+ status: targetStatus
+ },
+ success: function (res) {
+ if (res.code === 200) {
+ this.$message.success(`鐘舵�佹洿鏂版垚鍔焋);
+ row.status$ = targetStatus; // 鏇存柊鍓嶇鐘舵��
+ } else {
+ this.$message.error('鐘舵�佹洿鏂板け璐�');
+ }
+ }
+ });
+ });
+ },
handleChangeValueRight(val) {
console.log("33333"+val);
--
Gitblit v1.9.1