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