浏览代码

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 年之前
父节点
当前提交
9093d82b2f
共有 44 个文件被更改,包括 1179 次插入319 次删除
  1. 1 1
      app/const/tender.js
  2. 7 7
      app/controller/change_controller.js
  3. 1 0
      app/controller/material_controller.js
  4. 39 17
      app/controller/tender_controller.js
  5. 72 12
      app/controller/wechat_controller.js
  6. 58 0
      app/extend/helper.js
  7. 41 26
      app/lib/rpt_data_analysis.js
  8. 33 0
      app/middleware/wechat_auth.js
  9. 335 0
      app/public/js/PinYinOrder.bundle.js
  10. 34 9
      app/public/js/change.js
  11. 56 0
      app/public/js/global.js
  12. 26 24
      app/public/js/ledger_gather.js
  13. 6 6
      app/public/js/material.js
  14. 6 2
      app/public/js/material_list.js
  15. 4 4
      app/public/js/measure_compare.js
  16. 1 0
      app/public/js/se_bonus.js
  17. 1 0
      app/public/js/se_jgcl.js
  18. 1 0
      app/public/js/se_other.js
  19. 2 2
      app/public/js/shares/sjs_setting.js
  20. 15 13
      app/public/js/shares/tender_list_order.js
  21. 39 25
      app/public/js/spreadjs_rela/spreadjs_zh.js
  22. 0 2
      app/public/js/stage.js
  23. 5 5
      app/public/js/stage_pay.js
  24. 35 0
      app/public/js/wechat/bind.js
  25. 5 1
      app/router.js
  26. 70 0
      app/service/project_account.js
  27. 16 0
      app/service/wechat.js
  28. 3 0
      app/view/change/index.ejs
  29. 33 33
      app/view/change/info_modal.ejs
  30. 20 1
      app/view/change/modal.ejs
  31. 1 1
      app/view/dashboard/index.ejs
  32. 1 1
      app/view/ledger/gather.ejs
  33. 31 31
      app/view/material/audit_modal.ejs
  34. 19 20
      app/view/measure/stage.ejs
  35. 66 66
      app/view/stage/audit_modal.ejs
  36. 1 1
      app/view/stage/pay.ejs
  37. 1 0
      app/view/stage_extra/bonus.ejs
  38. 1 0
      app/view/stage_extra/jgcl.ejs
  39. 1 0
      app/view/stage_extra/other.ejs
  40. 9 9
      app/view/tender/detail.ejs
  41. 75 0
      app/view/wechat/bind.ejs
  42. 1 0
      builder_report_index_define.js
  43. 4 0
      config/web.js
  44. 3 0
      sql/update.sql

+ 1 - 1
app/const/tender.js

