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 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())
// -

202
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<CrudSchema
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: '150',
},
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
api: () => 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<CrudSchema[]>([
{
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'

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

Loading…
Cancel
Save