|
@@ -82,7 +82,7 @@ module.exports = app => {
|
|
|
case 5:
|
|
|
changeAudit = await ctx.service.changeAudit.getLastUser(c.cid, c.times - 1, status);
|
|
|
auditStatus = c.uid === ctx.session.sessionUser.accountId ? 1 : 0;
|
|
|
- const back_changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, c.cid);
|
|
|
+ const back_changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, c.cid);
|
|
|
c.stageChangeNum = this.ctx.helper.sum(back_changeUsedData.map(x => { return Math.abs(x.qty); }));
|
|
|
c.isSettle = await ctx.service.changeSettleList.isSettle(c.cid);
|
|
|
break;
|
|
@@ -93,7 +93,7 @@ module.exports = app => {
|
|
|
break;
|
|
|
case 9:
|
|
|
auditStatus = c.uid === ctx.session.sessionUser.accountId ? 9 : 0;
|
|
|
- const changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, c.cid);
|
|
|
+ const changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, c.cid);
|
|
|
c.stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.qty); }));
|
|
|
c.isSettle = await ctx.service.changeSettleList.isSettle(c.cid);
|
|
|
break;
|
|
@@ -591,7 +591,7 @@ module.exports = app => {
|
|
|
renderData.auditList = auditList;
|
|
|
|
|
|
// 获取是否已存在调用变更令
|
|
|
- const changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, change.cid);
|
|
|
+ const changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, change.cid);
|
|
|
renderData.stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.qty); }));
|
|
|
await this.layout('change/info.ejs', renderData, 'change/info_modal.ejs');
|
|
|
} catch (err) {
|
|
@@ -683,7 +683,7 @@ module.exports = app => {
|
|
|
removeSettleNum,
|
|
|
};
|
|
|
// 获取是否已存在调用变更令
|
|
|
- let changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, change.cid);
|
|
|
+ let changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, change.cid);
|
|
|
changeUsedData = ctx.helper._.orderBy(ctx.helper._.filter(changeUsedData, function(item) {
|
|
|
return item.qty !== null;
|
|
|
}), ['sorder'], ['desc']);
|
|
@@ -919,7 +919,7 @@ module.exports = app => {
|
|
|
await ctx.service.changeAuditList.saveLedgerListDatas(data.updateData, data.postData);
|
|
|
// 取所有工料表
|
|
|
responseData.data = { changeList: await ctx.service.changeAuditList.getList(ctx.change.cid),
|
|
|
- usedList: await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, ctx.change.cid) };
|
|
|
+ usedList: await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, ctx.change.cid) };
|
|
|
break;
|
|
|
case 'remove_list':
|
|
|
await ctx.service.changeAuditList.removeLedgerListDatas(data.updateData);
|
|
@@ -1630,7 +1630,7 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
// 获取是否已存在调用变更令
|
|
|
- // const changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, changeData.cid);
|
|
|
+ // const changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, changeData.cid);
|
|
|
// const stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.qty); }));
|
|
|
// if (stageChangeNum !== 0) {
|
|
|
// throw '该变更令已被调用,无法重新审批';
|