Browse Source

检验申请,任务记录包装

master_hella_20240701
zhang_li 8 months ago
parent
commit
10ee2e6f81
  1. 4
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  2. 6
      src/api/qms/inspectionJob/inspectionJobPackage/index.ts
  3. 4
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  4. 50
      src/api/qms/inspectionRequest/index.ts
  5. 3
      src/views/qms/inspection/inspectionJob/index.vue
  6. 3
      src/views/qms/inspection/inspectionRecord/index.vue
  7. 139
      src/views/qms/inspection/inspectionRequest/index.vue
  8. 2
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

4
src/api/qms/inspectionJob/inspectionJobMain/index.ts

@ -44,3 +44,7 @@ export const exportInspectionJobMain = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/inspection-job-main/get-import-template' }) return request.download({ url: '/qms/inspection-job-main/get-import-template' })
} }
//查询检验申请列表
export const getInspectionJobPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

6
src/api/qms/inspectionJob/inspectionJobPackage/index.ts

@ -1,6 +0,0 @@
import request from '@/config/axios'
//查询检验申请列表
export const getInspectionJobPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

4
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -67,3 +67,7 @@ export const importTemplate = () => {
export const publishInspectionRecordMain = async (data ) => { export const publishInspectionRecordMain = async (data ) => {
return await request.put({ url: `/qms/inspection-record-main/publish`, data }) return await request.put({ url: `/qms/inspection-record-main/publish`, data })
} }
//查询检验申请列表
export const getInspectionRecordPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id })
}

50
src/api/qms/inspectionRequest/index.ts

