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'})
}
// 查询厂区级部门列表
export const selectAllFactoryAreaDept = async () => {
return await request.get({ url: '/system/dept/selectAllFactoryAreaDept'})
}
// 查询厂区--班组下人员列表
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 { 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 * as SupplierApi from '@/api/eam/basic/supplier'
import * as UserApi from '@/api/system/user'
import { selecUserByType } from '@/api/system/dept'
const factoryList = await selectAllFactoryArea()
const factoryDeptList = await selectAllFactoryAreaDept()
const supplierList = await SupplierApi.getSupplierNoPage()
const userListAll = await UserApi.getSimpleUserList()
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
@ -135,14 +136,14 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: '150',
},
api: () => factoryList,
api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
return factoryDeptList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
api: () => factoryDeptList,
componentProps: {
optionsAlias: {
labelField: 'name',
@ -153,7 +154,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
},
form: {
component: 'Select',
api: () => factoryList,
api: () => factoryDeptList,
componentProps: {
disabled: false,
optionsAlias: {

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

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

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

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

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

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

Loading…
Cancel
Save