From ce7333bd6b6923a090693877e1fb5b3644c33ff8 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Mon, 8 Apr 2024 11:25:22 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=AE=A2=E5=8D=95=E6=9C=88=E8=AE=A1?= =?UTF-8?q?=E5=88=92=EF=BC=8C=E5=85=A5=E5=BA=93=E4=BB=93=E5=BA=93=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BD=BF=E7=94=A8=E5=8F=82=E7=85=A7=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/ordermonthplan/index.ts | 2 + src/views/mes/ordermonthplan/index.vue | 52 +++++++++++++--- .../ordermonthplan/mesOrderMonthSub.data.ts | 61 +++++++++++++++++-- 3 files changed, 101 insertions(+), 14 deletions(-) diff --git a/src/api/mes/ordermonthplan/index.ts b/src/api/mes/ordermonthplan/index.ts index d3fc9bfd1..ba1c7eb15 100644 --- a/src/api/mes/ordermonthplan/index.ts +++ b/src/api/mes/ordermonthplan/index.ts @@ -63,7 +63,9 @@ export interface MesOrderMonthSubVO { status: string remark: string productCode: string + productName: string bomCode: string + bomVersion: string inStoreCode: string planBegin: Date planEnd: Date diff --git a/src/views/mes/ordermonthplan/index.vue b/src/views/mes/ordermonthplan/index.vue index b2ac5fff8..c6758adb5 100644 --- a/src/views/mes/ordermonthplan/index.vue +++ b/src/views/mes/ordermonthplan/index.vue @@ -57,13 +57,14 @@ :detailAllSchemas="detailAllSchemas" :detailAllSchemasRules="MesOrderMonthSubRules" :apiPage="MesOrderMonthApi.getMesOrderMonthSubPage" - :apiCreate="MesOrderMonthApi.createMesOrderMonthSub" - :apiUpdate="MesOrderMonthApi.updateMesOrderMonthSub" + :apiCreate="createMesOrderMonthSub" + :apiUpdate="updateMesOrderMonthSub" :apiDelete="MesOrderMonthApi.deleteMesOrderMonthSub" :tabs="TabsList" :detailButtonIsShowDelete="true" :detailButtonIsShowEdit="true" :detailButtonIsShowAdd="true" + @searchTableSuccessDetail="searchTableSuccess" /> { - nextTick(() => { - const setV = {} - setV[formField] = val[0][searchField] - formRef.setValues(setV) - }) -} // 字段设置 更新主列表字段 const updataTableColumns = (val) => { tableColumns.value = val @@ -111,6 +106,7 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods + // 列表头部按钮 const HeadButttondata = [ defaultButtons.defaultAddBtn({hasPermi: 'mes:ordermonthplan:create'}), // 新增 @@ -255,4 +251,40 @@ onMounted(async () => { importTemplateData.templateUrl = await MesOrderMonthApi.importTemplate() }) const detailAllSchemas = ref(MesOrderMonthSub.allSchemas) +// 查询页面返回 +let productName +const searchTableSuccess = (formField, searchField, val, formRef) => { + nextTick(() => { + const setV = {} + setV[formField] = val[0][searchField] + formRef.setValues(setV) + if(formField=='productCode'){ + //formRef.setValues({standardBom:'bomddd'}) + // getProcessroutes(val[0][searchField]) + productName = val[0].name + getBoms(val[0][searchField]) + } + // if(formField=='workroomCode'){ + // getProductlines(val[0][searchField]) + // } + + }) +} +const bomOptions=ref([]) +const getBoms = async (code: String) => { + bomOptions.value = await OrderDayApi.getBoms(code) + MesOrderMonthSub.allSchemas.formSchema.forEach(item => { + if (item.field == 'bomCode') { + item.componentProps.options = bomOptions.value + } + }) +} +const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { + data.productName = productName + return await MesOrderMonthApi.createMesOrderMonthSub(data) +} +const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { + data.productName = productName + return await MesOrderMonthApi.updateMesOrderMonthSub(data) +} diff --git a/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts b/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts index d61da01ac..7e98714aa 100644 --- a/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts +++ b/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts @@ -1,6 +1,9 @@ import type {CrudSchema} from '@/hooks/web/useCrudSchemas' import {dateFormatter} from '@/utils/formatTime' - +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; +import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data"; +import * as WorehouseApi from "@/api/wms/warehouse"; // 表单校验 export const MesOrderMonthSubRules = reactive({ productCode: [required], @@ -19,7 +22,33 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ field: 'productCode', sort: 'custom', isTable: false, - isSearch: true + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '产品编码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '产品信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + isHideFilterButton:true, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'type', + action: 'in', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + value: 'CCP,BCP',//,SEMI] + isMainValue: false + }, + + ] + } + } }, { label: '产品名称', @@ -33,13 +62,37 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ field: 'bomCode', sort: 'custom', isTable: false, - isSearch: true + isSearch: true, + form: { + component:'Select', + componentProps: { + options: [{lablel:'bom',value:'bom'}] + } + } }, { label: '入库仓库编码', field: 'inStoreCode', sort: 'custom', - isSearch: true + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '仓库编码', // 查询弹窗标题 + searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类 + searchPage: WorehouseApi.getWarehousePage, // 查询弹窗所需分页方法 + isHideFilterButton:true, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + } }, { label: '计划数量',