Browse Source

HL-6012新增Q1通知单时,数量,索赔金额默认值为空,数值是通过复制粘贴进行,但是只能输入数值类型

hella_online_20240919
yufei_wang 3 months ago
parent
commit
25781f5eea
  1. 40
      src/views/qms/inspectionQ1/inspectionQ1.data.ts

40
src/views/qms/inspectionQ1/inspectionQ1.data.ts

@ -12,13 +12,29 @@ import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const validateNumber = (rule: any, value: any, callback: any) => {
if (!value) {
callback();
} else {
const codeReg = /^[-+]?[0-9]*\.?[0-9]+$/
if (codeReg.test(value)) {
callback()
} else {
callback(new Error('订单号只能是数字'))
}
}
}
// 表单校验
export const Q1Rules = reactive({
itemCode: [{ required: true, message: '请选择物料代码', trigger: 'change' }],
customerCode: [{ required: true, message: '请选择客户代码', trigger: 'change' }],
qty: [{ required: true, message: '请输入数量', trigger: 'change' }],
claimAmount: [{ required: true, message: '请输入索赔金额', trigger: 'change' }],
qty: [{ required: true, message: '请输入数量', trigger: 'change' },
{ validator:validateNumber, message: '数量必须是数值类型', trigger: 'change'}
],
claimAmount: [{ required: true, message: '请输入索赔金额', trigger: 'change' },
{ validator:validateNumber, message: '索赔金额必须是数值类型', trigger: 'change'}
],
code: [{ required: true, message: '请选择缺陷代码', trigger: 'change' }],
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
costCode: [{ required: true, message: '请选择选择成本中心代码', trigger: 'change' }],
@ -142,11 +158,11 @@ export const Q1 = useCrudSchemas(
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
// component: 'InputNumber',
// componentProps: {
// min: 0,
// precision: 2
// }
}
},
{
@ -194,11 +210,11 @@ export const Q1 = useCrudSchemas(
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
// component: 'InputNumber',
// componentProps: {
// min: 0,
// precision: 2
// }
}
},
{

Loading…
Cancel
Save