Browse Source

YT-448:隔离区精度按数量

intex_online20241111
songguoqiang 1 month ago
parent
commit
48b6bf0647
  1. 1
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
  2. 50
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue
  3. 11
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

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

@ -426,6 +426,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}else{ }else{
newRow['fromBatchFormItemType'] = '' newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true newRow['disabled_fromBatch'] = true
newRow['fromBatch'] = '';//
} }
} }
newRow['fromInventoryStatus'] = item['inventoryStatus'] newRow['fromInventoryStatus'] = item['inventoryStatus']

50
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue

@ -94,6 +94,7 @@ import * as LocationApi from '@/api/wms/location'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import dayjs from 'dayjs' import dayjs from 'dayjs'
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()
// OktoholdRequestMain // OktoholdRequestMain
// 使 // 使
@ -309,19 +310,57 @@ const clearInput = (field, row, index) => {
row['supplierName'] = '' row['supplierName'] = ''
} }
} }
const fromManagementPrecision = ref('')
const toManagementPrecision = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async() => {
if (type == 'tableForm') { if (type == 'tableForm') {
if(formField == 'fromPackingNumber'){ if(formField == 'fromPackingNumber'){
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['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['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{
const toLocationCode =formRef.formModel.toLocationCode//
if(toLocationCode==''){
message.warning('到库位代码不能为空');
return
}
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['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:item['locationCode']
}).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['fromLocationCode'] = item['locationCode'] newRow['fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
@ -765,4 +804,11 @@ onMounted(async () => {
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove() importTemplateData.templateUrl = await InventorymoveRequestMainApi.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>

11
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

@ -1108,15 +1108,16 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
label: '从批次', label: '从批次',
field: 'fromBatch', field: 'fromBatch',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
tableForm: { tableForm: {
disabled: true disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
}, },
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true,
valueFormat: 'YYYYMMDD',
} }
} }
}, },

Loading…
Cancel
Save