Browse Source

修复测试bug

master
ljlong_2630 8 months ago
parent
commit
0bed62c8ff
  1. 1
      src/components/Detail/src/Detail.vue
  2. 10
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  3. 56
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  4. 9
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  5. 8
      src/views/eam/device/devicemaintenancejob/index.vue
  6. 7
      src/views/eam/mold/moldRepair/moldRepair.data.ts
  7. 11
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  8. 8
      src/views/eam/mold/moldmaintenancejob/index.vue
  9. 6
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

1
src/components/Detail/src/Detail.vue

@ -496,7 +496,6 @@ const openForm = async (type: string, row?: number) => {
}
}
}
if (await props.openFormCallBack) {
props.openFormCallBack(type, row, masterParmas.value, () => {
formRef.value.open(type, row, masterParmas.value)

10
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -120,6 +120,16 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
search: {
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
},
form: {
component: 'Select',
componentProps: {

56
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -50,7 +50,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150',
fixed: 'left',
},
isSearch: true,
isSearch: false,
isForm: false,
},
{
@ -60,12 +60,12 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: '150',
},
isSearch: false,
api: () => repairList,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return repairList.find((account) => account.number == cellValue)?.name
// },
search: {
show: true,
component: 'Select',
api: () => repairList,
componentProps: {
@ -87,76 +87,77 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '设备',
field: 'deviceNumber',
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isDetail: false,
table: {
width: '150',
},
api: () => deviceList,
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => deviceList,
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => deviceList,
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'number'
valueField: 'id'
},
placeholder: "请选择设备"
},
}
},
{
label: '厂区',
field: 'factoryAreaNumber',
label: '设备',
field: 'deviceNumber',
sort: 'custom',
isSearch: false,
isDetail: false,
isSearch: true,
table: {
width: '150',
},
api: () => factoryList,
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
return deviceListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
valueField: 'number'
}
}
},
form: {
component: 'Select',
api: () => factoryList,
api: () => deviceList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
valueField: 'number'
},
placeholder: "请选择设备"
},
}
},
{
label: '检修人',
field: 'maintenance',
@ -359,9 +360,12 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id'
}
},
api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',')
formatter: (_: Recordable, __: TableColumn, cellValue) => {
const cellValueList = cellValue?.split(',');
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
form: {
component: 'Select',

9
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -345,12 +345,15 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '维修人',
field: 'maintenance',
field: 'maintenances',
sort: 'custom',
isDetail: false,
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue) => {
return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.nickname)?.join(',')
const cellValueList = cellValue ? cellValue.split(',') : [];
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
tableForm: {
type: 'Select',

8
src/views/eam/device/devicemaintenancejob/index.vue

@ -695,7 +695,7 @@ const detailValidate = (data) => {
}
}
//
const detailSubmitForm= async (formType,data,formRef,tableList) => {
const detailSubmitForm = async (formType, data, formRef, tableList) => {
try {
let data1 = {
id:data.id,
@ -737,7 +737,7 @@ const detailSubmitForm= async (formType,data,formRef,tableList) => {
const openFormCallBack = (type, row, masterParmas, callback) => {
if (operatRecord.value.type == 'TECH') {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();
@ -746,7 +746,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
})
} else if (operatRecord.value.type == 'DEVICE') {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();
@ -755,7 +755,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
})
} else if (operatRecord.value.type == 'MOLD') {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();

7
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -2,6 +2,9 @@ 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 { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
// 邮箱账号的列表
@ -21,6 +24,10 @@ export const MoldRepairRules = reactive({
type: [required],
available: [required],
concurrencyStamp: [required],
declarerPhone: [
required,
{ validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'}
]
// result: [required],
})

11
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -7,8 +7,10 @@ import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import * as UserApi from '@/api/system/user'
import { validateHanset, validateNumDot, validateNum, validateEmail } from '@/utils/validator'
const userStore = useUserStore()
const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea()
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({})
const moldListAll = await MoldAccountsApi.getMoldAccountsAllNoPage({})
@ -56,12 +58,12 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: '150',
},
isSearch: false,
api: () => repairList,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return repairList.find((account) => account.number == cellValue)?.name
// },
search: {
show: false,
component: 'Select',
api: () => repairList,
componentProps: {
@ -352,9 +354,12 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id'
}
},
api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',')
const cellValueList = cellValue ? cellValue.split(',') : [];
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
form: {
component: 'Select',

8
src/views/eam/mold/moldmaintenancejob/index.vue

@ -299,7 +299,7 @@ const isShowMainButton = (row, val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED') && isReceiver(row.maintenance)}), //
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance)) }), //
defaultButtons.acceptOrderBtn({
hide: !(
row.status == 'PENDING' &&
@ -602,7 +602,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
const openFormCallBack = (type, row, masterParmas, callback) => {
if (operatRecord.value.type == 'TECH') {
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();
@ -611,7 +611,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
})
} else if (operatRecord.value.type == 'DEVICE') {
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();
@ -620,7 +620,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
})
} else if (operatRecord.value.type == 'MOLD') {
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
if (item.field == 'maintenance') {
if (item.field == 'maintenances') {
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => {
item.componentProps.options = response
callback();

6
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -302,7 +302,11 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue) => {
return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.nickname).join(',')
const cellValueList = cellValue ? cellValue.split(',') : [];
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
tableForm: {
type: 'Select',

Loading…
Cancel
Save