@ -28,38 +28,72 @@ export const getInspectionMainPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/inspection/inspection-main/senior', data }) return await request.post({ url: '/qms/inspection-request-main/senior', data })
} else { } else {
return await request.get({ url: `/inspection/inspection-main/page`, params }) return await request.get({ url: `/qms/inspection-request-main/page`, params })
} }
} }
// 查询检验申请详情 // 查询检验申请详情
export const getInspectionMain = async (id: number) => { export const getInspectionMain = async (id: number) => {
return await request.get({ url: `/inspection/inspection-main/get?id=` + id }) return await request.get({ url: `/qms/inspection-request-main/get?id=` + id })
} }
// 新增检验申请 // 新增检验申请
export const createInspectionMain = async (data: InspectionMainVO) => { export const createInspectionMain = async (data: InspectionMainVO) => {
return await request.post({ url: `/inspection/inspection-main/create`, data }) return await request.post({ url: `/qms/inspection-request-main/create`, data })
} }
// 修改检验申请 // 修改检验申请
export const updateInspectionMain = async (data: InspectionMainVO) => { export const updateInspectionMain = async (data: InspectionMainVO) => {
return await request.put({ url: `/inspection/inspection-main/update`, data }) return await request.put({ url: `/qms/inspection-request-main/update`, data })
} }
// 删除检验申请 // 删除检验申请
export const deleteInspectionMain = async (id: number) => { export const deleteInspectionMain = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-main/delete?id=` + id }) return await request.delete({ url: `/qms/inspection-request-main/delete?id=` + id })
} }
// 导出检验申请 Excel // 导出检验申请 Excel
export const exportInspectionMain = async (params) => { export const exportInspectionMain = async (params) => {
return await request.download({ url: `/inspection/inspection-main/export-excel`, params }) return await request.download({ url: `/qms/inspection-request-main/export-excel`, params })
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-main/get-import-template' }) return request.download({ url: '/qms/inspection-request-main/get-import-template' })
} }
// 关闭检验申请主 Excel
export const closeInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/close?id=` + id })
}
// 重新添加检验申请主 Excel
export const reAddInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/reAdd?id=` + id })
}
// 提交检验申请主 Excel
export const submitInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/submit?id=` + id })
}
// 审批通过检验申请主 Excel
export const agreeInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/agree?id=` + id })
}
// 审批驳回检验申请主 Excel
export const refusedInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/refused?id=` + id })
}
// 处理检验申请主 Excel
export const handleInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/handle?id=` + id })
}
//查询检验申请列表
export const getInspectionRequestPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id })
}

3
src/views/qms/inspection/inspectionJob/index.vue

@ -58,7 +58,6 @@
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail' import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue' import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -171,7 +170,7 @@ const listTableRef = ref()
if (val == 'mainJobExe') { // if (val == 'mainJobExe') { //
execute('execute', row) execute('execute', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id) const list = await InspectionJobMainApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
} }
else if (val == 'mainJobClo') { // else if (val == 'mainJobClo') { //

3
src/views/qms/inspection/inspectionRecord/index.vue

@ -62,7 +62,6 @@
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import listTable from '@/components/listTable/src/listTable.vue' import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
@ -197,7 +196,7 @@
} }
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id) const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
}else if (val == 'delete') { // }else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)

139
src/views/qms/inspection/inspectionRequest/index.vue

@ -21,7 +21,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -37,6 +37,8 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" /> @success="importSuccess" />
<!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -44,9 +46,11 @@
import { InspectionMain, InspectionMainRules } from './inspectionMain.data' import { InspectionMain, InspectionMainRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest' import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue'
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 Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
defineOptions({ name: 'InspectionMain' }) defineOptions({ name: 'InspectionMain' })
@ -113,25 +117,134 @@
} }
} }
// - //
const butttondata = [ const isShowMainButton = (row, val) => {
defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionMain:update' }), // if (val.indexOf(row.status) > -1) {
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionMain:delete' }), // return false
] } else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), hasPermi: 'qms:inspection-request-main:close' }), //
// defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['5']), hasPermi: 'qms:inspection-request-main:reAdd' }), //
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-request-main:submit' }), //
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:refused' }), //
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:agree' }), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), //
defaultButtons.mainListPackageBtn(null), //
// defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), //
]
}
const listTableRef = ref()
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'mainClose') { //
handleClose(row.id)
} else if (val == 'mainReAdd') { //
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
handleRefused(row.id)
} else if (val == 'mainApprove') { //
handleAgree(row.id)
} else if (val == 'mainHandle') { //
handleHandle(row.id)
} else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // }else if (val == 'mainPackage') { //
handleDelete(row.id) const list = await InspectionMainApi.getInspectionRequestPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
}
}
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try{
await message.confirm(t('common.confirmColse'))
tableObject.loading = true
await InspectionMainApi.closeInspectRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id : number) => {
try{
await message.confirm(t('common.confirmReAdd'))
tableObject.loading = true
await InspectionMainApi.reAddInspectRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
}
}
/** 审批通过按钮操作 */
const handleAgree = async (id : number) => {
try{
await message.confirm(t('common.confirmAgree'))
tableObject.loading = true
await InspectionMainApi.agreeInspectRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id : number) => {
try{
await message.confirm(t('common.confirmRefused'))
tableObject.loading = true
await InspectionMainApi.refusedInspectRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
}
}
/** 处理按钮操作 */
const handleHandle = async (id : number) => {
try{
await message.confirm(t('common.confirmHandle'))
tableObject.loading = true
await InspectionMainApi.handleInspectRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
}
}
/** 提交按钮操作 */
const handleSubmit = async (id : number) => {
try{
await message.confirm(t('common.confirmSubmit'))
tableObject.loading = true
await InspectionMainApi.submitInspectRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
}catch{}finally{
tableObject.loading = false
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const formRef = ref()
const openForm = (type : string, row ?: any) => { const openForm = async (type : string, row ?: number) => {
basicFormRef.value.open(type, row) tableData.value = [] //
formRef.value.open(type, row)
} }
// form // form

2
src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

@ -232,7 +232,7 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 200,
fixed: 'right' fixed: 'right'
} }
} }

Loading…
Cancel
Save