From daa0b51b0b3609c683da3066c2815d3e9eb42b3f Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期三, 18 十二月 2024 09:39:46 +0800
Subject: [PATCH] 1.订单管理的异常订单

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

diff --git a/pages/supplier/list.vue b/pages/supplier/list.vue
index 971ee56..ef76953 100644
--- a/pages/supplier/list.vue
+++ b/pages/supplier/list.vue
@@ -26,11 +26,12 @@
           }
         },
         columns: [
+          { label: '供应商ID', prop: 'id', minWidth: '120px' },
           {
             label: '供应商名称',
             prop: 'name',
             minWidth: '120px',
-            fixed: 'left',
+            // fixed: 'left',
           },
           { label: '供应商类型', prop: 'typeName', minWidth: '100px' },
           {
@@ -43,6 +44,7 @@
           },
           { label: '联系人', prop: 'contactName', minWidth: '100px' },
           { label: '联系方式', prop: 'contactTel', minWidth: '120px' },
+          { label: '注册手机号', prop: 'registerTel', minWidth: '120px' },
           { label: '注册时间', prop: 'createTime', minWidth: '180px' },
           { label: '审核通过时间', prop: 'passTime', minWidth: '180px' },
           { label: '所属集货站', prop: 'stationName', minWidth: '120px' },
@@ -58,11 +60,31 @@
             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: [
           {
             type: 'row',
             items: [
+              {
+                label: '供应商ID', id: 'id', type: 'input',
+                rules: {
+                  required: false,
+                  pattern: /^\d*$/,
+                  message: '请输入合法的供应商ID',
+                  trigger: 'blur',
+                },
+              },
               { label: '供应商名称', id: 'name', type: 'input' },
               { label: '手机号', id: 'tel', type: 'input' },
               {
@@ -86,6 +108,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 +370,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