24282 преди 8 месеца
родител
ревизия
0cd80fdda8

+ 13 - 0
jy-business/src/main/java/com/jy/business/payment/controller/PaymentRequestsController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jy.business.payment.model.dto.PaymentRequestsDto;
 import com.jy.business.payment.model.dto.PaymentRequestsSelectDto;
 import com.jy.business.payment.model.entity.PaymentRemit;
+import com.jy.business.payment.model.vo.PaymentRemitExportVo;
 import com.jy.business.payment.model.vo.PaymentRequestsExportVo;
 import com.jy.business.payment.model.vo.PaymentRequestsVo;
 import com.jy.business.payment.service.PaymentRequestsService;
@@ -100,6 +101,18 @@ public class PaymentRequestsController {
     }
 
     /**
+     * 打款导出
+     */
+    @GetMapping("/remitExcelExport")
+    public void remitExcelExport(PaymentRequestsSelectDto dto) {
+        dto.setSearchAll(true);
+        Page<PaymentRequestsVo> page = getRemitPage(dto);
+        List<PaymentRequestsVo> records = page.getRecords();
+        List<PaymentRemitExportVo> list = BeanUtil.copyToList(records, PaymentRemitExportVo.class);
+        ExcelUtil.exportExcel(list, "打款", PaymentRemitExportVo.class, response);
+    }
+
+    /**
      * 打款
      */
     @PostMapping("/remit")

+ 102 - 0
jy-business/src/main/java/com/jy/business/payment/model/vo/PaymentRemitExportVo.java

@@ -0,0 +1,102 @@
+package com.jy.business.payment.model.vo;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.jy.system.service.SysDictDataService;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.Map;
+
+@Getter
+@Setter
+@ExcelIgnoreUnannotated
+public class PaymentRemitExportVo {
+
+    private static final SysDictDataService sysDictDataService = SpringUtil.getBean(SysDictDataService.class);
+    private static final Map<Integer, String> paymentRequestsTypeMap = sysDictDataService.getMapByCode("payment_requests_type");
+
+    /**
+     * 归属公司
+     */
+    @ExcelProperty("归属公司")
+    private String corporationName;
+
+    /**
+     * 归属部门
+     */
+    @ExcelProperty("归属部门")
+    private String deptName;
+
+    /**
+     * 请款类型
+     */
+    private Integer type;
+
+    /**
+     * 请款类型
+     */
+    @ExcelProperty("请款类型")
+    private String typeStr;
+
+    /**
+     * 请款人
+     */
+    @ExcelProperty("请款人")
+    private String userName;
+
+    /**
+     * 创建时间
+     */
+    @ExcelProperty("请款时间")
+    private Date createTime;
+
+    /**
+     * 用款时间
+     */
+    @ExcelProperty("用款时间")
+    private Date useTime;
+
+    /**
+     * 用款说明
+     */
+    @ExcelProperty("用款说明")
+    private String useRemark;
+
+    /**
+     * 请款金额
+     */
+    @ExcelProperty("请款金额")
+    private String totalAmount;
+
+    /**
+     * 放款状态
+     */
+    private Integer paymentStatus;
+
+    /**
+     * 放款状态
+     */
+    @ExcelProperty("放款状态")
+    private String paymentStatusStr;
+
+    public String getTypeStr() {
+        return paymentRequestsTypeMap.get(this.type);
+    }
+
+    public String getPaymentStatusStr() {
+        return switch (this.paymentStatus) {
+            case 0:
+                yield "未打款";
+            case 1:
+                yield "部分打款";
+            case 2:
+                yield "已打款";
+            default:
+                yield "";
+        };
+    }
+
+}

+ 1 - 1
jy-ui/.env

@@ -1,5 +1,5 @@
 # 标题
-VITE_APP_TITLE='JyAdmin'
+VITE_APP_TITLE='JY-ERP'
 
 # 登录页地址
 VITE_LOGIN_URL='/login'

+ 5 - 0
jy-ui/src/api/business/payment/requests.ts

@@ -46,4 +46,9 @@ export function retrieveApi(data: StrAnyObj): Promise<void> {
 // 下载excel
 export function excelExportApi(params: StrAnyObj): Promise<void> {
   return download.get(`/paymentRequests/excelExport`,params)
+}
+
+// 下载excel
+export function remitExcelExportApi(params: StrAnyObj): Promise<void> {
+  return download.get(`/paymentRequests/remitExcelExport`,params)
 }

+ 12 - 3
jy-ui/src/views/business/payment/remit/index.vue

@@ -5,11 +5,10 @@ import { ToolbarConfigType } from '@/components/AToolbar/type'
 import { ColumnConfigType } from '@/components/ATable/type'
 import { StrAnyObj, StrAnyObjArr } from '@/typings'
 import {
-  addApi,
-  editApi,
   getDetailApi,
   getRemitPageApi,
-  remitApi
+  remitApi,
+  remitExcelExportApi
 } from '@/api/business/payment/requests'
 import { getPageApi as getCorporationPageApi } from '@/api/business/corporation/corporation'
 import DeptTreeSelect from '@/views/components/DeptTreeSelect/index.vue'
@@ -110,6 +109,16 @@ const toolbarConfig: ToolbarConfigType[] = [
   //     dialogVisible.value = true
   //     dialogTitle.value = '新增'
   //   }
+  },
+  {
+    text: '导出',
+    icon: 'Download',
+    type: 'primary',
+    click() {
+      remitExcelExportApi(queryData.value).then(() => {
+        ElMessage.success('导出成功')
+      })
+    }
   }
 ]