From e64b1d5ec0b3ca0c42048903f4ab5f9d588349e8 Mon Sep 17 00:00:00 2001
From: cp <513960435@qq.com>
Date: 星期四, 19 六月 2025 08:37:51 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/webapp/static/js/mat/mat.js |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/zy-asrs-wms/src/main/webapp/static/js/mat/mat.js b/zy-asrs-wms/src/main/webapp/static/js/mat/mat.js
index 409af88..f47f21b 100644
--- a/zy-asrs-wms/src/main/webapp/static/js/mat/mat.js
+++ b/zy-asrs-wms/src/main/webapp/static/js/mat/mat.js
@@ -234,6 +234,36 @@
             case 'edit':
                 showEditModel(data)
                 break;
+            case'sync':
+            case 'sync':
+                layer.confirm('纭鍚屾搴撳瓨锛�', function () {
+                    notice.msg('姝e湪鍚屾搴撳瓨......', {icon: 4}); // 鍔犺浇鎻愮ず
+
+                    $.ajax({
+                        url: baseUrl + "/mat/sync",
+                        method: 'POST',
+                        contentType: 'application/json', // 姝g‘鐨凜ontent-Type浣嶇疆
+                        headers: {
+                            'token': localStorage.getItem('token')
+                        },
+                        data: JSON.stringify(data),
+                        success: function (res) {
+                            notice.destroy(); // 绉婚櫎鈥滄鍦ㄥ悓姝モ�濇彁绀�
+
+                            if (res.code === 200) {
+                                layer.msg('鍚屾鎴愬姛 鉁�', {icon: 1}); // 鉁� 鎴愬姛鎻愮ず
+                                $(".layui-laypage-btn")[0].click(); // 瑙﹀彂琛ㄦ牸鍒锋柊
+                            } else {
+                                layer.msg(res.msg || '鍚屾澶辫触 鉂�', {icon: 2}); // 鉂� 澶辫触鎻愮ず
+                            }
+                        },
+                        error: function (xhr) {
+                            notice.destroy();
+                            layer.msg('璇锋眰澶辫触锛�' + (xhr.responseText || '鏈煡閿欒'), {icon: 2});
+                        }
+                    });
+                });
+                break;
         }
     });
 

--
Gitblit v1.9.1