From 91f2cd5b0f832091f654cce926585d2f05cad114 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <xltys1995>
Date: 星期四, 08 四月 2021 23:22:32 +0800
Subject: [PATCH] Merge branches 'dev' and 'master' of https://gitee.com/luxiaotao1123/xtywms into master
---
src/main/webapp/static/js/locNormal/addLocNormal.js | 83 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/src/main/webapp/static/js/locNormal/addLocNormal.js b/src/main/webapp/static/js/locNormal/addLocNormal.js
new file mode 100644
index 0000000..e6db8bf
--- /dev/null
+++ b/src/main/webapp/static/js/locNormal/addLocNormal.js
@@ -0,0 +1,83 @@
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click', '#data-detail-close', function () {
+ parent.layer.closeAll();
+});
+
+layui.use(['table', 'laydate', 'form', 'upload'], function () {
+ var table = layui.table;
+ var $ = layui.jquery;
+ var layer = layui.layer;
+ var layDate = layui.laydate;
+ var upload = layui.upload;
+ var form = layui.form;
+
+ // 鑾峰彇浠撳簱涓嬫媺
+ $.ajax({
+ url: baseUrl+"/locArea/queryAll/auth",
+ headers: {'token': localStorage.getItem('token')},
+ // data: top.reObject(data),
+ method: 'POST',
+ success: function (res) {
+ var html = "";
+ if (res.data && res.data.length > 0) {
+ html += res.data.map(function (item) {
+ return "<Option value="+item.id+">"+item.name+"</Option>";
+ });
+ }
+ $('#warehouse').append(html);
+ form.render('select');
+ },
+ });
+
+ // 鏁版嵁淇濆瓨鍔ㄤ綔
+ form.on('submit(save)', function () {
+ if (banMsg != null) {
+ layer.msg(banMsg);
+ return;
+ }
+ // 鏁伴噺杈撳叆鏍¢獙
+ var reg=/^\d{1,}$/
+ var pattern=new RegExp(reg);
+ var anfme = $('#anfme').val();
+ if (!pattern.test(anfme)) {
+ layer.msg("璇疯緭鍏ユ纭殑鏁伴噺");
+ return;
+ }
+ // loading鍔犺浇鏁堟灉
+ var loadingIndex = layer.load(1, {
+ shade: [0.5,'#000']
+ });
+ // 琛ㄥ崟鍏ュ弬
+ var data = {
+ matnr: $('#matnr').val(),
+ maktx: $('#maktx').val(),
+ lgnum: $('#lgnum').val(),
+ type: $('#type').val(),
+ mnemonic: $('#mnemonic').val(),
+ supplier: $('#supplier').val(),
+ warehouse: $('#warehouse').val(),
+ brand: $('#brand').val(),
+ anfme: $('#anfme').val(),
+ altme: $('#altme').val(),
+ };
+ // 璇锋眰淇濆瓨鎺ュ彛
+ $.ajax({
+ url: baseUrl+"/locNomal/add/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: top.reObject(data),
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ parent.layer.closeAll();
+ parent.tableReload();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg);
+ }
+ // 鍏抽棴loading鍔犺浇鏁堟灉
+ layer.close(loadingIndex);
+ },
+ });
+ });
+});
\ No newline at end of file
--
Gitblit v1.9.1