|
@@ -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);
|