From 75074e27254e3d58df34e54e8405aed769b360d8 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Wed, 26 Jun 2024 15:55:42 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=20=E2=80=94=E2=80=94>=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E6=95=B0=E6=8D=AE=E7=94=9F=E4=BA=A7=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basicEamProductionline/index.ts | 73 +++++ src/api/eam/basicEamWorkshop/index.ts | 7 +- .../basicEamProductionline.data.ts | 235 ++++++++++++++ .../eam/basicEamProductionline/index.vue | 296 ++++++++++++++++++ 4 files changed, 610 insertions(+), 1 deletion(-) create mode 100644 src/api/eam/basicEamProductionline/index.ts create mode 100644 src/views/eam/basicEamProductionline/basicEamProductionline.data.ts create mode 100644 src/views/eam/basicEamProductionline/index.vue diff --git a/src/api/eam/basicEamProductionline/index.ts b/src/api/eam/basicEamProductionline/index.ts new file mode 100644 index 000000000..9f410aea3 --- /dev/null +++ b/src/api/eam/basicEamProductionline/index.ts @@ -0,0 +1,73 @@ +import request from '@/config/axios' +import {BasicEamWorkshopVO} from "@/api/eam/basicEamWorkshop"; + +export interface BasicEamProductionlineVO { + id: number + code: string + name: string + description: string + type: string + workshopCode: string + rawLocationCode: string + fgLocationCode: string + available: string + activeTime: Date + expireTime: Date + remark: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询生产线列表 +export const getBasicEamProductionlinePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic-eam-productionline/senior', data }) + } else { + return await request.get({ url: `/eam/basic-eam-productionline/page`, params }) + } +} + +// 查询生产线详情 +export const getBasicEamProductionline = async (id: number) => { + return await request.get({ url: `/eam/basic-eam-productionline/get?id=` + id }) +} + +// 新增生产线 +export const createBasicEamProductionline = async (data: BasicEamProductionlineVO) => { + return await request.post({ url: `/eam/basic-eam-productionline/create`, data }) +} + +// 修改生产线 +export const updateBasicEamProductionline = async (data: BasicEamProductionlineVO) => { + return await request.put({ url: `/eam/basic-eam-productionline/update`, data }) +} + +// 删除生产线 +export const deleteBasicEamProductionline = async (id: number) => { + return await request.delete({ url: `/eam/basic-eam-productionline/delete?id=` + id }) +} + +// 导出生产线 Excel +export const exportBasicEamProductionline = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/eam/basic-eam-productionline/export-excel-senior`, data }) + }else{ + return await request.download({ url: `/eam/basic-eam-productionline/export-excel`, params }) + } +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic-eam-productionline/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: BasicEamProductionlineVO) => { + return await request.post({ url: `/eam/basic-eam-productionline/ables` , data }) +} diff --git a/src/api/eam/basicEamWorkshop/index.ts b/src/api/eam/basicEamWorkshop/index.ts index 31acbb17c..09d83c2d9 100644 --- a/src/api/eam/basicEamWorkshop/index.ts +++ b/src/api/eam/basicEamWorkshop/index.ts @@ -51,7 +51,12 @@ export const deleteBasicEamWorkshop = async (id: number) => { // 导出EAM车间 Excel export const exportBasicEamWorkshop = async (params) => { - return await request.download({ url: `/eam/basic-eam-workshop/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/eam/basic-eam-workshop/export-excel-senior`, data }) + }else{ + return await request.download({ url: `/eam/basic-eam-workshop/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/views/eam/basicEamProductionline/basicEamProductionline.data.ts b/src/views/eam/basicEamProductionline/basicEamProductionline.data.ts new file mode 100644 index 000000000..a9018722a --- /dev/null +++ b/src/views/eam/basicEamProductionline/basicEamProductionline.data.ts @@ -0,0 +1,235 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as WorkshopApi from "@/api/eam/basicEamWorkshop"; +import {BasicEamWorkshop} from "@/views/eam/basicEamWorkshop/basicEamWorkshop.data"; +import {getBasicEamWorkshopPage} from "@/api/eam/basicEamWorkshop"; + +// 表单校验 +export const BasicEamProductionlineRules = reactive({ + code: [required], + available: [required], + concurrencyStamp: [required], +}) + +export const BasicEamProductionline = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '生产线编号', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '生产线名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: false, + }, + { + label: '生产线类型', + field: 'type', + sort: 'custom', + isSearch: true, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + isSearch: false, + required: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '车间', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: BasicEamWorkshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getBasicEamWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, + }, + { + label: '原料库位', + field: 'rawLocationCode', + sort: 'custom', + isSearch: true, + }, + { + label: '成品库位', + field: 'fgLocationCode', + sort: 'custom', + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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: 'expireTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '创建时间', + field: 'createTime', + 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')] + } + }, + isForm: false, + }, + { + label: '删除时间', + field: 'deletionTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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: '删除者ID', + field: 'deleterId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '扩展属性', + field: 'extraProperties', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/basicEamProductionline/index.vue b/src/views/eam/basicEamProductionline/index.vue new file mode 100644 index 000000000..1b00d53df --- /dev/null +++ b/src/views/eam/basicEamProductionline/index.vue @@ -0,0 +1,296 @@ + + +