Parcourir la source

feature(经费管理):经费入账、经费报销添加pdf下载

wanglj il y a 8 mois
Parent
commit
9db060f02c

+ 5 - 1
src/api/fund/claim.ts

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-04-07 16:19:26
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-04-10 09:27:31
+ * @LastEditTime: 2025-04-15 19:21:11
  * @FilePath: \labsop_scientific_h5\src\api\fund\claim.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -85,5 +85,9 @@ export function useClaimApi() {
     getEntityByFundId(query?: object) {
       return request.postRequest(basePath, 'SciFundAllotApply', 'GetEntityByFundId', query)
     },
+    // 根据到款id查认领详情
+    exportFundAllotNoticePDF(query?: object) {
+      return request.postRequest(basePath, 'SciFundAllot', 'ExportFundAllotNoticePDF', query)
+    },
   }
 }

+ 4 - 0
src/api/fund/reimbursement.ts

@@ -56,6 +56,10 @@ export function useRebateApi() {
     // 模板打印
     getPrintDataById(query?: object) {
       return request.postRequest(basePath, 'SciFundExpense', 'GetPrintDataById', query)
+    },
+    // 模板打印
+    exportPrintDataPDF(query?: object) {
+      return request.postRequest(basePath, 'SciFundExpense', 'ExportPrintDataPDF', query)
     }
   }
 }

+ 12 - 3
src/view/fund/claim-records/detail.vue

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-24 09:17:15
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-04-08 16:02:35
+ * @LastEditTime: 2025-04-15 19:32:59
  * @FilePath: \labsop_h5\src\view\instr\detail.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -36,7 +36,8 @@
   <van-action-bar placeholder>
     <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
     <van-action-bar-icon icon="cashier-o" text="经费入账" @click="onRouterPush('/fund/claim-records')" />
-    <van-action-bar-button class="w100" type="primary" text="打印" @click="onClickButton" />
+    <van-action-bar-button type="primary" text="下载" @click="onClickButton" />
+
   </van-action-bar>
 </template>
 
@@ -66,6 +67,7 @@
     isInstrHead: false,
     detail: [] as any,
     form: {
+      id: 0,
       amount: '', //金额(元)
       externalAmount: '', //外拨金额(元)
       fundId: null, //财务到账Id
@@ -110,7 +112,14 @@
     })
   }
   const onClickButton = async () => {
-   
+    const [err, res]:ToResponse = await to(claimApi.exportFundAllotNoticePDF({id: state.form.id}))
+    if (err) return
+    const link = document.createElement('a')
+    link.href = 'http://192.168.0.215:36000' + res.data
+    link.target = '_blank'
+    link.style.display = 'none'
+    document.body.append(link)
+    link.click()
   }
   onMounted(() => {
     const id = route.query.id ? +route.query.id : 0

+ 12 - 2
src/view/fund/reimbursement/detail.vue

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-24 09:17:15
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-04-11 17:31:14
+ * @LastEditTime: 2025-04-15 19:27:30
  * @FilePath: \labsop_h5\src\view\instr\detail.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -116,6 +116,7 @@
   const expenseRemindApi = useExpenseRemindApi()
   const fundApi = useFundApi()
   const dictApi = useDictApi()
+  const claimApi = useClaimApi()
   const expenseApi = useExpenseApi()
   const configApi = useConfigApi()
   const fundCardApi = useFundCardApi()
@@ -346,7 +347,16 @@
   const onPreview = (url: string) => {
     showImagePreview([url])
   }
-  const onClickButton = async () => {}
+  const onClickButton = async () => {
+    const [err, res]:ToResponse = await to(rebateApi.exportPrintDataPDF({id: state.form.id}))
+    if (err) return
+    const link = document.createElement('a')
+    link.href = 'http://192.168.0.215:36000' + res.data
+    link.target = '_blank'
+    link.style.display = 'none'
+    document.body.append(link)
+    link.click()
+  }
   onMounted(() => {
     const id = route.query.id ? +route.query.id : 0
     const remindId = route.query.remindId ? +route.query.remindId : 0