Browse Source

计划外入库批次必填

intex_online20241228
张立 2 months ago
parent
commit
c8a687cdea
  1. 30
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  2. 10
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

30
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue

@ -135,6 +135,7 @@ import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as SubjectAccountApi from '@/api/wms/subjectAccount'
const { loadStart, loadDone } = usePageLoading()
import * as ruleApi from '@/api/wms/rule/index'
//
defineOptions({ name: 'UnplannedreceiptRequestMain' })
@ -194,6 +195,7 @@ const isItemType = async (itemCode, labelTypeParams) => {
}
//
const fromManagementPrecision = ref('')
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row )
@ -201,6 +203,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
//
if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode:val[0]['code']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
if (fromManagementPrecision.value == 'BY_QUANTITY') {
// row['disabled_batch'] = false
UnplannedreceiptRequestDetailRules.batch[0].required = false
} else {
// row['disabled_batch'] = true
UnplannedreceiptRequestDetailRules.batch[0].required = true
}
})
} else if(formField == 'itemCode'){
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['code']))
if(itemCodes.length>0){
@ -525,7 +542,20 @@ const buttonTableClick = async (val, row) => {
return
}
})
ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:item['toLocationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
if (fromManagementPrecision.value == 'BY_QUANTITY') {
item.batch = formatDate(new Date(),'YYYYMMDD')
item['disabled_batch'] = false
} else {
item['disabled_batch'] = true
}
})
})
}
}

10
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

@ -1427,6 +1427,9 @@ function validateQty(rule, value, callback) {
}
//表单校验
export const UnplannedreceiptRequestDetailRules = reactive({
batch: [
{ required: true, message: '请选择批次', trigger: ['blur', 'change'] }
],
arriveDate: [
{ required: true, message: '请选择到货日期', trigger: 'change' }
],
@ -1521,7 +1524,9 @@ export const UnplannedreceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSc
width: 150
},
tableForm: {
disabled: true,
type: 'FormDate',
format: 'YYYYMMDD',
valueFormat: 'YYYYMMDD',
},
form: {
componentProps: {
@ -1762,4 +1767,7 @@ export const UnplannedreceiptRequestDetailLabelRules = reactive({
packUnit: [
{ required: true, message: '请选择包装规格', trigger: 'change' }
],
batch: [
{ required: true, message: '请选择批次', trigger: ['blur', 'change'] }
],
})

Loading…
Cancel
Save