|
|
@ -83,7 +83,19 @@ import * as InventorychangeRequestDetailApi from '@/api/wms/inventorychangeReque |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
|
|
// 库存修改申请 合格转隔离 |
|
|
|
defineOptions({ name: 'InventorychangeRequestMain' }) |
|
|
|
defineOptions({ name: 'OktoholdRequestMain' }) |
|
|
|
|
|
|
|
// 库存修改申请 隔离转合格 |
|
|
|
// defineOptions({ name: 'HoldtookRequestMain' }) |
|
|
|
|
|
|
|
// // 库存修改申请 隔离转报废 |
|
|
|
// defineOptions({ name: 'HoldtoscrapRequestMain' }) |
|
|
|
|
|
|
|
// // 库存修改申请 合格转报废 |
|
|
|
// defineOptions({ name: 'OktoscrapRequestMain' }) |
|
|
|
|
|
|
|
// // 库存修改申请 报废转隔离 |
|
|
|
// defineOptions({ name: 'ScraptoholdRequestMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
@ -107,16 +119,39 @@ const { tableObject, tableMethods } = useTable({ |
|
|
|
*/ |
|
|
|
if ( routeName.value == 'OktoholdRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
fromInventoryStatus: 'OK' |
|
|
|
fromInventoryStatus: 'OK', |
|
|
|
toInventoryStatus:'HOLD' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
toInventoryStatus.value = "HODxxx" |
|
|
|
} else if ( routeName.value == 'xxxx') { |
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
} else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
fromInventoryStatus: 'HOLD', |
|
|
|
toInventoryStatus:'OK' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
toInventoryStatus.value = "OK" |
|
|
|
} else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
fromInventoryStatus: 'HOLD', |
|
|
|
toInventoryStatus:'SCRAP' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
} else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
fromInventoryStatus: 'xxx' |
|
|
|
fromInventoryStatus: 'OK', |
|
|
|
toInventoryStatus:'SCRAP' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'xxx' |
|
|
|
toInventoryStatus.value = "xxx" |
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
} else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
tableObject.params = { |
|
|
|
fromInventoryStatus: 'SCRAP', |
|
|
|
toInventoryStatus:'HOLD' |
|
|
|
} |
|
|
|
fromInventoryStatus.value = 'SCRAP' |
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
} |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
@ -204,13 +239,14 @@ const isShowMainButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:inventorychange-request-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventorychange-request-main:delete'}), // 删除 |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:inventorychange-request-main:close'}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:inventorychange-request-main:reAdd'}), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorychange-request-main:submit'}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorychange-request-main:refused'}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorychange-request-main:agree'}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:inventorychange-request-main:handle'}), // 处理 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorychange-request-main:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventorychange-request-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -219,15 +255,53 @@ const butttondata = (row) => { |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
InventorychangeRequestMainApi.close(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
InventorychangeRequestMainApi.reAdd(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
InventorychangeRequestMainApi.submit(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
InventorychangeRequestMainApi.refused(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
InventorychangeRequestMainApi.agree(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
await message.confirm('确认要处理吗?') |
|
|
|
InventorychangeRequestMainApi.handle(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -270,7 +344,7 @@ const handleExport = async () => { |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await InventorychangeRequestMainApi.exportInventorychangeRequestMain(tableObject.params) |
|
|
|
download.excel(data, '库存修改申请主.xlsx') |
|
|
|
download.excel(data, '库存修改申请.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -298,10 +372,13 @@ const handleDeleteTable = (item, index) => { |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
data.fromInventoryStatus = fromInventoryStatus.value |
|
|
|
data.toInventoryStatus = toInventoryStatus.value |
|
|
|
data.subList.forEach(item => { |
|
|
|
item.fromInventoryStatus = fromInventoryStatus.value |
|
|
|
item.toInventoryStatus = toInventoryStatus.value |
|
|
|
}) |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
console.log(data) |
|
|
|
await InventorychangeRequestMainApi.createInventorychangeRequestMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
@ -325,7 +402,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '库存修改申请主导入模版.xlsx' |
|
|
|
templateTitle: '库存修改申请导入模版.xlsx' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|