Browse Source

保养周期和报表打印代码

master
ljlong_2630 7 months ago
parent
commit
4fd3915234
  1. 2
      src/utils/dict.ts
  2. 22
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  3. 33
      src/views/eam/basic/deviceMaintenance/index.vue
  4. 33
      src/views/eam/basic/moldMaintenance/index.vue
  5. 22
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  6. 14
      src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts
  7. 14
      src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts

2
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',//备件申领状态

22
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -123,6 +123,28 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
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',

33
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)
}

33
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)
}

22
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -122,6 +122,28 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
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',

14
src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts

@ -41,6 +41,20 @@ export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
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',

14
src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts

@ -42,6 +42,20 @@ export const MoldMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
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',

Loading…
Cancel
Save