diff --git a/src/api/eam/device/deviceAccounts/index.ts b/src/api/eam/device/deviceAccounts/index.ts index cba18c7..7476910 100644 --- a/src/api/eam/device/deviceAccounts/index.ts +++ b/src/api/eam/device/deviceAccounts/index.ts @@ -13,6 +13,7 @@ export interface DeviceAccountsVO { productionDate: Date purchasePrice: number siteId: string + status: string available: string concurrencyStamp: number } @@ -70,3 +71,4 @@ export const getDeviceAccountsAllNoPage = async (data: DeviceAccountsVO) => { return await request.post({ url: `/eam/device-accounts/noPage`,data }) } + diff --git a/src/api/eam/device/deviceMaintenanceMain/index.ts b/src/api/eam/device/deviceMaintenanceMain/index.ts index 2bc137e..8547c06 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -18,7 +18,6 @@ export interface DeviceMaintenanceMainVO { // 查询设备维修工单主列表 export const getDeviceMaintenanceMainPage = async (params) => { - params.type = 'DEVICE' if (params.isSearch) { delete params.isSearch const data = {...params} diff --git a/src/api/eam/device/deviceRepair/index.ts b/src/api/eam/device/deviceRepair/index.ts index 5a9679d..1751735 100644 --- a/src/api/eam/device/deviceRepair/index.ts +++ b/src/api/eam/device/deviceRepair/index.ts @@ -17,7 +17,6 @@ export interface DeviceRepairVO { // 查询报修申请列表 export const getDeviceRepairPage = async (params) => { - params.type = 'DEVICE' if (params.isSearch) { delete params.isSearch const data = { ...params } diff --git a/src/api/eam/device/techMaintenanceMain/index.ts b/src/api/eam/device/techMaintenanceMain/index.ts index 2b47249..b735af8 100644 --- a/src/api/eam/device/techMaintenanceMain/index.ts +++ b/src/api/eam/device/techMaintenanceMain/index.ts @@ -18,7 +18,6 @@ export interface DeviceMaintenanceMainVO { // 查询工艺维修工单主列表 export const getTechMaintenanceMainPage = async (params) => { - params.type = 'TECH' if (params.isSearch) { delete params.isSearch const data = {...params} diff --git a/src/api/eam/device/techRepair/index.ts b/src/api/eam/device/techRepair/index.ts index ceba717..ce1d3a9 100644 --- a/src/api/eam/device/techRepair/index.ts +++ b/src/api/eam/device/techRepair/index.ts @@ -17,7 +17,6 @@ export interface DeviceRepairVO { // 查询报修申请列表 export const getDeviceRepairPage = async (params) => { - params.type = 'TECH' if (params.isSearch) { delete params.isSearch const data = { ...params } diff --git a/src/api/eam/mold/moldMaintenanceMain/index.ts b/src/api/eam/mold/moldMaintenanceMain/index.ts index 9adbda2..fce98be 100644 --- a/src/api/eam/mold/moldMaintenanceMain/index.ts +++ b/src/api/eam/mold/moldMaintenanceMain/index.ts @@ -18,7 +18,6 @@ export interface MoldMaintenanceMainVO { // 查询维修工单主列表 export const getMoldMaintenanceMainPage = async (params) => { - params.type = 'MOLD' if (params.isSearch) { delete params.isSearch const data = {...params} diff --git a/src/api/eam/mold/moldRepair/index.ts b/src/api/eam/mold/moldRepair/index.ts index 028f2b4..0af3d79 100644 --- a/src/api/eam/mold/moldRepair/index.ts +++ b/src/api/eam/mold/moldRepair/index.ts @@ -16,7 +16,6 @@ export interface MoldRepairVO { // 查询报修申请列表 export const getMoldRepairPage = async (params) => { - params.type = 'MOLD' if (params.isSearch) { delete params.isSearch const data = { ...params } diff --git a/src/views/eam/device/deviceRepair/deviceRepair.data.ts b/src/views/eam/device/deviceRepair/deviceRepair.data.ts index 5a80249..8a01957 100644 --- a/src/views/eam/device/deviceRepair/deviceRepair.data.ts +++ b/src/views/eam/device/deviceRepair/deviceRepair.data.ts @@ -72,16 +72,6 @@ export const DeviceRepair = useCrudSchemas(reactive([ valueField: 'id' }, filterable: true, - onChange: (val) => { - DeviceAccountsApi.getDeviceAccountsNoPage({ - isSearch: false, - factoryAreaNumber: val - }).then((res) => { - deviceList.value = res - }).catch((e) => { - console.log(e) - }) - } }, } }, @@ -96,10 +86,23 @@ export const DeviceRepair = useCrudSchemas(reactive([ return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, isSearch: true, + search: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + // disabled: true, + filterable: true, + placeholder: "请选择类型" + } + }, form: { component: 'Select', componentProps: { - options: deviceTypeList, + options: deviceMoldTypeList, optionsAlias: { labelField: 'label', valueField: 'value' @@ -138,7 +141,7 @@ export const DeviceRepair = useCrudSchemas(reactive([ form: { component: 'Select', componentProps: { - options: deviceList, + options: deviceListNoPage, optionsAlias: { labelField: 'name', valueField: 'number' diff --git a/src/views/eam/device/deviceRepair/index.vue b/src/views/eam/device/deviceRepair/index.vue index 11c2d15..8410890 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -66,6 +66,7 @@ import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data' import * as DeviceRepairApi from '@/api/eam/device/deviceRepair' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' +import * as MoldAccountApi from '@/api/eam/mold/moldAccounts' import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data' import { useUserStore } from '@/store/modules/user' // import TableHead from '@/components/TableHead/src/TableHead.vue' @@ -88,7 +89,8 @@ const urls = ref([]) const viewKey = ref(0) routeName.value = route.name const tableColumns = ref(DeviceRepair.allSchemas.tableColumns) - +const factoryAreaNumber = ref(''); +const type = ref(''); // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -308,6 +310,61 @@ const onChange = (field, cur, item,formRef) => { setV['deviceNumber'] = '' formRef.setValues(setV) }) + factoryAreaNumber.value = cur + if(type.value != 'MOLD'){ + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } + } + + if (field == 'type') { + nextTick(() => { + const setV = {} + setV['deviceNumber'] = '' + formRef.setValues(setV) + }) + type.value = cur + if(cur != 'MOLD'){ + type.value = 'DEVICE' + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'DEVICE', + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + type.value = 'MOLD' + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'MOLD', + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } + } // if (field == 'factoryAreaNumber') { diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 7fa8e2b..dc0d9cb 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -705,7 +705,9 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ labelField: 'label', valueField: 'value' }, + disabled: false, filterable: true, + placeholder: "请选择类型" }, }, form: { @@ -717,7 +719,7 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ valueField: 'value' }, filterable: true, - placeholder: "请选择设备" + placeholder: "请选择类型" } }, }, diff --git a/src/views/eam/device/techRepair/index.vue b/src/views/eam/device/techRepair/index.vue index c2f8288..9b0f879 100644 --- a/src/views/eam/device/techRepair/index.vue +++ b/src/views/eam/device/techRepair/index.vue @@ -66,6 +66,7 @@ import { DeviceRepair, DeviceRepairRules } from './techRepair.data' import * as DeviceRepairApi from '@/api/eam/device/techRepair' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' +import * as MoldAccountApi from '@/api/eam/mold/moldAccounts' import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data' import { useUserStore } from '@/store/modules/user' // import TableHead from '@/components/TableHead/src/TableHead.vue' @@ -88,7 +89,8 @@ const urls = ref([]) const viewKey = ref(0) routeName.value = route.name const tableColumns = ref(DeviceRepair.allSchemas.tableColumns) - +const factoryAreaNumber = ref(''); +const type = ref(''); // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -308,6 +310,61 @@ const onChange = (field, cur, item,formRef) => { setV['deviceNumber'] = '' formRef.setValues(setV) }) + factoryAreaNumber.value = cur + if(type.value != 'MOLD'){ + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } + } + + if (field == 'type') { + nextTick(() => { + const setV = {} + setV['deviceNumber'] = '' + formRef.setValues(setV) + }) + type.value = cur + if(cur != 'MOLD'){ + type.value = 'DEVICE' + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'DEVICE', + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + type.value = 'MOLD' + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'MOLD', + status: '0' + }).then((res) => { + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } + } // if (field == 'factoryAreaNumber') { diff --git a/src/views/eam/device/techRepair/techRepair.data.ts b/src/views/eam/device/techRepair/techRepair.data.ts index 5a80249..c6af868 100644 --- a/src/views/eam/device/techRepair/techRepair.data.ts +++ b/src/views/eam/device/techRepair/techRepair.data.ts @@ -72,16 +72,6 @@ export const DeviceRepair = useCrudSchemas(reactive([ valueField: 'id' }, filterable: true, - onChange: (val) => { - DeviceAccountsApi.getDeviceAccountsNoPage({ - isSearch: false, - factoryAreaNumber: val - }).then((res) => { - deviceList.value = res - }).catch((e) => { - console.log(e) - }) - } }, } }, @@ -96,17 +86,30 @@ export const DeviceRepair = useCrudSchemas(reactive([ return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, isSearch: true, + search: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + // disabled: true, + filterable: true, + placeholder: "请选择类型" + } + }, form: { component: 'Select', componentProps: { - options: deviceTypeList, + options: deviceMoldTypeList, optionsAlias: { labelField: 'label', valueField: 'value' }, // disabled: true, filterable: true, - placeholder: "请选择设备" + placeholder: "请选择类型" } }, }, @@ -138,7 +141,7 @@ export const DeviceRepair = useCrudSchemas(reactive([ form: { component: 'Select', componentProps: { - options: deviceList, + options: deviceListNoPage, optionsAlias: { labelField: 'name', valueField: 'number' diff --git a/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts b/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts index b30a7c3..60e6d02 100644 --- a/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts +++ b/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts @@ -215,7 +215,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, - isSearch: false, + isSearch: true, form: { component: 'Select', componentProps: { @@ -229,6 +229,19 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ placeholder: "请选择设备" }, }, + search: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + disabled: false, + filterable: true, + placeholder: "请选择设备" + }, + }, }, { label: '类型', diff --git a/src/views/eam/mold/moldRepair/index.vue b/src/views/eam/mold/moldRepair/index.vue index 67b7f88..234a847 100644 --- a/src/views/eam/mold/moldRepair/index.vue +++ b/src/views/eam/mold/moldRepair/index.vue @@ -64,7 +64,8 @@ import download from '@/utils/download' import { MoldRepair, MoldRepairRules } from './moldRepair.data' import * as MoldRepairApi from '@/api/eam/mold/moldRepair' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import * as MoldAccountApi from '@/api/eam/mold/moldAccount' +import * as MoldAccountApi from '@/api/eam/mold/moldAccounts' +import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' defineOptions({ name: 'MoldRepair' }) @@ -80,6 +81,8 @@ const viewKey = ref(0) routeName.value = route.name const tableColumns = ref(MoldRepair.allSchemas.tableColumns) +const factoryAreaNumber = ref(''); +const type = ref(''); // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -182,7 +185,6 @@ const formsSuccess = async (formType, data) => { } if (data.activeTime == 0) data.activeTime = null; if (data.expireTime == 0) data.expireTime = null; - data.type = 'MOLD'; data.result = 'PENDING'; if (data.upload != null && data.upload != "") { data.filePathList = data?.upload?.map((item: any) => { @@ -289,13 +291,68 @@ onMounted(async () => { importTemplateData.templateUrl = await MoldRepairApi.importTemplate() }) -const onChange = (field, cur, item, formRef) => { + +const onChange = (field, cur, item,formRef) => { if (field == 'factoryAreaNumber') { nextTick(() => { const setV = {} setV['deviceNumber'] = '' formRef.setValues(setV) }) + factoryAreaNumber.value = cur + if(type.value != 'MOLD'){ + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + MoldRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: cur, + type: type.value, + status: '0' + }).then((res) => { + MoldRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } + } + + if (field == 'type') { + nextTick(() => { + const setV = {} + setV['deviceNumber'] = '' + formRef.setValues(setV) + }) + + if(cur != 'MOLD'){ + type.value = 'DEVICE' + DeviceAccountApi.getDeviceAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'DEVICE', + status: '0' + }).then((res) => { + MoldRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + }else{ + type.value = 'MOLD' + MoldAccountApi.getMoldAccountsAllNoPage({ + factoryAreaNumber: factoryAreaNumber.value, + type: 'MOLD', + status: '0' + }).then((res) => { + MoldRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = res + }) + } } } diff --git a/src/views/eam/mold/moldRepair/moldRepair.data.ts b/src/views/eam/mold/moldRepair/moldRepair.data.ts index f4a1692..579e79c 100644 --- a/src/views/eam/mold/moldRepair/moldRepair.data.ts +++ b/src/views/eam/mold/moldRepair/moldRepair.data.ts @@ -2,9 +2,11 @@ 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 { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' import * as UserApi from '@/api/system/user' const userListAll = await UserApi.getSimpleUserList() +const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) // 邮箱账号的列表 @@ -73,19 +75,47 @@ export const MoldRepair = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - onChange: (val) => { - MoldAccountsApi.getMoldAccountsNoPage({ - isSearch: false, - factoryAreaNumber: val - }).then((res) => { - moldList.value = res - }).catch((e) => { - console.log(e) - }) - } }, } }, + { + label: '类型', + field: 'type', + sort: 'custom', + table: { + width: '150', + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + }, + isSearch: true, + search: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + // disabled: true, + filterable: true, + placeholder: "请选择类型" + } + }, + form: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + // disabled: true, + filterable: true, + placeholder: "请选择类型" + } + }, + }, { label: '模具', field: 'deviceNumber', @@ -101,7 +131,7 @@ export const MoldRepair = useCrudSchemas(reactive([ form: { component: 'Select', componentProps: { - options: moldList, + options: moldListNoPage, optionsAlias: { labelField: 'name', valueField: 'number' diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index fcaf71a..9ab1c4a 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -116,16 +116,18 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ formatter: (_: Recordable, __: TableColumn, cellValue: number) => { return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, - isSearch: false, + isSearch: true, search: { component: 'Select', componentProps: { - options: deviceTypeList, + options: deviceMoldTypeList, optionsAlias: { labelField: 'label', valueField: 'value' }, + disabled: false, filterable: true, + placeholder: "请选择类型" }, }, form: {