Browse Source

增加提示窗

laiguoran 3 years ago
parent
commit
386708c1e5
2 changed files with 24 additions and 1 deletions
  1. 6 1
      app/public/js/material_list.js
  2. 18 0
      app/view/material/list_modal.ejs

+ 6 - 1
app/public/js/material_list.js

@@ -684,6 +684,7 @@ $(document).ready(() => {
                         const index = findSelfLeafXmj(select, 'index');
                         selfList.splice(index, 1);
                         materialListData = result;
+                        $('#cancel-self').modal('hide');
                     } else {
                         selfList.push(result);
                     }
@@ -771,7 +772,8 @@ $(document).ready(() => {
                     name: '取消单独添加工料',
                     icon: 'fa-remove',
                     callback: function (key, opt) {
-                        leafXmjSpreadObj.checkSelfMaterial('noself');
+                        $('#cancel-self').modal('show');
+                        // leafXmjSpreadObj.checkSelfMaterial('noself');
                     },
                     visible: function (key, opt) {
                         const sheet = leafXmjSpread.getActiveSheet();
@@ -790,6 +792,9 @@ $(document).ready(() => {
                 },
             }
         });
+        $('#cancelSelfBtn').click(function () {
+            leafXmjSpreadObj.checkSelfMaterial('noself');
+        });
         // material-spread右键功能
         const materialSpreadObj = {
             del: function () {

+ 18 - 0
app/view/material/list_modal.ejs

@@ -50,5 +50,23 @@
         </div>
     </div>
 </div>
+<div class="modal fade" id="cancel-self" data-backdrop="static">
+    <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>确认取消单独添加工料?</h5>-->
+                <h5>取消后将清空“单独添加工料窗口”,数据无法恢复,请谨慎操作。</h5>
+            </div>
+            <div class="modal-footer">
+                <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
+                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+                <button type="button" id="cancelSelfBtn" class="btn btn-danger btn-sm">确定取消</button>
+            </div>
+        </div>
+    </div>
+</div>
 <% } %>
 <% include ./audit_modal.ejs %>