laiguoran 4 лет назад
Родитель
Сommit
efff7c8458

+ 9 - 3
app/controller/change_controller.js

@@ -544,8 +544,6 @@ module.exports = app => {
 
                 // 根据auditStatus获取审批人列表
                 const auditList = await ctx.service.changeAudit.getListByStatus(change, auditStatus);
-                // 获取已选清单
-                let changeList = await ctx.service.changeAuditList.getList(change.cid);
 
                 // 获取用户人验证手机号
                 const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
@@ -561,7 +559,6 @@ module.exports = app => {
                     attList,
                     whiteList,
                     auditList,
-                    changeList,
                     tpUnit: ctx.tender.info.decimal.tp,
                     upUnit: ctx.tender.info.decimal.up,
                     authMobile: auth_mobile,
@@ -610,6 +607,9 @@ module.exports = app => {
                     // 获取公司列表
                     const companyList = await ctx.service.changeCompany.getAllDataByCondition({ where: { tid: ctx.tender.id } });
                     renderData.companyList = companyList;
+                    // 获取已选清单
+                    const changeList = await ctx.service.changeAuditList.getList(change.cid);
+                    renderData.changeList = changeList;
                 } else if (auditStatus === 3 || auditStatus === 4 || auditStatus === 5 || auditStatus === 7) {
                     // 展示页左侧审批流程列表和清单审批列表数据
                     const times = change.status === audit.flow.status.back ?
@@ -636,6 +636,9 @@ module.exports = app => {
                     }
                     renderData.auditList3 = auditList3;
 
+                    // 获取已选清单
+                    let changeList = await ctx.service.changeAuditList.getAllDataByCondition({ where: { cid: ctx.params.cid } });
+
                     changeList = JSON.parse(JSON.stringify(changeList.sort())).sort().sort();
                     for (const cl of changeList) {
                         const audit_amount = cl.audit_amount !== null && cl.audit_amount !== '' ? cl.audit_amount.split(',') : '';
@@ -681,6 +684,9 @@ module.exports = app => {
                     }
                     renderData.auditList4 = auditList4;
 
+                    // 获取已选清单
+                    let changeList = await ctx.service.changeAuditList.getAllDataByCondition({ where: { cid: ctx.params.cid } });
+
                     changeList = JSON.parse(JSON.stringify(changeList.sort())).sort().sort();
                     for (const cl of changeList) {
                         const audit_amount = cl.audit_amount !== null && cl.audit_amount !== '' ? cl.audit_amount.split(',') : '';

+ 1 - 1
app/public/js/change_information_set.js

@@ -358,7 +358,7 @@ $(document).ready(() => {
                     '<td>' + gcl.code + '</td>' +
                     '<td class="text-left">' + gcl.name + '</td>' +
                     '<td class="text-center">' + unit + '</td>' +
-                    '<td class="text-right">' + ZhCalc.round(unit_price, unitPriceUnit) + '</td>' +
+                    '<td class="text-right">' + (ZhCalc.round(unit_price, unitPriceUnit) ? ZhCalc.round(unit_price, unitPriceUnit) : 0) + '</td>' +
                     '<td class="text-right">' + quantity + '</td>' +
                     '</tr>';
                 list_index++;

+ 13 - 0
app/service/change_audit.js

@@ -580,6 +580,19 @@ module.exports = app => {
                     status: auditConst.auditStatus.checked,
                     sin_time: new Date(),
                 });
+                const changeList = await this.ctx.service.changeAuditList.getList(cid);
+                // 更新清单spamount的值
+                const updateListData = [];
+                for (const cl of changeList) {
+                    if(cl.camount !== cl.spamount) {
+                        const uld = {
+                            id: cl.id,
+                            spamount: cl.camount,
+                        };
+                        updateListData.push(uld);
+                    }
+                }
+                if(updateListData.length > 0) await transaction.updateRows(this.ctx.service.changeAuditList.tableName, updateListData);
 
                 // 添加短信通知-需要审批提醒功能
                 const sms = new SMS(this.ctx);