From 297b91f20eb2ae5d74513c22a5b202d01b5314b6 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Fri, 6 Dec 2024 15:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E6=96=B0=E5=A2=9E=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/back/component/addReturn.vue | 15 ++++-- src/views/material/lease/outBound/index.vue | 52 +++++++++++++------ 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/views/material/back/component/addReturn.vue b/src/views/material/back/component/addReturn.vue index 1e52063f..f68ae556 100644 --- a/src/views/material/back/component/addReturn.vue +++ b/src/views/material/back/component/addReturn.vue @@ -855,11 +855,18 @@ export default { ) }, checkNum(row) { + console.log(row) let maxNum = row.num - if (row.preNum <= 1) { - row.preNum = 1 - } else if (row.preNum >= maxNum) { - row.preNum = maxNum + if(row.unitValue==1){ + row.preNum=Number(String(row.preNum).replace(/[^\d.]/g,'')) + }else{ + row.preNum=Number(String(row.preNum).replace(/[^\d]/g,'')) + } + if (row.preNum <= 0) { + row.preNum = 0; + } + if (row.preNum > maxNum) { + row.preNum = maxNum; } }, /////// 设备类型树 切换 diff --git a/src/views/material/lease/outBound/index.vue b/src/views/material/lease/outBound/index.vue index c20d8ee7..d06d81a0 100644 --- a/src/views/material/lease/outBound/index.vue +++ b/src/views/material/lease/outBound/index.vue @@ -274,6 +274,12 @@ prop="typeName" :show-overflow-tooltip="true" /> + + - - - - - - + @@ -1081,6 +1091,8 @@ export default { this.$set(obj, "outNum", row.outNum); //待出库数量 this.$set(obj, "inputNum", 1); //出库数量 this.$set(obj, "num", row.num); //库存 + this.$set(obj, "unitValue", row.unitValue); + this.$set(obj, "unitName", row.unitName); console.log("[obj]", [obj]); this.outNumList = [obj]; }, @@ -1210,14 +1222,20 @@ export default { }, //输入出库数量 - checkNum(row) { + checkNum(row) { + console.log(row) let maxNum = row.outNum; - if (row.inputNum <= 1) { - row.inputNum = 1; + if(row.unitValue==1){ + row.inputNum=Number(String(row.inputNum).replace(/[^\d.]/g,'')) + }else{ + row.inputNum=Number(String(row.inputNum).replace(/[^\d]/g,'')) + } + if (row.inputNum <= 0) { + row.inputNum = 0; } if (row.inputNum > row.outNum) { row.inputNum = maxNum; - } + } }, },