|
@@ -64,32 +64,39 @@ export default {
|
|
let data = this.deliverList;
|
|
let data = this.deliverList;
|
|
if (data) {
|
|
if (data) {
|
|
let test = _(data).groupBy('address._id').values().value();
|
|
let test = _(data).groupBy('address._id').values().value();
|
|
|
|
+
|
|
let list = [];
|
|
let list = [];
|
|
for (const p1 of test) {
|
|
for (const p1 of test) {
|
|
let goodsList = [];
|
|
let goodsList = [];
|
|
|
|
+ let info = [];
|
|
for (const p2 of p1) {
|
|
for (const p2 of p1) {
|
|
if (p2.is_afterSale == false) {
|
|
if (p2.is_afterSale == false) {
|
|
for (let p3 of p2.goods) {
|
|
for (let p3 of p2.goods) {
|
|
- // _.pick(p3, ['goods', 'name', 'buy_num']);
|
|
|
|
- // let p3_2 = (({ goods, name, buy_num }) => ({ goods, name, buy_num }))(p3);
|
|
|
|
- let good = (({ name }) => ({ name }))(p3.goods);
|
|
|
|
- p3.goods = good;
|
|
|
|
- p3.order_no = p2.no;
|
|
|
|
|
|
+ if (p3.is_set == '0') {
|
|
|
|
+ for (const p4 of p3.goods) {
|
|
|
|
+ p4.order_no = p2.no;
|
|
|
|
+ p4.name = p4.spec_name;
|
|
|
|
+ p4.buy_num = p3.buy_num;
|
|
|
|
+ info.push(p4);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let good = (({ name }) => ({ name }))(p3.goods);
|
|
|
|
+ p3.goods = good;
|
|
|
|
+ p3.order_no = p2.no;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- goodsList.push(...p2.goods);
|
|
|
|
|
|
+ info.push(...p2.goods);
|
|
|
|
+ goodsList = info.filter((f) => f.is_set != '0');
|
|
let i = 0;
|
|
let i = 0;
|
|
- for (const p4 of goodsList) {
|
|
|
|
|
|
+ for (const p4 of info) {
|
|
p4.index = i;
|
|
p4.index = i;
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let address = _.pick(p1[0].address, ['name', 'phone', 'province', 'city', 'area', 'address', '_id']);
|
|
let address = _.pick(p1[0].address, ['name', 'phone', 'province', 'city', 'area', 'address', '_id']);
|
|
- // let address = (({ name, phone, province, city, area, address, _id }) => ({ name, phone, province, city, area, address, _id }))(p1[0].address);
|
|
|
|
list.push({ goodsList, address });
|
|
list.push({ goodsList, address });
|
|
}
|
|
}
|
|
- console.log(list);
|
|
|
|
-
|
|
|
|
this.$set(this, 'list', list);
|
|
this.$set(this, 'list', list);
|
|
}
|
|
}
|
|
},
|
|
},
|