From 1bda53878bb3da5677892295260016db1b918569 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Wed, 13 Aug 2025 10:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B0=8F=E6=95=B0=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/businessHandling/index.vue | 30 +++++++++++-------- .../lease/apply/component/addToolsApply.vue | 24 +++++++++++---- .../purchase/goodsAccept/editTools.vue | 28 ++++++++++------- 3 files changed, 54 insertions(+), 28 deletions(-) diff --git a/src/views/business/businessHandling/index.vue b/src/views/business/businessHandling/index.vue index fbeed95d..204967ab 100644 --- a/src/views/business/businessHandling/index.vue +++ b/src/views/business/businessHandling/index.vue @@ -299,19 +299,13 @@ @@ -657,6 +651,18 @@ export default { console.log(this.$route.query, 'this.$route.query') }, methods: { + handlePreNum(row, val, type) { + if (type === 'input') { + const reg = row.unitValue == 1 + ? val.replace(/[^\d.]/g, '') // 允许小数 + : val.replace(/[^\d]/g, '') // 只能整数 + row.preNum = reg + } else if (type === 'blur') { + if (row.preNum !== '') { + row.preNum = Number(row.preNum) + } + } + }, fitNumChange() { const newVal = Math.min(5, Math.max(1, parseInt(this.maForm.fitNum) || 1)) const ratio = newVal / this.lastFitNum diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue index 0ec84f6a..2b4ba4fb 100644 --- a/src/views/material/lease/apply/component/addToolsApply.vue +++ b/src/views/material/lease/apply/component/addToolsApply.vue @@ -260,11 +260,13 @@ @@ -540,6 +542,18 @@ export default { // this.equipmentType(); }, methods: { + handlePreNum(row, val, type) { + if (type === 'input') { + const reg = row.unitValue == 1 + ? val.replace(/[^\d.]/g, '') // 允许小数 + : val.replace(/[^\d]/g, '') // 只能整数 + row.preNum = reg + } else if (type === 'blur') { + if (row.preNum !== '') { + row.preNum = Number(row.preNum) + } + } + }, /** 转换菜单数据结构 */ normalizer(node) { if (node.children && !node.children.length) { diff --git a/src/views/material/purchase/goodsAccept/editTools.vue b/src/views/material/purchase/goodsAccept/editTools.vue index 868672fe..6fd35454 100644 --- a/src/views/material/purchase/goodsAccept/editTools.vue +++ b/src/views/material/purchase/goodsAccept/editTools.vue @@ -151,18 +151,12 @@ @@ -525,6 +519,18 @@ export default { this.getTaskInfo() }, methods: { + handlePreNum(row, val, type) { + if (type === 'input') { + const reg = row.unitValue == 1 + ? val.replace(/[^\d.]/g, '') // 允许小数 + : val.replace(/[^\d]/g, '') // 只能整数 + row.purchaseNum = reg + } else if (type === 'blur') { + if (row.purchaseNum !== '') { + row.purchaseNum = Number(row.purchaseNum) + } + } + }, handleDateTypeChange(val) { console.log('xxxxx', val) if (val === 'day') {