From 1dc8d975b6ce27321b886d602bd36c99a03dec67 Mon Sep 17 00:00:00 2001 From: 13218645326 Date: Wed, 13 Dec 2023 17:23:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95=E7=BB=93?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/http/api/enterprise.ts | 6 +++--- src/http/index.ts | 4 ++++ .../privacyAgreement/com/addCom.vue | 7 ++++--- .../configuration/privacyAgreement/index.vue | 4 +--- .../enterpriseInfo/index.vue | 21 ++++++++++++++++--- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/http/api/enterprise.ts b/src/http/api/enterprise.ts index f8c0787..ed13b4d 100644 --- a/src/http/api/enterprise.ts +++ b/src/http/api/enterprise.ts @@ -56,7 +56,7 @@ export const apiAddCompanyInfo = (params: any) => { // 企业入驻信息导出 export const apiCompanyExportExcel = (params: any) => { let strUrl = `/zlpt-company/company_info/exportExcel` - return get(strUrl, params) + return download(strUrl, params) } // 根据企业id查询企业信息 export const apiGetCompanyInfoById = (id: any) => { @@ -94,7 +94,7 @@ export const apiGetCompanyInfoById = (id: any) => { // business​/open​/exportExcel export const apiBusinessOpenExportExcel = ( ) => { let strUrl = `/zlpt-company/business/open/exportExcel` - return get(strUrl,{}) + return download(strUrl,{}) } // 新增业务开通请求 export const apiBusinessOpenInsert = (params: any) => { @@ -138,7 +138,7 @@ export const apiServiceGreementInfoAdd = (params: any) => { // 导出隐私协议模板信息 export const apiServiceExport = (params: any) => { let strUrl = `/zlpt-company/serviceGreementInfo/export` - return get(strUrl,{}) + return download(strUrl,{}) } // 获取隐私协议模板列表 diff --git a/src/http/index.ts b/src/http/index.ts index b32a9c9..303ca94 100644 --- a/src/http/index.ts +++ b/src/http/index.ts @@ -44,6 +44,7 @@ service.interceptors.response.use( const handleDataCode = (res: any) => { const data = res.data + console.log("data----",data) if (data.code == '200') { return data } else if (data.code == '403') { @@ -52,6 +53,9 @@ const handleDataCode = (res: any) => { } else if (data.code == '401') { ElMessage.error(data.msg) router.push('/login') + } else if (data.code == '500') { + ElMessage.error(data.msg) + router.push('/login') } else { return data diff --git a/src/views/configuration/privacyAgreement/com/addCom.vue b/src/views/configuration/privacyAgreement/com/addCom.vue index 9160816..136cc90 100644 --- a/src/views/configuration/privacyAgreement/com/addCom.vue +++ b/src/views/configuration/privacyAgreement/com/addCom.vue @@ -36,7 +36,7 @@ import type { FormInstance, FormRules } from 'element-plus' import { ElMessage } from 'element-plus' import editorWang from "components/com/editorWang.vue" -import { apiBmTopicInfoById,apiBmTopicInfoAddorupdate } from "http/api/config" +import { apiServiceGreementInfo,apiServiceGreementInfoAdd,apiServiceGreementInfoUpdate } from "http/api/enterprise" const emits = defineEmits(['send']) const addShow = ref(false) let title = ref("新增") @@ -78,8 +78,8 @@ const formRules = reactive>({ const getPrivicynfoById=async(id:any)=>{ - const res:any = await apiBmTopicInfoById(id) - console.log("resapiBmTopicInfoById",res) + const res:any = await apiServiceGreementInfo(id) + console.log("apiServiceGreementInfo",res) const data = res.data editorWangRef.value.setHtmlByFather(data.content) Object.assign(form,data) @@ -121,6 +121,7 @@ const edit = () => { const showFn =(val: any) => { title.value =val.title addShow.value = true + getPrivicynfoById(val.serviceId) } defineExpose({ open, diff --git a/src/views/configuration/privacyAgreement/index.vue b/src/views/configuration/privacyAgreement/index.vue index 9151221..ef6e7c8 100644 --- a/src/views/configuration/privacyAgreement/index.vue +++ b/src/views/configuration/privacyAgreement/index.vue @@ -63,9 +63,7 @@ let tableListInfo = reactive({ }) const showRowFn = (row: any) => { - addComRef.value.showFn({ - title: "111" - }) + addComRef.value.showFn(row) } diff --git a/src/views/enterpriseManagement/enterpriseInfo/index.vue b/src/views/enterpriseManagement/enterpriseInfo/index.vue index 67fd08c..56226ab 100644 --- a/src/views/enterpriseManagement/enterpriseInfo/index.vue +++ b/src/views/enterpriseManagement/enterpriseInfo/index.vue @@ -31,7 +31,7 @@
已通过
-
+
已驳回
@@ -65,8 +65,9 @@ import headerTop from "./com/headerTop.vue" import addCom from "./com/addCom.vue" import { ElConfirmBeforeOpert } from "utils/elementCom" -import { apiGetCompanyInfoSelectList, apiupdateCompanyInfo } from "http/api/enterprise" +import { apiGetCompanyInfoSelectList, apiupdateCompanyInfo ,apiCompanyExportExcel} from "http/api/enterprise" import { ElMessage } from 'element-plus' +import {exportBlob} from "utils/index" const router = useRouter() const addComRef = ref() const paginationInfo = reactive({ @@ -136,7 +137,21 @@ const resetFn = (params: any) => { initTableList() } -const exportFn = () => { + +const exportFn = async () => { + +const res: any = await apiCompanyExportExcel({}) +// console.log("res-apiCompanyExportExcel", res) + +const data = res.data.body +console.log("res-apiCompanyExportExcel", data) + +exportBlob(data) +ElMessage({ + type: 'success', + message: "导出成功" +}) + } const addFn = () => {