Browse Source

备件入库审核

master_hella_20240701
zhang_li 5 months ago
parent
commit
02ee1cc0dd
  1. 19
      src/api/eam/sparePartsInLocationMain/index.ts
  2. 4
      src/locales/en-US.ts
  3. 4
      src/locales/zh-CN.ts
  4. 124
      src/views/eam/sparepartsinlocation/index.vue
  5. 52
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

19
src/api/eam/sparePartsInLocationMain/index.ts

@ -67,4 +67,21 @@ export const exportSparePartsInLocationMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' })
}
}
// 撤回
export const cancelSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/cancel?id=` + id })
}
// 审核
export const submitExamineSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/submitExamine?id=` + id })
}
// 审核驳回
export const rejectSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/reject?id=` + id })
}
// 审核通过
export const approveSparePartsInLocation = async (data) => {
return await request.post({ url: `/eam/spare-parts-in-location-main/approve`,data })
}

4
src/locales/en-US.ts

@ -326,6 +326,7 @@ export default {
viewDetail:'Detailed list',
updataRecode:'Updata recode',
applyDecision:'Apply Decision',
auditing:'Auditing',
},
dialog: {
dialog: 'Dialog',
@ -993,6 +994,8 @@ export default {
'是否接受所选中数据?':'Do you accept the selected data?',
'接受成功!':'Accept Successfully!',
'是否驳回所选中数据?':'Do you reject the selected data?',
'是否撤回所选中数据?':'Do you revoke the selected data?',
'是否提交审核?':'Do you audit the selected data?',
'驳回成功!':'Reject Succussfully!',
'要货计划主':'Ask for master data of cargo plan',
'要货计划数量不得大于订单数量-已计划数量':'The planned quantity of the requested goods shall not be greater than the order quantity - the planned quantity',
@ -1053,6 +1056,7 @@ export default {
:'Supplier invoice request details',
:'Supplier invoice record master data',
:'Pass the audit',
:'Recall successful',
:'Cancellation',
'是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?',
'审批成功!':'Approval is successful!',

4
src/locales/zh-CN.ts

@ -325,6 +325,7 @@ export default {
viewDetail:'明细列表',
updataRecode:'更新记录',
applyDecision:'使用决策',
auditing:'审核',
},
dialog: {
dialog: '弹窗',
@ -993,6 +994,8 @@ export default {
'是否接受所选中数据?':'是否接受所选中数据?',
'接受成功!':'接受成功!',
'是否驳回所选中数据?':'是否驳回所选中数据?',
'是否撤回所选中数据?':'是否撤回所选中数据?',
'是否提交审核?':'是否提交审核?',
'驳回成功!':'驳回成功!',
'要货计划主':'要货计划主',
'要货计划数量不得大于订单数量-已计划数量':'要货计划数量不得大于订单数量-已计划数量',
@ -1053,6 +1056,7 @@ export default {
:'供应商发票申请明细',
:'供应商发票记录主',
:'审核通过',
:'撤回成功',
:'作废',
'是否审批拒绝所选中数据?':'是否审批拒绝所选中数据?',
'审批成功!':'审批成功!',

124
src/views/eam/sparepartsinlocation/index.vue

@ -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()

52
src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

@ -65,12 +65,14 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'approver',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核时间',
@ -78,6 +80,7 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm:false,
search: {
component: 'DatePicker',
componentProps: {
@ -130,7 +133,7 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isForm: false,
table: {
width: 150,
width: 220,
fixed: 'right'
},
isDetail:false
@ -170,19 +173,19 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>(
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择备件编号', // 输入框占位文本
// searchField: 'itemNumber', // 查询弹窗赋值字段
// searchTitle: '备件信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }
// ]
}
},
{
@ -196,7 +199,7 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>(
}
},
tableForm:{
disabled: true
// disabled: true
}
},
{
@ -272,4 +275,23 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>(
isTable:false
}
]))
export const SparePartsInLocationExamineRules = reactive({
approver: [required],
approveContent: [required],
sparePartsCode: [required],
})
// 审核完成字段
export const SparePartsInLocationExamine = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
}
}
},
]))

Loading…
Cancel
Save