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 @@ + + + +