| | |
| | | prop: 'statusStr', |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | label: '启用/禁用', |
| | | formatter: (row) => ( |
| | | <el-switch |
| | | value={row.isEnabled} |
| | | onChange={this.onEnabledChange.bind(this, row)} |
| | | ></el-switch> |
| | | ), |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | }, |
| | | ], |
| | | searchForm: [ |
| | | { |
| | |
| | | type: 'bus-select-dict', |
| | | el: { |
| | | code: 'supplier_status', |
| | | clearable: true, |
| | | style: 'width:100%', |
| | | }, |
| | | }, |
| | | { |
| | | label: '启动/禁用', |
| | | id: 'isEnabled', |
| | | type: 'bus-select-dict', |
| | | el: { |
| | | code: 'USER_ENABLED_OR_DISABLED', |
| | | clearable: true, |
| | | style: 'width:100%', |
| | | }, |
| | |
| | | } |
| | | return '' |
| | | }, |
| | | onEnabledChange(row, e) { |
| | | const url = 'flower/api/partner/page/isEnable' |
| | | const text = e ? '启用' : '禁用' |
| | | this.$elBusUtil |
| | | .confirm(`确定要${text}这个合伙人吗?`) |
| | | .then(async () => { |
| | | const { code } = await this.$elBusHttp.request(url, { |
| | | params: { |
| | | id: row.id, |
| | | }, |
| | | }) |
| | | if (code === 0) { |
| | | this.$message.success(`${text}成功`) |
| | | this.$refs.crud.getList() |
| | | } |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |