|
|
@ -93,6 +93,7 @@ import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 库存转移申请 |
|
|
|
// 只有库存转移申请在使用的 |
|
|
|
defineOptions({ name: 'InventorymoveRequestMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
@ -112,75 +113,9 @@ const importFileName = ref() |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: InventorymoveRequestDetailApi.getInventorymoveRequestDetailPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 判断 路由名称 进行条件过滤 |
|
|
|
/** |
|
|
|
* OktoholdRequestMain 合格转隔离 |
|
|
|
*/ |
|
|
|
if ( routeName.value == 'OktoholdRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'OK', |
|
|
|
// toInventoryStatus:'HOLD', |
|
|
|
businessType :'OkToHold' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
businessType.value = 'OkToHold' |
|
|
|
importFileName.value = '物料转隔离申请' |
|
|
|
} |
|
|
|
else if ( routeName.value == 'NoktoholdRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'NOK', |
|
|
|
// toInventoryStatus:'HOLD', |
|
|
|
businessType :'NokToHold' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'NOK' |
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
businessType.value = 'NokToHold' |
|
|
|
importFileName.value = '不合格转隔离申请' |
|
|
|
} |
|
|
|
else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'HOLD', |
|
|
|
// toInventoryStatus:'OK', |
|
|
|
businessType :'HoldToOk' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
toInventoryStatus.value = "OK" |
|
|
|
businessType.value = 'HoldToOk' |
|
|
|
importFileName.value = '隔离转合格申请' |
|
|
|
} else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'HOLD', |
|
|
|
// toInventoryStatus:'SCRAP', |
|
|
|
businessType:'HoldToScrap' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
businessType.value = 'HoldToScrap' |
|
|
|
importFileName.value = '隔离转报废申请' |
|
|
|
} else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'OK', |
|
|
|
// toInventoryStatus:'SCRAP', |
|
|
|
businessType :'OkToScrap' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
businessType.value = 'OkToScrap' |
|
|
|
importFileName.value = '合格转报废申请' |
|
|
|
} |
|
|
|
else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
// fromInventoryStatus: 'SCRAP', |
|
|
|
// toInventoryStatus:'HOLD', |
|
|
|
businessType :'ScrapToHold' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'SCRAP' |
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
businessType.value = 'ScrapToHold' |
|
|
|
importFileName.value = '报废转隔离申请' |
|
|
|
} else { |
|
|
|
// 库存移动申请 InventorymoveRequestMain |
|
|
|
// 仅有库存移动申请在使用 |
|
|
|
if ( routeName.value == 'InventorymoveRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
businessType :'Move' |
|
|
|
} |
|
|
@ -389,26 +324,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
newRow['fromLocationCode'] = item['locationCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['qty'] = item['qty'] |
|
|
|
if(routeName.value == 'OktoholdRequestMain'){ |
|
|
|
newRow['toInventoryStatus'] = "HOLD" |
|
|
|
}else if(routeName.value == 'NoktoholdRequestMain'){ |
|
|
|
newRow['toInventoryStatus'] = "HOLD" |
|
|
|
}else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
newRow['toInventoryStatus'] = "OK" |
|
|
|
}else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
newRow['toInventoryStatus'] = "SCRAP" |
|
|
|
}else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
newRow['toInventoryStatus'] = "SCRAP" |
|
|
|
}else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
newRow['toInventoryStatus'] = "HOLD" |
|
|
|
}else{ |
|
|
|
newRow['toInventoryStatus'] = item['inventoryStatus'] |
|
|
|
} |
|
|
|
newRow['toInventoryStatus'] = item['inventoryStatus']//库存移动申请 |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
if(routeName.value == 'OktoholdRequestMain'){ |
|
|
|
getDefaultToLocationCode() |
|
|
|
} |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
@ -446,21 +364,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
setV['fromInventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
setV['fromLocationCode'] = val[0]['locationCode'] |
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
if(routeName.value == 'OktoholdRequestMain'){ |
|
|
|
setV['toInventoryStatus'] = "HOLD" |
|
|
|
}else if(routeName.value == 'NoktoholdRequestMain'){ |
|
|
|
setV['toInventoryStatus'] = "HOLD" |
|
|
|
}else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
setV['toInventoryStatus'] = "OK" |
|
|
|
}else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
setV['toInventoryStatus'] = "SCRAP" |
|
|
|
}else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
setV['toInventoryStatus'] = "SCRAP" |
|
|
|
}else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
setV['toInventoryStatus'] = "HOLD" |
|
|
|
}else{ |
|
|
|
setV['toInventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
} |
|
|
|
setV['toInventoryStatus'] = val[0]['inventoryStatus'] //库存移动申请InventorymoveRequestMain |
|
|
|
|
|
|
|
} else { |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
} |
|
|
@ -473,9 +378,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:inventorymove-request-main:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:inventorymove-request-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:inventorymove-request-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:`wms:${routeName.value}::create`}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import`}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export`}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -527,14 +432,14 @@ const butttondata = (row,$index) => { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:inventorymove-request-main:close'}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:inventorymove-request-main:reAdd'}), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorymove-request-main:submit'}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorymove-request-main:refused'}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorymove-request-main:agree'}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:inventorymove-request-main:handle'}), // 处理 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorymove-request-main:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventorymove-request-main:delete'}), // 删除 |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:`wms:${routeName.value}:close`}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:`wms:${routeName.value}:reAdd`}), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:refused`}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:handle`}), // 处理 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:`wms:${routeName.value}:delete`}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -677,27 +582,9 @@ const handleExport = async () => { |
|
|
|
// 发起导出 |
|
|
|
loadStart() |
|
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
if(routeName.value == 'OktoholdRequestMain'){ |
|
|
|
const data = await InventorymoveRequestMainApi.exportOkToHoldRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
}else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
const data = await InventorymoveRequestMainApi.exportHoldToOkRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
}else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
const data = await InventorymoveRequestMainApi.exportHoldToScrapRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
}else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
const data = await InventorymoveRequestMainApi.exportOkToScrapRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
} |
|
|
|
// else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
// const data = await InventorymoveRequestMainApi.exportScrapToHoldRequestMain(tableObject.params) |
|
|
|
// download.excel(data, '报废转隔离申请主.xlsx') |
|
|
|
// } |
|
|
|
else{ |
|
|
|
const data = await InventorymoveRequestMainApi.exportInventorymoveRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
} |
|
|
|
// 库存移动申请InventorymoveRequestMain |
|
|
|
const data = await InventorymoveRequestMainApi.exportInventorymoveRequestMain(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
loadDone() |
|
|
@ -834,10 +721,9 @@ const searchList = (model)=>{ |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
// 库存移动申请InventorymoveRequestMain |
|
|
|
if(routeName.value == "InventorymoveRequestMain"){ |
|
|
|
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplate() |
|
|
|
}else { |
|
|
|
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove() |
|
|
|
} |
|
|
|
}) |
|
|
|
</script> |
|
|
|