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