From 199940b40ef09cbad18aa4d88114beeebc66e31e Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 15 Nov 2024 17:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../choose_inventory_count_fit_type_list.js | 43 +++++++++++-------- .../child/choose_scrap_fit_type_list.js | 2 +- .../child/demand_plan_detail_list.js | 2 +- .../choose_inventory_count_fit_type_list.html | 2 +- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/js/accessory/child/choose_inventory_count_fit_type_list.js b/js/accessory/child/choose_inventory_count_fit_type_list.js index 8f31eb6..2b16640 100644 --- a/js/accessory/child/choose_inventory_count_fit_type_list.js +++ b/js/accessory/child/choose_inventory_count_fit_type_list.js @@ -59,7 +59,7 @@ function initTable() { headers: { authorization: sessionStorage.getItem("gz-token"), }, - url: dataUrl + "backstage/paType/findByPage", + url: dataUrl + "backstage/paType/findByPageList", where: { encryptedData: JSON.stringify({ 'type': $('#type').val(), @@ -76,10 +76,10 @@ function initTable() { $.each(res.list, function (index, item) { $.each(jjDetailArr, function (index2, item2) { if (item.id === item2.id) { - item.num = item2.num; - item.price = item2.price; + item.checkNum = item2.checkNum; + item.addNum = item2.addNum; + item.subNum = item2.subNum; item.remarks = item2.remarks; - item.manufacturer = item2.manufacturer; } }); }); @@ -138,17 +138,17 @@ function initTable() { align: "center", }, { - field: "unit", + field: "num", title: "库存量", width: '8%', unresize: true, align: "center", templet: function (d) { - return '1'; + return '' + d.num + ''; }, }, { - field: "num", + field: "checkNum", width: '10%', title: " * 本次盘点量", unresize: true, @@ -157,21 +157,21 @@ function initTable() { style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { - field: "price", + field: "addNum", width: '10%', title: " * 盘盈量", unresize: true, align: "center", - edit: 'text', + // edit: 'text', style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { - field: "price", + field: "subNum", width: '10%', title: " * 盘亏量", unresize: true, align: "center", - edit: 'text', + // edit: 'text', style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;' }, { @@ -235,19 +235,26 @@ function initTable() { table.on('edit(currentTableId2)', function (obj) { var field = obj.field; // 得到修改的字段 var value = obj.value // 得到修改后的值 - if (field === 'num') { // 本次入库量 + if (field === 'checkNum') { // 本次盘点量 if (value) { const regex = /^(0|[1-9]\d{0,6})$/; if (!regex.test(value)) { obj.reedit(); return layer.msg('格式不正确,最大输入6位数,且为正整数!', { icon: 7 }) } - } - } else if (field === 'price') { - const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/; - if (!regex.test(value)) { - obj.reedit(); - return layer.msg('单价格式不正确!', { icon: 7 }) + let num = obj.data.num; // 库存量 + let addNum = 0, subNum = 0; // + let syNum = num - value; + if (syNum > 0) { + subNum = syNum; + } else { + addNum = Math.abs(syNum); + } + var update = { addNum: addNum, subNum: subNum }; + obj.update(update); + }else{ + var update = { addNum: '', subNum: '' }; + obj.update(update); } } else if (field === 'remarks') { // 备注 if (value) { diff --git a/js/accessory/child/choose_scrap_fit_type_list.js b/js/accessory/child/choose_scrap_fit_type_list.js index b9e2200..c26426d 100644 --- a/js/accessory/child/choose_scrap_fit_type_list.js +++ b/js/accessory/child/choose_scrap_fit_type_list.js @@ -59,7 +59,7 @@ function initTable() { headers: { authorization: sessionStorage.getItem("gz-token"), }, - url: dataUrl + "backstage/paType/findByPage", + url: dataUrl + "backstage/paType/findByPageList", where: { encryptedData: JSON.stringify({ 'type': $('#type').val(), diff --git a/js/demandPlan/child/demand_plan_detail_list.js b/js/demandPlan/child/demand_plan_detail_list.js index c1647f8..e67cdd7 100644 --- a/js/demandPlan/child/demand_plan_detail_list.js +++ b/js/demandPlan/child/demand_plan_detail_list.js @@ -176,5 +176,5 @@ function exportExcel() { // 需求计划编号 function plan_detail(obj) { - openIframeByParamObj2("plan_detail", "机具需求计划", "../../../page/demandPlan/child/apply_plan_detail.html", "92%", "95%", obj); + openIframeByParamObj("plan_detail", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/page/accessory/child/choose_inventory_count_fit_type_list.html b/page/accessory/child/choose_inventory_count_fit_type_list.html index b37ae47..c956feb 100644 --- a/page/accessory/child/choose_inventory_count_fit_type_list.html +++ b/page/accessory/child/choose_inventory_count_fit_type_list.html @@ -4,7 +4,7 @@
-