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; - } + } }, },