瀏覽代碼

功能優化

songxy 1 年之前
父節點
當前提交
8ef6766279

+ 1 - 1
client/src/api/oa/kpgl/index.ts

@@ -15,6 +15,6 @@ export const processContractInvoice = (params) => {
 }
 
 // 开票查询多选导出
-export const exportContractInvoiceListExcel = (data: { idList: string[] }) => {
+export const exportContractInvoiceListExcel = (data: { idList?: string[] }) => {
   return request.downloadPost({ url: '/contract-invoice/list/excel', data }, '/business')
 }

+ 1 - 8
client/src/config/axios/service.ts

@@ -172,14 +172,7 @@ service.interceptors.response.use(
       ElMessage.error({
         offset: 300,
         dangerouslyUseHTMLString: true,
-        message:
-          '<div>' +
-          t('sys.api.errMsg901') +
-          '</div>' +
-          '<div> &nbsp; </div>' +
-          '<div>参考 https://doc.iocoder.cn/ 教程</div>' +
-          '<div> &nbsp; </div>' +
-          '<div>5 分钟搭建本地环境</div>'
+        message: ''
       })
       return Promise.reject(new Error(msg))
     } else if (code !== 200) {

+ 2 - 0
client/src/utils/download.ts

@@ -1,3 +1,5 @@
+import { AxiosResponse } from 'axios'
+
 const download0 = (data: Blob, fileName: string, mineType: string) => {
   // 创建 blob
   const blob = new Blob([data], { type: mineType })

+ 4 - 8
client/src/views/OaSystem/financialManagement/kpglPage/deptIndex.vue

@@ -258,15 +258,11 @@ const handleSelectionChange = (arrs) => {
 }
 /** 列表导出 */
 const getExportContractInvoiceListExcel = async () => {
-  if (idList.value.length === 0) {
-    idList.value = list.value.map((item) => item.id)
+  const sendData = {}
+  if (idList.value.length > 0) {
+    sendData['idList'] = idList.value
   }
-  if (idList.value.length === 0) {
-    return
-  }
-  const data = await kpglApi.exportContractInvoiceListExcel({
-    idList: idList.value
-  })
+  const data = await kpglApi.exportContractInvoiceListExcel(sendData)
   download.excel(data, '开票台账导出记录.xls')
 }
 const loading = ref(true) // 列表的加载中

+ 4 - 8
client/src/views/OaSystem/financialManagement/kpglPage/index.vue

@@ -286,15 +286,11 @@ const handleSelectionChange = (arrs) => {
 }
 /** 列表导出 */
 const getExportContractInvoiceListExcel = async () => {
-  if (idList.value.length === 0) {
-    idList.value = list.value.map((item) => item.id)
+  const sendData = {}
+  if (idList.value.length > 0) {
+    sendData['idList'] = idList.value
   }
-  if (idList.value.length === 0) {
-    return
-  }
-  const data = await kpglApi.exportContractInvoiceListExcel({
-    idList: idList.value
-  })
+  const data = await kpglApi.exportContractInvoiceListExcel(sendData)
   download.excel(data, '开票台账导出记录.xls')
 }
 const loading = ref(true) // 列表的加载中

+ 4 - 8
client/src/views/OaSystem/financialManagement/kpglPage/myIndex.vue

@@ -262,15 +262,11 @@ const handleSelectionChange = (arrs) => {
 }
 /** 列表导出 */
 const getExportContractInvoiceListExcel = async () => {
-  if (idList.value.length === 0) {
-    idList.value = list.value.map((item) => item.id)
+  const sendData = {}
+  if (idList.value.length > 0) {
+    sendData['idList'] = idList.value
   }
-  if (idList.value.length === 0) {
-    return
-  }
-  const data = await kpglApi.exportContractInvoiceListExcel({
-    idList: idList.value
-  })
+  const data = await kpglApi.exportContractInvoiceListExcel(sendData)
   download.excel(data, '开票台账导出记录.xls')
 }
 const loading = ref(true) // 列表的加载中