diff --git a/src/api/eam/basicEamWorkshop/index.ts b/src/api/eam/basicEamWorkshop/index.ts index 729ea6dae..2728f74eb 100644 --- a/src/api/eam/basicEamWorkshop/index.ts +++ b/src/api/eam/basicEamWorkshop/index.ts @@ -67,3 +67,9 @@ export const importTemplate = () => { export const updateEnableCode = async (data: BasicEamWorkshopVO) => { return await request.post({ url: `/eam/basic-eam-workshop/ables` , data }) } + + +// 查询EAM车间列表 +export const getBasicEamWorkshopNoPage = async (params) => { + return await request.get({ url: `/eam/basic-eam-workshop/noPage`, params }) +} \ No newline at end of file diff --git a/src/api/eam/toolChangedRecord/index.ts b/src/api/eam/toolChangedRecord/index.ts new file mode 100644 index 000000000..c3b32e08f --- /dev/null +++ b/src/api/eam/toolChangedRecord/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' + +export interface ToolChangedRecordVO { + id: number + code: string + name: string + statusBefore: string + statusAfter: string + operator: number + operateTime: Date + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询设备变更记录列表 +export const getToolChangedRecordPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/tool-changed-record/senior', data }) + } else { + return await request.get({ url: `/eam/tool-changed-record/page`, params }) + } +} + +// 查询设备变更记录详情 +export const getToolChangedRecord = async (id: number) => { + return await request.get({ url: `/eam/tool-changed-record/get?id=` + id }) +} + +// 新增设备变更记录 +export const createToolChangedRecord = async (data: ToolChangedRecordVO) => { + return await request.post({ url: `/eam/tool-changed-record/create`, data }) +} + +// 修改设备变更记录 +export const updateToolChangedRecord = async (data: ToolChangedRecordVO) => { + return await request.put({ url: `/eam/tool-changed-record/update`, data }) +} + +// 删除设备变更记录 +export const deleteToolChangedRecord = async (id: number) => { + return await request.delete({ url: `/eam/tool-changed-record/delete?id=` + id }) +} + +// 导出设备变更记录 Excel +export const exportToolChangedRecord = async (params) => { + return await request.download({ url: `/eam/tool-changed-record/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/tool-changed-record/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/toolSigning/index.ts b/src/api/eam/toolSigning/index.ts new file mode 100644 index 000000000..66fca87e3 --- /dev/null +++ b/src/api/eam/toolSigning/index.ts @@ -0,0 +1,79 @@ +import request from '@/config/axios' + +export interface ToolSigningVO { + id: number + toolCode: string + operationDate: Date + operationer: string + operationDept: string + telephone: string + supplierCode: string + supplierPeople: string + supplierTelephone: string + status: string + approver: number + approveContent: string + approveTime: Date + autoExamine: string + autoAgree: string + directCreateRecord: string + storageLocation: string + factoryAreaCode: string + workshopCode: string + lineCode: string + processCode: string + workstationCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询工装到货签收记录列表 +export const getToolSigningPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/tool-signing/senior', data }) + } else { + return await request.get({ url: `/eam/tool-signing/page`, params }) + } +} + +// 查询工装到货签收记录详情 +export const getToolSigning = async (id: number) => { + return await request.get({ url: `/eam/tool-signing/get?id=` + id }) +} + +// 新增工装到货签收记录 +export const createToolSigning = async (data: ToolSigningVO) => { + return await request.post({ url: `/eam/tool-signing/create`, data }) +} + +// 新增工装到货签收记录 +export const createToolSigningNew = async (data: ToolSigningVO) => { + return await request.post({ url: `/eam/tool-signing/createNew`, data }) +} + +// 修改工装到货签收记录 +export const updateToolSigning = async (data: ToolSigningVO) => { + return await request.put({ url: `/eam/tool-signing/update`, data }) +} + +// 删除工装到货签收记录 +export const deleteToolSigning = async (id: number) => { + return await request.delete({ url: `/eam/tool-signing/delete?id=` + id }) +} + +// 导出工装到货签收记录 Excel +export const exportToolSigning = async (params) => { + return await request.download({ url: `/eam/tool-signing/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/tool-signing/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/equipmentAccounts/equipmentAccounts.data.ts b/src/views/eam/equipmentAccounts/equipmentAccounts.data.ts index f22e6e5dc..cea15dc35 100644 --- a/src/views/eam/equipmentAccounts/equipmentAccounts.data.ts +++ b/src/views/eam/equipmentAccounts/equipmentAccounts.data.ts @@ -11,12 +11,18 @@ import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' import * as ConfigApi from '@/api/infra/config' import * as ProductionlineApi from '@/api/wms/productionline' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' -import * as ProcessApi from '@/api/wms/process' -import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data' -import * as WorkStationApi from '@/api/wms/workstation' -import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' +import * as UserApi from '@/api/system/user' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +import * as BasicEamWorkshopApi from '@/api/eam/basicEamWorkshop' +import { BasicEamWorkshop } from '@/views/eam/basicEamWorkshop/basicEamWorkshop.data' -const workshopNoPage = await WorkshopApi.getWorkshopNoPage({}) +export interface User { + id: number, + nickname: string +} + +const workshopNoPage = await BasicEamWorkshopApi.getBasicEamWorkshopNoPage({}) const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({}); @@ -26,6 +32,13 @@ const autoSwitch = ref(false) if (autoCodeSwitch == 'TRUE') { autoSwitch.value = true } +const allDeptList = await DeptApi.getSimpleDeptList(); +const deptList = ref([]) // 树形结构 +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(allDeptList) + +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() // 表单校验 export const EquipmentAccountsRules = reactive({ @@ -113,13 +126,41 @@ export const EquipmentAccounts = useCrudSchemas(reactive([ label: '使用部门', field: 'useDept', sort: 'custom', - isSearch: false + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return allDeptList.find((item) => item.id == cellValue)?.name + }, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + } + } }, { label: '负责人', field: 'principal', sort: 'custom', - isSearch: false + isSearch: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '负责人联系方式', @@ -233,13 +274,38 @@ export const EquipmentAccounts = useCrudSchemas(reactive([ label: '采购部门', field: 'purchaseDept', sort: 'custom', - isSearch: false + isSearch: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return allDeptList.find((item) => item.id == cellValue)?.name + }, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + } + } }, { label: '采购人', field: 'purchaser', sort: 'custom', - isSearch: false + isSearch: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '出厂日期', @@ -378,8 +444,8 @@ export const EquipmentAccounts = useCrudSchemas(reactive([ searchListPlaceholder: '请选择车间代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '车间信息', // 查询弹窗标题 - searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 - searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchAllSchemas: BasicEamWorkshop.allSchemas, // 查询弹窗所需类 + searchPage: BasicEamWorkshopApi.getBasicEamWorkshopPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', @@ -388,58 +454,58 @@ export const EquipmentAccounts = useCrudSchemas(reactive([ } }, }, - { - label: '产线编号', - field: 'lineCode', - sort: 'custom', - isSearch: true, - isDetail: false, - isForm: false, - isTable: true, - isTableForm: false, - search: { - component: 'Select', - componentProps: { - options: productionlineNoPage, - optionsAlias: { - labelField: 'name', - valueField: 'code' - }, - filterable: true, - } - }, - formatter: (_: Recordable, __: TableColumn, cellValue: string) => { - return productionlineNoPage.find((item) => item.code == cellValue)?.name - }, - }, - { - label: '产线编号', - field: 'lineName', - sort: 'custom', - isSearch: false, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 - multiple:true, - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '生产线信息', // 查询弹窗标题 - searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 - searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 - searchCondition: [{ - key:'workshopCode', - value:'workshopCode', - message: '请填写车间代码!', - isMainValue: true - },{ - key: 'available', - value: 'TRUE', - isMainValue: false - }] - } - } - }, + // { + // label: '产线编号', + // field: 'lineCode', + // sort: 'custom', + // isSearch: true, + // isDetail: false, + // isForm: false, + // isTable: true, + // isTableForm: false, + // search: { + // component: 'Select', + // componentProps: { + // options: productionlineNoPage, + // optionsAlias: { + // labelField: 'name', + // valueField: 'code' + // }, + // filterable: true, + // } + // }, + // formatter: (_: Recordable, __: TableColumn, cellValue: string) => { + // return productionlineNoPage.find((item) => item.code == cellValue)?.name + // }, + // }, + // { + // label: '产线编号', + // field: 'lineName', + // sort: 'custom', + // isSearch: false, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + // multiple:true, + // searchField: 'code', // 查询弹窗赋值字段 + // searchTitle: '生产线信息', // 查询弹窗标题 + // searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + // searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key:'workshopCode', + // value:'workshopCode', + // message: '请填写车间代码!', + // isMainValue: true + // },{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, // { // label: '工序编号', // field: 'processCode', diff --git a/src/views/eam/equipmentAccounts/index.vue b/src/views/eam/equipmentAccounts/index.vue index 9a7a924e6..f41b4f823 100644 --- a/src/views/eam/equipmentAccounts/index.vue +++ b/src/views/eam/equipmentAccounts/index.vue @@ -47,6 +47,7 @@ :apiUpdate="EquipmentAccountsApi.updateEquipmentAccounts" :apiCreate="EquipmentAccountsApi.createEquipmentAccounts" @searchTableSuccess="searchTableSuccess" + @onChange="onChange" :isBusiness="false" /> @@ -112,6 +113,7 @@ import * as WorkshopApi from '@/api/wms/workshop' import * as ProductionlineApi from '@/api/wms/productionline' import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' +import * as UserApi from '@/api/system/user' defineOptions({ name: 'EquipmentAccounts' }) @@ -130,7 +132,10 @@ const detailAllSchemas = ref() const apiPage = ref() const dialogApiPage = ref() const dialogAllSchemas = ref() - +export interface User { + id: number, + nickname: string +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -515,6 +520,26 @@ const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) = }) } +const onChange = async (field, cur, formRef) => { + if(field == 'purchaseDept'){ + const userList = ref([]) + userList.value = await UserApi.getUserListByDeptIds([cur]) + EquipmentAccounts.allSchemas.formSchema.find(item => item.field == 'purchaser').componentProps.options = userList.value + let setV = {} + setV['purchaser'] = '' + formRef.value.setValues(setV) + } + if(field == 'useDept'){ + const user01List = ref([]) + user01List.value = await UserApi.getUserListByDeptIds([cur]) + EquipmentAccounts.allSchemas.formSchema.find(item => item.field == 'principal').componentProps.options = user01List.value + let setV = {} + setV['principal'] = '' + formRef.value.setValues(setV) + } + +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts b/src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts index 699400b36..e0692e15a 100644 --- a/src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts +++ b/src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts @@ -30,7 +30,6 @@ export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive([]) // 树形结构 +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() // 加载部门树(默认格式) -deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) +deptList.value = handleTreeToComponentOptions(allDeptList) // 表单校验 export const EquipmentManufacturerRules = reactive({ @@ -76,7 +85,18 @@ export const EquipmentManufacturer = useCrudSchemas(reactive([ label: '联系人', field: 'contacts', sort: 'custom', - isSearch: true + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '部门', diff --git a/src/views/eam/equipmentSigning/equipmentSigning.data.ts b/src/views/eam/equipmentSigning/equipmentSigning.data.ts index aed5e85ea..61756c1eb 100644 --- a/src/views/eam/equipmentSigning/equipmentSigning.data.ts +++ b/src/views/eam/equipmentSigning/equipmentSigning.data.ts @@ -6,21 +6,13 @@ import * as UserApi from '@/api/system/user' import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data' import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts' import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' -import * as ProductionlineApi from '@/api/wms/productionline' -import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' -import * as WorkshopApi from '@/api/wms/workshop' -import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' -import * as ProcessApi from '@/api/wms/process' -import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data' -import * as WorkStationApi from '@/api/wms/workstation' -import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' - +import * as BasicEamWorkshopApi from '@/api/eam/basicEamWorkshop' export interface User { id: number, nickname: string } - +const workshopList = await BasicEamWorkshopApi.getBasicEamWorkshopNoPage({}) const equipmentSupplierList = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) const allDeptList = await DeptApi.getSimpleDeptList() const deptList = ref([]) // 树形结构 @@ -337,7 +329,21 @@ export const EquipmentSigning = useCrudSchemas(reactive([ field: 'workshopCode', sort: 'custom', isSearch: true, - isForm: false, + isForm: true, + formatter: (_: Recordable, __: TableColumn, cellValue: string) => { + return workshopList.find((item) => item.code == cellValue)?.name + }, + form: { + component: 'Select', + componentProps: { + options: workshopList, + placeholder: '请选择车间编号', + optionsAlias: { + valueField: 'code', + labelField: 'name' + } + } + } }, // { // label: '产线编号', @@ -451,13 +457,13 @@ export const EquipmentSigning = useCrudSchemas(reactive([ // } // } // }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } - } + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } ])) diff --git a/src/views/eam/equipmentSigning/index.vue b/src/views/eam/equipmentSigning/index.vue index e7476efe9..e94de01e7 100644 --- a/src/views/eam/equipmentSigning/index.vue +++ b/src/views/eam/equipmentSigning/index.vue @@ -90,10 +90,11 @@ const searchTableSuccess = async (formField, searchField, val, formRef) => { setV[formField] = val[0][searchField] if(formField == 'equipmentCode'){ setV['supplierCode'] = val[0]['supplierCode'] + setV['workshopCode'] = val[0]['workshopCode'] const equipmentSupplierList = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) const entry = equipmentSupplierList.find(item => item.number == val[0]['supplierCode']) - setV['supplierTelephone'] = entry.phone - setV['supplierPeople'] = Number(entry.contacts) + setV['supplierTelephone'] = entry?.phone + setV['supplierPeople'] = Number(entry?.contacts) } nextTick(() => { formRef.setValues(setV) @@ -148,8 +149,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - // defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-signing:update'}), // 编辑 - // defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing:delete'}), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-signing:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing:delete'}), // 删除 ] // 列表-操作按钮事件 @@ -264,7 +265,15 @@ const onChange = async (field, cur, formRef) => { setV['operationer'] = '' formRef.value.setValues(setV) } - + if(field == 'supplierCode'){ + const equipmentSupplierList = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) + const entry = equipmentSupplierList.find(item => item.number == cur) + let setV = {} + setV['supplierTelephone'] = entry.phone + setV['supplierPeople'] = Number(entry.contacts) + formRef.value.setValues(setV) + } + } diff --git a/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts b/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts index 7e7fc6377..0f2f47116 100644 --- a/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts +++ b/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts @@ -3,10 +3,18 @@ import { dateFormatter } from '@/utils/formatTime' import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' import { handleTreeToComponentOptions } from '@/utils/tree' import * as DeptApi from '@/api/system/dept' -const deptList = ref([]) // 树形结构 +import * as UserApi from '@/api/system/user' + +export interface User { + id: number, + nickname: string +} +const deptList = ref([]) // 树形结构 // 加载部门树(默认格式) deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() // 表单校验 export const EquipmentSupplierRules = reactive({ @@ -82,7 +90,18 @@ export const EquipmentSupplier = useCrudSchemas(reactive([ label: '联系人', field: 'contacts', sort: 'custom', - isSearch: true + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '部门', diff --git a/src/views/eam/planSpotCheck/planSpotCheck.data.ts b/src/views/eam/planSpotCheck/planSpotCheck.data.ts index 01c49f3cd..d852ff5e3 100644 --- a/src/views/eam/planSpotCheck/planSpotCheck.data.ts +++ b/src/views/eam/planSpotCheck/planSpotCheck.data.ts @@ -298,7 +298,6 @@ export const PlanSpotCheck = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false, }, { label: '部门id', diff --git a/src/views/eam/toolAccounts/index.vue b/src/views/eam/toolAccounts/index.vue index 27ebebe3f..02e8625b1 100644 --- a/src/views/eam/toolAccounts/index.vue +++ b/src/views/eam/toolAccounts/index.vue @@ -52,6 +52,7 @@ :apiCreate="ToolAccountsApi.createToolAccounts" @searchTableSuccess="searchTableSuccess" :isBusiness="false" + @onChange="onChange" /> @@ -149,6 +150,7 @@ import * as WorkshopApi from '@/api/wms/workshop' import * as ProductionlineApi from '@/api/wms/productionline' import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' +import * as UserApi from '@/api/system/user' defineOptions({ name: 'ToolAccounts' }) @@ -172,6 +174,10 @@ const operationRecordList = ref([ { label: '巡检记录', value: 'inspection' }, { label: '点检记录', value: 'spot_check' } ]) +export interface User { + id: number, + nickname: string +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { @@ -521,6 +527,28 @@ const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) = } ) } + + +const onChange = async (field, cur, formRef) => { + if(field == 'purchaseDept'){ + const userList = ref([]) + userList.value = await UserApi.getUserListByDeptIds([cur]) + ToolAccounts.allSchemas.formSchema.find(item => item.field == 'purchaser').componentProps.options = userList.value + let setV = {} + setV['purchaser'] = '' + formRef.value.setValues(setV) + } + if(field == 'useDept'){ + const user01List = ref([]) + user01List.value = await UserApi.getUserListByDeptIds([cur]) + ToolAccounts.allSchemas.formSchema.find(item => item.field == 'principal').componentProps.options = user01List.value + let setV = {} + setV['principal'] = '' + formRef.value.setValues(setV) + } +} + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/toolAccounts/toolAccounts.data.ts b/src/views/eam/toolAccounts/toolAccounts.data.ts index a225fdf7f..0fd56a2ad 100644 --- a/src/views/eam/toolAccounts/toolAccounts.data.ts +++ b/src/views/eam/toolAccounts/toolAccounts.data.ts @@ -9,19 +9,36 @@ import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' import { EquipmentManufacturer } from '@/views/eam/equipmentManufacturer/equipmentManufacturer.data' import * as ProductionlineApi from '@/api/wms/productionline' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' +import * as UserApi from '@/api/system/user' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +import * as BasicEamWorkshopApi from '@/api/eam/basicEamWorkshop' +import { BasicEamWorkshop } from '@/views/eam/basicEamWorkshop/basicEamWorkshop.data' +export interface User { + id: number, + nickname: string +} -const workshopNoPage = await WorkshopApi.getWorkshopNoPage({}) +const workshopNoPage = await BasicEamWorkshopApi.getBasicEamWorkshopNoPage({}) const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({}); +const autoCodeSwitch = await ConfigApi.getConfigKey('toolCodeAutoSwitch') + -const autoCodeSwitch = await ConfigApi.getConfigKey('deviceCodeAutoSwitch') -// ProductionlineApi.getProductionlinePage const autoSwitch = ref(false) if (autoCodeSwitch == 'TRUE') { autoSwitch.value = true } +const allDeptList = await DeptApi.getSimpleDeptList(); +const deptList = ref([]) // 树形结构 +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(allDeptList) + +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() + // 表单校验 export const ToolAccountsRules = reactive({ code: [required], @@ -100,13 +117,41 @@ export const ToolAccounts = useCrudSchemas(reactive([ label: '使用部门', field: 'useDept', sort: 'custom', - isSearch: false + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return allDeptList.find((item) => item.id == cellValue)?.name + }, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + } + } }, { label: '负责人', field: 'principal', sort: 'custom', - isSearch: false + isSearch: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '负责人联系方式', @@ -119,6 +164,8 @@ export const ToolAccounts = useCrudSchemas(reactive([ field: 'status', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.DEVICE_STATUS, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 form: { component: 'Select' } @@ -218,13 +265,38 @@ export const ToolAccounts = useCrudSchemas(reactive([ label: '采购部门', field: 'purchaseDept', sort: 'custom', - isSearch: true + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return allDeptList.find((item) => item.id == cellValue)?.name + }, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + } + } }, { label: '采购人', field: 'purchaser', sort: 'custom', - isSearch: true + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } }, { label: '出厂日期', @@ -369,8 +441,8 @@ export const ToolAccounts = useCrudSchemas(reactive([ searchListPlaceholder: '请选择车间代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '车间信息', // 查询弹窗标题 - searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 - searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchAllSchemas: BasicEamWorkshop.allSchemas, // 查询弹窗所需类 + searchPage: BasicEamWorkshopApi.getBasicEamWorkshopPage, // 查询弹窗所需分页方法 disable:true, searchCondition: [{ key: 'available', @@ -380,58 +452,58 @@ export const ToolAccounts = useCrudSchemas(reactive([ } }, }, - { - label: '产线编号', - field: 'lineCode', - sort: 'custom', - isSearch: true, - isDetail: false, - isForm: false, - isTable: true, - isTableForm: false, - search: { - component: 'Select', - componentProps: { - options: productionlineNoPage, - optionsAlias: { - labelField: 'name', - valueField: 'code' - }, - filterable: true, - } - }, - formatter: (_: Recordable, __: TableColumn, cellValue: string) => { - return productionlineNoPage.find((item) => item.code == cellValue)?.name - }, - }, - { - label: '产线编号', - field: 'lineName', - sort: 'custom', - isSearch: false, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 - multiple:true, - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '生产线信息', // 查询弹窗标题 - searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 - searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 - searchCondition: [{ - key:'workshopCode', - value:'workshopCode', - message: '请填写车间代码!', - isMainValue: true - },{ - key: 'available', - value: 'TRUE', - isMainValue: false - }] - } - } - }, + // { + // label: '产线编号', + // field: 'lineCode', + // sort: 'custom', + // isSearch: true, + // isDetail: false, + // isForm: false, + // isTable: true, + // isTableForm: false, + // search: { + // component: 'Select', + // componentProps: { + // options: productionlineNoPage, + // optionsAlias: { + // labelField: 'name', + // valueField: 'code' + // }, + // filterable: true, + // } + // }, + // formatter: (_: Recordable, __: TableColumn, cellValue: string) => { + // return productionlineNoPage.find((item) => item.code == cellValue)?.name + // }, + // }, + // { + // label: '产线编号', + // field: 'lineName', + // sort: 'custom', + // isSearch: false, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + // multiple:true, + // searchField: 'code', // 查询弹窗赋值字段 + // searchTitle: '生产线信息', // 查询弹窗标题 + // searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + // searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key:'workshopCode', + // value:'workshopCode', + // message: '请填写车间代码!', + // isMainValue: true + // },{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, // { // label: '工序编号', // field: 'processCode', @@ -494,12 +566,12 @@ export const ToolAccounts = useCrudSchemas(reactive([ // } // }, // }, - { - label: '部门', - field: 'departmentCode', - sort: 'custom', - isSearch: false - }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // isSearch: false + // }, { label: '备注', field: 'remark', @@ -645,7 +717,7 @@ export const ToolAccounts = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 300, fixed: 'right' } } diff --git a/src/views/eam/toolChangedRecord/index.vue b/src/views/eam/toolChangedRecord/index.vue new file mode 100644 index 000000000..104629338 --- /dev/null +++ b/src/views/eam/toolChangedRecord/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/toolChangedRecord/toolChangedRecord.data.ts b/src/views/eam/toolChangedRecord/toolChangedRecord.data.ts new file mode 100644 index 000000000..b3001751d --- /dev/null +++ b/src/views/eam/toolChangedRecord/toolChangedRecord.data.ts @@ -0,0 +1,110 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as UserApi from '@/api/system/user' + +export interface User { + id: number, + nickname: string +} +// 表单校验 +export const ToolChangedRecordRules = reactive({ + code: [required], + name: [required], + concurrencyStamp: [required] +}) + +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() + +export const ToolChangedRecord = useCrudSchemas(reactive([ + { + label: '工装编号', + field: 'code', + sort: 'custom', + isSearch: true, + fixed: 'left' + }, + { + label: '工装名称', + field: 'name', + sort: 'custom', + isSearch: true + }, + { + label: '变更前状态', + field: 'statusBefore', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.DEVICE_STATUS, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Select' + } + }, + { + label: '变更后状态', + field: 'statusAfter', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.DEVICE_STATUS, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Select', + } + }, + { + label: '操作人', + field: 'operator', + sort: 'custom', + isSearch: true, + search: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + valueField: 'id', + labelField: 'nickname' + }, + filterable: true, + clearable: true + } + }, + }, + { + label: '操作时间', + field: 'operateTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } +])) diff --git a/src/views/eam/toolSigning/index.vue b/src/views/eam/toolSigning/index.vue new file mode 100644 index 000000000..abcad9423 --- /dev/null +++ b/src/views/eam/toolSigning/index.vue @@ -0,0 +1,280 @@ + + + diff --git a/src/views/eam/toolSigning/toolSigning.data.ts b/src/views/eam/toolSigning/toolSigning.data.ts new file mode 100644 index 000000000..32b8c320d --- /dev/null +++ b/src/views/eam/toolSigning/toolSigning.data.ts @@ -0,0 +1,487 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +import * as UserApi from '@/api/system/user' +import { ToolAccounts,ToolAccountsRules } from '../toolAccounts/toolAccounts.data' +import * as ToolAccountsApi from '@/api/eam/toolAccounts' +import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' +import * as BasicEamWorkshopApi from '@/api/eam/basicEamWorkshop' + + +export interface User { + id: number, + nickname: string +} + +const toolList = await ToolAccountsApi.getToolAccountsNoPage({}) +const workshopList = await BasicEamWorkshopApi.getBasicEamWorkshopNoPage({}) +const equipmentSupplierList = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) +const allDeptList = await DeptApi.getSimpleDeptList() +const deptList = ref([]) // 树形结构 +const userList = ref([]) +userList.value = await UserApi.getSimpleUserList() +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(allDeptList) + +// 表单校验 +export const ToolSigningRules = reactive({ + toolCode: [required], + operationDate: [required], + operationer: [required], + operationDept: [required], + storageLocation: [required], + concurrencyStamp: [required] +}) + +export const ToolSigning = useCrudSchemas(reactive([ + { + label: '工装', + field: 'toolCode', + sort: 'custom', + isSearch: true, + isTable: true, + isForm: false, + isDetail: false, + isTableForm: false, + formatter: (_: Recordable, __: TableColumn, cellValue: string) => { + return toolList.find((item) => item.code == cellValue)?.name + }, + }, + { + label: '工装', + field: 'toolName', + sort: 'custom', + isSearch: false, + isTable: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择设备', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '设备信息', // 查询弹窗标题 + searchAllSchemas: ToolAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ToolAccountsApi.getToolAccountsPage, // 查询弹窗所需分页方法 + searchCondition: + [{ + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key: 'status', + value: 'TOACCEPT', + isMainValue: false + }] + } + }, + }, + { + label: '验收日期', + field: 'operationDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '验收部门', + field: 'operationDept', + sort: 'custom', + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return allDeptList.find((item) => item.id == cellValue)?.name + }, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList.value, + disabled: false, + placeholder: "请选择部门", + filterable: true, + multiple: false, + } + } + }, + { + label: '验收人', + field: 'operationer', + sort: 'custom', + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { // 假设deptList是部门数据列表 + options: userList.value, + optionsAlias: { + valueField: 'id', + labelField: 'nickname' + }, + disabled: false, + placeholder: "请先选择部门", + filterable: true, + multiple: false, + } + } + }, + { + label: '验收人联系方式', + field: 'telephone', + sort: 'custom', + isSearch: false + }, + { + label: '供应商编号', + field: 'supplierCode', + sort: 'custom', + isSearch: false, + isForm: true, + isDetail: false, + isTable: false, + isTableForm: false, + form: { + component: 'Select', + componentProps: { + options: equipmentSupplierList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + disabled: true, + } + } + }, + // { + // label: '供应商编号', + // field: 'supplierName', + // sort: 'custom', + // isSearch: false, + // isForm: true, + // isDetail: false, + // isTable: false, + // isTableForm: false, + // form: { + // component: 'Input', + // componentProps: { + // disabled: true + // } + // } + // }, + { + label: '供应商联系人', + field: 'supplierPeople', + sort: 'custom', + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userList.value.find((item) => item.id == cellValue)?.nickname + }, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + disabled: true, + } + } + }, + { + label: '供应商联系方式', + field: 'supplierTelephone', + sort: 'custom', + isSearch: false, + isForm: true, + form: { + component: 'Input', + componentProps: { + disabled: true + } + } + }, + // { + // label: '流程状态', + // field: 'status', + // sort: 'custom', + // isSearch: true, + // dictType: DICT_TYPE.JOB_STATUS, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // form: { + // component: 'Select' + // } + // }, + // { + // label: '审核人', + // field: 'approver', + // sort: 'custom', + // isSearch: true, + // form: { + // component: 'InputNumber', + // value: 0 + // } + // }, + // { + // label: '审核内容', + // field: 'approveContent', + // sort: 'custom', + // isSearch: false, + // form: { + // component: 'Input', + // componentProps: { + // type: 'textarea', + // valueHtml: '', + // height: 200 + // } + // } + // }, + // { + // label: '审核时间', + // field: 'approveTime', + // sort: 'custom', + // formatter: dateFormatter, + // isSearch: false, + // search: { + // component: 'DatePicker', + // componentProps: { + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // type: 'daterange', + // defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + // } + // }, + // form: { + // component: 'DatePicker', + // componentProps: { + // type: 'datetime', + // valueFormat: 'x' + // } + // } + // }, + // { + // label: '自动审核', + // field: 'autoExamine', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + // { + // label: '自动通过', + // field: 'autoAgree', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + // { + // label: '直接生成记录', + // field: 'directCreateRecord', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + { + label: '存放位置描述', + field: 'storageLocation', + sort: 'custom', + isSearch: false, + isForm: true, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + placeholder: '请输入存放位置描述' + } + } + }, + // { + // label: '所属厂区编号', + // field: 'factoryAreaCode', + // sort: 'custom', + // isSearch: false + // }, + { + label: '车间编号', + field: 'workshopCode', + sort: 'custom', + isSearch: true, + isForm: true, + formatter: (_: Recordable, __: TableColumn, cellValue: string) => { + return workshopList.find((item) => item.code == cellValue)?.name + }, + form: { + component: 'Select', + componentProps: { + options: workshopList, + placeholder: '请选择车间编号', + optionsAlias: { + valueField: 'code', + labelField: 'name' + } + } + } + }, + // { + // label: '产线编号', + // field: 'lineCode', + // sort: 'custom', + // isSearch: true, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + // multiple:true, + // searchField: 'code', // 查询弹窗赋值字段 + // searchTitle: '生产线信息', // 查询弹窗标题 + // searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + // searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key:'workshopCode', + // value:'workshopCode', + // message: '请填写车间代码!', + // isMainValue: true + // },{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, + // { + // label: '工序编号', + // field: 'processCode', + // sort: 'custom', + // isSearch: true, + // form:{ + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择工序代码', + // searchField: 'code', + // searchTitle: '工序信息', + // searchAllSchemas: Process.allSchemas, + // searchPage: ProcessApi.getProcessPage, + // searchCondition: [{ + // key:'productionLineCode', + // value:'lineCode', + // message: '请填写生产线代码!', + // isMainValue: true + // },{ + // key:'workshopCode', + // value:'workshopCode', + // message: '请填写车间代码!', + // isMainValue: true + // },{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // }, + // }, + // { + // label: '工位编号', + // field: 'workstationCode', + // sort: 'custom', + // isSearch: true, + // form:{ + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择工位', // 输入框占位文本 + // searchField: 'code', // 查询弹窗赋值字段 + // searchTitle: '工位信息', // 查询弹窗标题 + // searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 + // searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key:'productionLineCode', + // value:'lineCode', + // message: '请填写生产线代码!', + // isMainValue: true + // },{ + // key:'workshopCode', + // value:'workshopCode', + // message: '请填写车间代码!', + // isMainValue: true + // },{ + // key:'available', + // value:'TRUE', + // isMainValue: false + // }] + // } + // }, + // }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false + }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: true, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } +]))