فهرست منبع

变更·计量审批和账号设置bug修复

laiguoran 6 سال پیش
والد
کامیت
cf38adec8e

+ 2 - 1
app/controller/change_controller.js

@@ -251,7 +251,8 @@ module.exports = app => {
         async info(ctx) {
             try {
                 const whiteList = this.ctx.app.config.multipart.whitelist;
-                const tenderid = ctx.session.sessionUser.tenderId !== undefined ? ctx.session.sessionUser.tenderId : ctx.params.id;
+                const tenderid = ctx.params.id !== undefined ? ctx.params.id : ctx.session.sessionUser.tenderId;
+                ctx.session.sessionUser.tenderId = tenderid;
                 const tender = await this.service.tender.getDataById(tenderid);
                 const change = await ctx.service.change.getDataByCondition({ cid: ctx.params.cid });
 

+ 1 - 1
app/controller/stage_controller.js

@@ -702,7 +702,7 @@ module.exports = app => {
         async checkAudit(ctx) {
             try {
                 await this._getStage(ctx);
-                if (!this.ctx.stage || this.ctx.stage.status !== auditConst.status.checking) {
+                if (!this.ctx.stage || (this.ctx.stage.status !== auditConst.status.checking && this.ctx.stage.status !== auditConst.status.checkNoPre)) {
                     throw '当前期数据有误';
                 }
                 if (!this.ctx.stage.curAuditor || this.ctx.stage.curAuditor.aid !== ctx.session.sessionUser.accountId) {

+ 2 - 2
app/middleware/stage_check.js

@@ -34,7 +34,7 @@ module.exports = options => {
             });
             console.log(stage);
             if (!stage) {
-                throw '期数据错误'
+                throw '期数据错误';
             }
             stage.auditors = yield this.service.stageAudit.getAuditors(stage.id, stage.times);
             stage.curAuditor = yield this.service.stageAudit.getCurAuditor(stage.id, stage.times);
@@ -58,4 +58,4 @@ module.exports = options => {
             this.redirect(this.request.headers.referer);
         }
     };
-};
+};

+ 11 - 0
app/public/js/setting.js

@@ -129,6 +129,17 @@ $(document).ready(() => {
         // 协作赋值
         $('#edit-user2 input:radio[value="' + account.cooperation + '"]').prop('checked', true);
     });
+
+    // 选择创建标段功能后可选协作办公
+    $('#edit-user2 input:checkbox').click(function () {
+        if ($(this).attr('id') === 'tender_1') {
+            if ($(this).is(':checked')) {
+                $('#edit-user2 input[name="cooperation"]').attr('disabled', false);
+            } else {
+                $('#edit-user2 input[name="cooperation"]').attr('disabled', true);
+            }
+        }
+    })
 });
 
 

+ 1 - 1
app/service/change_audit.js

@@ -252,7 +252,7 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async getAuditChange(uid) {
-            const sql = 'SELECT ca.`uid`, ca.`times`, ca.`usite`, ca.`usort`, ca.`tid`, ca.`cid`, ca.`sin_time`, ' +
+            const sql = 'SELECT ca.`uid`, ca.`times`, ca.`usite`, ca.`usort`, ca.`tid`, ca.`cid`, ca.`sin_time`, ca.`name` As `caname`, ' +
                 '    c.`code` As `ccode`, c.`name` As `cname`, c.`status` As `cstatus`, ' +
                 '    t.`name`, t.`type`, t.`user_id` ' +
                 '  FROM ?? AS ca, ?? AS c, ?? As t ' +

+ 6 - 2
app/service/project_account.js

@@ -489,9 +489,13 @@ module.exports = app => {
             }
             const updateData = {
                 id,
-                cooperation: data.cooperation,
             };
-            delete data.cooperation;
+            if (data.cooperation !== undefined && data.cooperation !== null) {
+                updateData.cooperation = data.cooperation;
+                delete data.cooperation;
+            } else {
+                updateData.cooperation = 0;
+            }
             delete data.id;
             updateData.permission = JSON.stringify(data);
 

+ 2 - 0
app/service/stage_audit.js

@@ -228,6 +228,8 @@ module.exports = app => {
                         await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times, nextAudit.order, transaction);
                         // 流程至下一审批人
                         await transaction.update(this.tableName, {id: nextAudit.id, status: auditConst.status.checking, begin_time: time});
+                        // 同步 期信息
+                        await transaction.update(this.ctx.service.stage.tableName, {id: stageId, status: auditConst.status.checking});
                     } else {
                         // 本期结束
                         // 计算并合同支付最终数据

+ 11 - 5
app/view/change/info_modal.ejs

@@ -357,8 +357,11 @@
                                     <% } %>
                                     <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small>
                                 </h5>
-                                <% if (a.sin_time !== null || (a.sdesc !== '' && a.sdesc !== null)) { %>
-                                    <p class="card-text"><%= a.sdesc %>&nbsp;<%= moment(a.sin_time).format('YYYY-MM-DD') %></p>
+                                <% if (a.sdesc !== '' && a.sdesc !== null) { %>
+                                    <p class="card-text mb-1"><%= a.sdesc %></p>
+                                <% } %>
+                                <% if (a.sin_time !== null) { %>
+                                    <p class="card-text"><small class="text-muted"><%= moment(a.sin_time).format('YYYY-MM-DD') %></small></p>
                                 <% } %>
                                 <% if (a.status === 2) { %>
                                     <div class="form-group">
@@ -369,7 +372,7 @@
                                         <!--终审填写批复编号-->
                                         <div class="form-group mt-3">
                                             <label><b class="text-danger">*&nbsp;</b>批复编号</label>
-                                            <input class="form-control" value="<%= change.name %>" name="p_code" type="text">
+                                            <input class="form-control" value="<%= change.code %>" name="p_code" type="text">
                                         </div>
                                         <% } else { %>
                                             <input type="hidden" name="audit_next_id" value="<%= auditList[index+1].id %>">
@@ -425,8 +428,11 @@
                                         <% } %>
                                         <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small>
                                     </h5>
-                                    <% if (a.sin_time !== null || (a.sdesc !== '' && a.sdesc !== null)) { %>
-                                        <p class="card-text"><%= a.sdesc %>&nbsp;<%= moment(a.sin_time).format('YYYY-MM-DD') %></p>
+                                    <% if (a.sdesc !== '' && a.sdesc !== null) { %>
+                                        <p class="card-text mb-1"><%= a.sdesc %></p>
+                                    <% } %>
+                                    <% if (a.sin_time !== null) { %>
+                                        <p class="card-text"><small class="text-muted"><%= moment(a.sin_time).format('YYYY-MM-DD') %></small></p>
                                     <% } %>
                                     <% if (a.status === 2) { %>
                                         <div class="form-group">

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

@@ -38,7 +38,7 @@
                     <img class="mr-3" src="public/images/avatar.png">
                     <div class="media-body">
                         <span class="pull-right text-muted"><%- (change.sin_time ? change.sin_time.toLocaleString() : '') %></span>
-                        <h5 class="mt-0"><%- change.pre.name %><small class="ml-3 text-muted"><%- change.pre.role %></small></h5>
+                        <h5 class="mt-0"><%- change.caname %><small class="ml-3 text-muted"><%- change.pre.role %></small></h5>
                         <p>
                             <a href="/tender/<%- change.tid %>"><%- change.name %></a>
                             变更令 <%- change.ccode %>
@@ -49,7 +49,7 @@
                             <a href="/tender/<%- change.tid %>/change/<%- change.cid %>/info">
                                 <% if (change.cstatus === acChange.status.checking) { %>
                                 审批
-                                <% } else if (change.cstatus === acChange.status.backnew && ctx.session.sessionUser.accountId !== change.user_id) { %>
+                                <% } else if (change.cstatus === acChange.status.backnew) { %>
                                 重新审批
                                 <% } else { %>
                                 重新上报

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

@@ -119,7 +119,7 @@
                                     <h5 class="card-title">
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
                                     </h5>
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                    <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNoPre) { %>
                                     <p class="card-text"><%- auditors[iA].opinion %></p>
                                     <% } else if (auditors[iA].status === auditConst.status.checking) { %>
                                     <div class="form-group">
@@ -190,7 +190,7 @@
                                     <h5 class="card-title">
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
                                     </h5>
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                    <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNoPre) { %>
                                     <p class="card-text"><%- auditors[iA].opinion %></p>
                                     <% } else if (auditors[iA].status === auditConst.status.checking) { %>
                                     <div class="form-group">
@@ -202,7 +202,7 @@
                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
                                             <label class="form-check-label" for="inlineRadio1">退回上报 <%- ctx.stage.user.name %></label>
                                         </div>
-                                        <% if (auditors[iA].order > 1) { %>
+                                        <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
                                         <div class="form-check form-check-inline">
                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
                                             <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- auditors[iA-1].name %></label>
@@ -849,7 +849,7 @@
                                     <h5 class="card-title">
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
                                     </h5>
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                    <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNoPre) { %>
                                     <p class="card-text"><%- auditors[iA].opinion %></p>
                                     <% } else if (auditors[iA].status === auditConst.status.checking) { %>
                                     <div class="form-group">
@@ -920,7 +920,7 @@
                                     <h5 class="card-title">
                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small>
                                     </h5>
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                    <% if (auditors[iA].status === auditConst.status.checked || auditors[iA].status === auditConst.status.checkNoPre) { %>
                                     <p class="card-text"><%- auditors[iA].opinion %></p>
                                     <% } else if (auditors[iA].status === auditConst.status.checking) { %>
                                     <div class="form-group">
@@ -932,7 +932,7 @@
                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
                                             <label class="form-check-label" for="inlineRadio1">退回上报 <%- ctx.stage.user.name %></label>
                                         </div>
-                                        <% if (auditors[iA].order > 1) { %>
+                                        <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
                                         <div class="form-check form-check-inline">
                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
                                             <label class="form-check-label" for="inlineRadio2">退回上一审批人 <%- auditors[iA-1].name %></label>