diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts index 336c9714a..a3dfde12d 100644 --- a/src/api/mes/workstation/index.ts +++ b/src/api/mes/workstation/index.ts @@ -40,16 +40,6 @@ export const deleteWorkstation = async (id: number) => { return await request.delete({ url: `/mes/workstation/delete?id=` + id }) } -// 导出工位 Excel -export const exportWorkstation = async (params) => { - return await request.download({ url: `/mes/workstation/export-excel`, params }) -} - -// 下载用户导入模板 -export const importTemplate = () => { - return request.download({ url: '/mes/workstation/get-import-template' }) -} - export const getEquipmentPage = async (params) => { params.workstationCode = goalParams.workstationCode if (params.isSearch) { diff --git a/src/views/mes/ordermonthplan/index.vue b/src/views/mes/ordermonthplan/index.vue index 8e5c97e9d..32805630a 100644 --- a/src/views/mes/ordermonthplan/index.vue +++ b/src/views/mes/ordermonthplan/index.vue @@ -44,9 +44,10 @@ @success="formsSuccess" :rules="MesOrderMonthMainRules" :formAllSchemas="MesOrderMonthMain.allSchemas" - :apiUpdate="MesOrderMonthApi.updateMesOrderMonthMain" - :apiCreate="MesOrderMonthApi.createMesOrderMonthMain" + :apiUpdate="updateMesOrderMonthMain" + :apiCreate="createMesOrderMonthMain" :apiDelete="MesOrderMonthApi.deleteMesOrderMonthMain" + @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> @@ -106,7 +107,11 @@ import { MesOrderMonthSubRules } from "@/views/mes/ordermonthplan/mesOrderMonthSub.data"; import * as OrderDayApi from "@/api/mes/orderDay"; -import {breakdown, MesOrderMonthSubVO} from "@/api/mes/ordermonthplan"; +import { + breakdown, + MesOrderMonthMainVO, + MesOrderMonthSubVO +} from "@/api/mes/ordermonthplan"; defineOptions({ name: 'MesOrderMonthMain' }) @@ -198,6 +203,7 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; + data.factoryName = factoryName if (formType === 'create') { await MesOrderMonthApi.createMesOrderMonthMain(data) message.success(t('common.createSuccess')) @@ -208,7 +214,6 @@ const formsSuccess = async (formType,data) => { basicFormRef.value.dialogVisible = false getList() } - /** 详情操作 */ const detailRef = ref() let mainPlanId @@ -278,8 +283,10 @@ onMounted(async () => { const detailAllSchemas = ref(MesOrderMonthSub.allSchemas) // 查询页面返回 let productName +let factoryName const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { + const setV = {} setV[formField] = val[0][searchField] formRef.setValues(setV) @@ -289,6 +296,10 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { productName = val[0].name getBoms(val[0][searchField]) } + if(formField=='factoryCode'){ + factoryName = val[0].name + formRef.setValues({factoryCode:val[0]['id']}) + } // if(formField=='workroomCode'){ // getProductlines(val[0][searchField]) // } @@ -304,6 +315,8 @@ const getBoms = async (code: String) => { } }) } + + const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { data.productName = productName return await MesOrderMonthApi.createMesOrderMonthSub(data) @@ -314,7 +327,6 @@ const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { } // 详情--头部按钮事件 const detailButtonBaseClick = async (val, item) => { - debugger try { // 二次确认 await message.confirm('确定要拆解成日计划吗?') diff --git a/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts b/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts index 422b79c07..908906fb6 100644 --- a/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts +++ b/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts @@ -1,5 +1,6 @@ import type {CrudSchema} from '@/hooks/web/useCrudSchemas' import {dateFormatter} from '@/utils/formatTime' +import * as TenantApi from '@/api/system/tenant' // 表单校验 export const MesOrderMonthMainRules = reactive({ @@ -35,24 +36,24 @@ export const MesOrderMonthMain = useCrudSchemas(reactive([ field: 'factoryCode', sort: 'custom', isTable: false, - // form: { - // // labelMessage: '信息提示说明!!!', - // componentProps: { - // isSearchList: true, // 开启查询弹窗 - // searchListPlaceholder: '请选择工厂', // 输入框占位文本 - // searchField: 'id', // 查询弹窗赋值字段 - // searchTitle: '请选择工厂', // 查询弹窗标题 - // searchAllSchemas: FactoryList.allSchemas, // 查询弹窗所需类 - // searchPage: TenantApi.getTenantPage, // 查询弹窗所需分页方法 - // isHideFilterButton: true, - // searchCondition: [{ - // key: 'available', - // value: 'TRUE', - // isMainValue: false - // } - // ] - // } - // } + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择工厂', // 输入框占位文本 + searchField: 'factoryCode', // 查询弹窗赋值字段 + searchTitle: '请选择工厂', // 查询弹窗标题 + searchAllSchemas: FactoryList.allSchemas, // 查询弹窗所需类 + searchPage: TenantApi.getTenantPage, // 查询弹窗所需分页方法 + isHideFilterButton: true, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + } }, { label: '工厂名称', diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 1e85ee1d4..092a7e41b 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -69,24 +69,19 @@ @detailOpenForm="detailOpenForm" /> - - diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 31278352b..6d405e1a9 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -19,10 +19,6 @@ export const TabsList = [{ label: "设备", prop: 'Equipment', }, - { - label: "工序", - prop: 'Process', - }, { label: "操作步骤", prop: 'Opersteps', @@ -95,13 +91,6 @@ export const Workstation = useCrudSchemas(reactive([ } } }, - { - label: '班组代码', - field: 'teamCode', - sort: 'custom', - isSearch: true, - isForm: false - }, { label: '生效时间', field: 'activeTime', @@ -161,13 +150,14 @@ export const Workstation = useCrudSchemas(reactive([ label: '操作', field: 'action', isForm: false, + isTable: true, table: { width: 150, fixed: 'right' } } ])) -export const Team = useCrudSchemas(reactive([ +export const select = useCrudSchemas(reactive([ { label: '代码', field: 'code', @@ -181,17 +171,6 @@ export const Team = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, isForm: false - }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false , - table: { - width: 150, - fixed: 'right' - }, - isTableForm:true, } ])) @@ -222,33 +201,6 @@ export const Equipment = useCrudSchemas(reactive([ 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 Opersteps = useCrudSchemas(reactive([ { label: '代码', @@ -291,7 +243,7 @@ export const equipmentPopList = useCrudSchemas(reactive([ searchListPlaceholder: '选择设备', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '选择设备', // 查询弹窗标题 - searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchAllSchemas: select.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', @@ -316,7 +268,7 @@ export const processPopList = useCrudSchemas(reactive([ searchListPlaceholder: '选择工序', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '选择工序', // 查询弹窗标题 - searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchAllSchemas: select.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', @@ -341,7 +293,7 @@ export const stepPopList = useCrudSchemas(reactive([ searchListPlaceholder: '选择操作步骤', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '选择操作步骤', // 查询弹窗标题 - searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchAllSchemas: select.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available',