|
@@ -897,11 +897,11 @@ module.exports = app => {
|
|
// 新增或删除list_gcl表
|
|
// 新增或删除list_gcl表
|
|
await this.ctx.service.materialListGcl.insertOrDelGcl(transaction, data.insertGclList, data.removeGclList, material.id);
|
|
await this.ctx.service.materialListGcl.insertOrDelGcl(transaction, data.insertGclList, data.removeGclList, material.id);
|
|
// 修改本期应耗数量值和有效价差,需要剔除不参与调差的清单数据,并返回总金额
|
|
// 修改本期应耗数量值和有效价差,需要剔除不参与调差的清单数据,并返回总金额
|
|
- const materials = await this.getAllDataByCondition({
|
|
|
|
|
|
+ const materials = await this.ctx.service.material.getAllDataByCondition({
|
|
where: { tid: this.ctx.tender.id },
|
|
where: { tid: this.ctx.tender.id },
|
|
order: ['order'],
|
|
order: ['order'],
|
|
});
|
|
});
|
|
- const preMaterial = materials[materials.length - 1];
|
|
|
|
|
|
+ const preMaterial = materials[materials.length - 2];
|
|
if (material.is_stage_self) {
|
|
if (material.is_stage_self) {
|
|
await this.ctx.service.materialStageBills.insertMsBills(transaction, this.ctx.tender.id, material.id, this._.find(materialStages, { sid: parseInt(data.stage_id) }), JSON.parse(material.decimal), preMaterial.is_stage_self, material.qty_source, material.rate);
|
|
await this.ctx.service.materialStageBills.insertMsBills(transaction, this.ctx.tender.id, material.id, this._.find(materialStages, { sid: parseInt(data.stage_id) }), JSON.parse(material.decimal), preMaterial.is_stage_self, material.qty_source, material.rate);
|
|
await transaction.update(this.ctx.service.material.tableName, {
|
|
await transaction.update(this.ctx.service.material.tableName, {
|