Browse Source

bug:要货计划新增保存报异常

master_hella_20240701
wangyufei 5 months ago
parent
commit
36d891660f
  1. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  2. 15
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

1
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -201,6 +201,7 @@ const getSearchTableData = async (number,formField,searchField)=>{
newRow['itemCode'] = row['itemCode'] newRow['itemCode'] = row['itemCode']
newRow['poNumber'] = row['number'] newRow['poNumber'] = row['number']
newRow['poLine'] = row['lineNumber'] newRow['poLine'] = row['lineNumber']
newRow['planQty'] = 0 //
if (formField == 'poLine') { if (formField == 'poLine') {
newRow['itemCode'] = row['itemCode'] newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom'] newRow['uom'] = row['uom']

15
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -596,13 +596,11 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
min: 1,
precision: 6 precision: 6
}, },
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 1,
precision: 6 precision: 6
} }
} }
@ -716,7 +714,15 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
} }
])) ]))
const validatePlanQty = (rule, value, callback) => {
console.log('validatePlanQty',value)
const numReg = /^[\d]+$/
if (numReg.test(value)&&value>0) {
callback()
} else {
callback(new Error('计划数量不能为0'))
}
}
//表单校验 //表单校验
export const PurchasePlanDetailRules = reactive({ export const PurchasePlanDetailRules = reactive({
// available: [ // available: [
@ -729,7 +735,8 @@ export const PurchasePlanDetailRules = reactive({
{ required: true, message: '请选择计量单位', trigger: 'change' } { required: true, message: '请选择计量单位', trigger: 'change' }
], ],
planQty: [ planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' } { required: true, message: '请输入计划数量', trigger: 'blur' },
{ validator:validatePlanQty, message: '计划数量不能为0', trigger: 'blur'}
], ],
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }

Loading…
Cancel
Save