Quellcode durchsuchen

删除计价规则保护

zhongzewei vor 7 Jahren
Ursprung
Commit
c8d8924cdf

+ 10 - 0
web/users/js/compilation.js

@@ -193,6 +193,16 @@ $(document).ready(function() {
         });
     });
 
+    //计价规则删除
+    $('#delete-confirm').click(function () {
+        let id = $('#del').attr('selectedId');
+        console.log(id);
+        if (id === undefined || id === '') {
+            return false;
+        }
+        window.location.href = `/compilation/valuation/bill/delete/${id}`;
+    });
+
     // 发布编办
     $("#release").click(function() {
         let id = $(this).data("id");

+ 11 - 0
web/users/js/main_tree_col.js

@@ -96,6 +96,17 @@ let MainTreeCol = {
             }else {
                 return treeNodeTools.isRation(node);
             }
+        },
+        forContentCharacter: function (node) {
+            return !MainTreeCol.readOnly.bills(node) || (node.data.type !== billType.BILL && node.data.type !== billType.FX);
+        },
+        forRuleText: function (node) {
+            if(MainTreeCol.readOnly.bills(node)){
+                if(node.data.type === billType.FX || (node.data.type === billType.BILL && node.source.children.length === 0)){
+                    return false;
+                }
+            }
+            return true;
         }
     },
     cellType: {

+ 2 - 1
web/users/views/compilation/index.html

@@ -50,7 +50,8 @@
                         </td>
                         <td>
                             <a href="/compilation/valuation/bill/<%= bill.id %>" class="btn btn-sm">编辑</a>
-                            <a href="/compilation/valuation/bill/delete/<%= bill.id %>" class="btn btn-sm text-danger">删除</a>
+                            <a onclick="$('#del').attr('selectedId', '<%= bill.id %>')" href="#" data-id="<%= bill.id %>" data-toggle="modal" data-target="#del" class="btn btn-sm text-danger">删除</a>
+                            <!--<a href="/compilation/valuation/bill/delete/<%= bill.id %>" class="btn btn-sm text-danger">删除</a>-->
                         </td>
                     </tr>
                     <% }) %>

+ 20 - 0
web/users/views/compilation/modal.html

@@ -183,4 +183,24 @@
         </div>
     </div>
 </div>
+<!--弹出删除-->
+<div class="modal fade" id="del" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">删除确认</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <h5 class="text-danger" id="tenderHint">删除计价规则 ?</h5>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
+                <a href="javascript:void(0);" class="btn btn-danger" id="delete-confirm">删除</a>
+            </div>
+        </div>
+    </div>
+</div>
 <script type="text/javascript" src="/web/users/js/col_setting.js"></script>