Browse Source

会签或签协同显示调整

MaiXinRong 9 months ago
parent
commit
768ee39a1a
3 changed files with 8 additions and 7 deletions
  1. 4 4
      app/const/audit.js
  2. 2 2
      app/public/js/shenpi.js
  3. 2 1
      app/view/tender/shenpi.ejs

+ 4 - 4
app/const/audit.js

@@ -10,10 +10,10 @@
 
 const auditType = (function () {
     const types = [
-        { key: 'common', name: '个人', value: 1, short: '', long: '', class: '' },
-        { key: 'and', name: '会签', value: 2, short: '会', long: '多人会签', class: 'primary' },
-        { key: 'or', name: '或签', value: 3, short: '或', long: '多人或签', class: 'success' },
-        { key: 'union', name: '协同', value: 4, short: '协', long: '多人协同', class: 'warning'},
+        { key: 'common', name: '个人', value: 1, short: '', long: '', class: '', },
+        { key: 'and', name: '会签', value: 2, short: '会', long: '多人会签', class: 'primary', valid: ['ledger', 'revise', 'stage', 'change'] },
+        { key: 'or', name: '或签', value: 3, short: '或', long: '多人或签', class: 'success', valid: ['ledger', 'revise', 'stage', 'change'] },
+        { key: 'union', name: '协同', value: 4, short: '协', long: '多人协同', class: 'warning', valid: ['stage']},
     ];
     const key = {};
     const info = [];

+ 2 - 2
app/public/js/shenpi.js

@@ -249,9 +249,9 @@ $(document).ready(function () {
         },
         getAuditTypeHtml: function(code, type) {
             const html = [];
-            const hide = ['stage', 'change', 'ledger', 'revise'].indexOf(code) === -1 ? 'style="display: none;"' : '';
-            html.push(`<span class="d-inline-block"><select class="form-control form-control-sm audit-type-key" ${hide} data-type="${type}">`);
+            html.push(`<span class="d-inline-block"><select class="form-control form-control-sm audit-type-key" data-type="${type}">`);
             for (const t of auditType.types) {
+                if (t.valid && t.valid.indexOf(code) < 0) continue;
                 html.push(`<option value="${t.value}" ${t.value === type ? 'selected' : ''}>${t.name}</option>`);
             }
             html.push('</select></span> ');

+ 2 - 1
app/view/tender/shenpi.ejs

@@ -57,8 +57,9 @@
                                             <span class="col-auto"><%- ctx.helper.transFormToChinese(i+1) %>审</span>
                                             <span class="col-7 spr-span">
                                                 <span class="d-inline-block">
-                                                    <select class="form-control form-control-sm audit-type-key" data-type="<%- auditGroup[0].audit_type %>" <% if (['stage', 'change', 'ledger', 'revise'].indexOf(sp.code) === -1 ) { %> style="display: none;" <% } %>>
+                                                    <select class="form-control form-control-sm audit-type-key" data-type="<%- auditGroup[0].audit_type %>">
                                                         <% for (const at of auditType.types) { %>
+                                                        <% if (at.valid && at.valid.indexOf(sp.code) < 0) continue; %>
                                                         <option value="<%- at.value %>" <% if (auditGroup[0].audit_type === at.value) { %>selected<%} %>><%- at.name %></option>
                                                         <% } %>
                                                     </select>