From 7eb3166fefee1c0d710eb4128dcb39748071d545 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Wed, 12 Jun 2024 15:58:09 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=20=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E5=B7=A5=E5=8D=95=E8=BD=AC=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/disposition/defaultButtons.ts | 13 + .../equipmentRepairJobMain.data.ts | 38 +- .../eam/equipmentRepairJobMain/index.vue | 43 +++ .../equipmentRepairJobMain/transferForm.vue | 344 ++++++++++++++++++ 4 files changed, 436 insertions(+), 2 deletions(-) create mode 100644 src/views/eam/equipmentRepairJobMain/transferForm.vue diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 8081b48ef..c5c2ec237 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -389,6 +389,19 @@ export function mainListExecuteBtn(option:any) { }) } +// 主列表-转办按钮 +export function mainListTransferBtn(option:any) { + return __defaultBtnOption(option,{ + label: t(`ts.转办`).replace('ts.', ''), + name: 'transfer', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-完成按钮 export function mainListFinishBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts index e6e3a50f6..e15b32625 100644 --- a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts +++ b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts @@ -4,6 +4,10 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data"; import * as ItemApi from "@/api/eam/basicFaultCause"; +import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; +import * as WorkshopApi from "@/api/wms/workshop"; +import {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data"; +import * as BasicFaultTypeApi from "@/api/eam/basicFaultType"; // 表单校验 export const EquipmentRepairJobMainRules = reactive({ @@ -388,10 +392,23 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ { label: '故障类型', field: 'faultType', - dictType: DICT_TYPE.FAILURE_REASON, - dictClass: 'string', sort: 'custom', isSearch: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择故障类型', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: BasicFaultType.allSchemas, // 查询弹窗所需类 + searchPage: BasicFaultTypeApi.getBasicFaultTypePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, }, { label: '流程状态', @@ -442,6 +459,23 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ field: 'workshopCode', sort: 'custom', isSearch: false, + required: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, }, // { // label: '产线编号', diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index 71dd0c1f4..d11441bf7 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -54,6 +54,7 @@ + { defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentRepairJobMain:update'}), // 编辑 defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 接单 defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 执行 + defaultButtons.mainListTransferBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 转办 defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //完成 defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 维修验证 defaultButtons.mainListValidateReportBtn({hide: isShowBaoXiuButton(row),hasPermi:'eam:equipmentRepairJobMain:update'}), // 报修验证 @@ -206,6 +209,8 @@ const buttonTableClick = async (val, row) => { handleValidateRepair(row) } else if (val == 'validate_report') { // 报修验证 handleValidateReport(row) + } else if (val == 'transfer') { // 转办 + handleTransferReport(row) } @@ -296,6 +301,14 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { }) } +/** 转办按钮操作 */ +const transferForm = ref() +const handleTransferReport = async (row) => { + await message.delConfirm('是否转办所选中工单?'); + transferForm.value.open('update', row); + +} + /** 报修验证按钮操作 */ const finishForm3Ref = ref() @@ -500,6 +513,36 @@ const getData3=(val)=> { ) } + +//finishForm4 关闭按钮回传 +const getClosed4=(val)=> { + nextTick?.(() => { + console.log(val) + getList() + }) +} + +//finishForm4 提交按钮回传 +const getData4=(val)=> { + nextTick?.(async () => { + console.log(val) + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = val + params.value.status = '3' + await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) + message.success(t('工单已流转')) + // 刷新列表 + await getList() + } catch {} + + } + ) +} + const onChange = (field, item) => { //设备 if(field == 'type' && item == 'DEVICE'){ diff --git a/src/views/eam/equipmentRepairJobMain/transferForm.vue b/src/views/eam/equipmentRepairJobMain/transferForm.vue new file mode 100644 index 000000000..e6fe8bfec --- /dev/null +++ b/src/views/eam/equipmentRepairJobMain/transferForm.vue @@ -0,0 +1,344 @@ + + + +