|
@@ -639,9 +639,13 @@ module.exports = app => {
|
|
|
if (!stage) return [];
|
|
if (!stage) return [];
|
|
|
|
|
|
|
|
const data = await this.ctx.service.stageSafeProd.getStageData(stage);
|
|
const data = await this.ctx.service.stageSafeProd.getStageData(stage);
|
|
|
|
|
+ const preData = await this.ctx.service.stageSafeProd.getEndStageData(stage.tid, stage.order);
|
|
|
for (const d of data) {
|
|
for (const d of data) {
|
|
|
- d.pre_qty = this.ctx.helper.add(d.qty, d.pre_qty);
|
|
|
|
|
- d.pre_tp = this.ctx.helper.add(d.tp, d.pre_tp);
|
|
|
|
|
|
|
+ const pd = this.ctx.helper._.find(preData, {uuid: d.uuid});
|
|
|
|
|
+ if (pd) {
|
|
|
|
|
+ d.pre_qty = pd.qty;
|
|
|
|
|
+ d.pre_tp = pd.tp;
|
|
|
|
|
+ }
|
|
|
d.end_qty = d.pre_qty;
|
|
d.end_qty = d.pre_qty;
|
|
|
d.end_tp = d.pre_tp;
|
|
d.end_tp = d.pre_tp;
|
|
|
d.qty = 0;
|
|
d.qty = 0;
|
|
@@ -679,9 +683,13 @@ module.exports = app => {
|
|
|
if (!stage) return [];
|
|
if (!stage) return [];
|
|
|
|
|
|
|
|
const data = await this.ctx.service.stageTempLand.getStageData(stage);
|
|
const data = await this.ctx.service.stageTempLand.getStageData(stage);
|
|
|
|
|
+ const preData = await this.ctx.service.stageTempLand.getEndStageData(stage.tid, stage.order);
|
|
|
for (const d of data) {
|
|
for (const d of data) {
|
|
|
- d.pre_qty = this.ctx.helper.add(d.qty, d.pre_qty);
|
|
|
|
|
- d.pre_tp = this.ctx.helper.add(d.tp, d.pre_tp);
|
|
|
|
|
|
|
+ const pd = this.ctx.helper._.find(preData, {uuid: d.uuid});
|
|
|
|
|
+ if (pd) {
|
|
|
|
|
+ d.pre_qty = pd.qty;
|
|
|
|
|
+ d.pre_tp = pd.tp;
|
|
|
|
|
+ }
|
|
|
d.end_qty = d.pre_qty;
|
|
d.end_qty = d.pre_qty;
|
|
|
d.end_tp = d.pre_tp;
|
|
d.end_tp = d.pre_tp;
|
|
|
d.qty = 0;
|
|
d.qty = 0;
|
|
@@ -717,8 +725,12 @@ module.exports = app => {
|
|
|
if (!stage) return [];
|
|
if (!stage) return [];
|
|
|
|
|
|
|
|
const data = await this.ctx.service.stageOther.getStageData(stage);
|
|
const data = await this.ctx.service.stageOther.getStageData(stage);
|
|
|
|
|
+ const preData = await this.ctx.service.stageOther.getEndStageData(stage.tid, stage.order);
|
|
|
for (const d of data) {
|
|
for (const d of data) {
|
|
|
- d.pre_tp = this.ctx.helper.add(d.pre_tp, d.tp);
|
|
|
|
|
|
|
+ const pd = this.ctx.helper._.find(preData, {uuid: d.uuid});
|
|
|
|
|
+ if (pd) {
|
|
|
|
|
+ d.pre_tp = pd.tp;
|
|
|
|
|
+ }
|
|
|
d.end_tp = d.pre_tp;
|
|
d.end_tp = d.pre_tp;
|
|
|
d.tp = 0;
|
|
d.tp = 0;
|
|
|
}
|
|
}
|