|
@@ -322,9 +322,9 @@ module.exports = app => {
|
|
|
(ctx.detail.status === auditConst.status.uncheck || ctx.detail.status === auditConst.status.checkNo)) {
|
|
|
const rptTpl = await ctx.service.rptTpl.getDataById(ctx.trInfo.rpt_id);
|
|
|
if (rptTpl) {
|
|
|
- // const pageRst = await ctx.service.jpcReport.getAllPreviewPagesCommon(rptTpl, 'A4');
|
|
|
- rptTpl.source_type = 101;
|
|
|
- const pageRst = await ctx.service.jpcReport.getPreviewPagesWithDiscreteDataCommon(ctx, rptTpl, 'A4', this.app.baseDir, null);
|
|
|
+ const pageRst = await ctx.service.jpcReport.getAllPreviewPagesCommon(rptTpl, 'A4');
|
|
|
+ // rptTpl.source_type = 101;
|
|
|
+ // const pageRst = await ctx.service.jpcReport.getPreviewPagesWithDiscreteDataCommon(ctx, rptTpl, 'A4', this.app.baseDir, null);
|
|
|
const rptMsg = pageRst.items[0];
|
|
|
// 判断与原有的报表审批人列表是否有区别
|
|
|
let difference = false;
|
|
@@ -368,6 +368,23 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 非审批完成可能要更新离散数据(cells值)
|
|
|
+ if (ctx.detail.status !== auditConst.status.checked) {
|
|
|
+ const rptTpl = await ctx.service.rptTpl.getDataById(ctx.trInfo.rpt_id);
|
|
|
+ if (rptTpl) {
|
|
|
+ rptTpl.source_type = 101;
|
|
|
+ const pageRst = await ctx.service.jpcReport.getPreviewPagesWithDiscreteDataCommon(ctx, rptTpl, 'A4', this.app.baseDir, null);
|
|
|
+ const rptMsg = pageRst.items[0];
|
|
|
+ const report_json = JSON.parse(ctx.detail.report_json);
|
|
|
+ if (report_json && report_json.items && report_json.items.length > 0 && report_json.items[0].cells &&
|
|
|
+ !ctx.helper._.isEmpty(ctx.helper._.differenceWith(JSON.parse(JSON.stringify(rptMsg.cells)), report_json.cells, ctx.helper._.isEqual))) {
|
|
|
+ report_json.items[0].cells = ctx.helper._.cloneDeep(rptMsg.cells);
|
|
|
+ const newJson = JSON.stringify(report_json);
|
|
|
+ await this.service.paymentDetail.defaultUpdate({ id: ctx.detail.id, report_json: newJson });
|
|
|
+ ctx.detail.report_json = newJson;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
const auditIdList = ctx.helper._.map(ctx.detail.auditors, 'aid');
|
|
|
const rptAuditIdList = ctx.helper._.map(ctx.detail.rptAudits, 'uid');
|
|
|
const uidList = ctx.helper._.uniq([...auditIdList, ...rptAuditIdList]);
|
|
@@ -791,7 +808,7 @@ module.exports = app => {
|
|
|
if (trInfo.uid === ctx.session.sessionUser.accountId && trInfo.is_del === 0 && trInfo.rpt_id) {
|
|
|
const rptTpl = await ctx.service.rptTpl.getDataById(trInfo.rpt_id);
|
|
|
if (rptTpl) {
|
|
|
- rptTpl.source_type = 101;
|
|
|
+ // rptTpl.source_type = 101;
|
|
|
const pageRst = await ctx.service.jpcReport.getAllPreviewPagesCommon(rptTpl, 'A4');
|
|
|
// const pageRst = await ctx.service.jpcReport.getPreviewPagesWithDiscreteDataCommon(ctx, rptTpl, 'A4', this.app.baseDir, null);
|
|
|
renderData.rptMsg = pageRst.items[0];
|
|
@@ -905,7 +922,7 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.paymentTenderRpt.updateRptAudit(trInfo, data.rpt_audit);
|
|
|
break;
|
|
|
case 'add-detail':
|
|
|
- responseData.data = await ctx.service.paymentDetail.addDetail(ctx, trInfo, data.code, data.s_time);
|
|
|
+ responseData.data = await ctx.service.paymentDetail.addDetail(trInfo, data.code, data.s_time);
|
|
|
break;
|
|
|
default: throw '参数有误';
|
|
|
}
|