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 @@
- scope.row.unitValue == 1
- ? (scope.row.preNum = Number(v.replace(/[^\d.]/g, '')))
- : (scope.row.preNum = Number(v.replace(/[^\d]/g, '')))
- "
- >
+ :disabled="scope.row.alNum && scope.row.alNum != 0"
+ @input="handlePreNum(scope.row, $event, 'input')"
+ @blur="handlePreNum(scope.row, $event, 'blur')"
+ />
@@ -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 @@
(scope.row.unitValue==1?scope.row.preNum=Number(v.replace(/[^\d.]/g,'')) : scope.row.preNum=Number(v.replace(/[^\d]/g,'')))"
- >
+ v-model="scope.row.preNum"
+ type="text"
+ style="width: 100%"
+ :disabled="scope.row.alNum && scope.row.alNum != 0"
+ @input="handlePreNum(scope.row, $event, 'input')"
+ @blur="handlePreNum(scope.row, $event, 'blur')"
+ />
@@ -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 @@
- scope.row.unitValue == 1
- ? (scope.row.purchaseNum = Number(v.replace(/[^\d.]/g, '')))
- : (scope.row.purchaseNum = Number(v.replace(/[^\d]/g, '')))
- "
- >
+ @input="handlePreNum(scope.row, $event, 'input')"
+ @blur="handlePreNum(scope.row, $event, 'blur')"
+ />
@@ -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') {