YY il y a 2 ans
Parent
commit
6b0f16126e

+ 7 - 3
src/views/platActivi/goodsSet/detail.vue

@@ -168,7 +168,11 @@ export default {
     async search() {
       if (this.id) {
         const res = await this.fetch(this.id);
-        if (this.$checkRes(res)) this.$set(this, `form`, res.data);
+        if (this.$checkRes(res)) {
+          let arr = await this.shopFetch(res.data.shop);
+          if (this.$checkRes(arr)) this.shopList.push(arr.data);
+          this.$set(this, `form`, res.data);
+        }
       } else {
         const obj = { is_use: '0', single_stock: '1', set: [], freight: 0 };
         this.$set(this, 'form', obj);
@@ -232,7 +236,8 @@ export default {
     toMoney() {
       let money = 0;
       for (const p1 of this.form.set) {
-        money += util.multiply(p1.set_num, p1.set_money);
+        let num = util.multiply(p1.set_num, p1.set_money);
+        money = util.plus(money, num);
       }
       this.$set(this.form, 'sell_money', money);
     },
@@ -241,7 +246,6 @@ export default {
     // 保存
     async toSave({ data }) {
       if (data.set.length > 0) {
-        console.log(data);
         let res;
         if (data._id) res = await this.update(data);
         else res = await this.create(data);

+ 1 - 2
src/views/selfShop/goodsSet/detail.vue

@@ -207,9 +207,8 @@ export default {
     toMoney() {
       let money = 0;
       for (const p1 of this.form.set) {
-        // money += util.multiply(p1.set_num, p1.set_money);
         let num = util.multiply(p1.set_num, p1.set_money);
-        money = util.plus(num, +num, num);
+        money = util.plus(money, num);
       }
       console.log(money);
       this.$set(this.form, 'sell_money', money);