Browse Source

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

master_hella_20240701
wangyufei 4 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['poNumber'] = row['number']
newRow['poLine'] = row['lineNumber']
newRow['planQty'] = 0 //
if (formField == 'poLine') {
newRow['itemCode'] = row['itemCode']
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: {
type: 'InputNumber',
min: 1,
precision: 6
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
}
@ -716,7 +714,15 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
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({
// available: [
@ -729,7 +735,8 @@ export const PurchasePlanDetailRules = reactive({
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
{ required: true, message: '请输入计划数量', trigger: 'blur' },
{ validator:validatePlanQty, message: '计划数量不能为0', trigger: 'blur'}
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }

Loading…
Cancel
Save