|
@@ -275,13 +275,19 @@ module.exports = app => {
|
|
|
said: this.ctx.session.sessionUser.accountId,
|
|
|
times: this.ctx.stage.curTimes, order: this.ctx.stage.curOrder
|
|
|
};
|
|
|
- sp.contract_qty = d.contract_qty === undefined && osp
|
|
|
- ? osp.contract_qty
|
|
|
- : this.ctx.helper.round(d.contract_qty, precision.value);
|
|
|
- sp.qc_qty = d.qc_qty === undefined && osp
|
|
|
- ? osp.qc_qty
|
|
|
- : this.ctx.helper.round(d.qc_qty, precision.value);
|
|
|
- sp.postil = d.postil === undefined && osp ? osp.postil : d.postil;
|
|
|
+ if (d.contract_qty !== undefined || osp) {
|
|
|
+ sp.contract_qty = d.contract_qty === undefined && osp
|
|
|
+ ? osp.contract_qty
|
|
|
+ : this.ctx.helper.round(d.contract_qty, precision.value);
|
|
|
+ }
|
|
|
+ if (d.qc_qty || osp) {
|
|
|
+ sp.qc_qty = d.qc_qty === undefined && osp
|
|
|
+ ? osp.qc_qty
|
|
|
+ : this.ctx.helper.round(d.qc_qty, precision.value);
|
|
|
+ }
|
|
|
+ if (d.postil || osp) {
|
|
|
+ sp.postil = d.postil === undefined && osp ? osp.postil : d.postil;
|
|
|
+ }
|
|
|
await transaction.insert(this.tableName, sp);
|
|
|
}
|
|
|
}
|