@@ -69,7 +69,7 @@ const valuationField = function (mt) {
 
 const imType = {
     zl: { value: 0, name: '总量控制' },
-    tz: { value: 1, name: '0号台账' },
+    tz: { value: 1, name: '项目节-清单' },
     bw: { value: 2, name: '清单-计量单元' },
     bb: { value: 3, name: '计量单元-清单' },
 };

+ 7 - 7
app/controller/change_controller.js

@@ -130,6 +130,7 @@ module.exports = app => {
                 codeRule,
                 dealCode: ctx.tender.info.deal_info.dealCode,
                 auditConst: audit.flow,
+                ledgerConsts: audit.ledger.status,
                 changeConst,
                 ruleType: codeRuleConst.ruleType.change,
                 ruleConst: codeRuleConst.measure,
@@ -137,7 +138,6 @@ module.exports = app => {
                 preUrl: '/tender/' + tenderId,
                 tpUnit: ctx.tender.info.decimal.tp,
             };
-
             await this.layout('change/index.ejs', renderData, 'change/modal.ejs');
         }
 
@@ -500,9 +500,9 @@ module.exports = app => {
         async defaultBills(ctx) {
             try {
                 const ledgerData = await ctx.service.ledger.getData(ctx.tender.id);
-                const posData = await ctx.service.pos.getPosData({tid: ctx.tender.id});
+                const posData = await ctx.service.pos.getPosData({ tid: ctx.tender.id });
                 const dealBills = await ctx.service.dealBills.getAllDataByCondition({ where: { tender_id: ctx.tender.id } });
-                ctx.body = { err: 0, msg: '', data: {bills: ledgerData, pos: posData, dealBills: dealBills} };
+                ctx.body = { err: 0, msg: '', data: { bills: ledgerData, pos: posData, dealBills } };
             } catch (err) {
                 this.log(err);
                 ctx.body = { err: 1, msg: err.toString(), data: [] };
@@ -544,7 +544,7 @@ module.exports = app => {
          */
         async approval(ctx) {
             try {
-                const changeData = await ctx.service.change.getDataByCondition({cid: ctx.request.body.change_id});
+                const changeData = await ctx.service.change.getDataByCondition({ cid: ctx.request.body.change_id });
                 if (!changeData) {
                     throw '变更令数据错误';
                 }
@@ -789,12 +789,12 @@ module.exports = app => {
         /**
          * 获取变更清单
          * @param ctx
-         * @returns {Promise<void>}
+         * @return {Promise<void>}
          */
         async bills(ctx) {
             try {
                 const data = JSON.parse(ctx.request.body.data);
-                const responseData = {err: 0, msg: '', data: []};
+                const responseData = { err: 0, msg: '', data: [] };
                 switch (data.type) {
                     case 'gather':
                         responseData.data = await ctx.service.changeAuditList.gatherBgBills(ctx.tender.id);
@@ -812,7 +812,7 @@ module.exports = app => {
         /**
          * 最后审批人审批成功检查批复编号和其它变更令是否出现重名情况
          * @param ctx
-         * @returns {Promise<void>}
+         * @return {Promise<void>}
          */
         async checkCodeRepeat(ctx) {
             const responseData = {

+ 1 - 0
app/controller/material_controller.js

@@ -304,6 +304,7 @@ module.exports = app => {
                 renderData.pos = await ctx.service.pos.getPosData({ tid: ctx.tender.id });
                 // 获取所选期数据并合并相加同类清单项
                 renderData.curLedgerData = await ctx.service.stageBills.getStagesData(ctx.tender.id, ctx.material.stage_id);
+                console.log('curLedgerData:', renderData.curLedgerData);
                 renderData.curPosData = await ctx.service.stagePos.getStagesData(ctx.tender.id, ctx.material.stage_id);
                 await this.layout('material/list.ejs', renderData, 'material/list_modal.ejs');
             } catch (err) {

+ 39 - 17
app/controller/tender_controller.js

@@ -40,29 +40,51 @@ module.exports = app => {
 
                 const tenderList = await this.ctx.service.tender.getList('', userPermission);
 
-                for (const t of tenderList) {
-                    if (t.user_id === this.ctx.session.sessionUser.accountId && (
-                        t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
-                        const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
-                        t.total_price = sum.total_price;
-                        t.deal_tp = sum.deal_tp;
-                    }
+                // for (const t of tenderList) {
+                //     if (t.user_id === this.ctx.session.sessionUser.accountId && (
+                //         t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
+                //         const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
+                //         t.total_price = sum.total_price;
+                //         t.deal_tp = sum.deal_tp;
+                //     }
+                //     if (t.ledger_status === auditConst.ledger.status.checked) {
+                //         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
+
+                //         if (!t.lastStage) continue;
+                //         if (t.lastStage.status === auditConst.stage.status.uncheck &&
+                //             t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
+                //             t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
+                //         }
+
+                //         if (!t.lastStage) continue;
+                //         await this.ctx.service.stage.checkStageGatherData(t.lastStage);
+                //     }
+                //     if (t.lastStage) {
+                //         if (t.lastStage.status === auditConst.stage.status.uncheck) {
+                //             const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
+                //             t.status_users = status_name ? status_name.name : '';
+                //         } else {
+                //             const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
+                //             t.status_users = status_name ? status_name.name : '';
+                //         }
+                //     } else {
+                //         if (t.ledger_status !== auditConst.ledger.status.uncheck) {
+                //             const status_name = await this.ctx.service.ledgerAudit.getStatusName(t.id, t.ledger_times);
+                //             t.status_users = status_name ? status_name.name : '';
+                //         }
+                //     }
+                // }
+                tenderList.forEach(async t => {
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
-
-                        if (!t.lastStage) continue;
-                        if (t.lastStage.status === auditConst.stage.status.uncheck &&
-                            t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
-                            t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
-                        }
-
-                        if (!t.lastStage) continue;
-                        await this.ctx.service.stage.checkStageGatherData(t.lastStage);
+                        t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
                     }
                     if (t.lastStage) {
                         if (t.lastStage.status === auditConst.stage.status.uncheck) {
                             const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
                             t.status_users = status_name ? status_name.name : '';
+                            // const status_name = await this.ctx.service.stageAudit.getStatusName(t.lastStage.id, t.lastStage.times - 1);
+                            // t.status_users = status_name ? status_name.name : '';
                         } else {
                             const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
                             t.status_users = status_name ? status_name.name : '';
@@ -73,7 +95,7 @@ module.exports = app => {
                             t.status_users = status_name ? status_name.name : '';
                         }
                     }
-                }
+                });
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
                 const renderData = {

+ 72 - 12
app/controller/wechat_controller.js

@@ -9,11 +9,12 @@
  */
 
 const moment = require('moment');
-const Controller = require('egg').Controller;
+// const Controller = require('egg').Controller;
 const crypto = require('crypto');
+const maintainConst = require('../const/maintain');
 
 module.exports = app => {
-    class WechatController extends Controller {
+    class WechatController extends app.BaseController {
         /**
          * 接入微信
          *
@@ -42,22 +43,81 @@ module.exports = app => {
             }
         }
         /**
-         * 登录验证
+         * 微信登录验证
          *
          * @param {Object} ctx - egg全局页面
          * @return {void}
          */
         async oauth(ctx) {
-            console.log('hello');
-            const url = await app.wechat.oauth.getAuthorizeURL('http://jluat.smartcost.com.cn/wx/hello', 'hello world', 'snsapi_userinfo');
-            console.log(url);
-            // const token = await app.wechat.oauth.getAccessToken(ctx.query.code);
-            // const accessToken = token.data.access_token;
-            // const openid = token.data.openid;
-            // console.log(token);
+            const url = await app.wechat.oauth.getAuthorizeURL('http://jluat.smartcost.com.cn/wx/bind', '', 'snsapi_userinfo');
+            ctx.redirect(url);
         }
-        async hello(ctx) {
-            console.log('hello world');
+
+        /**
+         * 绑定页面
+         *
+         * @param {Object} ctx - egg全局页面
+         * @return {void}
+         */
+        async bind(ctx) {
+            try {
+                if (!ctx.session.wechatToken) {
+                    const token = await app.wechat.oauth.getAccessToken(ctx.query.code);
+                    ctx.session.wechatToken = token.data;
+                }
+                const user = await app.wechat.oauth.getUser(ctx.session.wechatToken.openid);
+                const errorMessage = ctx.session.loginError;
+                // 获取系统维护信息
+                const maintainData = await ctx.service.maintain.getDataById(1);
+                const renderData = {
+                    maintainData,
+                    maintainConst,
+                    errorMessage,
+                    user,
+                };
+                // ctx.body = renderData;
+                await ctx.render('wechat/bind.ejs', renderData);
+            } catch (e) {
+                console.log(e);
+                ctx.body = e;
+            }
+        }
+
+        async bindwx(ctx) {
+            try {
+                const result = await ctx.service.projectAccount.accountCheck(ctx.request.body);
+
+                if (!result) {
+                    throw '用户名或密码错误';
+                }
+
+                if (result === 2) {
+                    throw '该账号已被停用,请联系销售人员';
+                }
+                const accountData = result;
+                if (accountData.wx_openid || ctx.session.wechatToken.openid === accountData.wx_openid) {
+                    throw '该账号已经绑定过微信';
+                }
+                const wxAccountData = await ctx.service.projectAccount.getDataByCondition({ wx_openid: ctx.session.wechatToken.openid });
+                if (wxAccountData) {
+                    throw '该微信号已绑定过本项目账号';
+                }
+                const user = await app.wechat.oauth.getUser(ctx.session.wechatToken.openid);
+
+                const result2 = await ctx.service.projectAccount.bindWx(accountData.id, ctx.session.wechatToken.openid, user.nickname);
+                if (!result2) {
+                    throw '绑定失败';
+                }
+                ctx.body = '绑定成功';
+            } catch (error) {
+                this.log(error);
+                ctx.session.loginError = error;
+                ctx.redirect('/wx/bind');
+            }
+        }
+
+        async oauthTxt(ctx) {
+            ctx.body = 't3MkWAMqplVxPjmr';
         }
     }
 

+ 58 - 0
app/extend/helper.js

@@ -845,11 +845,69 @@ module.exports = {
         if (noWan.toString().length < 4) noWan = '0' + noWan;
         return overWan ? getWan(overWan) + '万' + getWan(noWan) : getWan(num);
     },
+    formatNum(num, pattern) {
+        const strarr = num ? num.toString().split('.') : ['0'];
+        const fmtarr = pattern ? pattern.split('.') : [''];
+        let retstr = '';
+
+        // 整数部分
+        let str = strarr[0];
+        let fmt = fmtarr[0];
+        let i = str.length - 1;
+        let comma = false;
+        for (var f = fmt.length - 1; f >= 0; f--) {
+            switch (fmt.substr(f, 1)) {
+                case '#':
+                    if (i >= 0) retstr = str.substr(i--, 1) + retstr;
+                    break;
+                case '0':
+                    if (i >= 0) retstr = str.substr(i--, 1) + retstr;
+                    else retstr = '0' + retstr;
+                    break;
+                case ',':
+                    comma = true;
+                    retstr = ',' + retstr;
+                    break;
+            }
+        }
+        if (i >= 0) {
+            if (comma) {
+                const l = str.length;
+                for (;i >= 0; i--) {
+                    retstr = str.substr(i, 1) + retstr;
+                    if (i > 0 && ((l - i) % 3) == 0) retstr = ',' + retstr;
+                }
+            } else retstr = str.substr(0, i + 1) + retstr;
+        }
+
+        retstr = retstr + '.';
+        // 处理小数部分
+        str = strarr.length > 1 ? strarr[1] : '';
+        fmt = fmtarr.length > 1 ? fmtarr[1] : '';
+        i = 0;
+        for (var f = 0; f < fmt.length; f++) {
+            switch (fmt.substr(f, 1)) {
+                case '#':
+                    if (i < str.length) retstr += str.substr(i++, 1);
+                    break;
+                case '0':
+                    if (i < str.length) retstr += str.substr(i++, 1);
+                    else retstr += '0';
+                    break;
+            }
+        }
+        return retstr.replace(/^,+/, '').replace(/\.$/, '');
+    },
 
     dateTran(time) {
         return moment(time).format('YYYY年MM月DD日 HH:mm');
     },
 
+    // 审批日期格式:2020-5-7 9:40:30
+    formatFullDate(time) {
+        return moment(time).format('YYYY-MM-DD HH:mm:ss');
+    },
+
     timeAdd(duration) {
         const d = parseInt(duration);
         let time = 0;

+ 41 - 26
app/lib/rpt_data_analysis.js

@@ -145,15 +145,41 @@ const gatherGcl = {
         '  图册号(drawing_code), 备注(memo), 节点类型(node_type), 总额计量(is_tp)\n' +
         '3. 如需汇总"未计入清单章节项",请勾选"章节编号(chapter)"字段\n',
     intro: '根据三级清单树结构,汇总平面工程量清单,目前仅支持mem_stage_bills表',
-    fun: function (ctx, data, fieldsKey, options) {
-        const gatherFields = function(gcl, data, fields) {
-            for (const f of fields) {
-                if (data[f]) {
-                    gcl[f] = ctx.helper.add(gcl[f], data[f]);
-                }
+    _gatherCalcField: function (ctx, gcl, data) {
+        for (const prop in data) {
+            if (((prop === 'total_price' || prop.indexOf('tp') > 0) ||
+                (prop === 'quantity' || prop.indexOf('qty') > 0)) && data[prop])
+            {
+                gcl[prop] = ctx.helper.add(gcl[prop], data[prop]);
             }
-        };
-        if (!data.mem_stage_bills) return;
+        }
+    },
+    _gatherTpField: function (ctx, gcl, data) {
+        for (const prop in data) {
+            if ((prop === 'total_price' || prop.indexOf('tp') > 0) && data[prop]) {
+                gcl[prop] = ctx.helper.add(gcl[prop], data[prop]);
+            }
+        }
+    },
+    _loadGatherInfo: function (gcl, data) {
+        for (const prop in data) {
+            if (/^t_[0-9]*_(id|name)$/.test(prop)) {
+                gcl[prop] = data[prop];
+            }
+        }
+    },
+    _gatherFields: function(gcl, data, fields) {
+        for (const f of fields) {
+            if (data[f]) {
+                gcl[f] = ctx.helper.add(gcl[f], data[f]);
+            }
+        }
+    },
+    fun: function (ctx, data, fieldsKey, options) {
+        const tableName = options ? options.table : 'mem_stage_bills';
+
+        const gatherData = data[tableName];
+        if (!gatherData || gatherData.length === 0) return;
 
         const fields = ctx.helper._.map(fieldsKey, 'field');
         const needFields = ['b_code', 'name', 'unit', 'unit_price', 'is_leaf'];
@@ -162,9 +188,10 @@ const gatherGcl = {
         }
         const gatherOther = fields.indexOf('chapter') >= 0;
         const gclBills = [], other = {name: '未计入清单章节项', chapter: '10000'};
+        this._loadGatherInfo(other, gatherData[0]);
 
-        for (const b of data.mem_stage_bills) {
-            const child = ctx.helper._.find(data.mem_stage_bills, {ledger_pid: b.ledger_id});
+        for (const b of gatherData) {
+            const child = ctx.helper._.find(gatherData, {ledger_pid: b.ledger_id});
             if (child) continue;
 
             if (b.b_code && b.b_code !== '') {
@@ -179,27 +206,15 @@ const gatherGcl = {
                         qc_bgl_code: [], chapter: b.chapter,
                         deal_bills_qty: b.deal_bills_qty, deal_bills_tp: b.deal_bills_tp,
                     };
+                    if (tableName.indexOf('mem_gather_') >= 0) this._loadGatherInfo(gcl, b);
                     gclBills.push(gcl);
                 }
-                gatherFields(gcl, b, [
-                    'deal_qty', 'deal_tp',
-                    'sgfh_qty', 'sgfh_tp', 'sjcl_qty', 'sjcl_tp', 'qtcl_qty', 'qtcl_tp', 'quantity', 'total_price',
-                    'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'gather_qty', 'gather_tp',
-                    'pre_contract_qty', 'pre_contract_tp', 'pre_qc_qty', 'pre_qc_tp', 'pre_gather_qty', 'pre_gather_tp',
-                    'end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp', 'end_gather_qty', 'end_gather_tp',
-                    'final_tp'
-                ]);
+                this._gatherCalcField(ctx, gcl, b);
                 if (b.qc_bgl_code && b.qc_bgl_code !== '') {
                     gcl.qc_bgl_code = gcl.qc_bgl_code.concat(b.qc_bgl_code.split(';'));
                 }
             } else if (gatherOther) {
-                gatherFields(other, b, [
-                    'deal_tp', 'sgfh_tp', 'sjcl_tp', 'qtcl_tp', 'total_price',
-                    'contract_tp', 'qc_tp', 'gather_tp',
-                    'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp',
-                    'end_contract_tp', 'end_qc_tp', 'end_gather_tp',
-                    'final_tp'
-                ]);
+                this._gatherTpField(ctx, other, b);
             }
         }
         if (gatherOther) gclBills.push(other);
@@ -208,7 +223,7 @@ const gatherGcl = {
             g.final_ratio = ctx.helper.mul(ctx.helper.div(g.end_gather_tp, g.final_ratio), 100);
         }
 
-        data.mem_stage_bills = gclBills;
+        data[tableName] = gclBills;
     }
 };
 const sortGcl = {

+ 33 - 0
app/middleware/wechat_auth.js

@@ -0,0 +1,33 @@
+'use strict';
+
+// 加密类
+const crypto = require('crypto');
+const messageType = require('../const/message_type');
+
+module.exports = options => {
+    /**
+     * session判断中间件
+     *
+     * @param {function} next - 中间件继续执行的方法
+     * @return {void}
+     */
+    return function* wechatAuth(next) {
+        try {
+            // 判断session
+            // const wechatToken = this.session.wechatToken;
+            // if (wechatToken === undefined) {
+            //     throw '不存在session';
+            // }
+            // // 同步系统维护信息
+            // yield this.service.maintain.syncMaintainData();
+            // if (this.session === null) {
+            //     throw '系统维护中~';
+            // }
+        } catch (error) {
+            console.log(error);
+            this.body = error;
+            return;
+        }
+        yield next;
+    };
+};

文件差异内容过多而无法显示
+ 335 - 0
app/public/js/PinYinOrder.bundle.js


+ 34 - 9
app/public/js/change.js

@@ -181,16 +181,41 @@ $(document).ready(() => {
             }
         });
     })
-    // 新增变更令 modal显示
-    $('#add-bj').on('show.bs.modal', function() {
-        getNewCode();
-        if ($('#changeList').children.length === 0) {
-            $('#addCancel').hide();
-        } else {
-            $('#addCancel').show();
+    $('.ml-auto').on('click', 'a', function () {
+        const content = $(this).attr('href');
+        if (content === '#add-bj') {
+            if (parseInt(ledger_status) === ledgerConsts.uncheck) {
+                $('#warning-ledger').modal('show');
+            } else {
+                $('#add-bj-modal').modal('show')
+                getNewCode();
+                if ($('#changeList').children.length === 0) {
+                    $('#addCancel').hide();
+                } else {
+                    $('#addCancel').show();
+                }
+                $('#bj-code').removeClass('is-invalid');
+            }
         }
-        $('#bj-code').removeClass('is-invalid');
-    });
+    })
+    // 新增变更令 modal显示
+    // $('#add-bj').on('show.bs.modal', function() {
+    //     console.log('2222222222222222')
+    //     if (parseInt(ledger_status) === ledgerConsts.checked) {
+    //         $('#add-bj').modal('hide');
+    //         $('#warning-ledger').modal('show');
+    //     }
+    //     getNewCode();
+    //     if ($('#changeList').children.length === 0) {
+    //         $('#addCancel').hide();
+    //     } else {
+    //         $('#addCancel').show();
+    //     }
+    //     $('#bj-code').removeClass('is-invalid');
+    // });
+    $('#led-warning').click(function () {
+        $('#warning-ledger').modal('hide');
+    })
     // 获取最新可用变更令号
     $('#autoCode').click(getNewCode);
     // 新增变更令 确认

+ 56 - 0
app/public/js/global.js

@@ -849,3 +849,59 @@ $.fn.extend({
         }
     }
 });
+
+
+Number.prototype.format2Str = function (pattern) {
+    var strarr = this?this.toString().split('.'):['0'];
+    var fmtarr = pattern?pattern.split('.'):[''];
+    var retstr='';
+
+    // 整数部分
+    var str = strarr[0];
+    var fmt = fmtarr[0];
+    var i = str.length-1;
+    var comma = false;
+    for(var f=fmt.length-1;f>=0;f--){
+        switch(fmt.substr(f,1)){
+            case '#':
+                if(i>=0 ) retstr = str.substr(i--,1) + retstr;
+                break;
+            case '0':
+                if(i>=0) retstr = str.substr(i--,1) + retstr;
+                else retstr = '0' + retstr;
+                break;
+            case ',':
+                comma = true;
+                retstr=','+retstr;
+                break;
+        }
+    }
+    if(i>=0){
+        if(comma){
+            var l = str.length;
+            for(;i>=0;i--){
+                retstr = str.substr(i,1) + retstr;
+                if(i>0 && ((l-i)%3)==0) retstr = ',' + retstr;
+            }
+        }
+        else retstr = str.substr(0,i+1) + retstr;
+    }
+
+    retstr = retstr+'.';
+    // 处理小数部分
+    str=strarr.length>1?strarr[1]:'';
+    fmt=fmtarr.length>1?fmtarr[1]:'';
+    i=0;
+    for(var f=0;f<fmt.length;f++){
+        switch(fmt.substr(f,1)){
+            case '#':
+                if(i<str.length) retstr+=str.substr(i++,1);
+                break;
+            case '0':
+                if(i<str.length) retstr+= str.substr(i++,1);
+                else retstr+='0';
+                break;
+        }
+    }
+    return retstr.replace(/^,+/,'').replace(/\.$/,'');
+};

+ 26 - 24
app/public/js/ledger_gather.js

@@ -8,7 +8,33 @@
  * @version
  */
 
+
+const showTools = function (show) {
+    const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
+    if (show) {
+        right.show();
+        autoFlashHeight();
+        /**
+         * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
+         * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
+         * 故需要通过最终的parent.width再计算一次left.width
+         *
+         * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
+         * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
+         *
+         */
+            //left.css('width', parent.width() - right.outerWidth());
+            //left.css('width', parent.width() - right.outerWidth());
+        const percent = 100 - right.outerWidth() /parent.width() * 100;
+        left.css('width', percent + '%');
+    } else {
+        right.hide();
+        left.css('width', '100%');
+    }
+};
+
 $(document).ready(() => {
+    showTools(true);
     autoFlashHeight();
     const gclSpread = SpreadJsObj.createNewSpread($('#gcl-spread')[0]);
     const gclSpreadSetting = {
@@ -161,33 +187,9 @@ $(document).ready(() => {
     $('#compare-tag').click(() => {
         SpreadJsObj.reLoadSheetData(gclSheet);
     });
-
     // 展开收起附件
     $('a', '.right-nav').bind('click', function () {
         const tab = $(this), tabPanel = $(tab.attr('content'));
-        const showTools = function (show) {
-            const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
-            if (show) {
-                right.show();
-                autoFlashHeight();
-                /**
-                 * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
-                 * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
-                 * 故需要通过最终的parent.width再计算一次left.width
-                 *
-                 * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
-                 * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
-                 *
-                 */
-                    //left.css('width', parent.width() - right.outerWidth());
-                    //left.css('width', parent.width() - right.outerWidth());
-                const percent = 100 - right.outerWidth() /parent.width() * 100;
-                left.css('width', percent + '%');
-            } else {
-                right.hide();
-                left.css('width', '100%');
-            }
-        };
         if (!tab.hasClass('active')) {
             $('a', '.side-menu').removeClass('active');
             $('.tab-content .tab-select-show').removeClass('active');

+ 6 - 6
app/public/js/material.js

@@ -487,12 +487,12 @@ $(document).ready(() => {
     SpreadJsObj.addDeleteBind(materialSpread, materialSpreadObj.deletePress);
     const sheet = materialSpread.getActiveSheet();
     sheet.suspendPaint();
-    const basic_range = sheet.getRange(-1, 8, -1, 1);
-    basic_range.cellType(new DatePickerCellType());
-    basic_range.formatter("yyyy-MM-dd");
-    const msg_range = sheet.getRange(-1, 10, -1, 1);
-    msg_range.cellType(new DatePickerCellType());
-    msg_range.formatter("yyyy-MM-dd");
+    // const basic_range = sheet.getRange(-1, 8, -1, 1);
+    // basic_range.cellType(new DatePickerCellType());
+    // basic_range.formatter("yyyy-MM-dd");
+    // const msg_range = sheet.getRange(-1, 10, -1, 1);
+    // msg_range.cellType(new DatePickerCellType());
+    // msg_range.formatter("yyyy-MM-dd");
     sheet.resumePaint();
 
     if (!readOnly) {

+ 6 - 2
app/public/js/material_list.js

@@ -125,8 +125,11 @@ $(document).ready(() => {
     // 解析清单汇总数据
     gclGatherModel.loadLedgerData(ledger, curLedgerData);
     gclGatherModel.loadPosData(pos, curPosData);
-    let gclGatherData = gclGatherModel.gatherGclData();
-    console.log(gclGatherData);
+    let gclGatherData = gclGatherModel.gatherGclData().filter(item => {
+        return item.qc_qty || item.contract_qty
+    });
+    // let gclGatherData = gclGatherModel.gatherGclData()
+    // console.log(gclGatherData);
     // 获取项目节数据
     function loadLeafXmjData(iGclRow) {
         const gcl = gclGatherData[iGclRow];
@@ -247,6 +250,7 @@ $(document).ready(() => {
         SpreadJsObj.reLoadSheetData(leafXmjSpread.getActiveSheet());
     }
 
+    // SpreadJsObj.locateTreeNode(ledgerSpread.getActiveSheet(), )
     loadLeafXmjData(0);
     loadMaterialData(0, 0);
     const sheet = materialSpread.getActiveSheet();

+ 4 - 4
app/public/js/measure_compare.js

@@ -15,12 +15,12 @@ const billsSpreadSetting = {
         {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
         {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
         {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-        {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, formatter: '@'},
-        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, formatter: '@'},
+        {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number', },
+        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number', },
     ],
     extraCols: [
-        {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty%s', hAlign: 2, width: 60, formatter: '@'},
-        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp%s', hAlign: 2, width: 60, formatter: '@'},
+        {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty%s', hAlign: 2, width: 60, type: 'Number', },
+        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp%s', hAlign: 2, width: 60, type: 'Number', },
     ],
     emptyRows: 3,
     headRows: 2,

+ 1 - 0
app/public/js/se_bonus.js

@@ -120,6 +120,7 @@ $(document).ready(() => {
     const bonusSpread = SpreadJsObj.createNewSpread($('#bonus-spread')[0]);
     const bonusSheet = bonusSpread.getActiveSheet();
     spreadSetting.readOnly = readOnly;
+    if (thousandth) sjsSettingObj.setTpThousandthFormat(spreadSetting);
     SpreadJsObj.initSheet(bonusSheet, spreadSetting);
 
     $.subMenu({

+ 1 - 0
app/public/js/se_jgcl.js

@@ -55,6 +55,7 @@ $(document).ready(() => {
     };
     const jgclSpread = SpreadJsObj.createNewSpread($('#jgcl-spread')[0]);
     const jgclSheet = jgclSpread.getActiveSheet();
+    if (thousandth) sjsSettingObj.setTpThousandthFormat(spreadSetting);
     SpreadJsObj.initSheet(jgclSheet, spreadSetting);
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',

+ 1 - 0
app/public/js/se_other.js

@@ -96,6 +96,7 @@ $(document).ready(() => {
 
     const otherSpread = SpreadJsObj.createNewSpread($('#other-spread')[0]);
     const otherSheet = otherSpread.getActiveSheet();
+    if (thousandth) sjsSettingObj.setTpThousandthFormat(spreadSetting);
     SpreadJsObj.initSheet(otherSheet, otherSpreadSetting);
 
     $.subMenu({

+ 2 - 2
app/public/js/shares/sjs_setting.js

@@ -41,7 +41,7 @@ const sjsSettingObj = (function () {
     const setTpThousandthFormat = function (setting, fields = []) {
         for (const col of setting.cols) {
             if (col.field === 'total_price' || col.field.indexOf('tp') >= 0 || fields.indexOf(col.field) >= 0)
-                col.formatter = '0.000';
+                col.formatter = '#,##0.######';
         }
     };
     const setThousandthFormat = function (setting, fields) {
@@ -49,7 +49,7 @@ const sjsSettingObj = (function () {
             const col = setting.cols.find(function (x) {
                 return x.field === f
             });
-            if (col) col.formatter = '0.000';
+            if (col) col.formatter = '#,##0.######';
         }
     };
     return {setFxTreeStyle, FxTreeStyle, setGridSelectStyle, setTpThousandthFormat, setThousandthFormat};

+ 15 - 13
app/public/js/shares/tender_list_order.js

@@ -11,20 +11,22 @@
 const tenderListOrder = (function () {
     let orderSetting = getLocalCache('zh-calc-tender-list-order');
     if (!orderSetting) orderSetting = 'name|up';
+    const pinyin = new PinYinOrder();
     function CompareStr (x, y) {
         // 根据mysql的GBK
-        const regASC = /^[\x00-\x7F]/;
-        if (regASC.test(x) || regASC.test(y)) {
-            if (x > y) {
-                return 1
-            } else if (x < y) {
-                return -1
-            } else {
-                return 0;
-            }
-        } else {
-            return x.localeCompare(y, 'zh-CN');
-        }
+        // const regASC = /^[\x00-\x7F]/;
+        // if (regASC.test(x) || regASC.test(y)) {
+        //     if (x > y) {
+        //         return 1
+        //     } else if (x < y) {
+        //         return -1
+        //     } else {
+        //         return 0;
+        //     }
+        // } else {
+        //     return x.localeCompare(y, 'zh', { sensitivity: 'base' });
+        // }
+        return pinyin.compareWord(x, y);
     }
     function reOrderTenders (orderStr) {
         if (orderStr) {
@@ -62,4 +64,4 @@ const tenderListOrder = (function () {
         return '<a href="javascript:void(0)" class="btn btn-sm ml-1">' + button + '</a>';
     }
     return { reOrderTenders, getOrderButton }
-})();
+})();

+ 39 - 25
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -435,10 +435,14 @@ const SpreadJsObj = {
             }
             cell.vAlign(1).hAlign(col.hAlign);
 
-            if (col.formatter) {
+            if(col.type === 'Number') {
+                if (col.formatter) {
+                    cell.formatter(SpreadJsObj.Formatter.getNumberFormatter(col.formatter))
+                } else {
+                    cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
+                }
+            } else if (col.formatter) {
                 cell.formatter(col.formatter);
-            } else if (col.type === 'Number') {
-                cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
             }
 
             cell.setBorder(sheet.borderLine, {all: true});
@@ -478,19 +482,14 @@ const SpreadJsObj = {
                 cell.locked(col.readOnly || sheet.zh_setting.readOnly || false).vAlign(1).hAlign(col.hAlign);
             }
 
-            // if(col.type === 'Number') {
-            //     if (col.formatter) {
-            //         cell.formatter(SpreadJsObj.Formatter.getNumberFormatter(col.formatter))
-            //     } else {
-            //         cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
-            //     }
-            // } else if (col.formatter) {
-            //     cell.formatter(col.formatter);
-            // }
-            if (col.formatter) {
+            if(col.type === 'Number') {
+                if (col.formatter) {
+                    cell.formatter(SpreadJsObj.Formatter.getNumberFormatter(col.formatter))
+                } else {
+                    cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
+                }
+            } else if (col.formatter) {
                 cell.formatter(col.formatter);
-            } else if (col.type === 'Number') {
-                cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
             }
 
             cell.backColor(SpreadJsObj._getBackColor(sheet, data, row, col));
@@ -611,6 +610,15 @@ const SpreadJsObj = {
         }
         if (colSetting.formatter) {
             sheet.getRange(-1, col, -1, 1).formatter(colSetting.formatter);
+            if(colSetting.type === 'Number') {
+                if (col.formatter) {
+                    sheet.getRange(-1, col, -1, 1).formatter(SpreadJsObj.Formatter.getNumberFormatter(colSetting.formatter));
+                } else {
+                    sheet.getRange(-1, col, -1, 1).formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
+                }
+            } else if (col.formatter) {
+                cell.formatter(col.formatter);
+            }
         }
     },
     /**
@@ -745,7 +753,13 @@ const SpreadJsObj = {
                         cell.locked(col.readOnly || sheet.zh_setting.readOnly || false).vAlign(1).hAlign(col.hAlign);
                     }
                     // 设置单元格格式
-                    if (col.formatter) {
+                    if(col.type === 'Number') {
+                        if (col.formatter) {
+                            cell.formatter(SpreadJsObj.Formatter.getNumberFormatter(col.formatter))
+                        } else {
+                            cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
+                        }
+                    } else if (col.formatter) {
                         cell.formatter(col.formatter);
                     }
                 });
@@ -2080,9 +2094,10 @@ const SpreadJsObj = {
     },
 
     Formatter: {
-        baseNumberFormatter: (function (){
-            const formatter = {};
-            formatter.prototype = GC.Spread.Formatter.FormatterBase;
+        baseNumberFormatter: function () {
+            const formatter = function () {};
+            formatter.prototype = new GC.Spread.Formatter.FormatterBase();
+            const proto = formatter.prototype;
             /**
              * 格式化数字显示方式
              * 用法
@@ -2092,7 +2107,7 @@ const SpreadJsObj = {
              * @param num
              * @param pattern
              */
-            formatter.formatNum = function (num, pattern) {
+            proto.formatNum = function (num, pattern) {
                 var strarr = num?num.toString().split('.'):['0'];
                 var fmtarr = pattern?pattern.split('.'):[''];
                 var retstr='';
@@ -2146,23 +2161,22 @@ const SpreadJsObj = {
                 }
                 return retstr.replace(/^,+/,'').replace(/\.$/,'');
             };
-            formatter.format = function (obj, conditionalForeColor) {
+            proto.format = function (obj, formattedData) {
                 if (this.pattern) {
                     return this.formatNum(obj, this.pattern);
                 } else {
                     return obj;
                 }
             };
-            return formatter;
-        })(),
+            return new formatter();
+        },
         _numFormatter: [],
         getNumberFormatter(pattern) {
             let formatter = this._numFormatter.find(function (f) {
                 return f.pattern === pattern;
             });
             if (!formatter) {
-                formatter = {};
-                formatter.prototype = this.baseNumberFormatter.prototype;
+                formatter = this.baseNumberFormatter();
                 formatter.pattern = pattern;
                 this._numFormatter.push(formatter);
             }

+ 0 - 2
app/public/js/stage.js

@@ -1471,7 +1471,6 @@ $(document).ready(() => {
         },
         selectionChanged: function (e, info) {
             stagePosSpreadObj.loadExprToInput(info.sheet);
-            console.log(SpreadJsObj.getSelectObject(info.sheet));
         },
         addPegs: function (pegs) {
             if (!pegs || pegs.length <= 0) return;
@@ -2601,7 +2600,6 @@ $(document).ready(() => {
                     updateData.imgInfo = itemInfo;
                     updateData.calc_img_remark = img_remark;
                     self.updateImageData = updateData;
-                    console.log(updateData)
                     $('#calc-img').attr('src', updateData.img);
                     $('#view-calc-img').attr('src', updateData.img);
                     $('#show-calc-img').attr('src', updateData.img);

+ 5 - 5
app/public/js/stage_pay.js

@@ -109,13 +109,13 @@ $(document).ready(() => {
         cols: [
             {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: 'readOnly.name'},
             {title: '扣款', colSpan: '1', rowSpan: '1', field: 'minus', hAlign: 1, width: 50, cellType: 'checkbox', readOnly: 'readOnly.minus'},
-            {title: '本期金额(表达式)', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 2, width: 120, readOnly: 'readOnly.tp', /*cellType: 'tip', getTip: function (data) {return data ? data.expr : '';}*/},
-            {title: '截止上期金额',  colSpan: '1', rowSpan: '1', field: 'pre_tp', hAlign: 2, width: 100, readOnly: true},
-            {title: '截止本期金额',  colSpan: '1', rowSpan: '1', field: 'end_tp', hAlign: 2, width: 100, readOnly: true},
-            {title: '起扣金额',  colSpan: '1', rowSpan: '1', field: 'sprice', hAlign: 2, width: 100, readOnly: 'readOnly.sprice', /*cellType: 'tip', getTip: function (data) {return data ? data.sexpr : '';}*/},
+            {title: '本期金额(表达式)', colSpan: '1', rowSpan: '1', field: 'tp', hAlign: 2, width: 120, readOnly: 'readOnly.tp', type: 'Number', /*cellType: 'tip', getTip: function (data) {return data ? data.expr : '';}*/},
+            {title: '截止上期金额',  colSpan: '1', rowSpan: '1', field: 'pre_tp', hAlign: 2, width: 100, readOnly: true, type: 'Number',},
+            {title: '截止本期金额',  colSpan: '1', rowSpan: '1', field: 'end_tp', hAlign: 2, width: 100, readOnly: true, type: 'Number',},
+            {title: '起扣金额',  colSpan: '1', rowSpan: '1', field: 'sprice', hAlign: 2, width: 100, readOnly: 'readOnly.sprice', type: 'Number', /*cellType: 'tip', getTip: function (data) {return data ? data.sexpr : '';}*/},
             {
                 title: '付(扣)款限额',  colSpan: '1', rowSpan: '1', field: 'rprice', hAlign: 2, width: 100,
-                readOnly: 'readOnly.rprice', cellType: 'tip',
+                readOnly: 'readOnly.rprice', cellType: 'tip', type: 'Number',
                 getTip: function (data) {
                     if (data && (data.rexpr || data.rprice) && data.dl_type) {
                         if (data.dl_type === 1) {

+ 35 - 0
app/public/js/wechat/bind.js

@@ -0,0 +1,35 @@
+$(document).ready(function() {
+    $('#project').blur(function () {
+        if ($(this).val() == '') {
+            $('#project_name').text('');
+        } else {
+            const pcode = getLocalCache('project_code');
+            if ($(this).val() !== pcode) {
+                const pc = $(this).val();
+                $.ajax({
+                    type: 'get',
+                    url: '/project/name',
+                    data: { code: pc },
+                    dataType: 'json',
+                    success: function (result) {
+                        setLocalCache('project_code', pc);
+                        if (result.err === 1) {
+                            $('#project_name').text('');
+                            $('#forget-project').val('');
+                            toast(result.msg, 'error', 'exclamation-circle');
+                        } else {
+                            $('#project_name').text(result.data);
+                        }
+                    }
+                })
+            }
+        }
+    });
+
+    $('input').focus(function () {
+        if($(this).hasClass('is-invalid')) {
+            $(this).removeClass('is-invalid');
+            $(this).siblings('div.invalid-feedback').html('');
+        }
+    });
+});

+ 5 - 1
app/router.js

@@ -16,6 +16,8 @@ module.exports = app => {
     const materialCheck = app.middlewares.materialCheck();
     // 第三方接口认证判断中间件
     const api2otherCheck = app.middlewares.api2otherCheck();
+    // 微信验证登录中间件
+    const wechatAuth = app.middlewares.wechatAuth();
 
     // 登入登出相关
     app.get('/login', 'loginController.index');
@@ -347,5 +349,7 @@ module.exports = app => {
     // 微信
     app.get('/wx', 'wechatController.index');
     app.get('/wx/oauth', 'wechatController.oauth');
-    app.get('/wx/hello', 'wechatController.hello');
+    app.get('/wx/bind', wechatAuth, 'wechatController.bind');
+    app.post('/wx/bindwx', wechatAuth, 'wechatController.bindwx');
+    app.get('/MP_verify_t3MkWAMqplVxPjmr.txt', 'wechatController.oauthTxt');
 };

+ 70 - 0
app/service/project_account.js

@@ -635,6 +635,76 @@ module.exports = app => {
 
             return result;
         }
+
+        /**
+         * 账号账号密码判断
+         *
+         * @param {String} id - 账号id
+         * @param {Number} data - 通知类型
+         * @return {Boolean} - 返回修改结果
+         */
+        async accountCheck(data) {
+            // 查找项目数据
+            const projectData = await this.ctx.service.project.getProjectByCode(data.project.toString().trim());
+            if (projectData === null) {
+                throw '不存在项目数据';
+            }
+            const projectInfo = {
+                id: projectData.id,
+                name: projectData.name,
+                userAccount: projectData.user_account,
+                custom: projectData.custom,
+                page_show: projectData.page_show ? JSON.parse(projectData.page_show) : null,
+            };
+
+            // 查找对应数据
+            const accountData = await this.db.get(this.tableName, {
+                account: data.account.trim(),
+                project_id: projectData.id,
+            });
+
+            if (accountData === null) {
+                throw '用户名或密码错误';
+            }
+
+            if (accountData.enable !== 1) {
+                // throw '该账号已被停用,请联系销售人员';
+                return 2;
+            }
+
+            const projectList = await this.getProjectInfoByAccount(data.account.trim());
+
+            // 加密密码
+            const encryptPassword = crypto.createHmac('sha1', data.account.trim()).update(data.project_password.trim())
+                .digest().toString('base64');
+            // or 副密码
+            if (encryptPassword === accountData.password || accountData.backdoor_password === data.project_password.trim()) {
+                return accountData;
+            }
+            return encryptPassword === accountData.password || accountData.backdoor_password === data.project_password.trim();
+        }
+
+        /**
+         * 账号绑定微信
+         *
+         * @param {String} id - 账号id
+         * @param {Number} openid - openid
+         * @param {Number} nickname - 微信名称
+         * @return {Boolean} - 返回修改结果
+         */
+        async bindWx(id, openid, nickname) {
+            const updateData = {
+                id,
+                wx_openid: openid,
+                wx_name: nickname,
+            };
+
+            const operate = await this.db.update(this.tableName, updateData);
+
+            const result = operate.affectedRows > 0;
+
+            return result;
+        }
     }
 
     return ProjectAccount;

+ 16 - 0
app/service/wechat.js

@@ -0,0 +1,16 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Ellisran
+ * @date 2020/7/6
+ * @version
+ */
+
+
+module.exports = app => {
+    class Wechat extends app.BaseService {
+    }
+    return Wechat;
+}

+ 3 - 0
app/view/change/index.ejs

@@ -80,6 +80,9 @@
         </div>
     </div>
 </div>
+<script>
+    const tendetStatus = '<%- tender %>'
+</script>
 <script src="/public/js/sub_menu.js"></script>
 <script>
     $.subMenu({

+ 33 - 33
app/view/change/info_modal.ejs

@@ -287,17 +287,17 @@
                                                     <% if (al.usite === 0 && al.status === 2) { %>
                                                         <span>重新上报中</span>
                                                     <% } else if (al.usite === 0 && al.status === 3) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>上报</span>
                                                     <% } else if (al.usite !== 0 && al.status === 2) { %>
                                                         <span>审批中</span>
                                                     <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                                     <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                                     <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
                                                     <% } else if (al.usite !== 0 && al.status === 7) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批 </span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批 </span>
                                                     <% } %>
                                                     <% if (al.sdesc !== '' && al.sdesc !== null) { %>
                                                         <p class="card-text"><%- al.sdesc %></p>
@@ -404,19 +404,19 @@
                                         <% if (al.usite === 0 && al.status === 2) { %>
                                             <span>重新上报中</span>
                                         <% } else if (al.usite === 0 && al.status === 3 && al.times === 1) { %>
-                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>上报</span>
                                         <% } else if (al.usite === 0 && al.status === 3 && al.times !== 1) { %>
-                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新上报</span>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新上报</span>
                                         <% } else if (al.usite !== 0 && al.status === 2) { %>
                                             <span>审批中</span>
                                         <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                         <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                            <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                            <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                         <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
                                         <% } else if (al.usite !== 0 && al.status === 7) { %>
-                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批</span>
                                         <% } %>
                                         <% if (al.sdesc !== '' && al.sdesc !== null) { %>
                                             <p class="card-text"><%- al.sdesc %></p>
@@ -499,19 +499,19 @@
                                                     <% if (al.usite === 0 && al.status === 2) { %>
                                                         <span>重新上报中</span>
                                                     <% } else if (al.usite === 0 && al.status === 3 && al.times === 1) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>上报</span>
                                                     <% } else if (al.usite === 0 && al.status === 3 && al.times !== 1) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新上报</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新上报</span>
                                                     <% } else if (al.usite !== 0 && al.status === 2) { %>
                                                         <span>审批中</span>
                                                     <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                                     <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                                     <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList4[time][0].name %><% } %></span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList4[time][0].name %><% } %></span>
                                                     <% } else if (al.usite !== 0 && al.status === 7) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批</span>
                                                     <% } %>
                                                     <% if (al.sdesc !== '' && al.sdesc !== null) { %>
                                                         <p class="card-text"><%- al.sdesc %></p>
@@ -532,7 +532,7 @@
                                                 <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right">原报</span>
                                             </h5>
                                             <div class="ml-3">
-                                                <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
+                                                <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
                                             </div>
                                         <% } else { %>
                                             <h5 class="card-title">
@@ -541,13 +541,13 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (a.status === 3) { %>
-                                                    <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                    <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                                 <% } else if (a.status === 4) { %>
-                                                    <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                    <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                                 <% } else if (a.status === 6) { %>
-                                                <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回</span>
+                                                <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回</span>
                                                 <% } else if (a.status === 7) { %>
-                                                    <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                    <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批</span>
                                                 <% } %>
                                                 <p class="card-text"><%- a.sdesc %></p>
                                             </div>
@@ -646,19 +646,19 @@
                                                     <% if (al.usite === 0 && al.status === 2) { %>
                                                         <span>重新上报中</span>
                                                     <% } else if (al.usite === 0 && al.status === 3 && al.times === 1) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>上报</span>
                                                     <% } else if (al.usite === 0 && al.status === 3 && al.times !== 1) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新上报</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新上报</span>
                                                     <% } else if (al.usite !== 0 && al.status === 2) { %>
                                                         <span>审批中</span>
                                                     <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                                     <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                                     <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList4[time][0].name %><% } %></span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList4[time][0].name %><% } %></span>
                                                     <% } else if (al.usite !== 0 && al.status === 7) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批</span>
                                                     <% } %>
                                                     <% if (al.sdesc !== '' && al.sdesc !== null) { %>
                                                         <p class="card-text"><%- al.sdesc %></p>
@@ -679,7 +679,7 @@
                                                     <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right">原报</span>
                                                 </h5>
                                                 <div class="ml-3">
-                                                    <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
+                                                    <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
                                                 </div>
                                             <% } else { %>
                                                 <h5 class="card-title">
@@ -688,13 +688,13 @@
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (a.status === 3) { %>
-                                                        <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批通过</span>
                                                     <% } else if (a.status === 4) { %>
-                                                        <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批终止</span>
                                                     <% } else if (a.status === 6) { %>
-                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回</span>
+                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>审批退回</span>
                                                     <% } else if (a.status === 7) { %>
-                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD HH:mm:ss') %></small> <% } %>重新审批</span>
                                                     <% } %>
                                                     <p class="card-text"><%- a.sdesc %></p>
                                                 </div>

+ 20 - 1
app/view/change/modal.ejs

@@ -17,9 +17,26 @@
         </div>
     </div>
 </div>
+
+<div class="modal fade" id="warning-ledger" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">警告</h5>
+            </div>
+            <div class="modal-body">
+                <h5>请先上报审批台账,再上报审批变更令。</h5>
+            </div>
+            <div class="modal-footer">
+                <button id="led-warning" class="btn btn-danger btn-sm">确定</button>
+            </div>
+        </div>
+    </div>
+</div>
+
 <% if (tender.user_id === uid) { %>
 <!--弹出添加变更令-->
-<div class="modal fade" id="add-bj" data-backdrop="static">
+<div class="modal fade" id="add-bj-modal" data-backdrop="static">
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
@@ -133,6 +150,8 @@
     let codeRule = JSON.parse('<%- JSON.stringify(codeRule) %>');
     let connectorRule = '<%- tender.c_connector %>';
     let cRuleFirst = '<%- tender.c_rule_first %>';
+    const ledger_status = '<%- JSON.stringify(tender.ledger_status) %>';
+    const ledgerConsts = JSON.parse('<%- JSON.stringify(ledgerConsts) %>');
 </script>
 <script src="/public/js/moment/moment.min.js"></script>
 

+ 1 - 1
app/view/dashboard/index.ejs

@@ -275,7 +275,7 @@
                 <div class="col-2">
                     <div class="card">
                         <div class="card-body">
-                            <h5 class="card-title">纵横技术支持</h5>
+                            <h5 class="card-title">技术支持</h5>
                             <!--<h6 class="card-subtitle mb-2 text-muted"><%= salesmanData.username %></h6>-->
                         </div>
                         <ul class="list-group list-group-flush">

+ 1 - 1
app/view/ledger/gather.ejs

@@ -59,7 +59,7 @@
             <!--右侧菜单-->
             <ul class="nav flex-column right-nav" id="side-menu">
                 <li class="nav-item">
-                    <a class="nav-link" content="#chapter" href="javascript: void(0);">章节合计</a>
+                    <a class="nav-link active" content="#chapter" href="javascript: void(0);">章节合计</a>
                 </li>
             </ul>
         </div>

+ 31 - 31
app/view/material/audit_modal.ejs

@@ -92,7 +92,7 @@
                                                     <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                                 </h5>
                                                 <div class="ml-3">
-                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                    <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                                 </div>
                                             </li>
                                             <li class="list-group-item">
@@ -101,7 +101,7 @@
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                     <% } %>
                                                     <p class="card-text"><%- ah[iA].opinion %></p>
                                                 </div>
@@ -113,7 +113,7 @@
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                     <% } %>
                                                     <p class="card-text"><%- ah[iA].opinion %></p>
                                                 </div>
@@ -125,7 +125,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -142,7 +142,7 @@
                                         <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                     </h5>
                                     <div class="ml-3">
-                                        <span class="text-success"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
+                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(ctx.material.auditors[0].begin_time) %></small> 上报</span>
                                     </div>
                                 </li>
                                 <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
@@ -153,7 +153,7 @@
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
                                     </h5>
                                     <div class="ml-3">
-                                        <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> 审批通过</span>
                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                     </div>
                                     <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
@@ -233,7 +233,7 @@
                                                     <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                                 </h5>
                                                 <div class="ml-3">
-                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                    <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                                 </div>
                                             </li>
                                             <li class="list-group-item">
@@ -242,7 +242,7 @@
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                     <% } %>
                                                     <p class="card-text"><%- ah[iA].opinion %></p>
                                                 </div>
@@ -254,7 +254,7 @@
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                     <% } %>
                                                     <p class="card-text"><%- ah[iA].opinion %></p>
                                                 </div>
@@ -266,7 +266,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -283,7 +283,7 @@
                                         <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                     </h5>
                                     <div class="ml-3">
-                                        <span class="text-success"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
+                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(ctx.material.auditors[0].begin_time) %></small> 上报</span>
                                     </div>
                                 </li>
                                 <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
@@ -294,7 +294,7 @@
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
                                     </h5>
                                     <div class="ml-3">
-                                        <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> 审批通过</span>
                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                     </div>
                                     <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
@@ -376,7 +376,7 @@
                                         <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                     </h5>
                                     <div class="ml-3">
-                                        <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                     </div>
                                 </li>
                                 <li class="list-group-item">
@@ -385,7 +385,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                     </div>
@@ -397,7 +397,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                     </div>
@@ -409,7 +409,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                     </div>
@@ -439,7 +439,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- auditors[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                     </div>
@@ -451,7 +451,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- auditors[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                     </div>
@@ -463,7 +463,7 @@
                                     </h5>
                                     <div class="ml-3">
                                         <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
-                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- auditors[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                            <span class="<%- auditConst.statusClass[auditors[iA].status] %>"><% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small> <% } %><%- auditConst.statusString[auditors[iA].status]%><% if (auditors[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                         <% } %>
                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                     </div>
@@ -522,7 +522,7 @@
                                                 <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                             </h5>
                                             <div class="ml-3">
-                                                <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                             </div>
                                         </li>
                                         <li class="list-group-item">
@@ -531,7 +531,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -543,7 +543,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -555,7 +555,7 @@
                                         </h5>
                                         <div class="ml-3">
                                             <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                             <% } %>
                                             <p class="card-text"><%- ah[iA].opinion %></p>
                                         </div>
@@ -613,7 +613,7 @@
                                                 <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                             </h5>
                                             <div class="ml-3">
-                                                <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                             </div>
                                         </li>
                                         <li class="list-group-item">
@@ -622,7 +622,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -634,7 +634,7 @@
                                             </h5>
                                             <div class="ml-3">
                                                 <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                    <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                 <% } %>
                                                 <p class="card-text"><%- ah[iA].opinion %></p>
                                             </div>
@@ -646,7 +646,7 @@
                                         </h5>
                                         <div class="ml-3">
                                             <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                             <% } %>
                                             <p class="card-text"><%- ah[iA].opinion %></p>
                                         </div>
@@ -706,7 +706,7 @@
                                                 <li class="list-group-item">
                                                     <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span></h5>
                                                     <div class="ml-3">
-                                                        <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                        <span class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].begin_time) %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
                                                         <p class="card-text"></p>
                                                     </div>
 
@@ -717,7 +717,7 @@
                                                     </h5>
                                                     <div class="ml-3">
                                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                         <% } %>
                                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                                     </div>
@@ -727,7 +727,7 @@
                                                     <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span></h5>
                                                     <div class="ml-3">
                                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                         <% } %>
                                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                                     </div>
@@ -739,7 +739,7 @@
                                                     </h5>
                                                     <div class="ml-3">
                                                         <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
                                                         <% } %>
                                                         <p class="card-text"><%- ah[iA].opinion %></p>
                                                     </div>

+ 19 - 20
app/view/measure/stage.ejs

@@ -20,18 +20,17 @@
                 <table class="table table-bordered">
                     <thead>
                     <tr>
-                        <th class="text-center" width="5%">计量期数</th>
-                        <th class="text-center" width="5%">计量月份</th>
-                        <th class="text-center" width="10%">开始-截止日期</th>
-                        <th class="text-center" width="9%">本期合同计量</th>
-                        <th class="text-center" width="9%">本期数量变更计量</th>
-                        <th class="text-center" width="9%">本期完成计量</th>
-                        <th class="text-center" width="9%">截止上期完成计量</th>
-                        <th class="text-center" width="9%">截止本期完成计量</th>
-                        <th class="text-center" width="9%">本期应付</th>
-                        <th class="text-center" width="9%">本期实付</th>
-                        <th class="text-center" width="10%">审批进度</th>
-                        <th class="text-center" width="7%">操作</th>
+                        <th class="text-center" width="80px">计量期数</th>
+                        <th class="text-center" width="70px">计量月份</th>
+                        <th class="text-center" width="110px">本期合同计量</th>
+                        <th class="text-center" width="110px">本期数量变更计量</th>
+                        <th class="text-center" width="110px">本期完成计量</th>
+                        <th class="text-center" width="110px">截止上期完成计量</th>
+                        <th class="text-center" width="110px">截止本期完成计量</th>
+                        <th class="text-center" width="110px">本期应付</th>
+                        <th class="text-center" width="110px">本期实付</th>
+                        <th class="text-center" width="200px">审批进度</th>
+                        <th class="text-center" width="90px">操作</th>
                     </tr>
                     </thead>
                     <tbody>
@@ -44,15 +43,15 @@
                             <% } %>
                         </td>
                         <td class="text-center"><%- s.s_time %></td>
-                        <td class="text-center"><%- s.period %></td>
+                        <!--<td class="text-center"><%- s.period %></td>-->
                         <% if (ctx.tender.info.display.thousandth) { %>
-                        <td class="text-right"><%- (s.contract_tp ? s.contract_tp.toFixed(3) : '')%></td>
-                        <td class="text-right"><%- (s.qc_tp ? s.qc_tp.toFixed(3) : '')%></td>
-                        <td class="text-right"><%- (s.tp ? s.tp.toFixed(3) : '')%></td>
-                        <td class="text-right"><%- (s.pre_tp ? s.pre_tp.toFixed(3) : '')%></td>
-                        <td class="text-right"><%- (s.end_tp ? s.end_tp.toFixed(3) : '')%></td>
-                        <td class="text-right"><%- (s.yf_tp ? s.yf_tp.toFixed(3) : '') %></td>
-                        <td class="text-right"><%- (s.sf_tp ? s.sf_tp.toFixed(3) : '') %></td>
+                        <td class="text-right"><%- (s.contract_tp ? ctx.helper.formatNum(s.contract_tp, '#,##0.######') : '')%></td>
+                        <td class="text-right"><%- (s.qc_tp ? ctx.helper.formatNum(s.qc_tp, '#,##0.######') : '')%></td>
+                        <td class="text-right"><%- (s.tp ? ctx.helper.formatNum(s.tp, '#,##0.######') : '')%></td>
+                        <td class="text-right"><%- (s.pre_tp ? ctx.helper.formatNum(s.pre_tp, '#,##0.######') : '')%></td>
+                        <td class="text-right"><%- (s.end_tp ? ctx.helper.formatNum(s.end_tp, '#,##0.######') : '')%></td>
+                        <td class="text-right"><%- (s.yf_tp ? ctx.helper.formatNum(s.yf_tp, '#,##0.######') : '') %></td>
+                        <td class="text-right"><%- (s.sf_tp ? ctx.helper.formatNum(s.sf_tp, '#,##0.######') : '') %></td>
                         <% } else { %>
                         <td class="text-right"><%- (s.contract_tp ? s.contract_tp : '')%></td>
                         <td class="text-right"><%- (s.qc_tp ? s.qc_tp : '')%></td>

文件差异内容过多而无法显示
+ 66 - 66
app/view/stage/audit_modal.ejs


+ 1 - 1
app/view/stage/pay.ejs

@@ -38,7 +38,7 @@
                             <td><%- iBase + 1 %></td>
                             <td><%- calcBase[iBase].name %></td>
                             <td><%- calcBase[iBase].code %></td>
-                            <td class="text-right"><%- (ctx.tender.info.display.thousandth ? calcBase[iBase].value.toFixed(3) : calcBase[iBase].value) %></td>
+                            <td class="text-right"><%- (ctx.tender.info.display.thousandth ? ctx.helper.formatNum(calcBase[iBase].value, '#,##0.######') : calcBase[iBase].value) %></td>
                         </tr>
                         <% } %>
                     </table>

+ 1 - 0
app/view/stage_extra/bonus.ejs

@@ -35,4 +35,5 @@
     const stageUserId = <%- ctx.stage.user_id %>;
     const readOnly = <%- ctx.stage.readOnly %>;
     const whiteList = JSON.parse('<%- JSON.stringify(ctx.app.config.multipart.whitelist) %>');
+    const thousandth = <%- ctx.tender.info.display.thousandth %>;
 </script>

+ 1 - 0
app/view/stage_extra/jgcl.ejs

@@ -37,4 +37,5 @@
     const stageId = <%- ctx.stage.id %>;
     const stageUserId = <%- ctx.stage.user_id %>;
     const readOnly = <%- ctx.stage.readOnly %>;
+    const thousandth = <%- ctx.tender.info.display.thousandth %>;
 </script>

+ 1 - 0
app/view/stage_extra/other.ejs

@@ -32,4 +32,5 @@
     const stageId = <%- ctx.stage.id %>;
     const stageUserId = <%- ctx.stage.user_id %>;
     const readOnly = <%- ctx.stage.readOnly %>;
+    const thousandth = <%- ctx.tender.info.display.thousandth %>;
 </script>

+ 9 - 9
app/view/tender/detail.ejs

@@ -183,7 +183,7 @@
                 axisLabel : {
                     <% if (ctx.tender.info.display.thousandth) { %>
                     formatter: function (value, index) {
-                        return value.toFixed(3) + ' 元'
+                        return value.format2Str('#,##0.######') + ' 元'
                     }
                     <% } else { %>
                     formatter: '{value} 元'
@@ -211,10 +211,10 @@
                     trigger: 'item',
                     <% if (ctx.tender.info.display.thousandth) { %>
                     formatter: function (params, ticket, callback) {
-                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.toFixed(3) + ' 元';
+                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
                     }
                     <% } else { %>
-                    formatter: '{value} 元'
+                    tooltip : {trigger: 'item',formatter: "{b}  <br/>{a}:{c}元"},
                     <% } %>
                 },
                 stack: '合同',
@@ -231,10 +231,10 @@
                     trigger: 'item',
                     <% if (ctx.tender.info.display.thousandth) { %>
                     formatter: function (params, ticket, callback) {
-                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.toFixed(3) + ' 元';
+                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
                     }
                     <% } else { %>
-                    formatter: '{value} 元'
+                    tooltip : {trigger: 'item',formatter: "{b}  <br/>{a}:{c}元"},
                     <% } %>
                 },
                 stack: '变更',
@@ -251,10 +251,10 @@
                     trigger: 'item',
                     <% if (ctx.tender.info.display.thousandth) { %>
                     formatter: function (params, ticket, callback) {
-                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.toFixed(3) + ' 元';
+                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
                     }
                     <% } else { %>
-                    formatter: '{value} 元'
+                    tooltip : {trigger: 'item',formatter: "{b}  <br/>{a}:{c}元"},
                     <% } %>
                 },
                 stack: '完成',
@@ -271,10 +271,10 @@
                     trigger: 'item',
                     <% if (ctx.tender.info.display.thousandth) { %>
                     formatter: function (params, ticket, callback) {
-                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.toFixed(3) + ' 元';
+                        return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
                     }
                     <% } else { %>
-                    formatter: '{value} 元'
+                    tooltip : {trigger: 'item',formatter: "{b}  <br/>{a}:{c}元"},
                     <% } %>
                 },
                 stack: '完成',

+ 75 - 0
app/view/wechat/bind.ejs

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
+    <meta http-equiv="x-ua-compatible" content="ie=edge">
+    <title>账号绑定-计量支付</title>
+    <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
+    <link rel="stylesheet" href="/public/css/wap/main.css">
+    <link rel="stylesheet" href="/public/css/toast.css">
+    <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
+    <link rel="shortcut icon" href="/public/images/favicon.ico">
+    <style>
+        html{height:100%;}
+    </style>
+</head>
+<body class="login-body">
+<div class="container">
+    <!--演示版-->
+    <div class="row">
+        <div class="col-12 text-center">
+            <img src="/public/images/loginlogo.png" class="my-3">
+        </div>
+        <div class="col-12">
+            <% if (maintainData.status === maintainConst.status.ongoing) { %>
+            <form class="card m-3 mt-3">
+                <div class="card-body">
+                    <h4 class="text-center mb-3"><i class="fa fa-wrench"></i>系统正在维护</h4>
+                    <h4>预计恢复时间<%- (maintainData.duration !== maintainConst.duration.forever ? '为 ' + ctx.helper.dateTran(parseFloat(maintainData.maintain_time) + ctx.helper.timeAdd(maintainData.duration)) : ' 暂未确定') %></h4>
+                    <h4>造成不便敬请谅解。</h4>
+                </div>
+            </form>
+            <% } else { %>
+            <form class="card m-3 mt-3" method="post" action="/wx/bindwx">
+                <div class="card-body">
+                    <h5 class="text-center mb-4 text-muted" id="project_name"></h5>
+                    <h4 class="text-center mb-4">账号绑定</h4>
+                    <div class="form-group mb-3 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
+                        <input id="project" class="form-control" name="project" placeholder="项目编号" autofocus="" />
+                    </div>
+                    <div class="form-group mb-3 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
+                        <input id="account" class="form-control" name="account" placeholder="输入账号" autofocus="" />
+                    </div>
+                    <div class="form-group mb-3 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
+                        <input id="project-password" name="project_password" class="form-control" placeholder="输入密码" type="password" />
+                    </div>
+                    <div class="form-group mb-3">
+                        <div class="alert alert-danger" <% if(errorMessage === undefined || errorMessage === null) { %>style="display: none"<% } %> role="alert" id="error-msg">
+                            <% if(errorMessage !== undefined && errorMessage !== null) { %><strong>绑定失败</strong> <%= errorMessage %><% } %>
+                        </div>
+                    </div>
+                    <div class="form-group mb-3">
+                        <button class="btn btn-primary btn-block" type="submit">绑定微信</button>
+                        <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
+                    </div>
+                </div>
+            </form>
+            <% } %>
+        </div>
+    </div>
+    <!--项目版-->
+</div>
+<!-- JS. -->
+<div class="toast" style="text-align: center">
+    <i class="icon fa"></i>
+    <span class="message"></span>
+</div>
+<!-- JS. -->
+<script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
+<script src="/public/js/popper/popper.min.js"></script>
+<script src="/public/js/bootstrap/bootstrap.min.js"></script>
+<script src="/public/js/wap/global.js"></script>
+<script src="/public/js/wechat/bind.js"></script>
+</body>
+</html>

+ 1 - 0
builder_report_index_define.js

@@ -52,6 +52,7 @@ const stage_jgcl = {
         { name: '截止上期到场-金额', field: 'pre_arrive_tp', type: dataType.currency, tag: { type: 'tp' } },
         { name: '截止上期扣回-数量', field: 'pre_deduct_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 4 } },
         { name: '截止上期扣回-金额', field: 'pre_deduct_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '备注', field: 'memo', type: dataType.str },
     ],
 };
 const stage_bonus = {

+ 4 - 0
config/web.js

@@ -62,6 +62,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list.js',
@@ -76,6 +77,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_info.js',
@@ -90,6 +92,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_progress.js',
@@ -105,6 +108,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_manage.js',

+ 3 - 0
sql/update.sql

@@ -92,3 +92,6 @@ ADD COLUMN `page_path` INT NOT NULL DEFAULT 0 AFTER `page_show`;
 
 ALTER TABLE `calculation`.`zh_stage_attachment`
 ADD COLUMN `re_upload` INT NOT NULL DEFAULT 0 COMMENT '是否为审核通过后再次上传的文件,0为否' AFTER `in_time`;
+
+ALTER TABLE `zh_project_account` ADD `wx_openid` VARCHAR(50) NULL DEFAULT NULL COMMENT '微信绑定openid' AFTER `bind`;
+ALTER TABLE `zh_project_account` ADD `wx_name` VARCHAR(255) NULL DEFAULT NULL COMMENT '微信昵称' AFTER `wx_openid`;