|
@@ -376,17 +376,18 @@ export default {
|
|
i.daterange = daterange;
|
|
i.daterange = daterange;
|
|
//改变上报时间格式
|
|
//改变上报时间格式
|
|
i = this.changeRange(i);
|
|
i = this.changeRange(i);
|
|
- arrange.map(p => {
|
|
|
|
- let { termid, term, batchid, batch, number, carnum, _id } = p;
|
|
|
|
- let obj = {};
|
|
|
|
- obj[this.proAffix(batchid, 'term_batch')] = termid;
|
|
|
|
- obj[this.proAffix(batchid, 'batch')] = batch;
|
|
|
|
- obj[this.proAffix(batchid, 'batch_total')] = number;
|
|
|
|
- obj[this.proAffix(batchid, 'car_total')] = carnum;
|
|
|
|
- obj[this.proAffix(termid, 'term')] = term;
|
|
|
|
- obj[this.proAffix(batchid, 'arrange_id')] = _id;
|
|
|
|
- i = { ...i, ...obj };
|
|
|
|
- });
|
|
|
|
|
|
+ if (arrange)
|
|
|
|
+ arrange.map(p => {
|
|
|
|
+ let { termid, term, batchid, batch, number, carnum, _id } = p;
|
|
|
|
+ let obj = {};
|
|
|
|
+ obj[this.proAffix(batchid, 'term_batch')] = termid;
|
|
|
|
+ obj[this.proAffix(batchid, 'batch')] = batch;
|
|
|
|
+ obj[this.proAffix(batchid, 'batch_total')] = number;
|
|
|
|
+ obj[this.proAffix(batchid, 'car_total')] = carnum;
|
|
|
|
+ obj[this.proAffix(termid, 'term')] = term;
|
|
|
|
+ obj[this.proAffix(batchid, 'arrange_id')] = _id;
|
|
|
|
+ i = { ...i, ...obj };
|
|
|
|
+ });
|
|
i.plan = plan;
|
|
i.plan = plan;
|
|
}
|
|
}
|
|
return i;
|
|
return i;
|
|
@@ -581,10 +582,10 @@ export default {
|
|
let dl = _.cloneDeep(this.list);
|
|
let dl = _.cloneDeep(this.list);
|
|
let arr = dt.map(t => {
|
|
let arr = dt.map(t => {
|
|
t.batchnum.map(b => {
|
|
t.batchnum.map(b => {
|
|
- let { batchid, remaining } = b;
|
|
|
|
- let num = dl.reduce((prev, next) => prev + next[this.proAffix(batchid, 'batch_total')] * 1, 0);
|
|
|
|
- let remainder = remaining - num;
|
|
|
|
- b.remaining = remainder >= 0 ? remainder : 0;
|
|
|
|
|
|
+ let { batchid, remaining, bpt } = b;
|
|
|
|
+ let num = dl.reduce((prev, next) => prev + (next[this.proAffix(batchid, 'batch_total')] * 1 || 0), 0);
|
|
|
|
+ let remainder = bpt - num;
|
|
|
|
+ b.remaining = remainder;
|
|
return b;
|
|
return b;
|
|
});
|
|
});
|
|
return t;
|
|
return t;
|