Browse Source

国强-订单数不可编辑

如果订单数大于零小于1  收货数默认等于订单数
如果订单数大于1  默认收货数为1

提交收货数不能大于订单数,收货数量必须大于0
hella_online_20240816
wangyufei 3 months ago
parent
commit
92f96b0be5
  1. 11
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue
  2. 18
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts

11
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue

@ -509,6 +509,12 @@ const updateTableData = (tableList)=>{
//
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation']
if(Number(row['orderQty'])>1){
newRow['qty'] = 1
}else{
newRow['qty'] = row['orderQty']
}
if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){
tableData.value.push(newRow)
}
@ -734,6 +740,11 @@ const submitForm = async (formType, submitData) => {
tableData.value.forEach((row, index) => {
row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf()
})
if(tableData.value.find(item=>item['qty']>item['orderQty'])){
message.error('收货数不能大于订单数')
return
}
data.subList = tableData.value //
try {
if (formType === 'create') {

18
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts

@ -580,7 +580,13 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
}
]))
function validateQty(rule, value, callback) {
if (value>0) {
callback()
}else{
callback(new Error('数量必须大于0'))
}
}
//表单校验
export const PurchasereceiptRequestMainRules = reactive({
ppNumber: [
@ -609,7 +615,7 @@ export const PurchasereceiptRequestMainRules = reactive({
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
]
})
/**
@ -844,6 +850,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
},
sortTableDefault:9,
tableForm: {
disabled:true,
type: 'InputNumber',
min: 1,
precision: 6
@ -860,13 +867,13 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
form: {
component: 'InputNumber',
componentProps: {
min: 1,
min: 0,
precision: 6
},
},
tableForm: {
type: 'InputNumber',
min: 1,
min: 0,
precision: 6
}
},
@ -1370,6 +1377,9 @@ export const PurchasereceiptRequestDetailRules = reactive({
itemCode: [
{ required: true, message: '请输入物料代码', trigger: 'change' }
],
qty:[
{ validator:validateQty, message: '收货数量必须大于0', trigger: 'change'}
]
})
/**

Loading…
Cancel
Save