diff --git a/.env.development b/.env.development index 2f7bcbecf..353f4a4bb 100644 --- a/.env.development +++ b/.env.development @@ -5,6 +5,11 @@ VITE_DEV=false # 请求路径 VITE_BASE_URL='http://localhost:12080' +# VITE_BASE_URL='http://192.168.1.49:12080' +# VITE_BASE_URL='http://192.168.1.254:12080' +# VITE_BASE_URL='http://dev.ccwin-in.com:28050/api' +# VITE_BASE_URL='http://dev.ccwin-in.com:28040/api' +# VITE_BASE_URL='http://192.168.1.254:12080' # 上传路径 VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' @@ -34,7 +39,7 @@ VITE_OUT_DIR=dist VITE_INTERFACE_URL='http://localhost:12080/magic/web/index.html' # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://localhost:12080' +VITE_JMREPORT_BASE_URL='http://192.168.1.196:12080' # 租户配置 VITE_TENANT='["英泰"]' @@ -44,3 +49,6 @@ VITE_REPORT_URL = 'http://dev.ccwin-in.com:25400' # 是否需要验证码 VITE_NEED_CODE = false + +# 首页调用接口区分scp和wms +VITE_INDEX_INTERFACE = 'WMS' diff --git a/.env.prod b/.env.prod index 7ab6a15fe..42cfa7e47 100644 --- a/.env.prod +++ b/.env.prod @@ -51,3 +51,6 @@ VITE_NEED_CODE = true # 是否需要下载PDA链接 VITE_PDA_URL = false + +# 首页调用接口区分scp和wms +VITE_INDEX_INTERFACE = 'SCP' diff --git a/.env.test b/.env.test index 32e696b82..48526156e 100644 --- a/.env.test +++ b/.env.test @@ -47,4 +47,7 @@ VITE_NEED_CODE = true # 是否需要下载PDA链接 -VITE_PDA_URL = true \ No newline at end of file +VITE_PDA_URL = true + +# 首页调用接口区分scp和wms +VITE_INDEX_INTERFACE = 'SCP' \ No newline at end of file diff --git a/src/api/home/index.ts b/src/api/home/index.ts index bd8ef5eb9..092262a85 100644 --- a/src/api/home/index.ts +++ b/src/api/home/index.ts @@ -4,7 +4,10 @@ import request from '@/config/axios' export const getSupplierData = async () => { return await request.get({ url: `/wms/index/indexSupplier` }) } - +// WMS首页 +export const getWmsData = async () => { + return await request.get({ url: `/wms/index/indexWMS` }) +} // 原料管理员首页 export const getMaterialData = async () => { return await request.get({ url: `/wms/index/indexMaterial` }) diff --git a/src/views/home/components/supplierIndex.vue b/src/views/home/components/supplierIndex.vue index 731a44cfe..66f68ab37 100644 --- a/src/views/home/components/supplierIndex.vue +++ b/src/views/home/components/supplierIndex.vue @@ -170,11 +170,20 @@ const getPartTOPCharts = async () => { } // 获取供应商数据 const getSupplierData = async () => { - IndexApi.getSupplierData().then((res) => { - supplierData.value = res - getInvoiceCharts() - getPartTOPCharts() - }) + if (import.meta.env.VITE_INDEX_INTERFACE == 'SCP') { + IndexApi.getSupplierData().then((res) => { + supplierData.value = res + getInvoiceCharts() + getPartTOPCharts() + }) + } + if (import.meta.env.VITE_INDEX_INTERFACE == 'WMS') { + IndexApi.getWmsData().then((res) => { + supplierData.value = res + getInvoiceCharts() + getPartTOPCharts() + }) + } } // 最新消息 const notaicList = ref([]) // 列表的数据