Преглед изворни кода

多人协同,解锁控制相关

MaiXinRong пре 2 година
родитељ
комит
54dfd08953

+ 0 - 2
app/controller/stage_controller.js

@@ -186,8 +186,6 @@ module.exports = app => {
                     attData[index].in_time = moment(attData[index].in_time * 1000).format('YYYY-MM-DD');
                 }
                 renderData.attData = attData;
-                renderData.coopwd = ((ctx.stage.status === auditConst.status.uncheck || ctx.stage.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === ctx.stage.user_id)
-                    || ((ctx.stage.status === auditConst.status.checking || ctx.stage.status === auditConst.status.checkNoPre) && ctx.stage.curAuditor && ctx.stage.curAuditor.aid === ctx.session.sessionUser.accountId);
                 // 获取收方单列表
                 const sfData = await ctx.service.stageShoufang.getAllDataByCondition({ where: { sid: ctx.stage.id }, orders: [['id', 'desc']] });
                 for (const sf of sfData) {

+ 3 - 5
app/public/js/stage.js

@@ -373,17 +373,15 @@ $(document).ready(() => {
                 html.push(`<tr>`);
             }
             html.push(`<td>${p.node.code}</td>`, `<td>${p.node.name}</td>`);
-            if(coopwd) {
-                html.push('<td>', p.check ? `已解锁:${p.pwd}` : `<a name="ledger-unlock" lid="${p.ledger_id}" href="javascript: void(0);">解锁</a>`, '</td>');
-            }
+            html.push('<td>', p.check ? `已解锁:${p.pwd}` : `<a name="ledger-unlock" lid="${p.ledger_id}" href="javascript: void(0);">解锁</a>`, '</td>');
             html.push('<td>', p.company, '</td>');
             if (stage.status === auditConst.status.checking && !checkUsed(stageTree, stagePos, p.node)) {
                 html.push('<td>', '本期未计量', '</td>');
             } else if (p.check && p.confirm) {
-                html.push('<td>', moment(p.confirm_time).format('YYYY-MM-DD HH:mm') + ' ' + (coopwd ? `<a name="ledger-unconfirm" href="javascript: void(0);" lid="${p.ledger_id}">重新审批</a>` : ''), '</td>');
+                html.push('<td>', moment(p.confirm_time).format('YYYY-MM-DD HH:mm') + ' ' + `<a name="ledger-unconfirm" href="javascript: void(0);" lid="${p.ledger_id}">重新审批</a>`, '</td>');
             } else if (!p.check && p.confirm) {
                 html.push('<td>', moment(p.confirm_time).format('YYYY-MM-DD HH:mm'), '</td>');
-            } else if (p.check && !p.confirm && coopwd) {
+            } else if (p.check && !p.confirm) {
                 html.push('<td>', `<a name="ledger-confirm" href="javascript: void(0);" lid="${p.ledger_id}" class="btn btn-sm btn-success">确认</a>`, '</td>');
             } else {
                 const lockedInfo = stageTree.getLockedInfo(p.node);

+ 1 - 0
app/service/stage.js

@@ -656,6 +656,7 @@ module.exports = app => {
                     }
                 }
                 await transaction.delete(this.ctx.service.stageShoufang.tableName, { sid: id });
+                await transaction.delete(this.ctx.service.cooperationConfirm.tableName, { sid: id });
                 // 记录删除日志
                 await this.ctx.service.projectLog.addProjectLog(transaction, projectLogConst.type.stage, projectLogConst.status.delete, '第' + stageInfo.order + '期');
                 await transaction.commit();

+ 0 - 1
app/view/stage/index.ejs

@@ -533,7 +533,6 @@
     // const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
     const curAuditor = JSON.parse('<%- JSON.stringify(curAuditor) %>');
     const thirdParty = JSON.parse('<%- JSON.stringify(thirdParty) %>');
-    const coopwd = <%- coopwd %>;
     const sfAttDelPower = <%- sfAttDelPower %>;
     let sfData = JSON.parse(unescape('<%- escape(JSON.stringify(sfData)) %>'));
     const hintOver = <%- hintOver %>;

+ 2 - 2
app/view/stage/modal.ejs

@@ -477,7 +477,7 @@
                 <h5 class="modal-title">多人协同</h5>
             </div>
             <div class="modal-body">
-                <% if (coopwd) { %>
+                <% if (stage.readOnly) { %>
                     <div class="alert alert-warning">以下项目节及其子项被锁定,请输入密码解锁。</div>
                 <% } else { %>
                     <div class="alert alert-warning">以下项目节及其子项(灰色项)未确认审批。</div>
@@ -490,7 +490,7 @@
                 <div class="modal-height-300">
                     <table class="table table-hover table-bordered">
                         <thead>
-                        <tr><th>项目节编号</th><th>项目节名称</th><% if (coopwd) { %><th>解锁  </th><% } %><th>单位/协同人名称</th><th>确认数据</th></tr>
+                        <tr><th>项目节编号</th><th>项目节名称</th><th>解锁  </th><th>单位/协同人名称</th><th>确认数据</th></tr>
                         </thead>
                         <tbody id="cooperationList">
                         </tbody>

+ 4 - 1
sql/update.sql

@@ -1,2 +1,5 @@
 ALTER TABLE `zh_cooperation_confirm`
-ADD COLUMN `locked`  tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否锁定' AFTER `create_time`;
+ADD COLUMN `locked`  tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否锁定' AFTER `create_time`;
+
+ALTER TABLE `zh_s2b_spec_msg`
+ADD COLUMN `push_count`  int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '执行推送数量' AFTER `status`;