|
@ -106,7 +106,6 @@ routeName.value = route.name |
|
|
const tableColumns = ref([...InventorymoveRequestMain.allSchemas.tableColumns,...InventorymoveRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([...InventorymoveRequestMain.allSchemas.tableColumns,...InventorymoveRequestDetail.allSchemas.tableMainColumns]) |
|
|
const businessType = ref() |
|
|
const businessType = ref() |
|
|
|
|
|
|
|
|
console.log(99 , routeName.value) |
|
|
|
|
|
const fromInventoryStatus = ref() |
|
|
const fromInventoryStatus = ref() |
|
|
const toInventoryStatus = ref() |
|
|
const toInventoryStatus = ref() |
|
|
const importFileName = ref() |
|
|
const importFileName = ref() |
|
@ -123,7 +122,6 @@ if ( routeName.value == 'InventorymoveRequestMain') { |
|
|
businessType.value = 'Move' |
|
|
businessType.value = 'Move' |
|
|
importFileName.value = '库存移动申请' |
|
|
importFileName.value = '库存移动申请' |
|
|
} |
|
|
} |
|
|
console.log(99 , businessType.value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -299,7 +297,6 @@ const getDefaultToLocationCode = async ()=>{ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
let res = await LocationApi.selectBusinessTypeToLocation(params) |
|
|
let res = await LocationApi.selectBusinessTypeToLocation(params) |
|
|
console.log('res',res) |
|
|
|
|
|
if(res&&res.list.length>0){ |
|
|
if(res&&res.list.length>0){ |
|
|
tableData.value.forEach(item=>{ |
|
|
tableData.value.forEach(item=>{ |
|
|
if(!item['toLocationCode']){ |
|
|
if(!item['toLocationCode']){ |
|
@ -308,9 +305,11 @@ const getDefaultToLocationCode = async ()=>{ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
let fromManagementPrecision = ref('') |
|
|
|
|
|
let 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'])) |
|
@ -328,6 +327,28 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
newRow['toInventoryStatus'] = item['inventoryStatus']//库存移动申请 |
|
|
newRow['toInventoryStatus'] = item['inventoryStatus']//库存移动申请 |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}else if (formField == 'toLocationCode') { |
|
|
|
|
|
row[formField] = val[0][searchField] |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
|
|
locationCode:row['fromLocationCode'] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
fromManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
|
|
locationCode: val[0][searchField] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
toManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') { |
|
|
|
|
|
row['fromBatchFormItemType'] = 'FormDate' |
|
|
|
|
|
row['disabled_fromBatch'] = false |
|
|
|
|
|
} else { |
|
|
|
|
|
row['fromBatchFormItemType'] = '' |
|
|
|
|
|
row['disabled_fromBatch'] = true |
|
|
|
|
|
row['fromBatch'] ='' |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
@ -354,8 +375,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(async() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField == 'fromPackingNumber') { |
|
|
if(formField == 'fromPackingNumber') { |
|
|
setV['fromPackingNumber'] = val[0]['packingNumber'] |
|
|
setV['fromPackingNumber'] = val[0]['packingNumber'] |
|
@ -366,7 +387,37 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
setV['fromLocationCode'] = val[0]['locationCode'] |
|
|
setV['fromLocationCode'] = val[0]['locationCode'] |
|
|
setV['uom'] = val[0]['uom'] |
|
|
setV['uom'] = val[0]['uom'] |
|
|
setV['toInventoryStatus'] = val[0]['inventoryStatus'] //库存移动申请InventorymoveRequestMain |
|
|
setV['toInventoryStatus'] = val[0]['inventoryStatus'] //库存移动申请InventorymoveRequestMain |
|
|
|
|
|
} else if (formField == 'toLocationCode') { |
|
|
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [formRef.formModel.itemCode], |
|
|
|
|
|
locationCode:formRef.formModel.fromLocationCode |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
fromManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [formRef.formModel.itemCode], |
|
|
|
|
|
locationCode: val[0][searchField] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
toManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') { |
|
|
|
|
|
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch'))) |
|
|
|
|
|
obj.value.component= 'DatePicker' |
|
|
|
|
|
obj.value.componentProps.disabled= false |
|
|
|
|
|
obj.value.componentProps.type= 'date' |
|
|
|
|
|
obj.value.componentProps.valueFormat= 'YYYYMMDD' |
|
|
|
|
|
obj.value.componentProps.format = 'YYYYMMDD' |
|
|
|
|
|
InventorymoveRequestDetailRules.fromBatch[0].required = true |
|
|
|
|
|
} else { |
|
|
|
|
|
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch'))) |
|
|
|
|
|
obj.value.component= 'Input' |
|
|
|
|
|
obj.value.componentProps={ |
|
|
|
|
|
disabled : true |
|
|
|
|
|
} |
|
|
|
|
|
setV['fromBatch'] ='' |
|
|
|
|
|
InventorymoveRequestDetailRules.fromBatch[0].required = false |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
@ -457,7 +508,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
await message.confirm('确认要重新添加吗?') |
|
@ -468,7 +518,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
await message.confirm('确认要提交审批吗?') |
|
@ -479,7 +528,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
await message.confirm('确认要驳回吗?') |
|
|
await message.confirm('确认要驳回吗?') |
|
@ -490,7 +538,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
await message.confirm('确认要审批通过吗?') |
|
@ -501,7 +548,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
await message.confirm('确认要处理吗?') |
|
|
await message.confirm('确认要处理吗?') |
|
@ -512,7 +558,6 @@ const buttonTableClick = async (val, row) => { |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh',null) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
@ -531,20 +576,50 @@ const openForm =async (type: string, row?: number) => { |
|
|
/** |
|
|
/** |
|
|
* 详情 新增/编辑事件 |
|
|
* 详情 新增/编辑事件 |
|
|
*/ |
|
|
*/ |
|
|
const detailOpenForm = (type, row) => { |
|
|
const detailOpenForm =async (type, row) => { |
|
|
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.push({ |
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.push({ |
|
|
key: 'warehouseCode', |
|
|
key: 'warehouseCode', |
|
|
value: fromWarehouseCodeMain.value, |
|
|
value: fromWarehouseCodeMain.value, |
|
|
isMainValue: false |
|
|
isMainValue: false |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => { |
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => { |
|
|
if (item.key == 'warehouseCode') { |
|
|
if (item.key == 'warehouseCode') { |
|
|
item.value = fromWarehouseCodeMain.value |
|
|
item.value = fromWarehouseCodeMain.value |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if (type == 'update') { |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
|
|
locationCode:row['fromLocationCode'] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
fromManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
await ruleApi.getManagementPrecision({ |
|
|
|
|
|
itemCodes: [row['itemCode']], |
|
|
|
|
|
locationCode: row['toLocationCode'] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
toManagementPrecision.value = res[0].ManagementPrecision |
|
|
|
|
|
}) |
|
|
|
|
|
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') { |
|
|
|
|
|
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch'))) |
|
|
|
|
|
obj.value.component= 'DatePicker' |
|
|
|
|
|
obj.value.componentProps.disabled= false |
|
|
|
|
|
obj.value.componentProps.type= 'date' |
|
|
|
|
|
obj.value.componentProps.valueFormat= 'YYYYMMDD' |
|
|
|
|
|
obj.value.componentProps.format= 'YYYYMMDD' |
|
|
|
|
|
InventorymoveRequestDetailRules.fromBatch[0].required = true |
|
|
|
|
|
} else { |
|
|
|
|
|
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch'))) |
|
|
|
|
|
obj.value.component= 'Input' |
|
|
|
|
|
obj.value.componentProps={ |
|
|
|
|
|
disabled : true |
|
|
|
|
|
} |
|
|
|
|
|
InventorymoveRequestDetailRules.fromBatch[0].required = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const fromWarehouseCodeMain = ref() |
|
|
const fromWarehouseCodeMain = ref() |
|
@ -629,11 +704,16 @@ const submitForm = async (formType, submitData) => { |
|
|
message.warning('从库位和到库位不能相同') |
|
|
message.warning('从库位和到库位不能相同') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
let batchList = tableData.value.filter(item=>item.fromBatchFormItemType&&item.fromBatchFormItemType == 'FormDate') |
|
|
|
|
|
let noBatch = batchList.some(item => !item.fromBatch) |
|
|
|
|
|
if(noBatch){ |
|
|
|
|
|
message.warning('请选择从批次') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
let isExist = false |
|
|
let isExist = false |
|
|
tableData.value.forEach(item => { |
|
|
tableData.value.forEach(item => { |
|
|
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) ) |
|
|
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) ) |
|
|
console.log(rs,5666); |
|
|
|
|
|
if(rs.length > 1) isExist = true |
|
|
if(rs.length > 1) isExist = true |
|
|
}) |
|
|
}) |
|
|
if (isExist) { |
|
|
if (isExist) { |
|
@ -643,7 +723,6 @@ const submitForm = async (formType, submitData) => { |
|
|
} |
|
|
} |
|
|
flag.value = false |
|
|
flag.value = false |
|
|
data.subList.forEach(item => { |
|
|
data.subList.forEach(item => { |
|
|
console.log(556565,item); |
|
|
|
|
|
if(fromInventoryStatus.value){ |
|
|
if(fromInventoryStatus.value){ |
|
|
//item.fromInventoryStatus = fromInventoryStatus.value |
|
|
//item.fromInventoryStatus = fromInventoryStatus.value |
|
|
item.toInventoryStatus = toInventoryStatus.value |
|
|
item.toInventoryStatus = toInventoryStatus.value |
|
|