From 798dcfbbc3ab2a81d1e873b25e00bf5e4ed03aa7 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期一, 02 十二月 2024 18:11:54 +0800 Subject: [PATCH] ll --- admin/src/views/Inspection/path.vue | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/admin/src/views/Inspection/path.vue b/admin/src/views/Inspection/path.vue index 03e8b95..4bab064 100644 --- a/admin/src/views/Inspection/path.vue +++ b/admin/src/views/Inspection/path.vue @@ -26,7 +26,7 @@ <el-table-column prop="lineAmount" label="宸℃鐐规暟閲�" min-width="100px"></el-table-column> <el-table-column prop="status" label="鐘舵��" min-width="100px"> <template v-slot="scope"> - <el-switch v-model="scope.row.status" @change="changeStatus" active-value="0" inactive-value="1"> + <el-switch v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0" :inactive-value="1"> </el-switch> </template> </el-table-column> @@ -53,6 +53,8 @@ import TableLayout from '@/layouts/TableLayout' import Pagination from '@/components/common/Pagination' import OperaYwPatrolLineWindow from './components/OperaYwPatrolLineWindow' +import { updateStatusById } from '@/api/Inspection/ywPatrolLine' +import { Message } from 'element-ui' export default { name: 'YwPatrolLine', extends: BaseTable, @@ -85,8 +87,16 @@ this.search() }, methods: { - changeStatus() { - + changeStatus(row) { + updateStatusById({ + id: row.id, + status: row.status + }).then(res => { + Message.success('鏇存柊鎴愬姛') + this.search() + }, () => { + this.search() + }) }, editClick(row) { if (row && row.id) { -- Gitblit v1.9.3