Explorar o código

feat(业务台账):业务台账下载

sufan hai 5 meses
pai
achega
7082337eed

+ 6 - 0
src/api/dataSource/businessLedger/index.ts

@@ -15,3 +15,9 @@ export function getDetail(params?) {
 export function submitBusines(data) {
   return http.post<any, AxiosResponseRes>('/business/standingBook/modify', { data })
 }
+
+
+// 其他业务修改 - 下载
+export function downloadFiles(data) {
+  return http.post<any, AxiosResponseRes>('/business/standingBook/downloadBusinessStandingBook', { data, responseType: 'arraybuffer' })
+}

+ 1 - 1
src/api/dataSource/receiveLendingLedger/index.ts

@@ -20,7 +20,7 @@ export function getOtherDetail(params) {
   return http.get<any, AxiosResponseRes>('/payColl/standingBook/other/detail', { params })
 }
 
-// 其他业务修改 - 详情
+// 其他业务修改 - 下载
 export function downloadFiles(data) {
   return http.post<any, AxiosResponseRes>('/payColl/standingBook/downloadPayCollStandingBook', { data, responseType: 'arraybuffer' })
 }

+ 4 - 4
src/views/dataSource/businessLedger/index.columns.tsx

@@ -5,9 +5,9 @@ import { forMatMoney } from '@utils'
 export function useColumns(search) {
   const router = useRouter()
   const columns: TableColumnList = [
-    {
-      type: 'selection',
-    },
+    // {
+    //   type: 'selection',
+    // },
     {
       label: '序号',
       type: 'index',
@@ -70,7 +70,7 @@ export function useColumns(search) {
     },
     {
       label: '操作',
-      width: '160',
+      width: '100',
       cellRenderer: ({ index, row }) => {
         const btnList = [
           {

+ 9 - 2
src/views/dataSource/businessLedger/index.vue

@@ -47,7 +47,7 @@
           <el-button
             icon="Download"
             v-power="'downloadBusinessStandingBook'"
-            @click="fetchData"
+            @click="downloadClick"
             >下载</el-button
           >
         </div>
@@ -66,9 +66,10 @@
 
 <script lang="ts" setup>
   import { ref, reactive, onMounted } from 'vue'
-  import { getList } from '@api/dataSource/businessLedger'
+  import { getList, downloadFiles } from '@api/dataSource/businessLedger'
   import { useColumns } from './index.columns'
   import { useDictStore } from '@/store/modules/dict'
+  import { exportFile } from '@utils'
 
   defineOptions({
     name: 'ReceiveLendingLedger'
@@ -114,6 +115,12 @@
     search.rows = pageParams.pageSize
     fetchData()
   }
+
+  const downloadClick = () => {
+    downloadFiles({ ...search }).then((res) => {
+      exportFile(res)
+    })
+  }
 </script>
 
 <style lang="scss" scoped></style>