From 0d0e67818a45161af14114211f43aafd232a6da2 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 27 一月 2026 10:52:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
admin/src/views/business/goodsBrand.vue | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/admin/src/views/business/goodsBrand.vue b/admin/src/views/business/goodsBrand.vue
index 47cba60..80b765c 100644
--- a/admin/src/views/business/goodsBrand.vue
+++ b/admin/src/views/business/goodsBrand.vue
@@ -31,7 +31,7 @@
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:productlabel:create', 'business:productlabel:delete']">
<li><el-button type="primary" @click="$refs.operaProductLabelWindow.open('鏂板缓鍟嗗搧鏍囩淇℃伅琛�')" icon="el-icon-plus" v-permissions="['business:productlabel:create']">鏂板缓</el-button></li>
- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">鍒犻櫎</el-button></li>
+ <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">鍒犻櫎</el-button></li>
</ul>
<el-table
v-loading="isWorking.search"
@@ -49,6 +49,18 @@
<el-table-column prop="name" label="鍝佺墝鍚嶇О" min-width="100px"></el-table-column>
<el-table-column prop="sortnum" label="鎺掑簭鐮�(鍗囧簭)" min-width="100px"></el-table-column>
<el-table-column prop="createDate" label="鍒涘缓鏃堕棿" min-width="100px"></el-table-column>
+ <el-table-column prop="status" label="鐘舵��" min-width="100px">
+ <template slot-scope="{row}">
+ <el-switch
+ v-model="row.status"
+ :active-value="1"
+ :inactive-value="0"
+ active-color="#13ce66"
+ inactive-color="#ff4949"
+ @change="statusChange(row)"
+ ></el-switch>
+ </template>
+ </el-table-column>
<el-table-column
v-if="containPermissions(['business:productlabel:update', 'business:productlabel:delete'])"
label="鎿嶄綔"
@@ -57,7 +69,7 @@
>
<template slot-scope="{row}">
<el-button type="text" @click="$refs.operaProductLabelWindow.open('缂栬緫鍟嗗搧鏍囩淇℃伅琛�', row)" icon="el-icon-edit" v-permissions="['business:productlabel:update']">缂栬緫</el-button>
- <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">鍒犻櫎</el-button>
+ <el-button type="text" style="color: red;" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -78,6 +90,7 @@
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaGoodsBrandWindow from '@/components/business/OperaGoodsBrandWindow'
+import {updateStatusById} from "@/api/business/labels";
export default {
name: 'ProductLabel',
extends: BaseTable,
@@ -101,6 +114,20 @@
'field.main': 'id'
})
this.search()
+ },
+ methods: {
+ statusChange (row) {
+ this.api.updateStatusById({ id: row.id, status: row.status })
+ .then(() => {
+ this.$message.success('鎿嶄綔鎴愬姛')
+ })
+ .catch(e => {
+ this.$message.error('鎿嶄綔鎴愬姛')
+ })
+ .then(() => {
+ this.handlePageChange()
+ })
+ }
}
}
</script>
--
Gitblit v1.9.3