From 3c45ccaa0e46334b4c69a4325e63bbb52ce365e4 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Wed, 10 Apr 2024 09:19:08 +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=E6=8B=86=E8=A7=A3=E6=97=A5=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/ordermonthplan/index.ts | 8 + src/components/Detail/src/Detail.vue | 1 + src/views/mes/ordermonthplan/index.vue | 44 ++++- .../ordermonthplan/mesOrderMonthSub.data.ts | 165 +++++++++--------- 4 files changed, 134 insertions(+), 84 deletions(-) diff --git a/src/api/mes/ordermonthplan/index.ts b/src/api/mes/ordermonthplan/index.ts index daf0c42ea..b2b77a7d3 100644 --- a/src/api/mes/ordermonthplan/index.ts +++ b/src/api/mes/ordermonthplan/index.ts @@ -108,3 +108,11 @@ export const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { export const deleteMesOrderMonthSub = async (id: number) => { return await request.delete({ url: `/plan/mes-order-month-sub/delete?id=` + id }) } +export interface MesOrderMonthSubBreakdownReqVO{ + planMasterId: string + id: number +} +// 拆解为日计划 +export const breakdown = async (data: MesOrderMonthSubBreakdownReqVO) => { + return await request.post({ url: `/plan/mes-order-month-sub/breakdown`,data}) +} diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 3971d6463..5f7a5e26c 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -713,6 +713,7 @@ const opensearchTable = ( // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + debugger if (val == 'edit') { // 编辑 if(props.isOpenSearchTable){ diff --git a/src/views/mes/ordermonthplan/index.vue b/src/views/mes/ordermonthplan/index.vue index c6758adb5..8e5c97e9d 100644 --- a/src/views/mes/ordermonthplan/index.vue +++ b/src/views/mes/ordermonthplan/index.vue @@ -65,6 +65,29 @@ :detailButtonIsShowEdit="true" :detailButtonIsShowAdd="true" @searchTableSuccessDetail="searchTableSuccess" + :otherHeadButttonData = "[{ + label: '全部拆解', + name: 'splitAll', + hide: false, + type: 'primary', + // icon: 'ep:operation', + color: '', + float:'left', + hasPermi: '' + }]" + :buttondataTable = "[{ + label: '拆解', + name: 'split', + hide: false, + type: 'primary', + // icon: 'ep:operation', + color: '', + float:'left', + link: true, // 文本展现按钮 + hasPermi: '' + }]" + @buttonBaseClick="detailButtonBaseClick" + @buttondataTable="detailButtonBaseClick" /> { /** 详情操作 */ const detailRef = ref() +let mainPlanId const openDetail = (row: any, titleName: any, titleValue: any) => { + mainPlanId = row.id detailRef.value.openDetail(row, titleName, titleValue, 'basicMesOrderMonthMain') } @@ -287,4 +312,21 @@ const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { data.productName = productName return await MesOrderMonthApi.updateMesOrderMonthSub(data) } +// 详情--头部按钮事件 +const detailButtonBaseClick = async (val, item) => { + debugger + try { + // 二次确认 + await message.confirm('确定要拆解成日计划吗?') + // 发起删除 + await MesOrderMonthApi.breakdown({ + id : item.id, + planMasterId: mainPlanId + }) + message.success(t('common.delSuccess')) + // 刷新列表 + await getList() + } catch { + } +} diff --git a/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts b/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts index 176082762..f4a25613e 100644 --- a/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts +++ b/src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts @@ -74,14 +74,70 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ } } }, + { + label: '计划开始日期', + field: 'planBegin', + sort: 'custom', + isSearch: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180, + fixed: 'left' + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width: '100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '计划结束日期', + field: 'planEnd', + sort: 'custom', + isSearch: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180, + fixed: 'left' + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width: '100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 100, + fixed: 'left' + }, + }, { label: '入库仓库编码', field: 'inStoreCode', sort: 'custom', isSearch: true, table: { - width: 140, - fixed: 'left' + width: 150 }, form: { // labelMessage: '信息提示说明!!!', @@ -108,20 +164,36 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, table: { - width: 120, - fixed: 'left' + width: 120 }, }, { - label: '状态', - field: 'status', + label: '实际开工日期', + field: 'realStart', sort: 'custom', isSearch: true, isForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { - width: 100, - fixed: 'left' + width: 180 + } + }, + { + label: '实际完工日期', + field: 'realFinish', + sort: 'custom', + isSearch: true, + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' }, + table: { + width: 180 + } }, { label: '是否回冲', @@ -130,8 +202,7 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ isSearch: true, isForm: false, table: { - width: 120, - fixed: 'left' + width: 120 }, }, { @@ -198,78 +269,6 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ }, isForm: false }, - { - label: '计划开始日期', - field: 'planBegin', - sort: 'custom', - isSearch: true, - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - table: { - width: 180 - }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - }, - }, - { - label: '计划结束日期', - field: 'planEnd', - sort: 'custom', - isSearch: true, - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - table: { - width: 180 - }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - }, - }, - { - label: '实际开工日期', - field: 'realStart', - sort: 'custom', - isSearch: true, - isForm: false, - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - table: { - width: 180 - } - }, - { - label: '实际完工日期', - field: 'realFinish', - sort: 'custom', - isSearch: true, - isForm: false, - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - table: { - width: 180 - } - }, { label: '备注', field: 'remark', @@ -281,7 +280,7 @@ export const MesOrderMonthSub = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 160, fixed: 'right' } }