浏览代码

1. 计量台账,工序报验、档案管理颜色问题
2. 工序报验、档案管理可根据项目配置,显示状态

MaiXinRong 4 年之前
父节点
当前提交
49a7609ad9
共有 3 个文件被更改,包括 25 次插入12 次删除
  1. 4 2
      app/controller/stage_controller.js
  2. 12 10
      app/public/js/stage.js
  3. 9 0
      app/service/project_account.js

+ 4 - 2
app/controller/stage_controller.js

@@ -23,7 +23,6 @@ const accountGroup = require('../const/account_group').group;
 const sendToWormhole = require('stream-wormhole');
 const billsPosConvert = require('../lib/bills_pos_convert');
 const fs = require('fs');
-const thirdParty = require('../const/third_party');
 
 module.exports = app => {
     class StageController extends app.BaseController {
@@ -55,7 +54,10 @@ module.exports = app => {
                 measureType,
                 preUrl: '/tender/' + ctx.tender.id + '/measure/stage/' + ctx.params.order,
                 stage: ctx.stage,
-                thirdParty,
+                thirdParty: {
+                    gxby: ctx.session.sessionProject.gxby_status,
+                    dagl: ctx.session.sessionProject.dagl_status,
+                },
             };
             if ((ctx.stage.status === auditConst.status.uncheck || ctx.stage.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.stage.user_id) {
                 data.accountGroup = accountGroup;

+ 12 - 10
app/public/js/stage.js

@@ -558,16 +558,18 @@ $(document).ready(() => {
         changesObj.loadChanges({bills: node, pos: data});
     };
     posSpreadSetting.getColor = function (sheet, data, row, col, defaultColor) {
-        if (col.field === 'gxby') {
-            const def = thirdParty.gxby.find(function (x) {
-                return x.value === data.gxby_status;
-            });
-            if (def && def.color) return def.color;
-        } else if (col.field === 'dagl') {
-            const def = thirdParty.dagl.find(function (x) {
-                return x.value === data.dagl_status;
-            });
-            if (def && def.color) return def.color;
+        if (data) {
+            if (col.field === 'gxby') {
+                const def = thirdParty.gxby.find(function (x) {
+                    return x.value === data.gxby_status;
+                });
+                if (def && def.color) return def.color;
+            } else if (col.field === 'dagl') {
+                const def = thirdParty.dagl.find(function (x) {
+                    return x.value === data.dagl_status;
+                });
+                if (def && def.color) return def.color;
+            }
         }
         return data && data.end_contract_qty > data.quantity ? '#f8d7da' : defaultColor;
     };

+ 9 - 0
app/service/project_account.js

@@ -13,6 +13,8 @@ const crypto = require('crypto');
 const SSO = require('../lib/sso');
 const SMS = require('../lib/sms');
 const SmsAliConst = require('../const/sms_alitemplate');
+const thirdPartyConst = require('../const/third_party');
+
 module.exports = app => {
 
     class ProjectAccount extends app.BaseService {
@@ -228,8 +230,15 @@ module.exports = app => {
 
                     const thirdParty = await this.db.get('zh_s2b_proj', { pid: projectInfo.id });
                     if (thirdParty) {
+                        thirdParty.gxby_option = thirdParty.gxby_option ? JSON.parse(thirdParty.gxby_option) : null;
                         projectInfo.gxby = thirdParty.gxby;
+                        projectInfo.gxby_status = thirdParty.gxby_option && thirdParty.gxby_option.status
+                            ? thirdParty.gxby_option.status : thirdPartyConst.gxby;
+
+                        thirdParty.dagl_option = thirdParty.dagl_option ? JSON.parse(thirdParty.dagl_option): null;
                         projectInfo.dagl = thirdParty.dagl;
+                        projectInfo.dagl_status = thirdParty.dagl_option && thirdParty.dagl_option.status
+                            ? thirdParty.dagl_option.status : thirdPartyConst.dagl;
                     }
                     this.ctx.session.sessionProject = projectInfo;
                     this.ctx.session.sessionProjectList = projectList;