From b5f16c42d8105dc31509ae8e0844f971a58da816 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Thu, 11 Jul 2024 11:04:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=91=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demandforecastingMain.data.ts | 25 +++++++++++-------- .../demandforecastingMain/index.vue | 6 ++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts index 85e043a17..406aeb737 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts @@ -15,15 +15,20 @@ import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail' import dayjs from 'dayjs' const { t } = useI18n() // 国际化 -let planerList = await DemandforecastingMainApi.queryUserPlanerList() -if(planerList.length>0){ - planerList.unshift({ - planerId:'ALL', - planerNickname:t('ts.全选'), - planerUsername:t('ts.全选'), - }) +let planerList = [] +try { + planerList = await DemandforecastingMainApi.queryUserPlanerList() + if(planerList.length>0){ + planerList.unshift({ + planerId:'ALL', + planerNickname:t('ts.全选'), + planerUsername:t('ts.全选'), + }) + } + console.log('planerList',planerList) +} catch (error) { + } -console.log('planerList',planerList) /** * @returns {Array} 要货预测主表 @@ -117,10 +122,10 @@ export const DemandforecastingMain = useCrudSchemas(reactive([ multiple:true, emptyValues:[null, undefined], valueOnClear:null, - options:planerList.map(item=>({ + options:planerList.length>0?planerList.map(item=>({ label:item.planerUsername, value:item.planerId - })) + })):[] } }, }, diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 4f0b0c9b6..1057b940a 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue @@ -208,7 +208,11 @@ const searchFormClick = (searchData) => { /** 初始化 **/ onMounted(async () => { - await getListHead() + try { + await getListHead() + } catch (error) { + + } // updateDateTableColumns() getList() importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate()