zory 1 vecka sedan
förälder
incheckning
72d2b65d12

+ 7 - 0
src/api/model/merGoods.js

@@ -37,4 +37,11 @@ export default {
             return await http.post(this.url, params);
         },
     },
+    batch: {
+        url: `${config.API_URL}/merchant/goods/batch`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
 }

+ 18 - 12
src/views/merchant/goods/index/components/option.vue

@@ -6,8 +6,8 @@
         <div class="op-header">
             <div class="left-panel">
                 <el-button type="primary" icon="el-icon-plus" @click="table_add()">创建商品</el-button>
-                <el-button icon="el-icon-unlock" @click="table_batch_status(1)" :disabled="dataSelect.length>0?false:true">启用</el-button>
-                <el-button icon="el-icon-lock" type="danger" @click="table_batch_status(2)" :disabled="dataSelect.length>0?false:true">禁用</el-button>
+                <el-button icon="el-icon-unlock" @click="table_batch_status(1)" :disabled="dataSelect.length>0?false:true">上架</el-button>
+                <el-button icon="el-icon-lock" type="danger" @click="table_batch_status(2)" :disabled="dataSelect.length>0?false:true">下架</el-button>
             </div>
         </div>
     </fieldset>
@@ -47,19 +47,25 @@ export default {
 
             })
         },
-        async table_batch_status(status){
+        table_batch_status(status){
             if (this.dataSelect.length == 0) {
                 return this.$message.error("请选择修改数据")
             }
-            var loading = this.$loading()
-            let submitData = {"id":this.dataSelect,"value":status,"field":"enable","type":"batch"};
-            loading.close()
-            var resp = await this.$API.category.batch.post(submitData);
-            if (resp.code == 0) {
-                return this.$message.error(resp.msg);
-            }
-            this.$message.success(resp.msg);
-            this.$emit("success");
+            this.$confirm(`审核中的商品不支持该操作,请确认是否有勾选审核中的商品`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var loading = this.$loading()
+                let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+                loading.close()
+                var resp = await this.$API.merGoods.batch.post(submitData);
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(() => {
+
+            })
         },
         handleSuccess(){
             this.$emit("success");

+ 7 - 1
src/views/merchant/goods/index/components/table.vue

@@ -6,6 +6,7 @@
                 {{ scope.row.goods_id?scope.row.goods_id:'审核中' }}
             </template>
         </el-table-column>
+        <el-table-column label="商品类型" prop="types" width="100"></el-table-column>
         <el-table-column label="商品信息" width="340" prop="name">
             <template #default="scope">
                 <div class="goods-img">
@@ -36,7 +37,12 @@
                     <span>{{ $TOOL.disFormat(scope.row.price,scope.row.line_price) }}折</span></div>
             </template>
         </el-table-column>
-        <el-table-column label="商品计划" prop="category_id" width="200"></el-table-column>
+        <el-table-column label="剩余库存" prop="category_id" width="120">
+            <template #default="scope">
+                <span v-if="scope.row.limit_use_rule==1">{{ scope.row.use_num_per_consume }}</span>
+                <span v-else>不限</span>
+            </template>
+        </el-table-column>
         <el-table-column label="状态" prop="enable" width="120" align="center">
             <template #default="scope">
                 <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>