From 4dc0536dc7d270600cff1c22bcfbd60fa4cd0bfe Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 11 Dec 2024 14:45:51 +0800 Subject: [PATCH] =?UTF-8?q?YT-1591=E8=A6=81=E8=B4=A7=E9=A2=84=E6=B5=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/demandforecastingMain/index.ts | 4 +++ src/utils/dict.ts | 1 + .../demandforecastingMain.data.ts | 10 ++++++ .../demandforecastingMain/index.vue | 36 ++++++++++++++++--- .../demandforecastingSupplierMain/index.vue | 3 +- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/api/wms/demandforecastingMain/index.ts b/src/api/wms/demandforecastingMain/index.ts index cbb7bfb59..06ba51860 100644 --- a/src/api/wms/demandforecastingMain/index.ts +++ b/src/api/wms/demandforecastingMain/index.ts @@ -156,4 +156,8 @@ export const updateIsRead = async (data) => { return await request.post({ url: `/wms/demandforecasting-main/updateIsRead`,data }) } +export const publish = async (data) => { + return await request.post({ url: `/wms/demandforecasting-main/publishDemandForecast`,data }) +} + diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b946ce79a..1fb2d8fee 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -262,6 +262,7 @@ export enum DICT_TYPE { COUNT_PLAN_STATUS = 'count_plan_status', // 盘点计划状态 COUNT_DIMENSION = 'count_dimension', // 盘点维度 REQUEST_STATUS = 'request_status', // 申请状态 + DEMANDFORECASTING_STATUS = 'demandforecasting_status', // 申请状态 UNPLANNED_RECEIPT_REASON = 'unplanned_receipt_reason', // 计划外入库原因 UNPLANNED_ISSUE_REASON = 'unplanned_issue_reason', // 计划外出库原因 SCRAP_REASON = 'scrap_reason', // 报废出库原因 diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts index 92724f740..3d356089b 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts @@ -160,6 +160,16 @@ export const DemandforecastingMain = useCrudSchemas(reactive([ } } }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.DEMANDFORECASTING_STATUS, + dictClass: 'string', + table: { + width: 150 + }, + }, { label: '订单号', field: 'poNumber', diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 5d8cd7971..8ac89ce95 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue @@ -75,6 +75,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' import { isString } from '@/utils/is' +import {publish} from "@/api/wms/demandforecastingMain"; const { loadStart, loadDone } = usePageLoading() // 要货预测 @@ -198,13 +199,31 @@ const buttonBaseClick = async (val, item) => { console.log('其他按钮', item) } } + +const isShowMainButton = (row,val) => { + if (val.indexOf(row.status) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 const butttondata = (row,$index) => { return [ { label: t(`ts.生成要货计划`).replace('ts.', ''), name: 'previewPlan', - hide: !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)), + hide: isShowMainButton(row, ['2']) || !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)), + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }, + { + label: '发布', + name: 'publish', + hide: isShowMainButton(row, ['1']), type: 'primary', color: '', link: true, // 文本展现按钮 @@ -218,10 +237,19 @@ const buttonTableClick = async (val, row) => { if (val == 'previewPlan') { // 生成要货计划 tableObjectPlan.params.masterIds = row.mainId handlePreviewPlan() - } + } else if(val == 'publish') { + handlePublish(row) + } } - +const handlePublish = (row)=>{ + DemandforecastingMainApi.publish({id:row.mainId}).then(res => { + console.log('res',res); + getList() + }).catch(err => { + console.log(err) + }) +} @@ -405,4 +433,4 @@ onMounted(async () => { color:var(--el-color-success); font-weight:700; } - \ No newline at end of file + diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue index 49eb20d07..6c2afd24a 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue @@ -180,6 +180,7 @@ const buttonBaseClick = async (val, item) => { const searchClick = async (data)=>{ data.flag = 1 + data.status = 2 console.log('searchClick',data) await setSearchParamsHead(data) // updateDateTableColumns() @@ -290,4 +291,4 @@ onMounted(async () => { color:var(--el-color-success); font-weight:700; } - \ No newline at end of file +