diff --git a/src/api/eam/device/deviceInspectionMain/index.ts b/src/api/eam/device/deviceInspectionMain/index.ts index 12b54bc..232d254 100644 --- a/src/api/eam/device/deviceInspectionMain/index.ts +++ b/src/api/eam/device/deviceInspectionMain/index.ts @@ -33,7 +33,7 @@ export const getDeviceInspectionMain = async (id: number) => { // 新增检修工单主 export const createDeviceInspectionMain = async (data: DeviceInspectionMainVO) => { - return await request.post({ url: `/eam/device-inspection-main/create`, data }) + return await request.post({ url: `/eam/device-inspection-main/createPC`, data }) } // 修改检修工单主 diff --git a/src/api/eam/device/deviceMaintainOrderMain/index.ts b/src/api/eam/device/deviceMaintainOrderMain/index.ts index d6b0f98..44f7ba6 100644 --- a/src/api/eam/device/deviceMaintainOrderMain/index.ts +++ b/src/api/eam/device/deviceMaintainOrderMain/index.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' -export interface deviceMaintainOrderMainVO { +export interface DeviceMaintainOrderMainVO { number: string name: string planNumber: string @@ -18,9 +18,8 @@ export interface deviceMaintainOrderMainVO { available: string concurrencyStamp: number } - // 查询保养工单主列表 -export const getdeviceMaintainOrderMainPage = async (params) => { +export const getDeviceMaintainOrderMainPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} @@ -31,27 +30,27 @@ export const getdeviceMaintainOrderMainPage = async (params) => { } // 查询保养工单主详情 -export const getdeviceMaintainOrderMain = async (id: number) => { +export const getDeviceMaintainOrderMain = async (id: number) => { return await request.get({ url: `/eam/device-maintain-order-main/get?id=` + id }) } // 新增保养工单主 -export const createdeviceMaintainOrderMain = async (data: deviceMaintainOrderMainVO) => { +export const createDeviceMaintainOrderMain = async (data: DeviceMaintainOrderMainVO) => { return await request.post({ url: `/eam/device-maintain-order-main/create`, data }) } // 修改保养工单主 -export const updatedeviceMaintainOrderMain = async (data: deviceMaintainOrderMainVO) => { +export const updateDeviceMaintainOrderMain = async (data: DeviceMaintainOrderMainVO) => { return await request.put({ url: `/eam/device-maintain-order-main/update`, data }) } // 删除保养工单主 -export const deletedeviceMaintainOrderMain = async (id: number) => { +export const deleteDeviceMaintainOrderMain = async (id: number) => { return await request.delete({ url: `/eam/device-maintain-order-main/delete?id=` + id }) } // 导出保养工单主 Excel -export const exportdeviceMaintainOrderMain = async (params) => { +export const exportDeviceMaintainOrderMain = async (params) => { return await request.download({ url: `/eam/device-maintain-order-main/export-excel`, params }) } diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 4d041b5..e9eebb3 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -1,28 +1,14 @@ @@ -271,6 +206,12 @@ const props = defineProps({ required: false, default: false }, + // 是否显示新增按钮 + isShowAddBtn: { + type: Boolean, + required: false, + default: true + }, }) const isShowDrawer = ref(false) const detailLoading = ref(false) @@ -342,11 +283,11 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: setBeiJian() let detailButtonAdd: any = [] - detailButtonAdd = [ + detailButtonAdd = props.isShowAddBtn ? [ defaultButtons.defaultAddBtn({ hide: isShowMainButton(row, ['1']) }) - ] + ] : [] HeadButttondata.value = [...detailButtonAdd] // 动态显示操作列按钮 if (!props.detailButtonIsShow) { @@ -433,10 +374,12 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + console.log(val) + console.log(row) if (val == 'edit') { // 编辑 openForm('update', row) - emit('detailOpenForm', row) + // emit('detailOpenForm',val, row) } else if (val == 'delete') { // 删除 handleDelete(row.id) @@ -449,9 +392,14 @@ const formRef = ref() const openForm = async (type: string, row?: number) => { if (row) { if (detailAllSchemasRef.value?.tableColumns?.length > 0) { + //多选逗号分隔转换 let isTrue = false + let isChargePeoples = false let isItemNUmbersTrue = false isTrue = detailAllSchemasRef.value.tableColumns.some((item) => item.field == 'maintenances') + isChargePeoples = detailAllSchemasRef.value.tableColumns.some( + (item) => item.field == 'chargePeoples' + ) isItemNUmbersTrue = detailAllSchemasRef.value.tableColumns.some( (item) => item.field == 'itemNumbers' ) @@ -460,6 +408,11 @@ const openForm = async (type: string, row?: number) => { row.maintenances = row.maintenances.split(',').map(Number) } } + if (isChargePeoples) { + if (row.chargePeoples && isString(row.chargePeoples)) { + row.chargePeoples = row.chargePeoples.split(',').map(Number) + } + } } } @@ -500,7 +453,7 @@ const handleDelete = async (id: number) => { await getList() updateKey.value += 1 setBeiJian() - } catch {} + } catch { } } // 筛选提交 const searchFormClick = async (searchData) => { diff --git a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts index 81e7e29..fae1758 100644 --- a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts @@ -5,6 +5,8 @@ import { useUserStore } from '@/store/modules/user' import { selecUserByType } from '@/api/system/dept' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import { dateFormatter } from '@/utils/formatTime' +import { ItemSearchTable } from '../../basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' const userStore = useUserStore() const factoryList = await selectAllFactoryArea() const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) @@ -263,7 +265,8 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isDetail:false } ])) @@ -285,17 +288,29 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ }, isSearch: false, isForm: false, + isTableForm: false, }, { label: '责任人', - field: 'maintenance', + field: 'chargePeoples', sort: 'custom', table: { width: '150', }, + tableForm: { + type: 'Select', + initOptions: userList, + multiple:true, + collapseTags:true, + collapseTagsTooltip:true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + }, api: () => dutyUserList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return dutyUserList.find((account) => account.id == cellValue)?.name + return userList.filter(item=>cellValue.includes(item.id)).map(cur=>cur.name).join(',') }, form: { component: 'Select', @@ -306,7 +321,8 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - placeholder: "请选择责任人" + placeholder: "请选择责任人", + multiple: true, }, } }, @@ -321,11 +337,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ isSearch: false, isTable: true, form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } + component: 'Input', }, }, { @@ -336,26 +348,26 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ width: '150', }, isSearch: false, - isForm: true, + form: { + component: 'InputNumber', + }, isTable: true, + tableForm: { + type: 'InputNumber', + }, }, { label: '实际分钟', field: 'actualMinutes', sort: 'custom', - formatter: dateFormatter, table: { width: '150', }, isSearch: false, isTable: true, form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } + component: 'Input', }, }, @@ -376,6 +388,10 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ valueFormat: 'x' } }, + tableForm: { + type: 'FormDateTime', + valueFormat: 'x' + }, }, { label: '工程师确认', @@ -385,22 +401,9 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ table: { width: '150', }, - api: () => engineerList, - formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return engineerList.find((account) => account.id == cellValue)?.name - }, form: { - component: 'Select', - api: () => engineerList, - componentProps: { - disabled: false, - optionsAlias: { - labelField: 'name', - valueField: 'id' - }, - placeholder: "请选择工程师" - }, - } + component: 'Input', + }, }, { label: '是否完成', @@ -419,6 +422,12 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ disabled: false, } }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } + }, }, { label: '未完成原因', @@ -431,7 +440,63 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ isForm: true, isTable: true, }, - + { + label: '备件', + field: 'itemNumbers1', + sort: 'custom', + table: { + }, + tableForm:{ + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', + searchField: 'itemNumbers1', + searchTitle: '备件', + multiple:true, + searchAllSchemas: ItemSearchTable.allSchemas, + searchPage: ItemApi.getItemList, + tableSelectionChange: (value) => { + console.log('value', value) + // tableData.value.itemNumbers1 = value.map(item => item.itemNumber) + }, + searchCondition: [{ + key: 'deviceNumber', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'itemNumbers1', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + multiple:true, + searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'deviceNumber', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + } + }, + isSearch: false, + }, + { + label: '备件1', + field: 'itemNumbers', + sort: 'custom', + table: { + }, + isForm:false, + isDetail:false, + isTable:false, + isSearch: false, + isTableForm: false, + }, { label: '操作', field: 'action', @@ -439,6 +504,8 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isDetail: false, + isTableForm: false, } ])) diff --git a/src/views/eam/device/deviceInspectionMain/index.vue b/src/views/eam/device/deviceInspectionMain/index.vue index d500c1d..fe4fd93 100644 --- a/src/views/eam/device/deviceInspectionMain/index.vue +++ b/src/views/eam/device/deviceInspectionMain/index.vue @@ -34,21 +34,39 @@ - + + @searchTableSuccessDetail="searchTableSuccessDetail" + @detailOpenForm="detailOpenForm" + :detailValidate="detailValidate" + @detailSubmitForm="detailSubmitForm" + :isSearchTableItem="true" /> { +const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(() => { - const setV = {} - setV[formField] = val[0][searchField] - formRef.setValues(setV) + if (type == 'tableForm') { + // 明细查询页赋值 + if (formField == 'itemNumbers1') { + let str = '' + val.forEach((element) => { + str += element.name + ':' + element.qty + ',' + }) + str = str.substring(0, str.length - 1) + row['itemNumbers1'] = str + row['itemNumbers'] = val + } + } else { + // const setV = {} + // setV[formField] = val[0][searchField] + // setV['supplierCode'] = val[0]['code'] + // formRef.setValues(setV) + } }) } @@ -161,6 +195,7 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { + tableData.value = [] // 重置明细数据 basicFormRef.value.open(type, row) } @@ -273,6 +308,7 @@ const onChange = (field, cur, item) => { // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef) => { + debugger nextTick(() => { const setV = {} setV[formField] = val[0][searchField] @@ -312,23 +348,24 @@ const detailValidate = (data) => { } // 子表提交 const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { + console.log('data',data) try { let data1 = { id: data.id, - number: data.number, + number: data.maintenanceNumber, siteId: data.siteId, available: data.available, concurrencyStamp: data.concurrencyStamp, name: data.name, - peoples: data.peoples.join(','), + peoples: data.peoples, estimatedMinutes: data.estimatedMinutes, actualMinutes: data.actualMinutes, chargePeoples: data.chargePeoples.join(','), completionTime: data.completionTime, - engineer: data.engineer.join(','), + engineer: data.engineer, uncompleted: data.uncompleted } - console.log(data1) + console.log('data1',data1) if (formType === 'create') { await DeviceInspectionDetailApi.createDeviceInspectionDetail(data1) message.success(t('common.createSuccess')) @@ -354,6 +391,50 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => } } +/** + * tableForm方法 + */ + const tableFormKeys = {} + DeviceInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { + tableFormKeys[item.field] = item.default ? item.default : '' +}) + +// 添加明细 +const handleAddTable = () => { + tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) +} + +// 删除明细 +const handleDeleteTable = (item, index) => { + tableData.value.splice(index, 1) +} + + +// 主子数据 提交 +const submitForm = async (formType, data) => { + debugger + data.subList = tableData.value.map((item) => { + item.chargePeoples = item.chargePeoples.join(','); + return item; + }) // 拼接子表数据参数 + console.log(data.subList) + debugger + try { + if (formType === 'create') { + await DeviceInspectionMainApi.createDeviceInspectionMain(data) + message.success(t('common.createSuccess')) + } else { + await DeviceInspectionMainApi.updateDeviceInspectionMain(data) + message.success(t('common.updateSuccess')) + } + formRef.value.dialogVisible = false + // 刷新当前列表 + getList() + } finally { + formRef.value.formLoading = false + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts b/src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts index 416c2d4..71cef95 100644 --- a/src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts @@ -1,8 +1,22 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' +import { useUserStore } from '@/store/modules/user' +import { selecUserByType } from '@/api/system/dept' +import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import { dateFormatter } from '@/utils/formatTime' +import { ItemSearchTable } from '../../basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +const userStore = useUserStore() +const factoryList = await selectAllFactoryArea() +const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) +const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) +const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: undefined }) +const engineerList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 2}) +const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') // 表单校验 -export const deviceMaintainOrderMainRules = reactive({ +export const DeviceMaintainOrderMainRules = reactive({ number: [required], name: [required], planNumber: [required], @@ -13,39 +27,73 @@ export const deviceMaintainOrderMainRules = reactive({ concurrencyStamp: [required], }) -export const deviceMaintainOrderMain = useCrudSchemas(reactive([ +export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ { - label: '编号唯一标识', + label: '保养单号', field: 'number', sort: 'custom', isSearch: true, }, - { - label: '名称', - field: 'name', - sort: 'custom', - isSearch: true, - }, + // { + // label: '名称', + // field: 'name', + // sort: 'custom', + // isSearch: true, + // }, { label: '保养计划单号', field: 'planNumber', sort: 'custom', + isSearch: true, }, { - label: '设备/模具编号', + label: '设备/模具', field: 'deviceNumber', sort: 'custom', - isSearch: true, + isSearch: false, }, { label: '厂区编号', field: 'factoryAreaNumber', sort: 'custom', + table: { + width: '150', + }, + api: () => factoryList, + formatter: (_: Recordable, __: TableColumn, cellValue: String) => { + return factoryList.find((account) => account.id == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => factoryList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请先选择设备" + }, + }, + detail: { + } }, { - label: '工程师id', + label: '工程师', field: 'engineer', sort: 'custom', + isSearch: false, form: { component: 'InputNumber', value: 0 @@ -55,6 +103,7 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ label: '接单时间', field: 'receiveTime', sort: 'custom', + isSearch: false, formatter: dateFormatter, form: { component: 'DatePicker', @@ -68,6 +117,7 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ label: '指派时间', field: 'assignTime', sort: 'custom', + isSearch: false, formatter: dateFormatter, form: { component: 'DatePicker', @@ -77,19 +127,11 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ } }, }, - { - label: '工程师id', - field: 'worker', - sort: 'custom', - form: { - component: 'InputNumber', - value: 0 - }, - }, { label: '完成时间', field: 'finishedTime', sort: 'custom', + isSearch: false, formatter: dateFormatter, form: { component: 'DatePicker', @@ -103,6 +145,7 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ label: '验证时间', field: 'verifyTime', sort: 'custom', + isSearch: false, formatter: dateFormatter, form: { component: 'DatePicker', @@ -126,44 +169,304 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ field: 'type', sort: 'custom', isSearch: true, - form: { - component: 'Select' - }, + form: { + component: 'Select' + }, }, + // { + // label: '创建时间', + // field: 'createTime', + // sort: 'custom', + // formatter: dateFormatter, + // isSearch: false, + // search: { + // component: 'DatePicker', + // componentProps: { + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // type: 'daterange', + // defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + // } + // }, + // isForm: false, + // }, + // { + // label: '地点ID', + // field: 'siteId', + // sort: 'custom', + // isSearch: false, + // }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // isSearch: false, + // }, + // { + // label: '并发乐观锁', + // field: 'concurrencyStamp', + // sort: 'custom', + // form: { + // component: 'InputNumber', + // value: 0 + // }, + // }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isDetail: false, + } +])) + + + +// 表单校验 +export const DeviceMaintainOrderDetailRules = reactive({ + concurrencyStamp: [required], + name: [required], + number: [required], + peoples: [required], + estimatedMinutes: [required], + actualMinutes: [required], + chargePeoples: [required], + completionTime: [required], + engineer: [required] +}) + +export const DeviceMaintainOrderDetail = useCrudSchemas(reactive([ + { - label: '创建时间', - field: 'createTime', + label: '保养工单号', + field: 'number', sort: 'custom', - formatter: dateFormatter, isSearch: true, - search: { - component: 'DatePicker', + form: { + component: 'Input', componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + disabled: true, } }, - isForm: false, }, { - label: '地点ID', - field: 'siteId', + label: '人数', + field: 'peoples', sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + }, + isTable: true, + tableForm: { + type: 'InputNumber', + }, }, { - label: '是否可用', - field: 'available', + label: '预计分钟', + field: 'estimatedMinutes', sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + form: { + component: 'Input', + }, }, { - label: '并发乐观锁', - field: 'concurrencyStamp', + label: '实际分钟', + field: 'actualMinutes', sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, form: { - component: 'InputNumber', - value: 0 + component: 'Input', + }, + }, + { + label: '责任人多选', + field: 'chargePeoples', + sort: 'custom', + table: { + width: '150', + }, + tableForm: { + type: 'Select', + initOptions: userList, + multiple:true, + collapseTags:true, + collapseTagsTooltip:true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + }, + api: () => dutyUserList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.filter(item=>cellValue.includes(item.id)).map(cur=>cur.name).join(',') + }, + form: { + component: 'Select', + api: () => dutyUserList, + componentProps: { + disabled: false, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请选择责任人", + multiple: true, + }, + } + }, + { + label: '是否完成', + field: 'status', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + dictType: DICT_TYPE.JX_DETAILS_STATUS, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: false, + } + }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } + }, + }, + { + label: '未完成原因', + field: 'uncompleted', + sort: 'custom', + isSearch: false, + isTable: true, + form: { + component: 'Input', + componentProps: { + type:'textarea' + } + } + }, + { + label: '维修内容', + field: 'contents', + sort: 'custom', + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + disabled: true, + } + } + }, + { + label: '备件', + field: 'itemNumbers1', + sort: 'custom', + table: { + }, + tableForm:{ + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', + searchField: 'itemNumbers1', + searchTitle: '备件', + multiple:true, + searchAllSchemas: ItemSearchTable.allSchemas, + searchPage: ItemApi.getItemList, + tableSelectionChange: (value) => { + console.log('value', value) + // tableData.value.itemNumbers1 = value.map(item => item.itemNumber) + }, + searchCondition: [{ + key: 'deviceNumber', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'itemNumbers1', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + multiple:true, + searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'deviceNumber', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + } }, + isSearch: false, + }, + { + label: '备件1', + field: 'itemNumbers', + sort: 'custom', + table: { + }, + isForm:false, + isDetail:false, + isTable:false, + isSearch: false, + isTableForm: false, + }, + { + label: '完成时间', + field: 'completionTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + + { + label: '工程师确认', + field: 'engineer', + sort: 'custom', + isSearch: false, + form: { + component: 'Input', + componentProps: { + type:'TextArea' + } + } }, { label: '操作', @@ -172,6 +475,9 @@ export const deviceMaintainOrderMain = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isDetail: false, + isTableForm: false, } ])) + diff --git a/src/views/eam/device/deviceMaintainOrderMain/index.vue b/src/views/eam/device/deviceMaintainOrderMain/index.vue index 5baa32f..2a7daa6 100644 --- a/src/views/eam/device/deviceMaintainOrderMain/index.vue +++ b/src/views/eam/device/deviceMaintainOrderMain/index.vue @@ -1,18 +1,22 @@