Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 2 yıl önce
ebeveyn
işleme
2dcf7cc7c8

+ 9 - 3
app/lib/rpt_data_analysis.js

@@ -1524,8 +1524,13 @@ const loadCooperationData = {
 
     },
     _completeSign(auditor) {
-        if (!auditor || !auditor.end_time) return '';
-        return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
+        if (!auditor) return '';
+        if (auditor.ass_user_id) {
+            return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
+        } else {
+            if (!auditor.end_time) return '';
+            return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
+        }
     },
     _loadImCooperationData(ctx, data, options, csRela) {
         let coSignOrder = [];
@@ -1572,7 +1577,7 @@ const loadCooperationData = {
         if (!stageAuditAss || stageAuditAss.length === 0) return null;
         if (relaId.length > 0) {
             for (const id of relaId) {
-                const c = stageCooperation.find(x => { return x.ass_ledger_id.indexOf(id) >= 0; });
+                const c = stageAuditAss.find(x => { return x.ass_ledger_id.indexOf(id) >= 0; });
                 if (c) return c;
             }
             return null;
@@ -1598,6 +1603,7 @@ const loadCooperationData = {
             if (sa.end_time) stageAuditAss.push(data.mem_stage_audit_ass.filter(x => { return x.user_id === sa.aid; }));
             if (finish && !sa.end_time) finish = false;
         }
+
         for (const d of data[options.table]) {
             const bills = data.mem_stage_bills.find(x => { return x.id === d.lid; });
             const relaId = bills ? bills.full_path.split('-').reverse() : [];

+ 2 - 0
app/service/change_ledger.js

@@ -1208,6 +1208,7 @@ module.exports = app => {
                         qtcl_expr: d.qtcl_expr,
                         check_calc: 1,
                         ccid: this.ctx.change.cid,
+                        formc: 1,
                     };
                     for (const c of d.children) {
                         c.ledger_pid = newBills.ledger_id;
@@ -1236,6 +1237,7 @@ module.exports = app => {
                                 ex_memo2: pos.ex_memo2,
                                 ex_memo3: pos.ex_memo3,
                                 ccid: this.ctx.change.cid,
+                                formc: 1,
                             };
                             this._calcExpr(newPos, 'sgfh_qty', pos.sgfh_expr, pos.sgfh_qty, precision);
                             this._calcExpr(newPos, 'sjcl_qty', pos.sjcl_expr, pos.sjcl_qty, precision);

+ 3 - 1
app/service/change_pos.js

@@ -30,7 +30,7 @@ module.exports = app => {
                 columns: ['id', 'tid', 'lid', 'name', 'quantity', 'position', 'drawing_code', 'sgfh_qty', 'sjcl_qty',
                     'qtcl_qty', 'in_time', 'porder', 'add_stage', 'sgfh_expr', 'sjcl_expr', 'qtcl_expr', 'real_qty',
                     'dagl_status', 'dagl_url', 'gxby_status', 'gxby_limit', 'dagl_limit', 'dagl_status',
-                    'ex_memo1', 'ex_memo2', 'ex_memo3', 'ccid'],
+                    'ex_memo1', 'ex_memo2', 'ex_memo3', 'ccid', 'formc'],
                 order: [['porder', 'ASC']],
             });
         }
@@ -45,6 +45,7 @@ module.exports = app => {
             data.in_time = new Date();
             data.add_user = this.ctx.session.sessionUser.accountId;
             data.ccid = cid;
+            data.formc = 1;
         }
 
         async addPos(tid, cid, data) {
@@ -388,6 +389,7 @@ module.exports = app => {
             data.in_time = new Date();
             data.add_user = this.ctx.session.sessionUser.accountId;
             data.ccid = cid;
+            data.formc = 1;
             if (data.quantity) {
                 const bills = await this.ctx.service.changeLedger.getDataById(data.lid) || await this.ctx.service.ledger.getDataById(data.lid);
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);

+ 1 - 1
app/service/stage_audit_ass.js

@@ -173,7 +173,7 @@ module.exports = app => {
         async getReportData(sid, stimes) {
             const sql = 'SELECT saa.tid, saa.sid, saa.times, saa.user_id, saa.ass_ledger_id, saa.ass_user_id, saa.name, saa.company, saa.role, pa.sign_path, pa.stamp_path' +
                 `   FROM ${this.tableName} saa LEFT JOIN ${this.ctx.service.projectAccount.tableName} pa ON saa.ass_user_id = pa.id` +
-                `   WHERE saa.sid = ? AND saa.stimes = ?`;
+                `   WHERE saa.sid = ? AND saa.times = ?`;
             return this.db.query(sql, [sid, stimes]);
         }
     }

+ 6 - 6
app/view/stage/audit_modal.ejs

@@ -267,11 +267,11 @@
                 </div>
                 <div class="modal-body">
                     <div class="row">
-                        <% if(ctx.stage.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
+                        <div class="col-4">
+                            <% if(ctx.stage.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
                             <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
                                id="hideSp">修改审批流程</a>
-                        <% } %>
-                        <div class="col-4">
+                            <% } %>
                             <div class="card mt-3">
                                 <ul class="list-group list-group-flush auditors-list">
                                     <% ctx.stage.auditors2.forEach((item, idx) => { %>
@@ -461,11 +461,11 @@
                 </div>
                 <div class="modal-body">
                     <div class="row">
-                        <% if(ctx.stage.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
+                        <div class="col-4">
+                            <% if(ctx.stage.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
                             <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
                                id="hideSp">修改审批流程</a>
-                        <% } %>
-                        <div class="col-4">
+                            <% } %>
                             <div class="card mt-3">
                                 <ul class="list-group list-group-flush auditors-list">
                                     <% ctx.stage.auditors2.forEach((item, idx) => { %>