浏览代码

变更一些bug修复

laiguoran 6 年之前
父节点
当前提交
84ad44e762
共有 3 个文件被更改,包括 32 次插入87 次删除
  1. 4 0
      app/const/account_group.js
  2. 26 16
      app/public/js/change.js
  3. 2 71
      app/view/change/modal.ejs

+ 4 - 0
app/const/account_group.js

@@ -12,6 +12,8 @@ const accountGroup = {
     JLDW: 2,
     SGDW: 3,
     SJDW: 4,
+    DJDW: 5,
+    GZSJ: 6,
 };
 
 const group = [];
@@ -19,6 +21,8 @@ group[accountGroup.JSDW] = '建设单位';
 group[accountGroup.JLDW] = '监理单位';
 group[accountGroup.SGDW] = '施工单位';
 group[accountGroup.SJDW] = '设计单位';
+group[accountGroup.DJDW] = '代建单位';
+group[accountGroup.GZSJ] = '跟踪审计';
 
 module.exports = {
     type: accountGroup,

+ 26 - 16
app/public/js/change.js

@@ -137,24 +137,27 @@ class codeRuleSet {
 
 $(document).ready(() => {
     // 首次进入设置
-    if (cRuleFirst) {
+    let showNoNeed = false;
+    if (parseInt(cRuleFirst)) {
         codeRule = [];
-        const firstSet = new codeRuleSet($('div.modal-body', '#first'));
-        // 确认规则上传服务器
-        $('#setRule', '#first').bind('click', function () {
-            const data = {
-                rule: ruleType,
-                connector: connectorRule,
-                data: JSON.stringify(codeRule),
+        showNoNeed = true;
+        // const firstSet = new codeRuleSet($('div.modal-body', '#first'));
+        // // 确认规则上传服务器
+        // $('#setRule', '#first').bind('click', function () {
+        //     const data = {
+        //         rule: ruleType,
+        //         connector: connectorRule,
+        //         data: JSON.stringify(codeRule),
+        //
+        //     };
+        //     postData('/tender/rule', data, function () {
+        //         $('#first').modal('hide');
+        //         $('#add-bj').modal('show');
+        //     });
+        // });
 
-            };
-            postData('/tender/rule', data, function () {
-                $('#first').modal('hide');
-                $('#add-bj').modal('show');
-            });
-        });
-
-        $('#first').modal('show');
+        // $('#first').modal('show');
+        $('#setting').modal('show');
     } else if ($('#changList').children.length === 0) {
         $('#add-bj').modal('show');
     }
@@ -168,6 +171,9 @@ $(document).ready(() => {
         };
         postData('/tender/rule', data, function () {
             $('#setting').modal('hide');
+            if (parseInt(cRuleFirst) && showNoNeed) {
+                $('#add-bj').modal('show');
+            }
         });
     })
     // 新增变更令 modal显示
@@ -211,6 +217,10 @@ $(document).ready(() => {
     });
     // 不再显示首次使用
     $('#changeFirst').click(function () {
+        showNoNeed = false;
+        $('#changeFirst').remove();
+        $('#hide_modal').show();
+        $('#setting').modal('hide');
         postData('/tender/'+ $('#tenderId').val() +'/rule/first', '', function () {
         });
     })

+ 2 - 71
app/view/change/modal.ejs

@@ -1,74 +1,4 @@
 <% if (tender.user_id === uid) { %>
-
-    <% if (tender.c_rule_first) { %>
-<!--首次使用-->
-<div class="modal" id="first">
-    <div class="modal-dialog" role="document" >
-        <div class="modal-content">
-            <div class="modal-header">
-                <h5 class="modal-title">设置变更令号规则</h5>
-            </div>
-            <div class="modal-body">
-                <h5 >
-                    当前规则:
-                    <span id="preview">
-                        <% if (codeRule && codeRule instanceof Array) { %>
-                        <% const preview = []; %>
-                        <% for (const rule of codeRule) { %>
-                        <% preview.push(rule.preview); %>
-                        <% } %>
-                        <%- preview.join(tender.c_connector !== null && tender.c_connector !== '3' ? ruleConst.connectorString[tender.c_connector] : ''); %>
-                        <% } %>
-                    </span>
-                </h5>
-                <h5 id="ruleParts">
-                    <% if (codeRule && codeRule instanceof Array) { %>
-                    <% for (const rule of codeRule) { %>
-                    <span class="badge badge-light" title="<%- ruleConst.ruleString[rule.rule_type]%>">
-                            <span>
-                                <%- rule.preview %>
-                            </span>
-                            <a href="javascript: void(0);" class="text-danger" title="移除"><i class="fa fa-remove"></i></a>
-                        </span>
-                    <% } %>
-                    <% } %>
-                </h5>
-                <h5 class="my-3">连接符</h5>
-                <div class="form-group">
-                    <select class="form-control connector-change">
-                        <option disabled selected>请选择</option>
-                        <% for (const index in ruleConst.connectorString) { %>
-                            <option value="<%- index %>"><%- ruleConst.connectorString[index] %></option>
-                        <% } %>
-                    </select>
-                </div>
-                <h5 class="my-3">添加新规则组件</h5>
-                <div class="form-group">
-                    <select class="form-control rule-change">
-                        <option disabled selected>请选择组件</option>
-                        <% for (const index in ruleConst.ruleString) { %>
-                        <option value="<%- index %>"><%- ruleConst.ruleString[index] %></option>
-                        <% } %>
-                    </select>
-                </div>
-                <div class="form-group" id="format" style="display: none">
-                    <label>自动编号位数</label>
-                    <input min="3" class="form-control" step="1" max="6" value="3" type="number">
-                </div>
-                <div class="form-group" id="text" style="display: none">
-                    <label>起始编号</label>
-                    <input class="form-control" value="001" type="text">
-                </div>
-                <button class="btn btn-outline-primary" id="addRule">添加组件</button>
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal" id="changeFirst">暂时不需要</button>
-                <button class="btn btn-primary" id="setRule">确定</button>
-            </div>
-        </div>
-    </div>
-</div>
-    <% } %>
 <!--弹出添加变更令-->
 <div class="modal fade" id="add-bj" data-backdrop="static">
     <div class="modal-dialog" role="document">
@@ -169,7 +99,8 @@
                 </div>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <% if (tender.c_rule_first) { %><button type="button" class="btn btn-secondary" data-dismiss="modal" id="changeFirst">暂时不需要</button><% } %>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal" id="hide_modal" <% if (tender.c_rule_first) { %>style="display: none"<% } %>>关闭</button>
                 <button type="button" class="btn btn-primary" id="setRule">确定添加</button>
             </div>
         </div>