Browse Source

YT-436:数量-批次添加批次

intex_online20241111
songguoqiang 1 month ago
parent
commit
5343bcd653
  1. 45
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
  2. 6
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts
  3. 2
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

45
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

@ -99,6 +99,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// ()InventorymoveRecordMainNew // ()InventorymoveRecordMainNew
defineOptions({ name: 'InventorymoveRecordMainNew' }) defineOptions({ name: 'InventorymoveRecordMainNew' })
@ -375,21 +376,53 @@ const submitForm = async (formType, submitData) => {
formRef.value.formLoading = false formRef.value.formLoading = false
} }
} }
const fromManagementPrecision = ref('')
const toManagementPrecision = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) console.log('searchTableSuccess',formField, searchField, val, formRef, type, row)
nextTick(() => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
if(formField == 'itemCode'){ if(formField == 'itemCode'){
const fromLocationCode =formRef.formModel.fromLocationCode//
const toLocationCode =formRef.formModel.fromLocationCode//
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['origin_fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus'])) val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['origin_fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{ val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['fromPackingNumber'] = item['packingNumber'] newRow['fromPackingNumber'] = item['packingNumber']
newRow['toPackingNumber'] = item['packingNumber'] newRow['toPackingNumber'] = item['packingNumber']
newRow['fromContainerNumber'] = item['containerNumber'] newRow['fromContainerNumber'] = item['containerNumber']
newRow['itemCode'] = item['itemCode'] newRow['itemCode'] = item['itemCode']
newRow['fromBatch'] = item['batch'] newRow['fromBatch'] = item['batch']
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:fromLocationCode
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {//+
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:toLocationCode
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (toManagementPrecision.value != 'BY_QUANTITY') {//+
if(newRow['fromBatch']==''){
newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD
}
newRow['fromBatchFormItemType'] = 'FormDate'
newRow['disabled_fromBatch'] = false
}else {
newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true
}
}
newRow['fromInventoryStatus'] = item['inventoryStatus'] newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['origin_fromLocationCode'] = item['locationCode'] newRow['origin_fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
@ -467,5 +500,13 @@ onMounted(async () => {
// ()InventorymoveRecordMainNew // ()InventorymoveRecordMainNew
importTemplateData.templateUrl = await InventorymoveRecordMainApi.importTemplateExceptMove() importTemplateData.templateUrl = await InventorymoveRecordMainApi.importTemplateExceptMove()
}) })
const getFormattedDate = () =>{
const a = new Date();
const year = a.getFullYear();
const month = String(a.getMonth() + 1).padStart(2, '0');
const day = String(a.getDate()).padStart(2, '0');
return `${year}${month}${day}`;
}
</script> </script>
./inventorymoveRecordRequestMain.data ./inventorymoveRecordRequestMain.data

6
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts

@ -431,10 +431,14 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
}, },
tableForm: { tableForm: {
disabled: true, disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
}, },
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true,
valueFormat: 'YYYYMMDD',
} }
} }
}, },

2
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

@ -368,7 +368,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD
} }
await ruleApi.getManagementPrecision({ await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']], itemCodes: [item['itemCode']],
locationCode:val[0]['locationCode'] locationCode:val[0]['locationCode']
}).then((res) => { }).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision fromManagementPrecision.value = res[0].ManagementPrecision

Loading…
Cancel
Save