潘超林 6 miesięcy temu
rodzic
commit
cbac43a098

+ 20 - 16
src/views/manage/active.vue

@@ -1,4 +1,3 @@
-a
 <template>
   <div class="app-container">
     <el-form
@@ -303,7 +302,7 @@ a
               </el-table-column>
               <el-table-column label="起批量" align="center">
                 <template slot-scope="scope">
-                  {{ scope.row.lowestPurchase }}/ {{ scope.row.unit }}
+                  {{ scope.row.lowestPurchase }}{{ scope.row.unit }}
                 </template>
               </el-table-column>
               <el-table-column label="操作" align="center">
@@ -341,7 +340,7 @@ a
       :before-close="shopOpen == false"
       size="50%"
     >
-      <productList type="active" @multipleTable="multipleTable"></productList>
+      <productList @multipleTable="multipleTable" ref="product"></productList>
     </el-drawer>
   </div>
 </template>
@@ -404,12 +403,17 @@ export default {
   methods: {
     selectSpu() {
       this.shopOpen = true;
+
+      this.$nextTick(() => {
+        console.log(this.$refs.product);
+        this.$refs.product.handRef("active", 1);
+      });
     },
     multipleTable(val) {
       console.log(val);
-      val.forEach((e) => {
-        this.shopList.push(e);
-      });
+      // val.forEach((e) => {
+      //   this.shopList.push(e);
+      // });
       let list = [];
       val.forEach((e) => {
         list.push({
@@ -420,16 +424,16 @@ export default {
       this.shop.skuList = list;
 
       this.shop.promotionId = this.ParticipateId;
-      // promotionSku(this.shop).then((res) => {
-      //   if (res.code == 200) {
-      //     this.$message({
-      //       type: "success",
-      //       message: "添加成功",
-      //     });
-      //     this.shopOpen = false;
-      //     this.getShopList();
-      //   }
-      // });
+      promotionSku(this.shop).then((res) => {
+        if (res.code == 200) {
+          this.$message({
+            type: "success",
+            message: "添加成功",
+          });
+          this.shopOpen = false;
+          this.getShopList();
+        }
+      });
       this.shopOpen = false;
     },
     shopRemove(record) {

+ 10 - 19
src/views/manage/product.vue

@@ -44,7 +44,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5" v-if="activeShowBtn">
+      <el-col :span="1.5" v-if="!activeShowBtn">
         <el-button
           type="primary"
           plain
@@ -185,7 +185,7 @@
 
     <!-- 添加或修改参数配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rulesRole" label-width="140px">
+      <el-form ref="form" :model="form" label-width="140px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="商品名称:" prop="configName">
@@ -208,8 +208,6 @@
               <el-upload
                 action="https://jsonplaceholder.typicode.com/posts/"
                 list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
@@ -223,8 +221,6 @@
               <el-upload
                 action="https://jsonplaceholder.typicode.com/posts/"
                 list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
@@ -236,8 +232,6 @@
               <el-upload
                 action="https://jsonplaceholder.typicode.com/posts/"
                 list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
@@ -249,8 +243,6 @@
               <el-upload
                 action="https://jsonplaceholder.typicode.com/posts/"
                 list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
@@ -264,8 +256,6 @@
               <el-upload
                 action="https://jsonplaceholder.typicode.com/posts/"
                 list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
@@ -596,7 +586,6 @@ import { getClassificationListPage } from "@/api/common/index";
 export default {
   name: "Config",
   //   dicts: ["sys_yes_no"],
-  props: ["type"],
   data() {
     return {
       // 遮罩层
@@ -680,18 +669,20 @@ export default {
       multipleSelection: [],
     };
   },
-  created() {
+
+  mounted() {
     this.getList();
   },
-  watch: {
-    type(newV, oldV) {
-      if (newV == "active") {
+  methods: {
+    handRef(type, scope) {
+      if (type == "active") {
+        this.queryParams.scope = scope;
+        this.multipleSelection = [];
         this.activeShowBtn = false;
+        this.getList();
       }
     },
-  },
 
-  methods: {
     addActive() {
       this.$emit("multipleTable", this.multipleSelection);
     },

+ 6 - 2
src/views/manage/shopInfo.vue

@@ -82,10 +82,14 @@
             <el-descriptions-item label="入驻身份证">
               <el-image
                 style="width: 100px; height: 100px"
-                v-for="(item, index) in JSON.parse(shopInfo.auth.idCardUrl)"
+                v-for="(item, index) in shopInfo.auth.idCardUrl
+                  ? JSON.parse(shopInfo.auth.idCardUrl)
+                  : []"
                 :src="item"
                 :key="index"
-                :preview-src-list="JSON.parse(shopInfo.auth.idCardUrl)"
+                :preview-src-list="
+                  shopInfo.auth.idCardUrl ? JSON.parse(shopInfo.auth.idCardUrl) : []
+                "
               />
             </el-descriptions-item>
           </el-descriptions>

+ 17 - 6
src/views/manage/voucher/index.vue

@@ -12,10 +12,11 @@
                 inactive-text="关闭"
                 :active-value="1"
                 :inactive-value="0"
+                @change="submitConfig"
               >
               </el-switch>
             </el-form-item>
-            <el-form-item label="折扣卷类型">
+            <!-- <el-form-item label="折扣卷类型">
               <el-radio-group v-model="useVoucherType">
                 <el-radio :label="0" :value="0">普通满减卷</el-radio>
                 <el-radio :label="1" :value="1">折扣卷</el-radio>
@@ -30,7 +31,7 @@
                 @click="submitConfig"
                 >确认</el-button
               >
-            </div>
+            </div> -->
           </div>
         </el-col>
       </el-row>
@@ -38,7 +39,7 @@
     <h3>规则配置</h3>
     <el-radio-group v-model="queryParams.useVoucherType" @change="radioChang">
       <el-radio :label="0" value="0">普通满减卷</el-radio>
-      <el-radio :label="1" value="1">折扣卷</el-radio>
+      <!-- <el-radio :label="1" value="1">折扣卷</el-radio> -->
     </el-radio-group>
 
     <div style="margin-top: 20px">
@@ -60,6 +61,7 @@
                     v-model="item.min"
                     placeholder="请输入金额"
                     style="width: 140px"
+                    :min="1"
                   >
                     <span slot="suffix">元 </span>
                   </el-input>
@@ -68,6 +70,7 @@
                     v-model="item.max"
                     placeholder="请输入金额"
                     style="width: 140px"
+                    :min="1"
                   >
                     <span slot="suffix">元 </span>
                   </el-input>
@@ -77,6 +80,7 @@
                     v-model="item.amount"
                     placeholder="请输入金额"
                     style="width: 200px"
+                    :min="1"
                   >
                     <span slot="suffix">元 </span>
                   </el-input>
@@ -200,7 +204,7 @@ export default {
       });
     },
 
-    radioChange() {
+    radioChang() {
       this.getvoucherList();
     },
     removeRule(record, index) {
@@ -262,9 +266,16 @@ export default {
         params = this.form;
       } else {
         params = this.person;
+        params.forEach((e) => {
+          e.ratio = e.ratio / 10;
+        });
       }
-      voucherEdit(params).then((res) => {});
-      this.$modal.msgSuccess("保存成功!");
+      voucherEdit(params).then((res) => {
+        if (res.code == 200) {
+          this.$modal.msgSuccess("保存成功!");
+        }
+      });
+
       setTimeout(() => {
         this.getvoucherList();
       }, 500);