diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue index 1d41d95..2a83fb9 100644 --- a/src/views/eam/device/deviceAccounts/index.vue +++ b/src/views/eam/device/deviceAccounts/index.vue @@ -138,6 +138,8 @@ const tableObjectExtend = ref() const defaultParams = ref({}) const dialogApiPage = ref() const dialogAllSchemas = ref() +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken()) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { @@ -212,8 +214,7 @@ const butttondata = [ defaultButtons.selectItemBtn(null) //备件 ] -const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL -const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken()) + // 列表-操作按钮事件 diff --git a/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts b/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts index da6f385..9cf40f5 100644 --- a/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts +++ b/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts @@ -1,6 +1,19 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' - +import { selectAllFactoryArea } from '@/api/system/dept' +import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' +import { useUserStore } from '@/store/modules/user' +import { selecUserByType } from '@/api/system/dept' +import { ItemSearchTable } from '../../basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' +// 邮箱账号的列表 +const factoryList = await selectAllFactoryArea() +const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) +const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) +const moldListNoPage = await MoldAccountsApi.getMoldAccountsAllNoPage({}) +const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') +const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) // 表单校验 export const DeviceSpotInspectionRecordMainRules = reactive({ number: [required], @@ -16,80 +29,126 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive MoldAccountsApi.getMoldAccountsNoPage({ + isSearch: false + }), + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return moldListNoPage.find((account) => account.number == cellValue)?.name + }, + form: { + component: 'Select', + componentProps: { + options: moldList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + }, + } }, { label: '维修人', field: 'maintenance', sort: 'custom', - form: { - component: 'InputNumber', - value: 0 + table: { + width: '150', + }, + api: () => userList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.find((account) => account.id == cellValue)?.name }, + form: { + component: 'Select', + api: () => userList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + }, + } }, { label: '维修人联系电话', field: 'maintenancePhone', sort: 'custom', + table: { + width: '200', + }, }, { label: '状态', field: 'status', sort: 'custom', isSearch: true, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + table: { + width: '150', + }, form: { - component: 'Radio' + component: 'Select' }, }, { label: '类型', field: 'type', sort: 'custom', + table: { + width: '150', + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + }, isSearch: true, - form: { - component: 'Select' - }, - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - }, - { - label: '地点ID', - field: 'siteId', - sort: 'custom', - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', + search: { + component: 'Select', + componentProps: { + options: moldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + }, + }, + form: { + component: 'Select', + componentProps: { + options: moldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + placeholder: "请选择设备" + } + }, }, { - label: '并发乐观锁', - field: 'concurrencyStamp', + label: '描述', + field: 'describe', sort: 'custom', - form: { - component: 'InputNumber', - value: 0 + table: { + width: '300', }, }, { label: '操作', field: 'action', isForm: false, + isTable: false, table: { width: 150, fixed: 'right' @@ -107,88 +166,49 @@ export const DeviceSpotInspectionRecordDetailRules = reactive({ }) export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive([ + { - label: 'id', - field: 'id', - sort: 'custom', - isForm: false - }, - { - label: '检修工单号与主表一致', + label: '检修工单号', field: 'number', sort: 'custom', - isSearch: true - }, - { - label: '是否符合TRUE/FALSE', - field: 'isConform', - sort: 'custom', - isSearch: true - }, - { - label: '创建时间', - field: 'createTime', - 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')] - } + table: { + width: '300', }, - isForm: false }, { - label: '地点ID', - field: 'siteId', - sort: 'custom', - isSearch: true - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - isSearch: true - }, - { - label: '并发乐观锁', - field: 'concurrencyStamp', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 - } - }, - { - label: '主表id', - field: 'masterId', + label: '是否符合', + field: 'isConform', sort: 'custom', isSearch: true, - form: { - component: 'InputNumber', - value: 0 - } + table: { + width: '300', + }, }, + { label: '检查内容', field: 'name', sort: 'custom', + table: { + width: '300', + }, isSearch: true }, { label: '设备部位名称', field: 'equipmentPosition', sort: 'custom', + table: { + width: '300', + }, isSearch: true }, { label: '操作', field: 'action', isForm: false, + isTable: false, table: { width: 150, fixed: 'right' diff --git a/src/views/eam/mold/moldAccounts/index.vue b/src/views/eam/mold/moldAccounts/index.vue index 1c6f966..65dca2d 100644 --- a/src/views/eam/mold/moldAccounts/index.vue +++ b/src/views/eam/mold/moldAccounts/index.vue @@ -148,7 +148,8 @@ const dialogApiPage = ref() const dialogAllSchemas = ref() const dialogAllSchemasRules = ref() const milestone = ref("milestone") - +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken()) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { @@ -174,6 +175,7 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.selectQrCodeBatchBtn(null), //批量生成二维码 // defaultButtons.defaultImportBtn(null), // 导入 // defaultButtons.defaultExportBtn(null), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 @@ -194,6 +196,9 @@ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 openForm('create') + } else if (val == 'qrCodeBatch') { + // 批量生成二维码 + qrCodeBatch(val, item) } else if (val == 'import') { // 导入 handleImport() @@ -224,10 +229,12 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'selectQrCode') { + } else if (val == 'qrCode') { // 二维码 openQrCode(row.number) - } else if (val == 'selectItem') { + } else if (val == 'qrCode') { + window.open(src.value + "&number='" + row.number + "'") + } else if (val == 'selectItem') { openItem(row.number) } }