|
@@ -18,8 +18,20 @@
|
|
|
:scroll="{ y: tableHeight }"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
- <template slot="titles" slot-scope="text, record">
|
|
|
- {{ record.type && record.type == 'root' ? record.subareaName : record.subareaAreaName }}
|
|
|
+ <!-- 图片 -->
|
|
|
+ <template slot="imgs" slot-scope="text, record">
|
|
|
+ <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage109.360doc.com%2FDownloadImg%2F2023%2F11%2F1102%2F275164585_1_20231111020834648&refer=http%3A%2F%2Fimage109.360doc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1727402624&t=e31f68c14695a678aea6137f7f0c088e" alt="图片走丢啦" width="60" />
|
|
|
+ </template>
|
|
|
+ <!-- 状态 -->
|
|
|
+ <template slot="enabledFlag" slot-scope="text, record">
|
|
|
+ <a-switch
|
|
|
+ :id="'supplierInfoList-enableFlag-'+record.id"
|
|
|
+ v-if="$hasPermissions('B_supplierInfo_enabled')"
|
|
|
+ checkedChildren="启用"
|
|
|
+ unCheckedChildren="禁用"
|
|
|
+ v-model="record.enableFlag"
|
|
|
+ @change="changeFlagHandle(text, record)"/>
|
|
|
+ <span v-else :style="{color:(record.enableFlag==1?'#00aa00':'#999')}"> {{ record.enableFlag==1? '已启用': '已禁用' }} </span>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -95,12 +107,12 @@ export default {
|
|
|
openZoneModal: false, // 打开分区弹窗
|
|
|
openDealerModal: false, // 打开经销商弹窗
|
|
|
columns: [
|
|
|
- { title: '类目名称', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '图片', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
|
|
|
- { title: '优先级', dataIndex: 'remark', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '创建时间', dataIndex: 'remark', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '状态', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
|
|
|
+ { title: '类目名称', dataIndex: 'createDate', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '图片', scopedSlots: { customRender: 'imgs' }, width: '15%', align: 'center' },
|
|
|
+ { title: '优先级', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '创建时间', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '15%', align: 'center' },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -136,12 +148,36 @@ export default {
|
|
|
this.openZoneModal = true
|
|
|
this.parentData = row
|
|
|
},
|
|
|
+ // 状态
|
|
|
+ changeFlagHandle () {
|
|
|
+ // 启用后,关联的产品不会同步上架,确认启用吗?
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '禁用后,关联的产品会同步下架,确认禁用吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ const delFun = row.type && row.type == 'root' ? deleteSubareaBySn : deleteSubareaAreaBySn
|
|
|
+ const params = { sn: row.type && row.type == 'root' ? row.subareaSn : row.subareaAreaSn }
|
|
|
+ delFun(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.spinning = false
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除
|
|
|
handleDel (row) {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '确定要删除吗?删除后相关用户权限自动解绑。',
|
|
|
+ content: '删除后,关联的产品会同步删除,确认删除吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|