Browse Source

备件入库审核

master_hella_20240701
zhang_li 5 months ago
parent
commit
02ee1cc0dd
  1. 17
      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

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

@ -68,3 +68,20 @@ export const exportSparePartsInLocationMain = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' }) 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', viewDetail:'Detailed list',
updataRecode:'Updata recode', updataRecode:'Updata recode',
applyDecision:'Apply Decision', applyDecision:'Apply Decision',
auditing:'Auditing',
}, },
dialog: { dialog: {
dialog: 'Dialog', dialog: 'Dialog',
@ -993,6 +994,8 @@ export default {
'是否接受所选中数据?':'Do you accept the selected data?', '是否接受所选中数据?':'Do you accept the selected data?',
'接受成功!':'Accept Successfully!', '接受成功!':'Accept Successfully!',
'是否驳回所选中数据?':'Do you reject the selected data?', '是否驳回所选中数据?':'Do you reject the selected data?',
'是否撤回所选中数据?':'Do you revoke the selected data?',
'是否提交审核?':'Do you audit the selected data?',
'驳回成功!':'Reject Succussfully!', '驳回成功!':'Reject Succussfully!',
'要货计划主':'Ask for master data of cargo plan', '要货计划主':'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', '要货计划数量不得大于订单数量-已计划数量':'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 request details',
:'Supplier invoice record master data', :'Supplier invoice record master data',
:'Pass the audit', :'Pass the audit',
:'Recall successful',
:'Cancellation', :'Cancellation',
'是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?', '是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?',
'审批成功!':'Approval is successful!', '审批成功!':'Approval is successful!',

4
src/locales/zh-CN.ts

@ -325,6 +325,7 @@ export default {
viewDetail:'明细列表', viewDetail:'明细列表',
updataRecode:'更新记录', updataRecode:'更新记录',
applyDecision:'使用决策', applyDecision:'使用决策',
auditing:'审核',
}, },
dialog: { dialog: {
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" :isShowAddBtn="true"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
/> />
<!-- 审核页面 -->
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> -->
<BasicForm
ref="formRefApproved"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationExamine.allSchemas"
@submitForm="approveSparePartsInLocation"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
ref="importFormRef" ref="importFormRef"
@ -94,13 +101,15 @@ import {
SparePartsInLocationMain, SparePartsInLocationMain,
SparePartsInLocationMainRules, SparePartsInLocationMainRules,
SparePartsInLocationDetail, SparePartsInLocationDetail,
SparePartsInLocationDetailRules SparePartsInLocationDetailRules,
SparePartsInLocationExamine
} from './sparePartsInLocationMain.data' } from './sparePartsInLocationMain.data'
import * as SparePartsInLocationMainApi from '@/api/eam/sparePartsInLocationMain' import * as SparePartsInLocationMainApi from '@/api/eam/sparePartsInLocationMain'
import * as SparePartsInLocationDetailApi from '@/api/eam/sparePartsInLocationDetail' import * as SparePartsInLocationDetailApi from '@/api/eam/sparePartsInLocationDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import AudiForm from '@/views/eam/sparepartsinlocation/audiForm.vue'
// //
defineOptions({ name: 'SparePartsApply' }) defineOptions({ name: 'SparePartsApply' })
@ -111,8 +120,9 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const formRef = ref() const formRef = ref()
const formRefApproved = ref()
const tableColumns = ref(SparePartsInLocationMain.allSchemas.tableColumns) const tableColumns = ref(SparePartsInLocationMain.allSchemas.tableColumns)
// const audiFormRef = ref()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -223,8 +233,12 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hasPermi: 'eam:spare-parts-in-location-main:update' }), // defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:spare-parts-in-location-main:delete' }) // 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) openForm('update', row)
} }
// else if (val == 'mainOrderClo') { else if (val == 'auditing') {
// // //
// handleClose(row.id) 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') { else if (val == 'delete') {
// //
handleDelete(row.id) 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) => { const openForm = async (type: string, row?: number) => {
tableData.value = [] // tableData.value = [] //
@ -269,35 +302,7 @@ const handleDelete = async (id: number) => {
} catch {} } catch {}
} }
/** 列表导出按钮操作 */
const exportLoading = ref(false) // 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 () => { const handleExport = async () => {
try { try {
@ -379,7 +384,52 @@ const searchFormClick = (searchData) => {
} }
getList() // 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 () => { onMounted(async () => {
getList() getList()

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

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