Browse Source

修复巡检点检字段翻译问题,模具加二维码

master
ljlong_2630 9 months ago
parent
commit
4ede5ee556
  1. 5
      src/views/eam/device/deviceAccounts/index.vue
  2. 202
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  3. 13
      src/views/eam/mold/moldAccounts/index.vue

5
src/views/eam/device/deviceAccounts/index.vue

@ -138,6 +138,8 @@ const tableObjectExtend = ref()
const defaultParams = ref({}) const defaultParams = ref({})
const dialogApiPage = ref() const dialogApiPage = ref()
const dialogAllSchemas = 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) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -212,8 +214,7 @@ const butttondata = [
defaultButtons.selectItemBtn(null) // defaultButtons.selectItemBtn(null) //
] ]
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken())
// - // -

202
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -1,6 +1,19 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' 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({ export const DeviceSpotInspectionRecordMainRules = reactive({
number: [required], number: [required],
@ -16,80 +29,126 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: '150',
},
}, },
{ {
label: '设备模具', label: '设备模具',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: true, isSearch: true,
}, api: () => MoldAccountsApi.getMoldAccountsNoPage({
{ isSearch: false
label: '描述', }),
field: 'describe', formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
sort: 'custom', return moldListNoPage.find((account) => account.number == cellValue)?.name
},
form: {
component: 'Select',
componentProps: {
options: moldList,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
}
}, },
{ {
label: '维修人', label: '维修人',
field: 'maintenance', field: 'maintenance',
sort: 'custom', sort: 'custom',
form: { table: {
component: 'InputNumber', width: '150',
value: 0 },
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: '维修人联系电话', label: '维修人联系电话',
field: 'maintenancePhone', field: 'maintenancePhone',
sort: 'custom', sort: 'custom',
table: {
width: '200',
},
}, },
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
table: {
width: '150',
},
form: { form: {
component: 'Radio' component: 'Select'
}, },
}, },
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true, isSearch: true,
form: { search: {
component: 'Select' component: 'Select',
}, componentProps: {
}, options: moldTypeList,
{ optionsAlias: {
label: '创建时间', labelField: 'label',
field: 'createTime', valueField: 'value'
sort: 'custom', },
formatter: dateFormatter, },
isForm: false, },
}, form: {
{ component: 'Select',
label: '地点ID', componentProps: {
field: 'siteId', options: moldTypeList,
sort: 'custom', optionsAlias: {
}, labelField: 'label',
{ valueField: 'value'
label: '是否可用', },
field: 'available', placeholder: "请选择设备"
sort: 'custom', }
},
}, },
{ {
label: '并发乐观锁', label: '描述',
field: 'concurrencyStamp', field: 'describe',
sort: 'custom', sort: 'custom',
form: { table: {
component: 'InputNumber', width: '300',
value: 0
}, },
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isTable: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
@ -107,88 +166,49 @@ export const DeviceSpotInspectionRecordDetailRules = reactive({
}) })
export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: '检修工单号',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '检修工单号与主表一致',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true
},
{
label: '是否符合TRUE/FALSE',
field: 'isConform',
sort: 'custom',
isSearch: true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true, isSearch: true,
search: { table: {
component: 'DatePicker', width: '300',
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', label: '是否符合',
field: 'siteId', field: 'isConform',
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',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { table: {
component: 'InputNumber', width: '300',
value: 0 },
}
}, },
{ {
label: '检查内容', label: '检查内容',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
table: {
width: '300',
},
isSearch: true isSearch: true
}, },
{ {
label: '设备部位名称', label: '设备部位名称',
field: 'equipmentPosition', field: 'equipmentPosition',
sort: 'custom', sort: 'custom',
table: {
width: '300',
},
isSearch: true isSearch: true
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isTable: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'

13
src/views/eam/mold/moldAccounts/index.vue

@ -148,7 +148,8 @@ const dialogApiPage = ref()
const dialogAllSchemas = ref() const dialogAllSchemas = ref()
const dialogAllSchemasRules = ref() const dialogAllSchemasRules = ref()
const milestone = ref("milestone") 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) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -174,6 +175,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.selectQrCodeBatchBtn(null), //
// defaultButtons.defaultImportBtn(null), // // defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), // // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
@ -194,6 +196,9 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { if (val == 'add') {
// //
openForm('create') openForm('create')
} else if (val == 'qrCodeBatch') {
//
qrCodeBatch(val, item)
} else if (val == 'import') { } else if (val == 'import') {
// //
handleImport() handleImport()
@ -224,10 +229,12 @@ const buttonTableClick = async (val, row) => {
if (val == 'edit') { if (val == 'edit') {
// //
openForm('update', row) openForm('update', row)
} else if (val == 'selectQrCode') { } else if (val == 'qrCode') {
// //
openQrCode(row.number) 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) openItem(row.number)
} }
} }

Loading…
Cancel
Save