From e93234340fe0958b8c205ea6d60d43c9c0d76b14 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期五, 20 九月 2024 16:37:41 +0800
Subject: [PATCH] add:限购判断

---
 pages/goods/list/index.vue       |   51 ++++++++++++++++++++++++++++++++-------------------
 pages/goods/list/_action/_id.vue |    2 +-
 2 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/pages/goods/list/_action/_id.vue b/pages/goods/list/_action/_id.vue
index 636d3cc..d2d522d 100644
--- a/pages/goods/list/_action/_id.vue
+++ b/pages/goods/list/_action/_id.vue
@@ -83,7 +83,7 @@
               label: '限购数量:',
               id: 'limited',
               type: 'input-number',
-              el: { precision: 0, min: 0, max: 99999999, style: 'width:100%' },
+              el: { precision: 0,  min:1, max: 99999999,  style: 'width:100%' },
             },
             {
               label: '驳回原因:',
diff --git a/pages/goods/list/index.vue b/pages/goods/list/index.vue
index b033e04..0c0022d 100644
--- a/pages/goods/list/index.vue
+++ b/pages/goods/list/index.vue
@@ -128,6 +128,23 @@
                 searchImmediately: true,
               },
               {
+                label: '是否限购:',
+                id: 'isLimited',
+                type: 'bus-radio',
+                el: {
+                  fromDict: false,
+                  hasAll: true,
+                  childType: 'el-radio-button',
+                  options: [
+                    { label: '是', value: true },
+                    { label: '否', value: false },
+                  ],
+                },
+                default: '',
+                span: 24,
+                searchImmediately: true,
+              },
+              {
                 label: '所属专区:',
                 id: 'zoneId',
                 type: 'bus-radio',
@@ -276,18 +293,6 @@
             },
           },
           {
-            text: '批量设置限购数量',
-            type: 'primary',
-            disabled: (selected) => selected.length === 0,
-            atClick: (selected) => {
-              this.$refs.crud.$refs.extraDialog[4].show({
-                ids: selected.map((item) => item.id),
-                limited: selected.length === 1 ? selected[0].limited : null,
-              })
-              return false
-            },
-          },
-          {
             text: '批量取消推荐',
             type: 'primary',
             disabled: (selected) =>
@@ -328,6 +333,18 @@
                 ids: selected
                   .filter((item) => item.status === 'PENDING')
                   .map((item) => item.id),
+              })
+              return false
+            },
+          },
+          {
+            text: '每人限购',
+            type: 'primary',
+            disabled: (selected) => selected.length === 0,
+            atClick: (selected) => {
+              this.$refs.crud.$refs.extraDialog[4].show({
+                ids: selected.map((item) => item.id),
+                limited: selected.length === 1 ? selected[0].limited : undefined,
               })
               return false
             },
@@ -522,7 +539,7 @@
             },
           },
           {
-            title: '批量设置限购数量',
+            title: '每人限购',
             form: [
               {
                 id: 'ids',
@@ -536,13 +553,9 @@
                 label: '限购数量:',
                 id: 'limited',
                 type: 'input-number',
-                el: { precision: 0, min: 0,  max: 99999999, style: 'width:100%' },
-                rules: {
-                  required: true,
-                  message: '请输入限购数量',
-                  trigger: 'blur',
-                },
+                el: { precision: 0,  min:1, max: 99999999,  style: 'width:100%'},
               },
+
             ],
             atConfirm: async (val) => {
 

--
Gitblit v1.9.3