|
@ -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 |
|
|