Преглед изворни кода

增加供养批量缴费按钮以及页面

xiongxing пре 4 месеци
родитељ
комит
a145e16fb3
2 измењених фајлова са 74 додато и 2 уклоњено
  1. 8 0
      src/api/elderly/fee/bill-pay/index.ts
  2. 66 2
      src/views/elderly/fee/bill-pay/index.vue

+ 8 - 0
src/api/elderly/fee/bill-pay/index.ts

@@ -159,3 +159,11 @@ export const editExpenseOrder = (data) => {
     data
   })
 }
+
+// 供养批量缴费
+export const selfFundedPay = (data) => {
+  return request.post({
+    url: `/elderly/expenseOrder/markSupportElderlyBillsPaid`,
+    data
+  })
+}

+ 66 - 2
src/views/elderly/fee/bill-pay/index.vue

@@ -83,11 +83,14 @@
           <el-button  :loading="smsLoading" type="success" plain @click="handlePushJD(undefined)" v-hasPermi="['bill-pay:push-jd']">
             <Icon icon="ep:promotion" class="mr-5px" />   批量推送账单到金蝶
           </el-button>
+          <el-button type="primary" plain @click="handleSelfFundedPay" v-hasPermi="['bill-pay:self-funded-pay']">
+            <Icon icon="ep:promotion" class="mr-5px" /> 供养批量缴费
+          </el-button>
         </template>
       </TabBarBtn>
       <Table2
         selection
-        @selectionChange="handleSelectionChange"
+        @selection-change="handleSelectionChange"
         v-loading="loading"
         :data="list"
         :columns="BillPayColumns"
@@ -271,6 +274,19 @@
      </template>
    </Dialog>
 
+  <!-- 供养批量缴费弹窗 -->
+  <Dialog v-model="selfFundedVisible" title="供养批量缴费" width="500px" @close="handleSelfFundedClosed">
+    <el-form :model="selfFundedParams" :rules="selfFundedRules" ref="selfFundedFormRef">
+      <el-form-item label="账单月" prop="billingMonth">
+        <TgDatePicker v-model="selfFundedParams.billingMonth" type="month" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <el-button @click="handleSelfFundedClosed">取消</el-button>
+      <el-button type="primary" :loading="selfFundedLoading" @click="handleSubmitSelfFundedPay">确定</el-button>
+    </template>
+  </Dialog>
+
   <!-- 推送账单弹窗 -->
   <el-dialog
     v-model="pushOrderVisible"
@@ -319,7 +335,7 @@ import {
   sendSmsBillOrder,
   confirmStatusOrder,
   batchGenerateExpenseBillTask,
-  queryExpenseBillItem, generateExpenseBill, pushOrder, syncArReceivebillNewBatch
+  queryExpenseBillItem, generateExpenseBill, pushOrder, syncArReceivebillNewBatch, selfFundedPay
 } from '@/api/elderly/fee/bill-pay'
 import { BillPayColumns } from '../column'
 import Form from './Form.vue'
@@ -370,6 +386,16 @@ const batchRules = ref({
   billingMonth: [{ required: true, message: '生成月份不能为空', trigger: 'blur' }]
 })
 
+const selfFundedVisible = ref(false)
+const selfFundedLoading = ref(false)
+const selfFundedFormRef = ref()
+const selfFundedParams = ref({
+  billingMonth: ''
+})
+const selfFundedRules = ref({
+  billingMonth: [{ required: true, message: '账单月不能为空', trigger: 'change' }]
+})
+
 let timeoutId:number = 0
 const exportLoading = ref(false)
 
@@ -804,6 +830,44 @@ const pollTaskStatus = async (taskId: string) => {
 };
 
 
+// 供养批量缴费
+const handleSelfFundedPay = () => {
+  if (queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1) {
+    message.error('只能选择一个机构')
+    return
+  }
+  selfFundedParams.value.billingMonth = ''
+  selfFundedVisible.value = true
+}
+
+const handleSelfFundedClosed = () => {
+  if (selfFundedLoading.value) return
+  selfFundedVisible.value = false
+  selfFundedParams.value.billingMonth = ''
+}
+
+const handleSubmitSelfFundedPay = async () => {
+  if (selfFundedLoading.value) return
+  const valid = await selfFundedFormRef.value?.validate()
+  if (!valid) return
+
+  try {
+    selfFundedLoading.value = true
+    const res = await selfFundedPay({
+      tenantId: queryParams.tenantIds[0],
+      billingMonth: selfFundedParams.value.billingMonth
+    })
+
+    if (res) {
+      message.success('操作成功')
+      handleSelfFundedClosed()
+      await getList()
+    }
+  } finally {
+    selfFundedLoading.value = false
+  }
+}
+
 // 打开弹窗
 const handleBatch = () => {
   batchResult.value = null // 重置结果状态