fix:预警管理功能新增配置数字校验
This commit is contained in:
@@ -160,7 +160,8 @@ const defaultForm = {
|
|||||||
update_name: null,
|
update_name: null,
|
||||||
update_time: null,
|
update_time: null,
|
||||||
cron: null,
|
cron: null,
|
||||||
notify_type: null
|
notify_type: null,
|
||||||
|
tableData: []
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -175,6 +176,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const numberOne = (rule, value, callback) => {
|
||||||
|
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||||
|
const numRe = new RegExp(numReg)
|
||||||
|
if (value) {
|
||||||
|
if (!numRe.test(value)) {
|
||||||
|
callback(new Error('只能输入数字'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dtlShow: false,
|
dtlShow: false,
|
||||||
@@ -188,6 +202,17 @@ export default {
|
|||||||
],
|
],
|
||||||
stor_code: [
|
stor_code: [
|
||||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||||
|
], safe_qty_lower_limit: [
|
||||||
|
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||||
|
{ validator: numberOne }
|
||||||
|
],
|
||||||
|
safe_qty_upper_limit: [
|
||||||
|
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||||
|
{ validator: numberOne }
|
||||||
|
],
|
||||||
|
safe_days: [
|
||||||
|
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||||
|
{ validator: numberOne }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
stors: []
|
stors: []
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="cron" label="表达式" :min-width="flexWidth('cron',crud.data,'表达式')" />
|
|
||||||
<el-table-column prop="notify_type" label="通知类型" :min-width="flexWidth('notify_type',crud.data,'通知类型')">
|
<el-table-column prop="notify_type" label="通知类型" :min-width="flexWidth('notify_type',crud.data,'通知类型')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.NOTIFY_TYPE[scope.row.notify_type] }}
|
{{ dict.label.NOTIFY_TYPE[scope.row.notify_type] }}
|
||||||
|
|||||||
Reference in New Issue
Block a user