|
@@ -223,12 +223,14 @@ module.exports = app => {
|
|
|
throw '标段数据有误';
|
|
|
}
|
|
|
const preDatas = await this.getAllDataByCondition({
|
|
|
- columns: ['uuid', 'name', 'unit', 'unit_price', 'source', 'bills_code', 'check_code', 'memo', 'add_uid', 'add_sid', 'order'],
|
|
|
+ columns: ['uuid', 'name', 'unit', 'unit_price', 'source', 'bills_code', 'check_code', 'memo', 'add_uid', 'add_sid', 'order', 'arrive_qty', 'deduct_qty'],
|
|
|
where: { sid: preStage.id },
|
|
|
});
|
|
|
if (preDatas.length > 0) {
|
|
|
for (const pd of preDatas) {
|
|
|
pd.pre_used = pd.pre_used || !this.ctx.helper.checkZero(pd.arrive_qty) || !this.ctx.helper.checkZero(pd.deduct_qty);
|
|
|
+ delete pd.arrive_qty;
|
|
|
+ delete pd.deduct_qty;
|
|
|
pd.sid = stage.id;
|
|
|
}
|
|
|
const result = await transaction.insert(this.tableName, preDatas);
|