diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index b62d9ac..3d902d7 100644 --- a/src/api/system/dept/index.ts +++ b/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) => { diff --git a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts index f5bda0a..e2efc86 100644 --- a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts +++ b/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([ 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([ }, form: { component: 'Select', - api: () => factoryList, + api: () => factoryDeptList, componentProps: { disabled: false, optionsAlias: { diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 61f0bf6..1794d6e 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/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() diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index c506a92..acf8af4 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/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([ 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([ }, form: { component: 'Select', - api: () => factoryList, + api: () => factoryDeptList, componentProps: { disabled: false, optionsAlias: { diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index bae3576..47bc698 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/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 })