@@ -671,7 +671,6 @@ module.exports = app => {
}
const changeBills = await this.ctx.service.changeAuditList.getChangeAuditBills(tid);
for (const d of changeBills) {
- //const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, d.unit);
d.o_qty = d.oamount;
d.o_tp = this.ctx.helper.mul(d.o_qty, d.unit_price, decimal.tp);
d.c_qty = d.camount;
@@ -28,6 +28,25 @@ module.exports = app => {
return data;
+
+ async addInitialStageData(stage, preStage, transaction) {
+ if (!stage || !preStage) {
+ throw '标段数据有误';
+ }
+ const preDatas = await this.getAllDataByCondition({
+ where: {sid: preStage.id}
+ });
+ if (preDatas.length > 0) {
+ for (const pd of preDatas) {
+ delete pd.id;
+ pd.sid = stage.id;
+ const result = await transaction.insert(this.tableName, preDatas);
+ return result.affectedRows === preDatas.length;
+ } else {
+ return true;
return RptCustomDefine;
@@ -275,6 +275,10 @@ module.exports = app => {
const otherResult = await this.ctx.service.stageOther.addInitialStageData(newStage, preStage, transaction);
if (!otherResult) throw '初始化其他台账数据失败';
+ // 新增期拷贝报表相关配置
+ if (preStage) {
+ const rptResult = await this.ctx.service.rptCustomDefine.addInitialStageData(newStage, preStage, transaction);
await transaction.commit();
return newStage;
@@ -227,7 +227,6 @@ module.exports = app => {
} else {
return true;
-