Browse Source

测试bug修复

master
ljlong_2630 8 months ago
parent
commit
2c070006e1
  1. 5
      src/api/system/dept/index.ts
  2. 11
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  3. 59
      src/views/eam/device/devicemaintenancejob/index.vue
  4. 11
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts
  5. 43
      src/views/eam/mold/moldmaintenancejob/index.vue

5
src/api/system/dept/index.ts

@ -48,6 +48,11 @@ export const selectAllFactoryArea = async () => {
return await request.get({ url: '/system/dept/selectAllFactoryArea'}) return await request.get({ url: '/system/dept/selectAllFactoryArea'})
} }
// 查询厂区级部门列表
export const selectAllFactoryAreaDept = async () => {
return await request.get({ url: '/system/dept/selectAllFactoryAreaDept'})
}
// 查询厂区--班组下人员列表 // 查询厂区--班组下人员列表
export const selecUserByType = async (data) => { export const selecUserByType = async (data) => {

11
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -1,11 +1,12 @@
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 { selectAllFactoryArea,selectAllFactoryAreaDept } from '@/api/system/dept'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as SupplierApi from '@/api/eam/basic/supplier' import * as SupplierApi from '@/api/eam/basic/supplier'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { selecUserByType } from '@/api/system/dept' import { selecUserByType } from '@/api/system/dept'
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const factoryDeptList = await selectAllFactoryAreaDept()
const supplierList = await SupplierApi.getSupplierNoPage() const supplierList = await SupplierApi.getSupplierNoPage()
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
@ -135,14 +136,14 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
api: () => factoryList, api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name return factoryDeptList.find((account) => account.id == cellValue)?.name
}, },
search: { search: {
show: true, show: true,
component: 'Select', component: 'Select',
api: () => factoryList, api: () => factoryDeptList,
componentProps: { componentProps: {
optionsAlias: { optionsAlias: {
labelField: 'name', labelField: 'name',
@ -153,7 +154,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
}, },
form: { form: {
component: 'Select', component: 'Select',
api: () => factoryList, api: () => factoryDeptList,
componentProps: { componentProps: {
disabled: false, disabled: false,
optionsAlias: { optionsAlias: {

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

@ -423,9 +423,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
setV['deviceNumber'] = '' const setV = {}
formRefSec.setValues(setV) setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if (cur == 'TECH') { } else if (cur == 'TECH') {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
@ -439,9 +444,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
setV['deviceNumber'] = '' const setV = {}
formRefSec.setValues(setV) setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if(cur == 'DEVICE'){ } else if(cur == 'DEVICE'){
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
@ -455,9 +465,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
setV['deviceNumber'] = '' const setV = {}
formRefSec.setValues(setV) setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} }
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
@ -840,25 +855,17 @@ const submitForm = async (formType, data) => {
// //
const submitFormSec = async (formType, data) => { const submitFormSec = async (formType, data) => {
data.subList = tableData.value.map((item) => { const data1 = {
return { status: data.turnType,
describes: item.describes, deviceNumber: data.deviceNumber,
describes1: item.describes1, type: data.type,
itemNumbers: item.itemNumbers, maintenance: data.maintenance,
maintenances: item.maintenances.join(','), id: data.id
workOut: item.workOut, }
factoryAreaNumber: newRow.value.factoryAreaNumber,
}
}) //
console.log(data.subList) console.log(data.subList)
try { try {
if (formType === 'create') { await DeviceMaintenanceMainApi.orderTurnTo(data1)
await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) message.success(t('common.updateSuccess'))
message.success(t('common.createSuccess'))
} else {
await DeviceMaintenanceMainApi.updateDeviceMaintenanceMain(data)
message.success(t('common.updateSuccess'))
}
formRefSec.value.dialogVisible = false formRefSec.value.dialogVisible = false
// //
getList() getList()

11
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -1,9 +1,10 @@
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 { selectAllFactoryArea,selectAllFactoryAreaDept } from '@/api/system/dept'
import * as SupplierApi from '@/api/eam/basic/supplier' import * as SupplierApi from '@/api/eam/basic/supplier'
import { validateHanset,validateNumDot, validateEmail,validateNum } from '@/utils/validator' import { validateHanset,validateNumDot, validateEmail,validateNum } from '@/utils/validator'
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const factoryDeptList = await selectAllFactoryAreaDept()
const supplierList = await SupplierApi.getSupplierNoPage() const supplierList = await SupplierApi.getSupplierNoPage()
// 表单校验 // 表单校验
export const MoldAccountsRules = reactive({ export const MoldAccountsRules = reactive({
@ -82,14 +83,14 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
api: () => factoryList, api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name return factoryDeptList.find((account) => account.id == cellValue)?.name
}, },
search: { search: {
show: true, show: true,
component: 'Select', component: 'Select',
api: () => factoryList, api: () => factoryDeptList,
componentProps: { componentProps: {
optionsAlias: { optionsAlias: {
labelField: 'name', labelField: 'name',
@ -100,7 +101,7 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
}, },
form: { form: {
component: 'Select', component: 'Select',
api: () => factoryList, api: () => factoryDeptList,
componentProps: { componentProps: {
disabled: false, disabled: false,
optionsAlias: { optionsAlias: {

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

@ -777,10 +777,15 @@ const onChangeSec = (field, cur, item,formRefSec) => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
setV['deviceNumber'] = '' const setV = {}
formRefSec.setValues(setV) setV['deviceNumber'] = ''
} else if (cur == 'TECH') { formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if (cur == 'TECH') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
@ -793,9 +798,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
setV['deviceNumber'] = '' const setV = {}
formRefSec.setValues(setV) setV['deviceNumber'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if(cur == 'DEVICE'){ } else if(cur == 'DEVICE'){
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
@ -806,12 +816,17 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
})
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
}) })
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
} }
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
@ -841,7 +856,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
MoldAccountsApi.getMoldAccountsAllNoPage({}) MoldAccountsApi.getMoldAccountsAllNoPage({})
.then(res => { .then(res => {
moldList.value = res moldList.value = res
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = moldList.value }).componentProps.options = moldList.value
}) })
@ -850,7 +865,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
DeviceAccountsApi.getDeviceAccountsAllNoPage({}) DeviceAccountsApi.getDeviceAccountsAllNoPage({})
.then(res => { .then(res => {
deviceList.value = res deviceList.value = res
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
}) })

Loading…
Cancel
Save