diff --git a/src/main/resources/static/js/stockTaking/stockTakingForLocationCard.js b/src/main/resources/static/js/stockTaking/stockTakingForLocationCard.js index 5c1e2322..8df68019 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForLocationCard.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForLocationCard.js @@ -824,24 +824,40 @@ layui.use(['form', 'step', 'flow', 'laydate', 'inputTag'], function () { }; - - changeSelectValueForProducedDate = function(obj){ - let req = {}; - var id = obj.id; - var idNumber = id.split('producedDate')[1]; // 得到当前id对应数字 - req.mid = $("#" + "midForLocation" + idNumber).val(); - req.producedDate = obj.value; - $.ajax({ - url: "/material/findQuantityByProducedDate", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (d) { - $("#" + "oldInventory" + idNumber).val(d.data) - } - }); - }; - + form.on('select()', function (data) { + var id = data.elem.id; //得到select原始DOM对象id + var req = {}; + if (id.includes("producedDate")) { + var idNumber = id.split('producedDate')[1]; // 得到当前id对应数字 + req.mid = $("#" + "mid" + idNumber).val(); + req.producedDate = data.value; + $.ajax({ + url: "/material/findQuantityByProducedDate", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + $("#" + "oldInventory" + idNumber).val(d.data) + } + }); + } + else if (id.includes("unit")) { + let idNumber = id.split("unit")[1]; // 得到当前id对应数字 + req.mid = $("#" + "midForLocation" + idNumber).val(); + req.unit = data.value; + req.placeId = $("#placeId").val(); + $.ajax({ + url: "/material/findQuantityByUnit", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + $("#" + "oldInventory" + idNumber).val(d.data) + } + }); + } + }); }); \ No newline at end of file diff --git a/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js b/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js index 27a3b5e6..757a6102 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js @@ -313,6 +313,7 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { placeId = nowPlaceId; updateTableShowForLocation(); } + $("#locationCard")[0].reset(); } }); diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking.html b/src/main/resources/templates/pages/stockTaking/stockTaking.html index 1c947f4b..5aa3a09b 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTaking.html +++ b/src/main/resources/templates/pages/stockTaking/stockTaking.html @@ -35,10 +35,6 @@ .layui-form-select { width: 100%; height: 38px; - line-height: 1.3; - border-width: 1px; - border-style: solid; - background-color: #fff; } @@ -242,133 +238,163 @@
-
-
- 盘点明细 - -
-
- -
- - -
-
- +
+ 盘点明细 + +
+
+ +
+ + +
+
+ + +
+ -
-
-
-
- -
-
- - +
+ +
+
+ + +
-
-
- -
- - +
+ +
+ + +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
+
@@ -453,7 +479,6 @@ }); - // 用于提交盘点情况 form.on('submit(formStep)', function (data) { data = data.field; @@ -499,28 +524,27 @@ data = data.field; data.params = params; data.departmentManagerId = departmentManagerIdForLocation; - console.log(data) - /* $.ajax({ - url: "/stockTaking/addStockTakingRecord", - type: 'post', - dataType: 'json', - contentType: "application/json;charset=utf-8", - data: JSON.stringify(data), - beforeSend: function () { - this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); - }, - success: function (data) { - layer.msg("申请提交成功", { - icon: 6,//成功的表情 - time: 500 //1秒关闭(如果不配置,默认是3秒) - }, function () { - step.next('#stepForm'); - }); - }, - complete: function () { - layer.close(this.layerIndex); - } - });*/ + $.ajax({ + url: "/stockTaking/addStockTakingRecord", + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + beforeSend: function () { + this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); + }, + success: function (data) { + layer.msg("申请提交成功", { + icon: 6,//成功的表情 + time: 500 //1秒关闭(如果不配置,默认是3秒) + }, function () { + step.next('#stepForm'); + }); + }, + complete: function () { + layer.close(this.layerIndex); + } + }); }); $('.pre').click(function () { diff --git a/target/classes/templates/pages/stockTaking/stockTaking.html b/target/classes/templates/pages/stockTaking/stockTaking.html index 1c947f4b..5aa3a09b 100644 --- a/target/classes/templates/pages/stockTaking/stockTaking.html +++ b/target/classes/templates/pages/stockTaking/stockTaking.html @@ -35,10 +35,6 @@ .layui-form-select { width: 100%; height: 38px; - line-height: 1.3; - border-width: 1px; - border-style: solid; - background-color: #fff; } @@ -242,133 +238,163 @@
-
-
- 盘点明细 - -
-
- -
- - -
-
- +
+ 盘点明细 + +
+
+ +
+ + +
+
+ + +
+ -
-
-
-
- -
-
- - +
+ +
+
+ + +
-
-
- -
- - +
+ +
+ + +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
+
@@ -453,7 +479,6 @@ }); - // 用于提交盘点情况 form.on('submit(formStep)', function (data) { data = data.field; @@ -499,28 +524,27 @@ data = data.field; data.params = params; data.departmentManagerId = departmentManagerIdForLocation; - console.log(data) - /* $.ajax({ - url: "/stockTaking/addStockTakingRecord", - type: 'post', - dataType: 'json', - contentType: "application/json;charset=utf-8", - data: JSON.stringify(data), - beforeSend: function () { - this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); - }, - success: function (data) { - layer.msg("申请提交成功", { - icon: 6,//成功的表情 - time: 500 //1秒关闭(如果不配置,默认是3秒) - }, function () { - step.next('#stepForm'); - }); - }, - complete: function () { - layer.close(this.layerIndex); - } - });*/ + $.ajax({ + url: "/stockTaking/addStockTakingRecord", + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + beforeSend: function () { + this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); + }, + success: function (data) { + layer.msg("申请提交成功", { + icon: 6,//成功的表情 + time: 500 //1秒关闭(如果不配置,默认是3秒) + }, function () { + step.next('#stepForm'); + }); + }, + complete: function () { + layer.close(this.layerIndex); + } + }); }); $('.pre').click(function () {