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