|
@ -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 isShowMainButton = (row, val) => { |
|
|
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
|
|
return false |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionMain:update' }), // 编辑 |
|
|
return [ |
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionMain:delete' }), // 删除 |
|
|
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表单提交 |
|
|