laiguoran 6 роки тому
батько
коміт
2e2aa52fe0

+ 4 - 1
app/controller/tender_controller.js

@@ -416,9 +416,12 @@ module.exports = app => {
                     throw '当前未打开标段';
                 }
                 const data = JSON.parse(ctx.request.body.data);
-                if (!data.rule || !data.connector || !codeRuleConst.ruleField[data.rule]) {
+                if (!data.rule || !JSON.parse(data.data).length || !codeRuleConst.ruleField[data.rule]) {
                     throw '请选择组件再添加';
                 }
+                if (!data.connector) {
+                    throw '请选择连接符';
+                }
 
                 const updateData = {
                     id: tenderId,

+ 0 - 1
app/public/js/change.js

@@ -142,7 +142,6 @@ $(document).ready(() => {
 
         // $('#first').modal('show');
         $('#setting').modal('show');
-        connectorRule = ruleConst.connectorType.nothing;
     } else if ($('#changList').children.length === 0) {
         $('#add-bj').modal('show');
     }

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

@@ -92,7 +92,7 @@
                             <select class="form-control connector-change">
                                 <option disabled selected>请选择</option>
                                 <% for (const index in ruleConst.connectorString) { %>
-                                    <option value="<%- index %>" <% if ((tender.c_connector !== null && tender.c_connector === parseInt(index)) || (tender.c_connector === null && parseInt(index) === ruleConst.connectorType.nothing)) { %>selected<% } %>><%- ruleConst.connectorString[index] %></option>
+                                    <option value="<%- index %>" <% if (tender.c_connector !== null && tender.c_connector === parseInt(index)) { %>selected<% } %>><%- ruleConst.connectorString[index] %></option>
                                 <% } %>
                             </select>
                         </div>