From 4fd391523476231ccd406d4c96196fd35768bf77 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 22 Apr 2024 14:04:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=85=BB=E5=91=A8=E6=9C=9F=E5=92=8C?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=89=93=E5=8D=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 2 ++ .../deviceMaintenance.data.ts | 22 +++++++++++++ .../eam/basic/deviceMaintenance/index.vue | 33 +++++++++++++++++++ src/views/eam/basic/moldMaintenance/index.vue | 33 +++++++++++++++++++ .../moldMaintenance/moldMaintenance.data.ts | 22 +++++++++++++ .../deviceMaintainPlan.data.ts | 14 ++++++++ .../moldMaintainPlan/moldMaintainPlan.data.ts | 14 ++++++++ 7 files changed, 140 insertions(+) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 4bcbdde..5d2524b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -289,6 +289,8 @@ export enum DICT_TYPE { JX_STATUS = 'JX_STATUS', //检修状态, EXECUTION_CYCLE = 'execution_cycle', //模具保养周期 MOLD_EXECUTION_CYCLE = 'mold_execution_cycle', //模具保养周期 + SPECIAL_CYCLE_MONTH = 'special_cycle_month', //涂装周期-月 + SPECIAL_CYCLE_WEEK = 'special_cycle_week', //涂装周期-周 GET_ORDER_STATUS = 'get_order_status', //模具保养周期 IS_COMPLETE = 'is_complete', //完成/未完成 ITEM_APPLY_STATUS = 'item_apply_status',//备件申领状态 diff --git a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts index e485739..f41e1d0 100644 --- a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts +++ b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts @@ -123,6 +123,28 @@ export const DeviceMaintenance = useCrudSchemas(reactive([ component: 'Select' }, }, + { + label: '涂装保养周期-月份', + field: 'executionCycleMonth', + dictType: DICT_TYPE.SPECIAL_CYCLE_MONTH, + dictClass: 'string', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + }, + }, + { + label: '涂装保养周期-星期', + field: 'executionCycleWeek', + dictType: DICT_TYPE.SPECIAL_CYCLE_WEEK, + dictClass: 'string', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + }, + }, { label: '人数', field: 'peoples', diff --git a/src/views/eam/basic/deviceMaintenance/index.vue b/src/views/eam/basic/deviceMaintenance/index.vue index a1f4fbe..4582ff7 100644 --- a/src/views/eam/basic/deviceMaintenance/index.vue +++ b/src/views/eam/basic/deviceMaintenance/index.vue @@ -90,6 +90,7 @@ import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' import { updateForm } from '@/api/bpm/form' +import * as DeptApi from '@/api/system/dept' const userStore = useUserStore() // 用户信息 defineOptions({ name: 'DeviceMaintenance' }) @@ -109,13 +110,38 @@ const updateFormValue = reactive({ const openDataOld = ref() const openDataNew = ref() const operatType = ref('') +const tzDeptId = ref() // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { + if(formField == 'deviceNumber' && val[0].factoryAreaNumber == tzDeptId.value){ + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycle' + }).componentProps.disabled = true + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleMonth' + }).componentProps.disabled = false + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleWeek' + }).componentProps.disabled = false + }else{ + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycle' + }).componentProps.disabled = false + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleMonth' + }).componentProps.disabled = true + DeviceMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleWeek' + }).componentProps.disabled = true + } nextTick(() => { const setV = {} setV[formField] = val[0][searchField] + setV['executionCycle'] = null + setV['executionCycleMonth'] = null + setV['executionCycleWeek'] = null formRef.setValues(setV) }) } @@ -186,6 +212,13 @@ const basicFormRef = ref() const openForm = (type: string, row?: any) => { openDataOld.value = row updateFormValue.remark = '' + DeptApi.getSimpleDeptList().then(res=>{ + res.forEach(item=>{ + if(item.busiType == 'TZ'){ + tzDeptId.value = item.id + } + }) + }) basicFormRef.value.open(type, row) } diff --git a/src/views/eam/basic/moldMaintenance/index.vue b/src/views/eam/basic/moldMaintenance/index.vue index a13e77b..39ac48a 100644 --- a/src/views/eam/basic/moldMaintenance/index.vue +++ b/src/views/eam/basic/moldMaintenance/index.vue @@ -88,6 +88,7 @@ import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' +import * as DeptApi from '@/api/system/dept' const userStore = useUserStore() // 用户信息 defineOptions({ name: 'MoldMaintenance' }) @@ -110,9 +111,33 @@ const operatType = ref('') // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { + if(formField == 'deviceNumber' && val[0].factoryAreaNumber == tzDeptId.value){ + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycle' + }).componentProps.disabled = true + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleMonth' + }).componentProps.disabled = false + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleWeek' + }).componentProps.disabled = false + }else{ + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycle' + }).componentProps.disabled = false + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleMonth' + }).componentProps.disabled = true + MoldMaintenance.allSchemas.formSchema.find(item=>{ + return item.field == 'executionCycleWeek' + }).componentProps.disabled = true + } nextTick(() => { const setV = {} setV[formField] = val[0][searchField] + setV['executionCycle'] = null + setV['executionCycleMonth'] = null + setV['executionCycleWeek'] = null formRef.setValues(setV) }) } @@ -180,9 +205,17 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() +const tzDeptId = ref() const openForm = (type: string, row?: any) => { openDataOld.value = row updateFormValue.remark = '' + DeptApi.getSimpleDeptList().then(res=>{ + res.forEach(item=>{ + if(item.busiType == 'TZ'){ + tzDeptId.value = item.id + } + }) + }) basicFormRef.value.open(type, row) } diff --git a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts index 300af30..1b27c86 100644 --- a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts +++ b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts @@ -122,6 +122,28 @@ export const MoldMaintenance = useCrudSchemas(reactive([ component: 'Select' }, }, + { + label: '涂装保养周期-月份', + field: 'executionCycleMonth', + dictType: DICT_TYPE.SPECIAL_CYCLE_MONTH, + dictClass: 'string', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + }, + }, + { + label: '涂装保养周期-星期', + field: 'executionCycleWeek', + dictType: DICT_TYPE.SPECIAL_CYCLE_WEEK, + dictClass: 'string', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + }, + }, { label: '人数', field: 'peoples', diff --git a/src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts b/src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts index 0d0f75c..2b1d050 100644 --- a/src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts +++ b/src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts @@ -41,6 +41,20 @@ export const DeviceMaintainPlan = useCrudSchemas(reactive([ dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE, dictClass: 'string', }, + { + label: '涂装保养周期-月', + field: 'cycleMonth', + sort: 'custom', + dictType: DICT_TYPE.SPECIAL_CYCLE_MONTH, + dictClass: 'string', + }, + { + label: '涂装保养周期-周', + field: 'cycleWeek', + sort: 'custom', + dictType: DICT_TYPE.SPECIAL_CYCLE_WEEK, + dictClass: 'string', + }, // { // label: '次数', // field: 'times', diff --git a/src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts b/src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts index 10b2c50..57f81d1 100644 --- a/src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts +++ b/src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts @@ -42,6 +42,20 @@ export const MoldMaintainPlan = useCrudSchemas(reactive([ dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE, dictClass: 'string', }, + { + label: '涂装保养周期-月', + field: 'cycleMonth', + sort: 'custom', + dictType: DICT_TYPE.SPECIAL_CYCLE_MONTH, + dictClass: 'string', + }, + { + label: '涂装保养周期-周', + field: 'cycleWeek', + sort: 'custom', + dictType: DICT_TYPE.SPECIAL_CYCLE_WEEK, + dictClass: 'string', + }, // { // label: '次数', // field: 'times',