cloudroam
2024-10-28 491df5ea13a34c46cab555469fc310fa985c20e8
pages/supplier/list.vue
@@ -43,6 +43,8 @@
          },
          { label: '联系人', prop: 'contactName', minWidth: '100px' },
          { label: '联系方式', prop: 'contactTel', minWidth: '120px' },
          { label: '用户ID', prop: 'userId', minWidth: '240px' },
          { label: '注册手机号', prop: 'registerTel', minWidth: '120px' },
          { label: '注册时间', prop: 'createTime', minWidth: '180px' },
          { label: '审核通过时间', prop: 'passTime', minWidth: '180px' },
          { label: '所属集货站', prop: 'stationName', minWidth: '120px' },
@@ -53,6 +55,17 @@
              <el-switch
                value={row.showed}
                onChange={this.onShownChange.bind(this, row)}
              ></el-switch>
            ),
            minWidth: 120,
            fixed: 'right',
          },
          {
            label: '启用/禁用',
            formatter: (row) => (
              <el-switch
                value={row.isEnabled}
                onChange={this.onEnabledChange.bind(this, row)}
              ></el-switch>
            ),
            minWidth: 120,
@@ -86,6 +99,17 @@
              {
                ...getStationListConfig(),
                label: '所属集货站',
              },
              {
                label: '启用/禁用',
                id: 'isEnabled',
                type: 'bus-select-dict',
                default: '1',
                el: {
                  code: 'USER_ENABLED_OR_DISABLED',
                  clearable: true,
                  style: 'width:100%',
                },
              },
            ],
          },
@@ -337,6 +361,24 @@
        })
        .catch(() => {})
    },
    onEnabledChange(row, e) {
      const url = 'flower/api/supplier/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>