ソースを参照

规格添加购买限制

YY 2 年 前
コミット
dabb562d34
2 ファイル変更42 行追加2 行削除
  1. 21 1
      src/views/platmanag/goods/spec.vue
  2. 21 1
      src/views/selfShop/goods/spec.vue

+ 21 - 1
src/views/platmanag/goods/spec.vue

@@ -38,6 +38,9 @@
             <template #can_group>
               <el-option v-for="i in tfList" :key="i.model" :label="i.label" :value="i.value"></el-option>
             </template>
+            <template #buy_limit>
+              <el-option v-for="i in buy_limitList" :key="i.model" :label="i.label" :value="i.value"></el-option>
+            </template>
           </data-form>
         </el-col>
       </el-row>
@@ -65,6 +68,16 @@ export default {
         { label: '库存', model: 'num' },
         { label: '实际销售价格', model: 'sell_money' },
         { label: '划掉销售价格', model: 'flow_money' },
+        {
+          label: '购买限制',
+          model: 'buy_limit',
+          format: (i) => {
+            let data = this.buy_limitList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '限制数量界限', model: 'limit_num' },
         { label: '运费', model: 'freight' },
         { label: '团长价格', model: 'leader_price' },
         { label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
@@ -90,6 +103,8 @@ export default {
         { label: '库存', model: 'num', type: 'number' },
         { label: '实际销售价格', model: 'sell_money', type: 'number' },
         { label: '划掉销售价格', model: 'flow_money', type: 'number' },
+        { label: '购买限制', model: 'buy_limit', type: 'select' },
+        { label: '限制数量界限', model: 'limit_num', type: 'number' },
         { label: '运费', model: 'freight', type: 'number' },
         { label: '排序', model: 'sort', type: 'number' },
         { label: '状态', model: 'status', type: 'select' },
@@ -106,6 +121,8 @@ export default {
       tfList: [],
       // 面包屑
       data: [],
+      // 购买限制
+      buy_limitList: [],
     };
   },
   computed: {
@@ -127,7 +144,7 @@ export default {
     ...methodUtil,
     // 添加自定义
     initAddData() {
-      const obj = { goods: this.goods, status: '0', freight: 0 };
+      const obj = { goods: this.goods, status: '0', freight: 0, buy_limit: '0' };
       this.$set(this, 'form', obj);
     },
     // 面包屑
@@ -195,6 +212,9 @@ export default {
       // 是否可以团购
       res = await this.getDict({ code: 'tf' });
       if (this.$checkRes(res)) this.$set(this, 'tfList', res.data);
+      // 购买限制
+      res = await this.getDict({ code: 'buy_limit' });
+      if (this.$checkRes(res)) this.$set(this, 'buy_limitList', res.data);
     },
   },
   metaInfo() {

+ 21 - 1
src/views/selfShop/goods/spec.vue

@@ -38,6 +38,9 @@
             <template #can_group>
               <el-option v-for="i in tfList" :key="i.model" :label="i.label" :value="i.value"></el-option>
             </template>
+            <template #buy_limit>
+              <el-option v-for="i in buy_limitList" :key="i.model" :label="i.label" :value="i.value"></el-option>
+            </template>
           </data-form>
         </el-col>
       </el-row>
@@ -66,6 +69,16 @@ export default {
         { label: '库存', model: 'num' },
         { label: '实际销售价格', model: 'sell_money' },
         { label: '划掉销售价格', model: 'flow_money' },
+        {
+          label: '购买限制',
+          model: 'buy_limit',
+          format: (i) => {
+            let data = this.buy_limitList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '限制数量界限', model: 'limit_num' },
         { label: '运费', model: 'freight' },
         { label: '团长价格', model: 'leader_price' },
         { label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
@@ -91,6 +104,8 @@ export default {
         { label: '库存', model: 'num', type: 'number' },
         { label: '实际销售价格', model: 'sell_money', type: 'number' },
         { label: '划掉销售价格', model: 'flow_money', type: 'number' },
+        { label: '购买限制', model: 'buy_limit', type: 'select' },
+        { label: '限制数量界限', model: 'limit_num', type: 'number' },
         { label: '排序', model: 'sort', type: 'number' },
         { label: '运费', model: 'freight', type: 'number' },
         { label: '状态', model: 'status', type: 'select' },
@@ -106,6 +121,8 @@ export default {
       // 是否可以团购
       tfList: [],
       data: [],
+      // 购买限制
+      buy_limitList: [],
     };
   },
   computed: {
@@ -127,7 +144,7 @@ export default {
     ...methodUtil,
     // 添加自定义
     initAddData() {
-      const obj = { goods: this.goods, status: '0', freight: 0 };
+      const obj = { goods: this.goods, status: '0', freight: 0, buy_limit: '0' };
       this.$set(this, 'form', obj);
     },
     async toData(row) {
@@ -194,6 +211,9 @@ export default {
       // 是否可以团购
       res = await this.getDict({ code: 'tf' });
       if (this.$checkRes(res)) this.$set(this, 'tfList', res.data);
+      // 购买限制
+      res = await this.getDict({ code: 'buy_limit' });
+      if (this.$checkRes(res)) this.$set(this, 'buy_limitList', res.data);
     },
   },
   metaInfo() {