doum
2025-12-11 3cd92951fd2a67a02e649a870d100b3e8776ae11
admin/src/views/business/goodsBrand.vue
@@ -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="操作"
@@ -101,6 +113,20 @@
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    statusChange (row) {
      this.api.updateById({ id: row.id, status: row.status })
        .then(() => {
          this.$message.success('操作成功')
        })
        .catch(e => {
          this.$message.error('操作成功')
        })
        .then(() => {
          this.handlePageChange()
        })
    }
  }
}
</script>