From 2bc7d6bb5cfd9ed2034f2f616366d69e226c4d5d Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期六, 14 九月 2024 15:51:51 +0800
Subject: [PATCH] Merge branch 'master' of http://47.96.225.205:8888/r/operation_pc-v2

---
 pages/supplier/list.vue |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/pages/supplier/list.vue b/pages/supplier/list.vue
index 971ee56..e9737f8 100644
--- a/pages/supplier/list.vue
+++ b/pages/supplier/list.vue
@@ -58,6 +58,17 @@
             minWidth: 120,
             fixed: 'right',
           },
+          {
+            label: '启用/禁用',
+            formatter: (row) => (
+              <el-switch
+                value={row.isEnabled}
+                onChange={this.onEnabledChange.bind(this, row)}
+              ></el-switch>
+            ),
+            minWidth: 120,
+            fixed: 'right',
+          },
         ],
         searchForm: [
           {
@@ -86,6 +97,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 +359,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>

--
Gitblit v1.9.3