From fc3132120fdcbd5a4eb7876c98c277d4b1e19714 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 12 三月 2021 09:13:23 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/ioWorks/matQuery.js |   49 +++++++++++++++++++++++++++++++++++--------------
 1 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/src/main/webapp/static/js/ioWorks/matQuery.js b/src/main/webapp/static/js/ioWorks/matQuery.js
index 3721713..d216eb9 100644
--- a/src/main/webapp/static/js/ioWorks/matQuery.js
+++ b/src/main/webapp/static/js/ioWorks/matQuery.js
@@ -9,12 +9,16 @@
     cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:65})
     return cols;
 }
-
-layui.use(['table','laydate', 'form'], function() {
+layui.config({
+    base: baseUrl + "/static/layui/lay/modules/"
+}).extend({
+    notice: 'notice/notice',
+}).use(['table','laydate', 'form',  'notice'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var form = layui.form;
+    var notice = layui.notice;
 
     tableIns = table.render({
         elem: '#chooseData',
@@ -41,12 +45,18 @@
         switch (obj.event) {
             case 'createDoc':
                 if (data.length === 0){
-                    layer.msg('璇锋坊鍔犵墿鏂�');
+                    notice.error({
+                        title: '娑堟伅閫氱煡',
+                        message: '璇锋坊鍔犵墿鏂�'
+                    });
                 } else {
                     var success = true;
                     for (var i=0;i<matData.length;i++) {
                         if (matData[i].count <= 0) {
-                            layer.msg(matData[i].matnr + '鐗╂枡鏁伴噺蹇呴』澶т簬闆讹紒', {icon: 2})
+                            notice.error({
+                                title: '娑堟伅閫氱煡',
+                                message: matData[i].matnr + '鐗╂枡鏁伴噺蹇呴』澶т簬闆讹紒'
+                            });
                             success = false;
                             return false;
                         }
@@ -111,12 +121,18 @@
             method: 'POST',
             success: function (res) {
                 if (res.code === 200){
-                    layer.msg(res.msg, {icon: 1});
+                    notice.success({
+                        title: '娑堟伅閫氱煡',
+                        message: res.msg
+                    });
                     top.layui.layer.close(top.popupRight);
                 } else if (res.code === 403){
                     top.location.href = baseUrl+"/";
                 } else {
-                    layer.msg(res.msg, {icon: 2})
+                    notice.error({
+                        title: '娑堟伅閫氱煡',
+                        message: res.msg
+                    });
                 }
             }
         });
@@ -124,21 +140,23 @@
 
     function updateMatData(locNo, matnr, count) {
         if (isNaN(count)) {
-            layer.msg("璇疯緭鍏ユ暟瀛�");
+            notice.error({
+                title: '娑堟伅閫氱煡',
+                message: '璇疯緭鍏ユ暟瀛�'
+            });
         } else {
             if (count > 0) {
                 for (var i=0;i<matData.length;i++){
                     if (matData[i]["matnr"] === matnr){
-                        // if (count > locDetlData[i]["anfme"]) {
-                        //     layer.msg("涓嶈兘瓒呰繃鍘熸暟閲�");
-                        // } else {
-                            matData[i]["count"] = count;
-                        // }
+                        matData[i]["count"] = count;
                         break;
                     }
                 }
             } else {
-                layer.msg("鏁伴噺蹇呴』澶т簬闆�");
+                notice.error({
+                    title: '娑堟伅閫氱煡',
+                    message: '鏁伴噺蹇呴』澶т簬闆�'
+                });
             }
         }
         tableIns.reload({data: matData,done:function (res) {
@@ -197,7 +215,10 @@
             } else if (res.code === 403){
                 top.location.href = baseUrl+"/";
             } else {
-                layer.msg(res.msg, {icon: 2})
+                notice.error({
+                    title: '娑堟伅閫氱煡',
+                    message: res.msg
+                });
             }
         }
     });

--
Gitblit v1.9.1