diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts
index 1e8e44a8f..37694b15d 100644
--- a/src/api/mes/workstation/index.ts
+++ b/src/api/mes/workstation/index.ts
@@ -6,7 +6,9 @@ export interface WorkstationVO {
expireTime: Date
name: string
}
-
+export const goalParams = {
+ workstationCode:null
+}
// 查询工位列表
export const getWorkstationPage = async (params) => {
if (params.isSearch) {
@@ -46,4 +48,154 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' })
-}
\ No newline at end of file
+}// 查询班组列表
+export const getTeamPage = async (params) => {
+ console.log(goalParams.workstationCode)
+ params.workstationCode = goalParams.workstationCode
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/team/senior', data })
+ } else {
+ return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
+ }
+}
+// 查询选择班组列表
+export const checkTeamPageList = async (params) => {
+ console.log(goalParams.workstationCode)
+ params.workstationCode = goalParams.workstationCode
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/team/senior', data })
+ } else {
+ return await request.get({ url: `/mes/team/pageCheckListByWorkstationCode`, params })
+ }
+}
+// 添加班组关联
+export const createTeamRelation = async (workstationCode,teamCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ teamCodes : teamCodes
+ }
+ return await request.post({ url: `/mes/team/createRelation`, data })
+}
+
+// 删除班组关联
+export const deleteTeamRelation = async (workstationCode,teamCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ teamCodes : teamCodes
+ }
+ return await request.post({ url: `/mes/team/deleteRelation`, data })
+}
+export const getEquipmentPage = async (params) => {
+ console.log(goalParams.workstationCode)
+ params.workstationCode = goalParams.workstationCode
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/equipment/senior', data })
+ } else {
+ return await request.get({ url: `/mes/equipment/pageListByWorkstationCode`, params })
+ }
+}
+// 查询选择设备列表
+export const checkEquipmentPageList = async (params) => {
+ console.log(goalParams.workstationCode)
+ params.workstationCode = goalParams.workstationCode
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/equipment/senior', data })
+ } else {
+ return await request.get({ url: `/mes/equipment/pageCheckListByWorkstationCode`, params })
+ }
+}
+// 添加设备关联
+export const createEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ equipmentCodes : equipmentCodes
+ }
+ return await request.post({ url: `/mes/team/createRelation`, data })
+}
+
+// 删除设备关联
+export const deleteEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ equipmentCodes : equipmentCodes
+ }
+ return await request.post({ url: `/mes/team/deleteRelation`, data })
+}
+export const getProcessPage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/production-process/senior', data })
+ } else {
+ return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params })
+ }
+}
+export const checkProcessPageList = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/production-process/senior', data })
+ } else {
+ return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
+ }
+}
+// 添加工序关联
+export const createProcessRelation = async (workstationCode,processCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ processCodes : processCodes
+ }
+ return await request.post({ url: `/mes/production-process/createRelation`, data })
+}
+
+// 删除工序关联
+export const deleteProcessRelation = async (workstationCode,processCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ processCodes : processCodes
+ }
+ return await request.post({ url: `/mes/production-process/deleteRelation`, data })
+}
+export const getProductionPage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/production-process/senior', data })
+ } else {
+ return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params })
+ }
+}
+export const checkProductionPageList = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/mes/production-process/senior', data })
+ } else {
+ return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
+ }
+}
+// 添加产品关联
+export const createProductionRelation = async (workstationCode,productionCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ productionCodes : productionCodes
+ }
+ return await request.post({ url: `/mes/production-process/createRelation`, data })
+}
+
+// 删除产品关联
+export const deleteProductionRelation = async (workstationCode,productionCodes:string[]) => {
+ const data = {
+ workstationCode : workstationCode,
+ productionCodes : productionCodes
+ }
+ return await request.post({ url: `/mes/production-process/deleteRelation`, data })
+}
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 237ab67ab..67ad62537 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -280,7 +280,7 @@ export enum DICT_TYPE {
MESDO_STATUS= 'mes_do_status', // 工单执行状态
MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单)
MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式
- MES_PLANDO_STATUS='mes_plando_status' //计划执行状态
+ MES_PLANDO_STATUS='mes_plando_status', //计划执行状态
PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型
DELIVER_TYPE="deliver_type",//发货类型
BILL_TYPE="bill_type", // 发票类型
diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue
index 35f6f2dd1..fe96e49f1 100644
--- a/src/views/mes/workstation/index.vue
+++ b/src/views/mes/workstation/index.vue
@@ -4,15 +4,15 @@
-
-
+
+
@@ -51,26 +51,90 @@
/>
-
-
+
+
+
+
+
+
diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts
index 611194817..21d49d7d0 100644
--- a/src/views/mes/workstation/workstation.data.ts
+++ b/src/views/mes/workstation/workstation.data.ts
@@ -1,11 +1,28 @@
-import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
-import { dateFormatter } from '@/utils/formatTime'
+import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
+import {dateFormatter} from '@/utils/formatTime'
// 表单校验
export const WorkstationRules = reactive({
code: [required]
})
+export const TabsList = [{
+ label: "班组",
+ prop: 'Team',
+},
+ {
+ label: "设备",
+ prop: 'Equipment',
+ },
+ {
+ label: "工序",
+ prop: 'Process',
+ },
+ {
+ label: "产品",
+ prop: 'Production',
+ }
+]
export const Workstation = useCrudSchemas(reactive([
{
@@ -46,26 +63,36 @@ export const Workstation = useCrudSchemas(reactive([
field: 'activeTime',
sort: 'custom',
formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
form: {
component: 'DatePicker',
componentProps: {
+ style: {width: '100%'},
type: 'datetime',
- valueFormat: 'x'
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
}
- }
+ },
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
form: {
component: 'DatePicker',
componentProps: {
+ style: {width: '100%'},
type: 'datetime',
- valueFormat: 'x'
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
}
- }
+ },
},
{
label: '操作',
@@ -77,3 +104,127 @@ export const Workstation = useCrudSchemas(reactive([
}
}
]))
+export const Team = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:true,
+ }
+]))
+export const TeamSelect = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ }
+]))
+export const Equipment = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:true,
+ }
+]))
+export const Process = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:true,
+ }
+]))
+export const Production = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:true,
+ }
+]))