diff --git a/target/classes/templates/pages/showInventory/showInventoryForMaterial.html b/target/classes/templates/pages/showInventory/showInventoryForMaterial.html
index de13c5ce..04b91eb4 100644
--- a/target/classes/templates/pages/showInventory/showInventoryForMaterial.html
+++ b/target/classes/templates/pages/showInventory/showInventoryForMaterial.html
@@ -107,7 +107,21 @@
");
+ for (let i = 0; i < result.length; i++) {
+ let resultElement = result[i];
+ let splitInventory = resultElement.splitInventory;
+ let keys = Object.keys(splitInventory);
+ let InventoryItem = "";
+ for (let j = 0; j < keys.length; j++) {
+ let key = keys[j];
+ let item = '
' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '
';
+ InventoryItem += item;
+ }
+ lis.push('
' +
+ '');
+ lis.push('
'
+ + InventoryItem
+ + '
');
+ }
+ lis.push('
');
+ takingPre += result.length;
+ //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
+ //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
+ next(lis.join(''), takingPre < res.count);
+ checkedInputCheck();
+ });
+ }
+ });
+ };
+
- flow.load({
- elem: '#LAY_InventoryShow' //流加载容器
- , done: function (page, next) { //执行下一页的回调
- let result;
- let lis = [];
- $.get('/material/findMaterialByConditionForStockTaking?page=' + page + '&size=' + size + '&mid=' + id, function (res) {
- result = res.data;
- lis.push("");
- for (let i = 0; i < result.length; i++) {
- let splitInventory = result[i].splitInventory;
- let keys = Object.keys(splitInventory);
- let InventoryItem = "";
- for (let j = 0; j < keys.length; j++) {
- let key = keys[j];
- let item = '
' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '
';
- InventoryItem += item;
+ chooseBusiness = function (obj) {
+ // 获取当前点击结果
+ let checked = $(obj).prop("checked");
+ // 获取要处理的id
+ let id = $(obj).attr("id");
+ if (checked) {
+ // 保存出入库id到redis中
+ $.ajax({
+ url: "/material/temporaryValue",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify({"id": id, "type": "Out"}),
+ contentType: "application/json;charset=utf-8",
+ });
+ $.ajax({
+ url: "/material/temporaryValue",
+ type: "post",
+ dataType: 'json',
+ data: JSON.stringify({"id": id, "type": "In"}),
+ contentType: "application/json;charset=utf-8",
+ });
+
+ $("#chooseBusinessType").show();
+ } else {
+ // 删除保存redis中的出入库id
+ $.ajax({
+ url: "/material/delTemporaryValue",
+ type: 'post',
+ data: JSON.stringify({"id": id, "type": "Out"}),
+ dataType: 'json',
+ contentType: "application/json;charset=utf-8",
+ success: function (res) {
+ let data = res.data;
+ if (data === 0) {
+ $("#chooseBusinessType").hide();
}
- lis.push('
');
- lis.push('
'
- + InventoryItem
- + '
');
}
- lis.push('
');
- takingPre += result.length;
- //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
- //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
- next(lis.join(''), takingPre < res.count);
});
+
+ $.ajax({
+ url: "/material/delTemporaryValue",
+ type: 'post',
+ data: JSON.stringify({"id": id, "type": "In"}),
+ dataType: 'json',
+ contentType: "application/json;charset=utf-8"
+ })
}
- });
- $('body').on('click', '[data-refresh]', function () {
- location.reload();
- })
+ return false;
+ };
+
+
+ /**
+ * 用于跳转导入库页面
+ */
+ applicationIn = function(){
+ miniTab.openNewTabByIframeNew({
+ href: "/application_In_temporaryValue",
+ title: "入库申请"
+ });
+ };
+
+ /**
+ * 用于跳转到出库页面
+ */
+ applicationOut = function () {
+ miniTab.openNewTabByIframeNew({
+ href: "/application_Out_temporaryValue",
+ title: "出库申请"
+ });
+ };
+
+ /**
+ * 用于跳转到直接出库页面
+ */
+ applicationImmediateOut = function () {
+ miniTab.openNewTabByIframeNew({
+ href: "/application_Immediate_Out_temporaryValue",
+ title: "出库申请"
+ });
+ };
+
+
+ /**
+ * 用于选择选择框
+ */
+ checkedInputCheck = function () {
+ if(chooseIdList.length > 0){
+ for (const checkedId of chooseIdList) {
+ $("#"+checkedId).attr("checked","checked");
+ }
+ $("#chooseBusinessType").show();
+ }
+ }
})