Просмотр исходного кода

我的付款加数据导出功能

@dongkboy 3 месяцев назад
Родитель
Сommit
a3e8c3909b
2 измененных файлов с 48 добавлено и 12 удалено
  1. 4 1
      src/api/modules/finance.ts
  2. 44 11
      src/views/payCredit/myTask.vue

+ 4 - 1
src/api/modules/finance.ts

@@ -93,7 +93,10 @@ const financeApi = (axiosInstance: ApiInstance) => ({
     // 应付账款-概览
     getPayableStatistics: (data: any) => axiosInstance.post('userAccount/getPayableStatistics', data), // 总数
     userAccountList: (data: any) => axiosInstance.post('/userAccount/accountList', data), // 列表
-  // 应付概览-数据导出
+
+    // 我的付款-导出
+    exportMyPayment: (data: any) => axiosInstance.post('/amountAuditing/exportMyPayment', data),
+     // 应付概览-数据导出
     exportPayableStatisticsExcel: (data: any) => axiosInstance.post('/amountAuditing/exportYwyIORecs', data),
     // 基础管理-账户管理
     cardList: (data: any) => axiosInstance.post('/accountCard/cardList', data), // 账户列表

+ 44 - 11
src/views/payCredit/myTask.vue

@@ -1,7 +1,7 @@
 <template>
   <PageMain class="vh100">
     <el-tabs v-model="activeName" class="demo-tabs h-full" @tab-click="handleClick">
-      <el-tab-pane  name="0" class="h-full">
+      <el-tab-pane name="0" class="h-full">
         <template #label>
           <el-badge :value="total1">
             <span>待付款</span>
@@ -37,6 +37,7 @@
             <el-col :span="4" :offset="20" style="display: flex; align-items: start; justify-content: flex-end">
               <el-button type="primary" @click="handleSearch">搜索</el-button>
               <el-button plain>重置</el-button>
+              <el-button type="primary" @click="handleExport">导出</el-button>
             </el-col>
           </el-row>
         </el-form>
@@ -45,7 +46,9 @@
           <el-table-column prop="name" label="业务员"></el-table-column>
           <el-table-column prop="attrType" label="业务员类型">
             <template #default="scope">
-              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3' ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
+              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3'
+                ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType
+                  === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
             </template>
           </el-table-column>
           <el-table-column prop="managerName" label="管理人"></el-table-column>
@@ -77,7 +80,7 @@
             @current-change="pageCurrentChange"></el-pagination>
         </div>
       </el-tab-pane>
-      <el-tab-pane  name="1" class="h-full">
+      <el-tab-pane name="1" class="h-full">
         <template #label>
           <el-badge :value="total2">
             <span>已付款</span>
@@ -115,6 +118,8 @@
             <el-col :span="8" style="display: flex; align-items: start; justify-content: flex-end">
               <el-button type="primary" @click="handleSearch">搜索</el-button>
               <el-button plain>重置</el-button>
+              <el-button type="primary" @click="handleExport">导出</el-button>
+
             </el-col>
           </el-row>
         </el-form>
@@ -124,7 +129,9 @@
           <el-table-column prop="name" label="业务员"></el-table-column>
           <el-table-column prop="attrType" label="业务员类型">
             <template #default="scope">
-              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3' ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
+              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3'
+                ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType
+                  === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
             </template>
           </el-table-column>
           <el-table-column prop="managerName" label="管理人"></el-table-column>
@@ -146,7 +153,7 @@
             @current-change="pageCurrentChange"></el-pagination>
         </div>
       </el-tab-pane>
-      <el-tab-pane  name="2" class="h-full">
+      <el-tab-pane name="2" class="h-full">
         <template #label>
           <el-badge :value="total3">
             <span>拒绝付款</span>
@@ -184,6 +191,8 @@
             <el-col :span="8" style="display: flex; align-items: start; justify-content: flex-end">
               <el-button type="primary" @click="handleSearch">搜索</el-button>
               <el-button plain>重置</el-button>
+              <el-button type="primary" @click="handleExport">导出</el-button>
+
             </el-col>
           </el-row>
         </el-form>
@@ -193,7 +202,9 @@
           <el-table-column prop="name" label="业务员"></el-table-column>
           <el-table-column prop="attrType" label="业务员类型">
             <template #default="scope">
-              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3' ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
+              {{ scope.row.attrType === '1' ? '前线人员' : scope.row.attrType === '2' ? '后线人员' : scope.row.attrType === '3'
+                ? '合伙人' : scope.row.attrType === '4' ? '工作室管理员' : scope.row.attrType === '5' ? '团队' : scope.row.attrType
+                  === '6' ? '个代' : scope.row.attrType === '7' ? '电销' : scope.row.attrType === '8' ? '渠道' : '' }}
             </template>
           </el-table-column>
           <el-table-column prop="managerName" label="管理人"></el-table-column>
@@ -246,7 +257,7 @@
           <el-button type="primary" @click="accountSearch">查询</el-button>
         </el-col>
       </el-row>
-      <el-table ref="AccountRef" row-key="id" style="margin: 24px 0; max-height: 400px"  highlight-current-row
+      <el-table ref="AccountRef" row-key="id" style="margin: 24px 0; max-height: 400px" highlight-current-row
         :data="accountData" @current-change="handleCurrentChange" @row-dblclick="handleSelectedRow">
         <el-table-column prop="bankCardNum" label="银行卡号"></el-table-column>
         <el-table-column prop="bankNum" label="开户行"></el-table-column>
@@ -401,10 +412,10 @@ const accountSearch = () => {
   initAccount();
 }
 let selectItem = ref(null)
-const handleCurrentChange = ( row:any) => {
+const handleCurrentChange = (row: any) => {
   selectItem.value = row
-    AccountRef.value.clearSelection()
-    AccountRef.value.toggleRowSelection(row);
+  AccountRef.value.clearSelection()
+  AccountRef.value.toggleRowSelection(row);
 }
 const handleSelectedRow = (row: any) => {
   selectItem.value = row
@@ -507,7 +518,29 @@ const getMyPaymentTotalWithdrawalAmount = () => {
     createTimeEnd: time1.value?.[1],
     auditingStatus: activeName.value,
   }).then((res: any) => {
-      totalAmount.value = res.msg
+    totalAmount.value = res.msg
+  })
+}
+//导出我的付款列表
+const handleExport = () => {
+  api.financeApi.exportMyPayment({
+    salesman: queryInfo.value.salesman,
+    attrType: queryInfo.value.attrType,
+    createTimeStart: time1.value?.[0],
+    createTimeEnd: time1.value?.[1],
+    auditingStatus: activeName.value,
+  }).then((res: any) => {
+    if (res.code == 200) {
+      const link = document.createElement('a');
+      link.href = res.msg;
+      link.download = '';
+      // 触发下载
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    } else {
+    }
+
   })
 }
 onMounted(() => {