From 7b12d2bda32d275cc016e11beee4c3addfda28f6 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 6 Jan 2025 20:59:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20add=E5=B7=A5=E5=BA=8F=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/baseProcessInfo/index.ts | 76 +++++ src/api/mes/baseProcessInfo/types.ts | 165 +++++++++ src/api/mes/baseStationInfo/index.ts | 76 +++++ src/api/mes/baseStationInfo/types.ts | 195 +++++++++++ src/plugins/index.ts | 11 +- src/utils/ruoyi.ts | 21 ++ src/views/mes/baseProcessInfo/index.vue | 352 +++++++++++++++++++ src/views/mes/baseProdLineInfo/index.vue | 1 - src/views/mes/baseStationInfo/index.vue | 413 +++++++++++++++++++++++ 9 files changed, 1308 insertions(+), 2 deletions(-) create mode 100644 src/api/mes/baseProcessInfo/index.ts create mode 100644 src/api/mes/baseProcessInfo/types.ts create mode 100644 src/api/mes/baseStationInfo/index.ts create mode 100644 src/api/mes/baseStationInfo/types.ts create mode 100644 src/views/mes/baseProcessInfo/index.vue create mode 100644 src/views/mes/baseStationInfo/index.vue diff --git a/src/api/mes/baseProcessInfo/index.ts b/src/api/mes/baseProcessInfo/index.ts new file mode 100644 index 0000000..79c7585 --- /dev/null +++ b/src/api/mes/baseProcessInfo/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { BaseProcessInfoVO, BaseProcessInfoForm, BaseProcessInfoQuery } from '@/api/mes/baseProcessInfo/types'; + +/** + * 查询工序信息列表 + * @param query + * @returns {*} + */ + +export const listBaseProcessInfo = (query?: BaseProcessInfoQuery): AxiosPromise => { + return request({ + url: '/mes/baseProcessInfo/list', + method: 'get', + params: query + }); +}; + +/** + * 查询工序信息详细 + * @param processId + */ +export const getBaseProcessInfo = (processId: string | number): AxiosPromise => { + return request({ + url: '/mes/baseProcessInfo/' + processId, + method: 'get' + }); +}; + +/** + * 新增工序信息 + * @param data + */ +export const addBaseProcessInfo = (data: BaseProcessInfoForm) => { + return request({ + url: '/mes/baseProcessInfo', + method: 'post', + data: data + }); +}; + +/** + * 修改工序信息 + * @param data + */ +export const updateBaseProcessInfo = (data: BaseProcessInfoForm) => { + return request({ + url: '/mes/baseProcessInfo', + method: 'put', + data: data + }); +}; + +/** + * 删除工序信息 + * @param processId + */ +export const delBaseProcessInfo = (processId: string | number | Array) => { + return request({ + url: '/mes/baseProcessInfo/' + processId, + method: 'delete' + }); +}; + +/** + * 查询工序信息下拉框列表 + * @param query + * @returns {*} + */ +export function getProcessInfoList(query) { + return request({ + url: '/mes/baseProcessInfo/getProcessInfoList', + method: 'get', + params: query + }); +}; diff --git a/src/api/mes/baseProcessInfo/types.ts b/src/api/mes/baseProcessInfo/types.ts new file mode 100644 index 0000000..b1377e1 --- /dev/null +++ b/src/api/mes/baseProcessInfo/types.ts @@ -0,0 +1,165 @@ +export interface BaseProcessInfoVO { + /** + * 主键标识 + */ + processId: string | number; + + /** + * 租户编号 + */ + tenantId: string | number; + + /** + * 工序编号 + */ + processCode: string; + + /** + * 工序名称 + */ + processName: string; + + /** + * 工序类别(1生产工序 2质检工序) + */ + processType: string; + + /** + * 工序顺序 + */ + processQueue: number; + + /** + * 单位生产时间(秒);页面显示小时和分钟,就是标准工时,完成一个产品的制造所需的时间 + */ + productionTime: number; + + /** + * 激活标识(1是 0否) + */ + activeFlag: string; + + /** + * 备注 + */ + remark: string; + + /** + * 创建部门 + */ + createDept: number; + + /** + * 创建人 + */ + createBy: number; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 更新人 + */ + updateBy: number; + + /** + * 更新时间 + */ + updateTime: string; + +} + +export interface BaseProcessInfoForm extends BaseEntity { + /** + * 主键标识 + */ + processId?: string | number; + + /** + * 工序编号 + */ + processCode?: string; + + /** + * 工序名称 + */ + processName?: string; + + /** + * 工序类别(1生产工序 2质检工序) + */ + processType?: string; + + /** + * 工序顺序 + */ + processQueue?: number; + + /** + * 单位生产时间(秒);页面显示小时和分钟,就是标准工时,完成一个产品的制造所需的时间 + */ + productionTime?: number; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 备注 + */ + remark?: string; + + productionTimeDays?: number; + productionTimeHours?: number; + productionTimeMinutes?: number; + +} + +export interface BaseProcessInfoQuery extends PageQuery { + + /** + * 主键标识 + */ + processId?: string | number; + + /** + * 工序编号 + */ + processCode?: string; + + /** + * 工序名称 + */ + processName?: string; + + /** + * 工序类别(1生产工序 2质检工序) + */ + processType?: string; + + /** + * 工序顺序 + */ + processQueue?: number; + + /** + * 单位生产时间(秒);页面显示小时和分钟,就是标准工时,完成一个产品的制造所需的时间 + */ + productionTime?: number; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/mes/baseStationInfo/index.ts b/src/api/mes/baseStationInfo/index.ts new file mode 100644 index 0000000..1a8e702 --- /dev/null +++ b/src/api/mes/baseStationInfo/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { BaseStationInfoVO, BaseStationInfoForm, BaseStationInfoQuery } from '@/api/mes/baseStationInfo/types'; + +/** + * 查询工位信息列表 + * @param query + * @returns {*} + */ + +export const listBaseStationInfo = (query?: BaseStationInfoQuery): AxiosPromise => { + return request({ + url: '/mes/baseStationInfo/list', + method: 'get', + params: query + }); +}; + +/** + * 查询工位信息详细 + * @param stationId + */ +export const getBaseStationInfo = (stationId: string | number): AxiosPromise => { + return request({ + url: '/mes/baseStationInfo/' + stationId, + method: 'get' + }); +}; + +/** + * 新增工位信息 + * @param data + */ +export const addBaseStationInfo = (data: BaseStationInfoForm) => { + return request({ + url: '/mes/baseStationInfo', + method: 'post', + data: data + }); +}; + +/** + * 修改工位信息 + * @param data + */ +export const updateBaseStationInfo = (data: BaseStationInfoForm) => { + return request({ + url: '/mes/baseStationInfo', + method: 'put', + data: data + }); +}; + +/** + * 删除工位信息 + * @param stationId + */ +export const delBaseStationInfo = (stationId: string | number | Array) => { + return request({ + url: '/mes/baseStationInfo/' + stationId, + method: 'delete' + }); +}; + +/** + * 查询工位信息下拉框列表 + * @param query + * @returns {*} + */ +export function getStationInfoList(query) { + return request({ + url: '/mes/baseStationInfo/getStationInfoList', + method: 'get', + params: query + }); +}; diff --git a/src/api/mes/baseStationInfo/types.ts b/src/api/mes/baseStationInfo/types.ts new file mode 100644 index 0000000..5aeb67d --- /dev/null +++ b/src/api/mes/baseStationInfo/types.ts @@ -0,0 +1,195 @@ +export interface BaseStationInfoVO { + /** + * 主键标识 + */ + stationId: string | number; + + /** + * 租户编号 + */ + tenantId: string | number; + + /** + * 工位编号 + */ + stationCode: string; + + /** + * 工位名称 + */ + stationName: string; + + /** + * 工位类型(1生产工位 2质检工位) + */ + stationType: string; + + /** + * 所属工序 + */ + processId: string | number; + + /** + * 单位生产时间(秒) + */ + productionTime: number; + + /** + * AGV编号 + */ + agvCode: string; + + /** + * IP地址 + */ + ipAddress: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag: string; + + /** + * 备注 + */ + remark: string; + + /** + * 创建部门 + */ + createDept: number; + + /** + * 创建人 + */ + createBy: number; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 更新人 + */ + updateBy: number; + + /** + * 更新时间 + */ + updateTime: string; + +} + +export interface BaseStationInfoForm extends BaseEntity { + /** + * 主键标识 + */ + stationId?: string | number; + + /** + * 工位编号 + */ + stationCode?: string; + + /** + * 工位名称 + */ + stationName?: string; + + /** + * 工位类型(1生产工位 2质检工位) + */ + stationType?: string; + + /** + * 所属工序 + */ + processId?: string | number; + + /** + * 单位生产时间(秒) + */ + productionTime?: number; + + /** + * AGV编号 + */ + agvCode?: string; + + /** + * IP地址 + */ + ipAddress?: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 备注 + */ + remark?: string; + + productionTimeDays?: number; + productionTimeHours?: number; + productionTimeMinutes?: number; + +} + +export interface BaseStationInfoQuery extends PageQuery { + + /** + * 主键标识 + */ + stationId?: string | number; + + /** + * 工位编号 + */ + stationCode?: string; + + /** + * 工位名称 + */ + stationName?: string; + + /** + * 工位类型(1生产工位 2质检工位) + */ + stationType?: string; + + /** + * 所属工序 + */ + processId?: string | number; + + /** + * 单位生产时间(秒) + */ + productionTime?: number; + + /** + * AGV编号 + */ + agvCode?: string; + + /** + * IP地址 + */ + ipAddress?: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/plugins/index.ts b/src/plugins/index.ts index 6c5e0c3..8ac05ad 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -9,7 +9,14 @@ import animate from '@/animate'; import { download as dl } from '@/utils/request'; import { useDict } from '@/utils/dict'; import { getConfigKey, updateConfigByKey } from '@/api/system/config'; -import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'; +import { + parseTime, + addDateRange, + handleTree, + selectDictLabel, + selectDictLabels, + formatDayHourMinutes +} from '@/utils/ruoyi'; import { App } from 'vue'; @@ -40,4 +47,6 @@ export default function installPlugin(app: App) { app.config.globalProperties.selectDictLabel = selectDictLabel; app.config.globalProperties.selectDictLabels = selectDictLabels; app.config.globalProperties.animate = animate; + + app.config.globalProperties.formatDayHourMinutes = formatDayHourMinutes; } diff --git a/src/utils/ruoyi.ts b/src/utils/ruoyi.ts index 8efd12c..394b36c 100644 --- a/src/utils/ruoyi.ts +++ b/src/utils/ruoyi.ts @@ -249,3 +249,24 @@ export const blobValidate = (data: any) => { export default { handleTree }; + +// 秒转天、小时、分钟 +export const formatDayHourMinutes = (seconds: any) => { + if (seconds === 0){ + return ''; + } + const days = Math.floor(seconds / (24 * 60 * 60)); + const hours = Math.floor((seconds % (24 * 60 * 60)) / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + let result = ''; + if (days > 0) { + result += `${days}天`; + } + if (hours > 0) { + result += `${hours}小时`; + } + if (minutes > 0) { + result += `${minutes}分钟`; + } + return result; +} diff --git a/src/views/mes/baseProcessInfo/index.vue b/src/views/mes/baseProcessInfo/index.vue new file mode 100644 index 0000000..440a584 --- /dev/null +++ b/src/views/mes/baseProcessInfo/index.vue @@ -0,0 +1,352 @@ + + + diff --git a/src/views/mes/baseProdLineInfo/index.vue b/src/views/mes/baseProdLineInfo/index.vue index c4ba37d..940f17c 100644 --- a/src/views/mes/baseProdLineInfo/index.vue +++ b/src/views/mes/baseProdLineInfo/index.vue @@ -177,7 +177,6 @@ const dialog = reactive({ const getWorkshopListSelect = async () => { let res = await getWorkshopList(null); workshopInfoList.value = res.data; - console.log("workshopInfoList.value",workshopInfoList.value, res); }; // 列显隐信息 diff --git a/src/views/mes/baseStationInfo/index.vue b/src/views/mes/baseStationInfo/index.vue new file mode 100644 index 0000000..7c85add --- /dev/null +++ b/src/views/mes/baseStationInfo/index.vue @@ -0,0 +1,413 @@ + + +