Forráskód Böngészése

台账修订中禁止进度台账调整

laiguoran 4 éve
szülő
commit
e021ecf9d0

+ 1 - 1
app/controller/schedule_controller.js

@@ -85,7 +85,7 @@ module.exports = app => {
                 jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.schedule.ledger),
                 revising: await this._getLastReviseStatus(ctx),
             };
-            await this.layout('schedule/ledger.ejs', renderData);
+            await this.layout('schedule/ledger.ejs', renderData, 'schedule/modal.ejs');
         }
 
         async plan(ctx) {

+ 13 - 1
app/public/js/schedule_ledger.js

@@ -53,7 +53,7 @@ $(function () {
     const ledgerCol = {
         readOnly: {
             can_select: function (data) {
-                return !data.can_select;
+                return !(data.can_select && !revising);
             },
         },
     };
@@ -304,6 +304,9 @@ function updateParentCanSelect(datas, ledger_pid) {
 }
 
 function updateChildrenSelect(datas, is_select) {
+    if(revising) {
+        return;
+    }
     for (const data of datas) {
         if (data.can_select) {
             data.is_select = is_select;
@@ -316,6 +319,9 @@ function updateChildrenSelect(datas, is_select) {
 }
 
 function updateSiblingsSelect(tree, pid, is_select, select_msg) {
+    if(revising) {
+        return;
+    }
     const parent = pid !== -1 ? _.find(tree.nodes, { 'ledger_id': pid }) : tree;
     if (parent) {
         for(const d of parent.children) {
@@ -332,6 +338,9 @@ function updateSiblingsSelect(tree, pid, is_select, select_msg) {
 }
 
 function updateOtherSiblingsSelect(tree, pid, is_select, select_msg) {
+    if(revising) {
+        return;
+    }
     if(pid === -1) {
         return;
     }
@@ -367,6 +376,9 @@ function updateOtherSiblingsSelect(tree, pid, is_select, select_msg) {
 }
 
 function updateParentSelect(tree, pid, is_select) {
+    if(revising) {
+        return;
+    }
     if (pid !== -1) {
         const parent = _.find(tree.nodes, { 'ledger_id': pid });
         if (parent) {

+ 0 - 1
app/view/schedule/ledger.ejs

@@ -51,6 +51,5 @@
     const tenderInfo = JSON.parse(unescape('<%- escape(JSON.stringify(tenderInfo)) %>'));
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
     const measureType = JSON.parse('<%- JSON.stringify(measureType) %>');
-    const selectedLedgerList = JSON.parse('<%- JSON.stringify(scheduleLedgerList) %>');
     const hadDataLidList = JSON.parse('<%- JSON.stringify(hadDataLidList) %>');
 </script>

+ 1 - 1
app/view/schedule/modal.ejs

@@ -25,7 +25,7 @@
     </div>
 </div>
 <% } %>
-<% if (scheduleLedgerList.length !== 0 && revising) { %>
+<% if (revising) { %>
     <!--正在修订提示-->
     <div class="modal fade" id="unedit" data-backdrop="static">
         <div class="modal-dialog " role="document" >