|
|
@ -78,7 +78,14 @@ |
|
|
|
:isShowAddBtn="true" |
|
|
|
:detailButtonIsShowAdd="false" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 审核页面 --> |
|
|
|
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> --> |
|
|
|
<BasicForm |
|
|
|
ref="formRefApproved" |
|
|
|
:rules="SparePartsInLocationMainRules" |
|
|
|
:formAllSchemas="SparePartsInLocationExamine.allSchemas" |
|
|
|
@submitForm="approveSparePartsInLocation" |
|
|
|
/> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
@ -94,13 +101,15 @@ import { |
|
|
|
SparePartsInLocationMain, |
|
|
|
SparePartsInLocationMainRules, |
|
|
|
SparePartsInLocationDetail, |
|
|
|
SparePartsInLocationDetailRules |
|
|
|
SparePartsInLocationDetailRules, |
|
|
|
SparePartsInLocationExamine |
|
|
|
} from './sparePartsInLocationMain.data' |
|
|
|
import * as SparePartsInLocationMainApi from '@/api/eam/sparePartsInLocationMain' |
|
|
|
import * as SparePartsInLocationDetailApi from '@/api/eam/sparePartsInLocationDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
// import AudiForm from '@/views/eam/sparepartsinlocation/audiForm.vue' |
|
|
|
|
|
|
|
// 采购订单 |
|
|
|
defineOptions({ name: 'SparePartsApply' }) |
|
|
@ -111,8 +120,9 @@ const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const formRef = ref() |
|
|
|
const formRefApproved = ref() |
|
|
|
const tableColumns = ref(SparePartsInLocationMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
// const audiFormRef = ref() |
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -223,8 +233,12 @@ const isShowMainButton = (row, val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'eam:spare-parts-in-location-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:spare-parts-in-location-main:delete' }) // 删除 |
|
|
|
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:delete' }), // 删除 |
|
|
|
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:examine' }), //审核 |
|
|
|
defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:cancel'}), // 撤回 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:rejecte' }), //驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:approve' }), //审批通过 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -234,16 +248,35 @@ const buttonTableClick = async (val, row) => { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} |
|
|
|
// else if (val == 'mainOrderClo') { |
|
|
|
// // 关闭 |
|
|
|
// handleClose(row.id) |
|
|
|
// } |
|
|
|
else if (val == 'auditing') { |
|
|
|
//审核 |
|
|
|
handleSubmitExamine(row.id) |
|
|
|
} |
|
|
|
else if (val == 'mainTurnDown') { |
|
|
|
//驳回 |
|
|
|
handleRejecte(row.id) |
|
|
|
} |
|
|
|
else if (val == 'mainApprove') { |
|
|
|
//审核通过 |
|
|
|
formRefApproved.value.open('update',row,{masterId:row.id},'auditing') |
|
|
|
} |
|
|
|
else if (val == 'revoke') { // 撤回 |
|
|
|
handleCancel(row.id) |
|
|
|
} |
|
|
|
else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isShowStatusButton = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
@ -269,35 +302,7 @@ const handleDelete = async (id: number) => { |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 列表导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleMainExport = async (id: number) => { |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(id) |
|
|
|
download.excel(data, '盘点工单.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
// const handleClose = async (id: number) => { |
|
|
|
// try { |
|
|
|
// // 关闭的二次确认 |
|
|
|
// await message.confirm('是否关闭所选中数据?') |
|
|
|
// // 发起关闭 |
|
|
|
// await SparePartsApplyMainApi.closeSparePartsApplyMain(id) |
|
|
|
// message.success(t('关闭成功!')) |
|
|
|
// // 刷新列表 |
|
|
|
// await getList() |
|
|
|
// } catch {} |
|
|
|
// } |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const handleExport = async () => { |
|
|
|
try { |
|
|
@ -379,7 +384,52 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
// 审核 |
|
|
|
const handleSubmitExamine = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否提交审核?')); |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.submitExamineSparePartsInLocation(id) |
|
|
|
message.success(t('ts.提交审批成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
/** 撤回按钮操作 */ |
|
|
|
const handleCancel = async (id: number) => { |
|
|
|
await message.delConfirm(t('ts.是否撤回所选中数据?')); |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.cancelSparePartsInLocation(id) |
|
|
|
message.success(t('ts.撤回成功')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
//审核驳回按钮 |
|
|
|
const handleRejecte=async(id: number)=> { |
|
|
|
await message.delConfirm(t('ts.是否驳回所选中数据?')); |
|
|
|
try { |
|
|
|
await SparePartsInLocationMainApi.rejectSparePartsInLocation(id) |
|
|
|
message.success(t('ts.驳回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
// 审核通过 |
|
|
|
const approveSparePartsInLocation =async(formType,data)=> { |
|
|
|
console.log(data) |
|
|
|
try { |
|
|
|
// const params = { |
|
|
|
// id: |
|
|
|
// } |
|
|
|
await SparePartsInLocationMainApi.approveSparePartsInLocation(data) |
|
|
|
message.success(t('ts.审核通过!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|