diff --git a/src/api/eam/basic/deviceMaintenance/index.ts b/src/api/eam/basic/deviceMaintenance/index.ts index 85247fe..7eace84 100644 --- a/src/api/eam/basic/deviceMaintenance/index.ts +++ b/src/api/eam/basic/deviceMaintenance/index.ts @@ -13,7 +13,7 @@ export interface DeviceMoldItemsVO { // 查询项记录表(设备 模具 保养 维修 巡检点检)列表 export const getDeviceMoldItemsPage = async (params) => { params.type="DEVICE" - params.status="MAINTAIN" + params.status = "MAINTAIN" if (params.isSearch) { delete params.isSearch const data = {...params} @@ -31,7 +31,13 @@ export const getDeviceMoldItems = async (id: number) => { // 查询供应商发票申请主详情 export const getNumber = async (params) => { - return await request.get({ url: `/eam/device-mold-items/getNumber`, params}) + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/device-accounts/senior', data }) + } else { + return await request.get({ url: `/eam/device-mold-items/getNumber`, params }) + } } // 新增项记录表(设备 模具 保养 维修 巡检点检) diff --git a/src/api/eam/basic/moldMaintenance/index.ts b/src/api/eam/basic/moldMaintenance/index.ts index 4a1fdbc..babfc29 100644 --- a/src/api/eam/basic/moldMaintenance/index.ts +++ b/src/api/eam/basic/moldMaintenance/index.ts @@ -13,7 +13,7 @@ export interface DeviceMoldItemsVO { // 查询项记录表(设备 模具 保养 维修 巡检点检)列表 export const getDeviceMoldItemsPage = async (params) => { params.type="MOLD" - params.status="MAINTAIN" + params.status = "MAINTAIN" if (params.isSearch) { delete params.isSearch const data = {...params} @@ -31,7 +31,13 @@ export const getDeviceMoldItems = async (id: number) => { // 查询供应商发票申请主详情 export const getNumber = async (params) => { - return await request.get({ url: `/eam/device-mold-items/getNumber`, params}) + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/mold-accounts/senior', data }) + } else { + return await request.get({ url: `/eam/device-mold-items/getNumber`, params}) + } } // 新增项记录表(设备 模具 保养 维修 巡检点检) diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index 7f22412..1556cf9 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -63,7 +63,7 @@ clearable :type="headerItem?.tableForm?.inputType" :placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" - :disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false" + :disabled="itemIsDisabled(headerItem, row)" style="flex:1" /> @@ -381,7 +381,7 @@ const handleTableSelect = (row, column, event) => { // 某个item是否禁用 const itemIsDisabled = (colum, row) => { - return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field]) + return Boolean(colum.tableForm?.disabled) || colum?.tableForm?.isInpuFocusShow || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field]) } // const { t } = useI18n() // 国际化 diff --git a/src/views/eam/basic/deviceMaintenance/index.vue b/src/views/eam/basic/deviceMaintenance/index.vue index 4d7bac3..0d2e329 100644 --- a/src/views/eam/basic/deviceMaintenance/index.vue +++ b/src/views/eam/basic/deviceMaintenance/index.vue @@ -291,6 +291,20 @@ const handleExport = async () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != "status"&&item.column != 'type') + const fixedField = [ + { + action:"==", + column:"status", + value:"MAINTAIN", + }, + { + action:"==", + column:"type", + value:"DEVICE", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/basic/inspection/index.vue b/src/views/eam/basic/inspection/index.vue index d69f35f..62f93f0 100644 --- a/src/views/eam/basic/inspection/index.vue +++ b/src/views/eam/basic/inspection/index.vue @@ -254,6 +254,20 @@ const handleExport = async () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != "status"&&item.column != 'type') + const fixedField = [ + { + action:"==", + column:"status", + value:"INSPECTION", + }, + { + action:"==", + column:"type", + value:"DEVICE", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/basic/moldInspection/index.vue b/src/views/eam/basic/moldInspection/index.vue index 148db3f..00541f5 100644 --- a/src/views/eam/basic/moldInspection/index.vue +++ b/src/views/eam/basic/moldInspection/index.vue @@ -209,6 +209,20 @@ const handleExport = async () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != "status"&&item.column != 'type') + const fixedField = [ + { + action:"==", + column:"status", + value:"INSPECTION", + }, + { + action:"==", + column:"type", + value:"MOLD", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/basic/moldInspection/moldInspection.data.ts b/src/views/eam/basic/moldInspection/moldInspection.data.ts index 5cfaf85..a57a9fe 100644 --- a/src/views/eam/basic/moldInspection/moldInspection.data.ts +++ b/src/views/eam/basic/moldInspection/moldInspection.data.ts @@ -1,6 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' +import * as DeviceMoldItemsApi from '@/api/eam/basic/moldMaintenance' // 表单校验 export const DeviceMoldItemsRules = reactive({ diff --git a/src/views/eam/basic/moldMaintenance/index.vue b/src/views/eam/basic/moldMaintenance/index.vue index 9258146..7957ddc 100644 --- a/src/views/eam/basic/moldMaintenance/index.vue +++ b/src/views/eam/basic/moldMaintenance/index.vue @@ -284,6 +284,20 @@ const handleExport = async () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != "status"&&item.column != 'type') + const fixedField = [ + { + action:"==", + column:"status", + value:"MAINTAIN", + }, + { + action:"==", + column:"type", + value:"MOLD", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts index 91c7a93..d2e1689 100644 --- a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts +++ b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts @@ -1,6 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' +import * as DeviceMoldItemsApi from '@/api/eam/basic/moldMaintenance' // 表单校验 export const MoldMaintenanceRules = reactive({ diff --git a/src/views/eam/device/deviceRepair/index.vue b/src/views/eam/device/deviceRepair/index.vue index 8410890..4a42397 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -279,6 +279,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"DEVICE", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts index a526dcf..406d77e 100644 --- a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts @@ -438,7 +438,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'Select', - initOptions: userList, + initOptions: dutyUserList, multiple: true, collapseTags: true, collapseTagsTooltip: true, diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 1dcd565..5d6e9cc 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -42,7 +42,7 @@ :apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain" :apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain" @searchTableSuccess="searchTableSuccess" - :isBusiness="false" + :isBusiness="true" @onChange="onChange" :tableAllSchemas="DeviceInspectionDetail.allSchemas" :tableFormRules="DeviceInspectionDetailRules" @@ -51,6 +51,7 @@ @handleDeleteTable="handleDeleteTable" @submitForm="submitForm" :isSearchTableItem="true" + @formSelectChange="formSelectChange" /> @@ -386,6 +387,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"DEVICE", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters @@ -441,6 +451,24 @@ const onChange = (field, cur, item) => { } } +const formSelectChange = (field, cur, item) =>{ + if (field == 'status') { + if (cur == '1') { + DeviceInspectionDetail.allSchemas.tableFormColumns.find(item => item.field == 'uncompleted').disabled = false + DeviceInspectionDetail.allSchemas.tableFormColumns.find(item => item.field == 'completionTime').disabled = true + item['completionTime']='' + DeviceInspectionDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }] + DeviceInspectionDetailRules.completionTime = [{ required: false }] + } else { + DeviceInspectionDetail.allSchemas.tableFormColumns.find(item => item.field == 'uncompleted').disabled = true + DeviceInspectionDetail.allSchemas.tableFormColumns.find(item => item.field == 'completionTime').disabled = false + item['uncompleted']='' + DeviceInspectionDetailRules.uncompleted = [{ required: false }] + DeviceInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}] + } + } +} + diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 97f38a6..6e838d8 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -840,6 +840,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"DEVICE", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/device/techRepair/index.vue b/src/views/eam/device/techRepair/index.vue index 9b0f879..cd1d322 100644 --- a/src/views/eam/device/techRepair/index.vue +++ b/src/views/eam/device/techRepair/index.vue @@ -279,6 +279,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"TECH", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/device/techmaintenancejob/index.vue b/src/views/eam/device/techmaintenancejob/index.vue index 3977f4e..b2875dd 100644 --- a/src/views/eam/device/techmaintenancejob/index.vue +++ b/src/views/eam/device/techmaintenancejob/index.vue @@ -819,6 +819,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"TECH", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/mold/moldRepair/index.vue b/src/views/eam/mold/moldRepair/index.vue index 234a847..5b2881b 100644 --- a/src/views/eam/mold/moldRepair/index.vue +++ b/src/views/eam/mold/moldRepair/index.vue @@ -254,6 +254,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"MOLD", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 6f86379..6f768c4 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -42,7 +42,7 @@ :apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain" :apiCreate="MoldInspectionMainApi.createMoldInspectionMain" @searchTableSuccess="searchTableSuccess" - :isBusiness="false" + :isBusiness="true" @onChange="onChange" :tableAllSchemas="MoldInspectionDetail.allSchemas" :tableFormRules="MoldInspectionDetailRules" @@ -51,6 +51,7 @@ @handleDeleteTable="handleDeleteTable" @submitForm="submitForm" :isSearchTableItem="true" + @formSelectChange="formSelectChange" /> @@ -389,6 +390,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"MOLD", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters @@ -671,6 +681,25 @@ const orderPrint = (row) => { window.open(src.value + "&id=" + row.id) } +const formSelectChange = (field, cur, item) =>{ + + if (field == 'status') { + if (cur == '1') { + item['disabled_' + 'uncompleted'] = false + item['disabled_' + 'completionTime'] = true + item['completionTime']='' + MoldInspectionDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }] + MoldInspectionDetailRules.completionTime = [{ required: false }] + } else { + item['disabled_' + 'uncompleted'] = true + item['disabled_' + 'completionTime'] = false + item['uncompleted']='' + MoldInspectionDetailRules.uncompleted = [{ required: false }] + MoldInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}] + } + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index c540491..d2f6642 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -37,6 +37,9 @@ export const MoldInspectionMainRules = reactive({ status: [required], type: [required], faultType: [required], + uncompleted: [ + { required: true, message: '该项为必填项', trigger: 'blur' } + ], }) export const MoldInspectionMain = useCrudSchemas(reactive([ diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index f05fee2..65f5b6f 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -603,6 +603,15 @@ const importSuccess = () => { // 筛选提交 const searchFormClick = (searchData) => { + searchData.filters = searchData.filters.filter(item=>item.column != 'type') + const fixedField = [ + { + action:"==", + column:"type", + value:"MOLD", + }, + ] + searchData.filters.push(...fixedField) tableObject.params = { isSearch: true, filters: searchData.filters