|
|
@@ -9,9 +9,18 @@
|
|
|
:inline="true"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
- <TenantSelect v-model="queryParams.tenantIds" placeholder="请选择机构名称" prop="tenantIds"/>
|
|
|
+ <TenantSelect
|
|
|
+ v-model="queryParams.tenantIds"
|
|
|
+ placeholder="请选择机构名称"
|
|
|
+ prop="tenantIds"
|
|
|
+ />
|
|
|
<el-form-item label="长者姓名" prop="elderName">
|
|
|
- <el-input @keyup.enter="handleQuery" v-model="queryParams.elderName" placeholder="请输入长者姓名" class="!w-240px" />
|
|
|
+ <el-input
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ v-model="queryParams.elderName"
|
|
|
+ placeholder="请输入长者姓名"
|
|
|
+ class="!w-240px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="床位号" prop="bedId">
|
|
|
<SelectRoom v-model="queryParams.bedId" class="!w-240px" />
|
|
|
@@ -65,25 +74,54 @@
|
|
|
<!-- 列表 -->
|
|
|
<ContentWrap>
|
|
|
<TabBarBtn @export="handleExport" @add="handleGenerator" :exportLoading="exportLoading">
|
|
|
- <template #middle>
|
|
|
-<!-- <el-button type="danger" plain @click="handleCancel" v-hasPermi="['bill-pay:cancel-t']">-->
|
|
|
-<!-- <Icon icon="ep:remove" class="mr-5px" /> 推送撤回-->
|
|
|
-<!-- </el-button>-->
|
|
|
+ <template #middle>
|
|
|
+ <!-- <el-button type="danger" plain @click="handleCancel" v-hasPermi="['bill-pay:cancel-t']">-->
|
|
|
+ <!-- <Icon icon="ep:remove" class="mr-5px" /> 推送撤回-->
|
|
|
+ <!-- </el-button>-->
|
|
|
</template>
|
|
|
<template #next>
|
|
|
<el-button type="primary" plain @click="handleBatch">
|
|
|
<Icon icon="ep:document-add" class="mr-5px" /> 批量生成账单
|
|
|
</el-button>
|
|
|
- <el-button :disabled="ids.length<=0" :loading="fwhLoading" type="warning" plain @click="handlePushOrder(undefined)" v-hasPermi="['bill-pay:push-fwh']">
|
|
|
- <Icon icon="ep:promotion" class="mr-5px" /> {{ids.length>0?`批量推送账单到小程序(已选:${ids.length})`:'批量推送账单到小程序'}}
|
|
|
+ <el-button
|
|
|
+ :disabled="ids.length <= 0"
|
|
|
+ :loading="fwhLoading"
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ @click="handlePushOrder(undefined)"
|
|
|
+ v-hasPermi="['bill-pay:push-fwh']"
|
|
|
+ >
|
|
|
+ <Icon icon="ep:promotion" class="mr-5px" />
|
|
|
+ {{
|
|
|
+ ids.length > 0 ? `批量推送账单到小程序(已选:${ids.length})` : '批量推送账单到小程序'
|
|
|
+ }}
|
|
|
</el-button>
|
|
|
- <el-button :disabled="ids.length<=0" :loading="smsLoading" type="primary" plain @click="handlePush(undefined)" v-hasPermi="['bill-pay:push-sms']">
|
|
|
- <Icon icon="ep:promotion" class="mr-5px" /> {{ids.length>0?`批量发送缴费短信(已选:${ids.length})`:'批量发送缴费短信'}}
|
|
|
+ <el-button
|
|
|
+ :disabled="ids.length <= 0"
|
|
|
+ :loading="smsLoading"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="handlePush(undefined)"
|
|
|
+ v-hasPermi="['bill-pay:push-sms']"
|
|
|
+ >
|
|
|
+ <Icon icon="ep:promotion" class="mr-5px" />
|
|
|
+ {{ ids.length > 0 ? `批量发送缴费短信(已选:${ids.length})` : '批量发送缴费短信' }}
|
|
|
</el-button>
|
|
|
- <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
|
|
|
+ :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']">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="handleSelfFundedPay"
|
|
|
+ v-hasPermi="['bill-pay:self-funded-pay']"
|
|
|
+ >
|
|
|
<Icon icon="ep:promotion" class="mr-5px" /> 供养批量缴费
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -129,8 +167,14 @@
|
|
|
>
|
|
|
欠费备注
|
|
|
</el-button> -->
|
|
|
- <el-button v-if="scope.payStatus!=1" type="primary" link @click="handlePush([scope.id])" v-hasPermi="['bill-pay:push-sms']">
|
|
|
- 发送缴费短信
|
|
|
+ <el-button
|
|
|
+ v-if="scope.payStatus != 1"
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ @click="handlePush([scope.id])"
|
|
|
+ v-hasPermi="['bill-pay:push-sms']"
|
|
|
+ >
|
|
|
+ 发送缴费短信
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
link
|
|
|
@@ -138,7 +182,7 @@
|
|
|
@click="handleBack(scope)"
|
|
|
v-if="scope.payStatus == 1"
|
|
|
v-hasPermi="['bill-pay:bill-cancel']"
|
|
|
- >
|
|
|
+ >
|
|
|
撤销
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
@@ -159,19 +203,14 @@
|
|
|
>
|
|
|
推送账单到小程序
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="success"
|
|
|
- @click="handlePreview(scope)"
|
|
|
- v-if="scope.payStatus != 1"
|
|
|
- >
|
|
|
+ <el-button link type="success" @click="handlePreview(scope)" v-if="scope.payStatus != 1">
|
|
|
缴费通知单
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
link
|
|
|
type="warning"
|
|
|
@click="handlePushJD(scope.id)"
|
|
|
- v-if="(scope.payStatus == 1 && !scope.isPushKingdeeReceiveBill)"
|
|
|
+ v-if="scope.payStatus == 1 && !scope.isPushKingdeeReceiveBill"
|
|
|
v-hasPermi="['bill-pay:push-jd']"
|
|
|
>
|
|
|
推送账单到金蝶
|
|
|
@@ -195,87 +234,116 @@
|
|
|
<billGenerator ref="billGeneratorRef" @success="getList" />
|
|
|
<unpayPreview ref="unpayPreviewRef" />
|
|
|
|
|
|
-
|
|
|
<!-- 批量生成账单弹窗 -->
|
|
|
- <Dialog v-model="batchVisible" :title="batchResult ? '批量生成账单结果' : '批量生成账单(生成期间请勿刷新页面或其他操作)'" width="800px" @close="handleClosed">
|
|
|
- <!-- 生成表单 -->
|
|
|
- <div v-if="!batchResult">
|
|
|
- <el-form :model="batchParams" :rules="batchRules">
|
|
|
- <el-form-item label="生成月份" prop="billingMonth">
|
|
|
- <TgDatePicker :disabled="formLoading" v-model="batchParams.billingMonth" type="month" :disabledDate="disabledDate"/>
|
|
|
- <el-text v-show="formLoading" style="color: red">生成时间较长,请耐心等待...</el-text>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <Dialog
|
|
|
+ v-model="batchVisible"
|
|
|
+ :title="batchResult ? '批量生成账单结果' : '批量生成账单(生成期间请勿刷新页面或其他操作)'"
|
|
|
+ width="800px"
|
|
|
+ @close="handleClosed"
|
|
|
+ >
|
|
|
+ <!-- 生成表单 -->
|
|
|
+ <div v-if="!batchResult">
|
|
|
+ <el-form :model="batchParams" :rules="batchRules">
|
|
|
+ <el-form-item label="生成月份" prop="billingMonth">
|
|
|
+ <TgDatePicker
|
|
|
+ :disabled="formLoading"
|
|
|
+ v-model="batchParams.billingMonth"
|
|
|
+ type="month"
|
|
|
+ :disabledDate="disabledDate"
|
|
|
+ />
|
|
|
+ <el-text v-show="formLoading" style="color: red">生成时间较长,请耐心等待...</el-text>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- 生成结果 -->
|
|
|
- <div v-else v-loading="generateLoading">
|
|
|
- <!-- 统计信息 -->
|
|
|
- <div class="mb-4 p-4 bg-gray-50 rounded-lg">
|
|
|
- <div class="grid grid-cols-3 gap-4 mb-4">
|
|
|
- <div class="text-center">
|
|
|
- <div class="text-2xl font-bold text-blue-600">{{ batchResult.totalCount }}</div>
|
|
|
- <div class="text-sm text-gray-600">总数量</div>
|
|
|
- </div>
|
|
|
- <div class="text-center">
|
|
|
- <div class="text-2xl font-bold text-green-600">{{ batchResult.processedCount }}</div>
|
|
|
- <div class="text-sm text-gray-600">处理数量</div>
|
|
|
- </div>
|
|
|
- <div class="text-center">
|
|
|
- <div class="text-2xl font-bold text-green-600">{{ batchResult.successCount }}</div>
|
|
|
- <div class="text-sm text-gray-600">成功数量</div>
|
|
|
- </div>
|
|
|
- <div class="text-center">
|
|
|
- <div class="text-2xl font-bold text-red-600">{{ batchResult.failedCount }}</div>
|
|
|
- <div class="text-sm text-gray-600">失败数量</div>
|
|
|
- </div>
|
|
|
- <div class="text-center" v-if="batchResult.skippedCount">
|
|
|
- <div class="text-2xl font-bold text-orange-600">{{ batchResult.skippedCount }}</div>
|
|
|
- <div class="text-sm text-gray-600">跳过数量</div>
|
|
|
- </div>
|
|
|
- <div class="text-center">
|
|
|
- <div class="text-lg font-semibold" :class="batchResult.status === 'COMPLETED' ? 'text-green-600' : 'text-red-600'">
|
|
|
- {{ batchResult.status === 'COMPLETED' ? '已完成' : '失败' }}
|
|
|
- </div>
|
|
|
- <div class="text-sm text-gray-600">状态</div>
|
|
|
- </div>
|
|
|
+ <!-- 生成结果 -->
|
|
|
+ <div v-else v-loading="generateLoading">
|
|
|
+ <!-- 统计信息 -->
|
|
|
+ <div class="mb-4 p-4 bg-gray-50 rounded-lg">
|
|
|
+ <div class="grid grid-cols-3 gap-4 mb-4">
|
|
|
+ <div class="text-center">
|
|
|
+ <div class="text-2xl font-bold text-blue-600">{{ batchResult.totalCount }}</div>
|
|
|
+ <div class="text-sm text-gray-600">总数量</div>
|
|
|
+ </div>
|
|
|
+ <div class="text-center">
|
|
|
+ <div class="text-2xl font-bold text-green-600">{{ batchResult.processedCount }}</div>
|
|
|
+ <div class="text-sm text-gray-600">处理数量</div>
|
|
|
+ </div>
|
|
|
+ <div class="text-center">
|
|
|
+ <div class="text-2xl font-bold text-green-600">{{ batchResult.successCount }}</div>
|
|
|
+ <div class="text-sm text-gray-600">成功数量</div>
|
|
|
</div>
|
|
|
- <div class="mb-2">
|
|
|
- <span class="font-medium">生成月份:</span>
|
|
|
- <span class="text-blue-600">{{ batchResult.billingMonth }}</span>
|
|
|
+ <div class="text-center">
|
|
|
+ <div class="text-2xl font-bold text-red-600">{{ batchResult.failedCount }}</div>
|
|
|
+ <div class="text-sm text-gray-600">失败数量</div>
|
|
|
</div>
|
|
|
- <div v-if="batchResult.errorMessage" class="mt-2 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-sm">
|
|
|
- <span class="font-medium">错误信息:</span>{{ batchResult.errorMessage }}
|
|
|
+ <div class="text-center" v-if="batchResult.skippedCount">
|
|
|
+ <div class="text-2xl font-bold text-orange-600">{{ batchResult.skippedCount }}</div>
|
|
|
+ <div class="text-sm text-gray-600">跳过数量</div>
|
|
|
+ </div>
|
|
|
+ <div class="text-center">
|
|
|
+ <div
|
|
|
+ class="text-lg font-semibold"
|
|
|
+ :class="batchResult.status === 'COMPLETED' ? 'text-green-600' : 'text-red-600'"
|
|
|
+ >
|
|
|
+ {{ batchResult.status === 'COMPLETED' ? '已完成' : '失败' }}
|
|
|
+ </div>
|
|
|
+ <div class="text-sm text-gray-600">状态</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <span class="font-medium">生成月份:</span>
|
|
|
+ <span class="text-blue-600">{{ batchResult.billingMonth }}</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="batchResult.errorMessage"
|
|
|
+ class="mt-2 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-sm"
|
|
|
+ >
|
|
|
+ <span class="font-medium">错误信息:</span>{{ batchResult.errorMessage }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- 详细信息列表(可滚动) -->
|
|
|
- <div v-if="batchResult.details && batchResult.details.length > 0" class="mt-4">
|
|
|
- <div class="mb-2 font-medium text-gray-700">详细信息:</div>
|
|
|
- <div class="max-h-80 overflow-y-auto border border-gray-200 rounded">
|
|
|
- <el-table :data="batchResult.details" size="small" height="320">
|
|
|
- <el-table-column prop="elderName" label="长者姓名" width="200" fixed />
|
|
|
- <el-table-column prop="message" label="结果信息" min-width="300" />
|
|
|
- <el-table-column prop="message" label="操作" min-width="300" >
|
|
|
+ <!-- 详细信息列表(可滚动) -->
|
|
|
+ <div v-if="batchResult.details && batchResult.details.length > 0" class="mt-4">
|
|
|
+ <div class="mb-2 font-medium text-gray-700">详细信息:</div>
|
|
|
+ <div class="max-h-80 overflow-y-auto border border-gray-200 rounded">
|
|
|
+ <el-table :data="batchResult.details" size="small" height="320">
|
|
|
+ <el-table-column prop="elderName" label="长者姓名" width="200" fixed />
|
|
|
+ <el-table-column prop="message" label="结果信息" min-width="300" />
|
|
|
+ <el-table-column prop="message" label="操作" min-width="300">
|
|
|
<template #default="scope">
|
|
|
- <el-button @click="generate(scope.row)" v-show="(scope.row.result=='CONFIRM' && !scope.row.isQuery)" type="warning">生成账单{{scope.row.isQuery}}</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="generate(scope.row)"
|
|
|
+ v-show="scope.row.result == 'CONFIRM' && !scope.row.isQuery"
|
|
|
+ type="warning"
|
|
|
+ >生成账单{{ scope.row.isQuery }}</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <template #footer>
|
|
|
- <el-button @click="handleClosed" v-if="!batchResult">取消</el-button>
|
|
|
- <el-button v-loading="formLoading" v-if="!batchResult" type="primary" @click="submitForm">确定</el-button>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="handleClosed" v-if="!batchResult">取消</el-button>
|
|
|
+ <el-button v-loading="formLoading" v-if="!batchResult" type="primary" @click="submitForm"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
|
|
|
- <el-button @click="handleClosed" v-if="batchResult">关闭</el-button>
|
|
|
- <el-button type="primary" v-if="batchResult" @click="exportBatchDetails">导出跳过数据</el-button>
|
|
|
- </template>
|
|
|
- </Dialog>
|
|
|
+ <el-button @click="handleClosed" v-if="batchResult">关闭</el-button>
|
|
|
+ <el-button type="primary" v-if="batchResult" @click="exportBatchDetails"
|
|
|
+ >导出跳过数据</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </Dialog>
|
|
|
|
|
|
<!-- 供养批量缴费弹窗 -->
|
|
|
- <Dialog v-model="selfFundedVisible" title="供养批量缴费" width="500px" @close="handleSelfFundedClosed">
|
|
|
+ <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" />
|
|
|
@@ -283,25 +351,28 @@
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleSelfFundedClosed">取消</el-button>
|
|
|
- <el-button type="primary" :loading="selfFundedLoading" @click="handleSubmitSelfFundedPay">确定</el-button>
|
|
|
+ <el-button type="primary" :loading="selfFundedLoading" @click="handleSubmitSelfFundedPay"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</Dialog>
|
|
|
|
|
|
<!-- 推送账单弹窗 -->
|
|
|
- <el-dialog
|
|
|
- v-model="pushOrderVisible"
|
|
|
- :title="'推送账单确认'"
|
|
|
- width="600px"
|
|
|
- >
|
|
|
+ <el-dialog v-model="pushOrderVisible" :title="'推送账单确认'" width="600px">
|
|
|
<div class="py-4">
|
|
|
<div class="text-center mb-6">
|
|
|
<div class="text-xl font-semibold mb-2">已选人数</div>
|
|
|
- <div class="text-4xl font-bold text-primary" style="color:#f3a454;">{{ pushOrderCount }}</div>
|
|
|
+ <div class="text-4xl font-bold text-primary" style="color: #f3a454">{{
|
|
|
+ pushOrderCount
|
|
|
+ }}</div>
|
|
|
</div>
|
|
|
|
|
|
<div v-if="pushOrderResult" class="mb-4">
|
|
|
<div class="mb-2 font-medium">推送结果</div>
|
|
|
- <div v-if="pushOrderResult.success" class="p-3 bg-green-50 border border-green-200 rounded text-green-600">
|
|
|
+ <div
|
|
|
+ v-if="pushOrderResult.success"
|
|
|
+ class="p-3 bg-green-50 border border-green-200 rounded text-green-600"
|
|
|
+ >
|
|
|
{{ pushOrderResult.message }}
|
|
|
</div>
|
|
|
<div v-else class="p-3 bg-red-50 border border-red-200 rounded text-red-600">
|
|
|
@@ -322,7 +393,6 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
@@ -335,7 +405,11 @@ import {
|
|
|
sendSmsBillOrder,
|
|
|
confirmStatusOrder,
|
|
|
batchGenerateExpenseBillTask,
|
|
|
- queryExpenseBillItem, generateExpenseBill, pushOrder, syncArReceivebillNewBatch, selfFundedPay
|
|
|
+ queryExpenseBillItem,
|
|
|
+ generateExpenseBill,
|
|
|
+ pushOrder,
|
|
|
+ syncArReceivebillNewBatch,
|
|
|
+ selfFundedPay
|
|
|
} from '@/api/elderly/fee/bill-pay'
|
|
|
import { BillPayColumns } from '../column'
|
|
|
import Form from './Form.vue'
|
|
|
@@ -349,9 +423,9 @@ import download from '@/utils/download'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import { useBillStore } from '@/store/modules/bill'
|
|
|
const { t } = useI18n() // 国际化
|
|
|
-import {exportWithCustomHeaders} from "@/utils/excel-export";
|
|
|
-import {formatToDateTime} from "@/utils/dateUtil";
|
|
|
-import {CloseBold} from "@element-plus/icons-vue";
|
|
|
+import { exportWithCustomHeaders } from '@/utils/excel-export'
|
|
|
+import { formatToDateTime } from '@/utils/dateUtil'
|
|
|
+import { CloseBold } from '@element-plus/icons-vue'
|
|
|
defineOptions({ name: 'BillPay' })
|
|
|
const userStore = useUserStore()
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
@@ -396,7 +470,7 @@ const selfFundedRules = ref({
|
|
|
billingMonth: [{ required: true, message: '账单月不能为空', trigger: 'change' }]
|
|
|
})
|
|
|
|
|
|
-let timeoutId:number = 0
|
|
|
+let timeoutId: number = 0
|
|
|
const exportLoading = ref(false)
|
|
|
|
|
|
/** 查询列表 */
|
|
|
@@ -440,16 +514,16 @@ const generate = async (item) => {
|
|
|
}
|
|
|
)
|
|
|
await queryEB()
|
|
|
- }catch (_){}
|
|
|
+ } catch (_) {}
|
|
|
}
|
|
|
|
|
|
let tempGeneratePrams = {
|
|
|
- items:[],
|
|
|
+ items: [],
|
|
|
elderId: '',
|
|
|
- billingMonth: '',
|
|
|
+ billingMonth: ''
|
|
|
}
|
|
|
-const queryEB = async ()=>{
|
|
|
- if(generateLoading.value){
|
|
|
+const queryEB = async () => {
|
|
|
+ if (generateLoading.value) {
|
|
|
return
|
|
|
}
|
|
|
generateLoading.value = true
|
|
|
@@ -466,7 +540,9 @@ const queryEB = async ()=>{
|
|
|
if (res) {
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
// 更新 batchResult.value.details 数组中的实际对象
|
|
|
- const index = batchResult.value.details.findIndex(item => item.elderId === tempQueryObj.value.elderId)
|
|
|
+ const index = batchResult.value.details.findIndex(
|
|
|
+ (item) => item.elderId === tempQueryObj.value.elderId
|
|
|
+ )
|
|
|
if (index !== -1) {
|
|
|
// 使用 Vue.set 或直接替换整个对象来确保响应式更新
|
|
|
batchResult.value.details[index] = {
|
|
|
@@ -475,25 +551,23 @@ const queryEB = async ()=>{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }catch (e){
|
|
|
- console.log("异常",e)
|
|
|
+ } catch (e) {
|
|
|
+ console.log('异常', e)
|
|
|
} finally {
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
generateLoading.value = false
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const disabledDate = (time) => {
|
|
|
- // 获取下个月的日期
|
|
|
- const nextMonth = new Date()
|
|
|
- nextMonth.setMonth(nextMonth.getMonth() + 3)
|
|
|
- // 设置为下个月的第一天
|
|
|
- nextMonth.setDate(1)
|
|
|
- // 限制只能选择下个月及之前的月份
|
|
|
- return time > nextMonth
|
|
|
+ // 获取下个月的日期
|
|
|
+ const nextMonth = new Date()
|
|
|
+ nextMonth.setMonth(nextMonth.getMonth() + 3)
|
|
|
+ // 设置为下个月的第一天
|
|
|
+ nextMonth.setDate(1)
|
|
|
+ // 限制只能选择下个月及之前的月份
|
|
|
+ return time > nextMonth
|
|
|
}
|
|
|
|
|
|
const confirmForm = async (params) => {
|
|
|
@@ -501,11 +575,10 @@ const confirmForm = async (params) => {
|
|
|
await message.cancelConfirm('确认之后,该账单进入锁定状态(无法增减费用),您确定要操作吗?')
|
|
|
const res = await confirmStatusOrder(params.id) //账单确认锁定
|
|
|
if (res) {
|
|
|
- message.success("操作成功!")
|
|
|
+ message.success('操作成功!')
|
|
|
await getList()
|
|
|
}
|
|
|
- }catch(_){}
|
|
|
-
|
|
|
+ } catch (_) {}
|
|
|
}
|
|
|
|
|
|
/** 添加/修改操作 */
|
|
|
@@ -515,7 +588,7 @@ const visible = ref(false)
|
|
|
const openForm = (row: any = {}, isDetail: boolean = false) => {
|
|
|
router.push({
|
|
|
name: isDetail ? 'BillConfirmDetail' : 'BillConfirmForm',
|
|
|
- params:{
|
|
|
+ params: {
|
|
|
id: row.id,
|
|
|
tId: row.tenantId
|
|
|
}
|
|
|
@@ -530,57 +603,58 @@ const handleClickRemark = (row) => {
|
|
|
const unpayPreviewRef = ref()
|
|
|
const previewRef = ref()
|
|
|
const handlePreview = (row) => {
|
|
|
- if(row.payStatus == 1){
|
|
|
+ if (row.payStatus == 1) {
|
|
|
previewRef.value.open(row.id, row)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
unpayPreviewRef.value.open(row.id)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const showDeleteCondition = (row)=>{
|
|
|
- return ((row.type == 2||row.type == 4) && row.payStatus != 1)
|
|
|
+const showDeleteCondition = (row) => {
|
|
|
+ return (row.type == 2 || row.type == 4) && row.payStatus != 1
|
|
|
}
|
|
|
-const showDetailsCondition = (row)=>{
|
|
|
- return (row.payStatus == 1)
|
|
|
+const showDetailsCondition = (row) => {
|
|
|
+ return row.payStatus == 1
|
|
|
}
|
|
|
|
|
|
//批量推送金蝶账单
|
|
|
-const handlePushJD = (id)=>{
|
|
|
- if(id){
|
|
|
+const handlePushJD = (id) => {
|
|
|
+ if (id) {
|
|
|
ElMessageBox.confirm('确定要推送该账单到金蝶吗?', '提示', {
|
|
|
confirmButtonText: '确 认',
|
|
|
cancelButtonText: '取 消'
|
|
|
})
|
|
|
.then(async () => {
|
|
|
try {
|
|
|
- loading.value=true
|
|
|
+ loading.value = true
|
|
|
const res = await syncArReceivebillNewBatch([id])
|
|
|
if (res) {
|
|
|
+ message.warning(res)
|
|
|
+ } else {
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
}
|
|
|
- }finally {
|
|
|
- loading.value=false
|
|
|
+ } finally {
|
|
|
+ loading.value = false
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => console.info('操作取消')).finally(()=>{
|
|
|
- loading.value=false
|
|
|
- })
|
|
|
- }else {
|
|
|
+ .catch(() => console.info('操作取消'))
|
|
|
+ .finally(() => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
jdFormRef.value.open()
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 推送小程序
|
|
|
-const handlePush = (idList:any) => {
|
|
|
- if(!idList){
|
|
|
+const handlePush = (idList: any) => {
|
|
|
+ if (!idList) {
|
|
|
idList = ids.value
|
|
|
- if(idList.length<=0){
|
|
|
- message.warning("请先勾选需要发送的长者账单!")
|
|
|
+ if (idList.length <= 0) {
|
|
|
+ message.warning('请先勾选需要发送的长者账单!')
|
|
|
}
|
|
|
}
|
|
|
- if(!idList||idList.length<=0){
|
|
|
+ if (!idList || idList.length <= 0) {
|
|
|
return
|
|
|
}
|
|
|
ElMessageBox.confirm('请认真核对账单费用信息,确定要发送短信通知家属缴费吗?', '提示', {
|
|
|
@@ -588,15 +662,16 @@ const handlePush = (idList:any) => {
|
|
|
cancelButtonText: '取 消'
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- smsLoading.value=true
|
|
|
+ smsLoading.value = true
|
|
|
const res = await sendSmsBillOrder(idList)
|
|
|
- if(res){
|
|
|
- message.success("发送成功")
|
|
|
+ if (res) {
|
|
|
+ message.success('发送成功')
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => console.info('操作取消')).finally(()=>{
|
|
|
- smsLoading.value=false
|
|
|
- })
|
|
|
+ .catch(() => console.info('操作取消'))
|
|
|
+ .finally(() => {
|
|
|
+ smsLoading.value = false
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const delItem = (id) => {
|
|
|
@@ -607,15 +682,14 @@ const delItem = (id) => {
|
|
|
})
|
|
|
.then(async () => {
|
|
|
const res = await deletePayment(id)
|
|
|
- if(res){
|
|
|
- message.success("删除成功")
|
|
|
+ if (res) {
|
|
|
+ message.success('删除成功')
|
|
|
await getList()
|
|
|
}
|
|
|
})
|
|
|
- .catch((_) =>{})
|
|
|
+ .catch((_) => {})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 推送账单相关变量
|
|
|
const pushOrderVisible = ref(false)
|
|
|
const pushOrderLoading = ref(false)
|
|
|
@@ -626,17 +700,17 @@ let pushOrderIds = []
|
|
|
// 推送账单
|
|
|
const handlePushOrder = (item) => {
|
|
|
// 确定要推送的账单ID
|
|
|
- if(item){
|
|
|
+ if (item) {
|
|
|
pushOrderIds = [item.id]
|
|
|
pushOrderCount.value = 1
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pushOrderIds = [...ids.value]
|
|
|
pushOrderCount.value = ids.value.length
|
|
|
}
|
|
|
|
|
|
// 如果没有选中任何账单,提示用户
|
|
|
- if(pushOrderCount.value <= 0){
|
|
|
- message.warning("请先勾选需要推送的长者账单!")
|
|
|
+ if (pushOrderCount.value <= 0) {
|
|
|
+ message.warning('请先勾选需要推送的长者账单!')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -647,14 +721,14 @@ const handlePushOrder = (item) => {
|
|
|
|
|
|
// 确认推送账单
|
|
|
const confirmPushOrder = async () => {
|
|
|
- if(pushOrderLoading.value) return
|
|
|
+ if (pushOrderLoading.value) return
|
|
|
|
|
|
pushOrderLoading.value = true
|
|
|
try {
|
|
|
const res = await pushOrder(pushOrderIds)
|
|
|
- console.log("推送结果:",res)
|
|
|
+ console.log('推送结果:', res)
|
|
|
// 显示推送结果
|
|
|
- if(res){
|
|
|
+ if (res) {
|
|
|
pushOrderResult.value = {
|
|
|
success: true,
|
|
|
message: res.toString()
|
|
|
@@ -663,7 +737,7 @@ const confirmPushOrder = async () => {
|
|
|
} else {
|
|
|
pushOrderResult.value = {
|
|
|
success: false,
|
|
|
- message: "推送失败!"
|
|
|
+ message: '推送失败!'
|
|
|
}
|
|
|
}
|
|
|
} catch (error) {
|
|
|
@@ -674,11 +748,8 @@ const confirmPushOrder = async () => {
|
|
|
} finally {
|
|
|
pushOrderLoading.value = false
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
const handleBack = (item) => {
|
|
|
ElMessageBox.confirm('是否要撤销该账单', '提示', {
|
|
|
confirmButtonText: '确 认',
|
|
|
@@ -686,8 +757,8 @@ const handleBack = (item) => {
|
|
|
})
|
|
|
.then(async () => {
|
|
|
const res = await cancelPayment(item.id)
|
|
|
- if(res){
|
|
|
- message.success("撤销成功")
|
|
|
+ if (res) {
|
|
|
+ message.success('撤销成功')
|
|
|
getList()
|
|
|
}
|
|
|
})
|
|
|
@@ -696,7 +767,7 @@ const handleBack = (item) => {
|
|
|
|
|
|
const billGeneratorRef = ref()
|
|
|
const handleGenerator = () => {
|
|
|
- if(queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1){
|
|
|
+ if (queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1) {
|
|
|
message.error('新增只能选择一个机构')
|
|
|
return
|
|
|
}
|
|
|
@@ -709,7 +780,7 @@ const handleSelectionChange = (val) => {
|
|
|
}
|
|
|
|
|
|
const handleClosed = () => {
|
|
|
- if(formLoading.value){
|
|
|
+ if (formLoading.value) {
|
|
|
return
|
|
|
}
|
|
|
batchParams.value.billingMonth = ''
|
|
|
@@ -717,8 +788,6 @@ const handleClosed = () => {
|
|
|
batchVisible.value = false
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/** 导出批量生成详细数据 */
|
|
|
const exportBatchDetails = async () => {
|
|
|
try {
|
|
|
@@ -730,9 +799,14 @@ const exportBatchDetails = async () => {
|
|
|
const list = batchResult.value.details
|
|
|
const headers = [
|
|
|
{ key: 'elderName', title: '长者姓名' },
|
|
|
- { key: 'message', title: '结果信息' },
|
|
|
+ { key: 'message', title: '结果信息' }
|
|
|
]
|
|
|
- exportWithCustomHeaders(list, headers, `批量生成账单详细数据${formatToDateTime()}.xlsx`, '详细数据')
|
|
|
+ exportWithCustomHeaders(
|
|
|
+ list,
|
|
|
+ headers,
|
|
|
+ `批量生成账单详细数据${formatToDateTime()}.xlsx`,
|
|
|
+ '详细数据'
|
|
|
+ )
|
|
|
} catch (error) {
|
|
|
console.error('导出失败:', error)
|
|
|
message.error('导出失败!')
|
|
|
@@ -740,95 +814,94 @@ const exportBatchDetails = async () => {
|
|
|
}
|
|
|
|
|
|
const submitForm = async () => {
|
|
|
- if(formLoading.value){
|
|
|
+ if (formLoading.value) {
|
|
|
return
|
|
|
}
|
|
|
formLoading.value = true
|
|
|
- try{
|
|
|
- if(queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1){
|
|
|
+ try {
|
|
|
+ if (queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1) {
|
|
|
message.error('新增只能选择一个机构')
|
|
|
return
|
|
|
}
|
|
|
const res = await batchGenerateExpenseBill(batchParams.value)
|
|
|
if (res) {
|
|
|
- //开始轮询
|
|
|
- await pollTaskStatus(res.taskId)
|
|
|
- // const taskBill = await batchGenerateExpenseBillTask(res.taskId)
|
|
|
- // console.log("收到taskBill:",taskBill)
|
|
|
- // if(taskBill){
|
|
|
+ //开始轮询
|
|
|
+ await pollTaskStatus(res.taskId)
|
|
|
+ // const taskBill = await batchGenerateExpenseBillTask(res.taskId)
|
|
|
+ // console.log("收到taskBill:",taskBill)
|
|
|
+ // if(taskBill){
|
|
|
|
|
|
- // }
|
|
|
+ // }
|
|
|
// message.success("操作成功")
|
|
|
// getList()
|
|
|
// batchVisible.value = false
|
|
|
- }else {
|
|
|
- message.error("批量生成失败!")
|
|
|
+ } else {
|
|
|
+ message.error('批量生成失败!')
|
|
|
}
|
|
|
- }catch(err){
|
|
|
- message.error("批量生成异常"+err.toString())
|
|
|
- console.log("err", err)
|
|
|
- setTimeout(()=>{
|
|
|
+ } catch (err) {
|
|
|
+ message.error('批量生成异常' + err.toString())
|
|
|
+ console.log('err', err)
|
|
|
+ setTimeout(() => {
|
|
|
formLoading.value = false
|
|
|
- },500)
|
|
|
- }finally{
|
|
|
-
|
|
|
+ }, 500)
|
|
|
+ } finally {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 轮询函数
|
|
|
const pollTaskStatus = async (taskId: string) => {
|
|
|
- const pollInterval = 6000; // 3秒轮询间隔
|
|
|
+ const pollInterval = 6000 // 3秒轮询间隔
|
|
|
|
|
|
const checkStatus = async () => {
|
|
|
try {
|
|
|
- const res = await batchGenerateExpenseBillTask(taskId);
|
|
|
- console.log("轮询结果:", res);
|
|
|
+ const res = await batchGenerateExpenseBillTask(taskId)
|
|
|
+ console.log('轮询结果:', res)
|
|
|
|
|
|
if (res.status === 'COMPLETED') {
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
formLoading.value = false
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
// 生成完成,显示结果
|
|
|
batchResult.value = res
|
|
|
- message.success("批量生成完成!")
|
|
|
+ message.success('批量生成完成!')
|
|
|
clearTimeout(timeoutId)
|
|
|
} else if (res.status === 'FAILED') {
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
formLoading.value = false
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
// 生成失败,显示结果
|
|
|
batchResult.value = res
|
|
|
- message.error("批量生成失败!")
|
|
|
+ message.error('批量生成失败!')
|
|
|
clearTimeout(timeoutId)
|
|
|
} else if (res.status === 'PROCESSING') {
|
|
|
// 继续轮询
|
|
|
- timeoutId = setTimeout(checkStatus, pollInterval);
|
|
|
+ timeoutId = setTimeout(checkStatus, pollInterval)
|
|
|
}
|
|
|
-
|
|
|
} catch (error) {
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
formLoading.value = false
|
|
|
- },500)
|
|
|
- console.error('轮询请求失败:', error);
|
|
|
- message.error("轮询请求超时或失败")
|
|
|
+ }, 500)
|
|
|
+ console.error('轮询请求失败:', error)
|
|
|
+ message.error('轮询请求超时或失败')
|
|
|
clearTimeout(timeoutId)
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
try {
|
|
|
- if(batchResult.value && batchResult.value.details && batchResult.value.details.length>0){
|
|
|
- batchResult.value.details.map((e)=>{
|
|
|
+ if (
|
|
|
+ batchResult.value &&
|
|
|
+ batchResult.value.details &&
|
|
|
+ batchResult.value.details.length > 0
|
|
|
+ ) {
|
|
|
+ batchResult.value.details.map((e) => {
|
|
|
e.isQuery = false
|
|
|
})
|
|
|
}
|
|
|
- }catch (_){}
|
|
|
-
|
|
|
+ } catch (_) {}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
// 开始首次检查
|
|
|
- timeoutId = setTimeout(checkStatus, pollInterval);
|
|
|
-};
|
|
|
-
|
|
|
+ timeoutId = setTimeout(checkStatus, pollInterval)
|
|
|
+}
|
|
|
|
|
|
// 供养批量缴费
|
|
|
const handleSelfFundedPay = () => {
|
|
|
@@ -876,11 +949,11 @@ const handleBatch = () => {
|
|
|
|
|
|
// 导出excel
|
|
|
const handleExport = async () => {
|
|
|
- if(queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1){
|
|
|
+ if (queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1) {
|
|
|
message.error('只能选择一个机构')
|
|
|
return
|
|
|
}
|
|
|
- try{
|
|
|
+ try {
|
|
|
exportLoading.value = true
|
|
|
const res = await exportExpenseOrderExcel({
|
|
|
...queryParams,
|
|
|
@@ -889,26 +962,28 @@ const handleExport = async () => {
|
|
|
tenantId: queryParams.tenantIds[0]
|
|
|
})
|
|
|
download.excel(res, `账单缴费${dayjs(new Date()).format('YYYY-MM-DD')}`)
|
|
|
- }finally{
|
|
|
+ } finally {
|
|
|
exportLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-watch(()=>billStore.getBillKey, ()=>{
|
|
|
- getList()
|
|
|
-})
|
|
|
+watch(
|
|
|
+ () => billStore.getBillKey,
|
|
|
+ () => {
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+)
|
|
|
|
|
|
const route = useRoute()
|
|
|
/** 初始化 **/
|
|
|
onMounted(() => {
|
|
|
- if(route.query && route.query.elderName){
|
|
|
+ if (route.query && route.query.elderName) {
|
|
|
queryParams.elderName = route.query.elderName as string
|
|
|
}
|
|
|
getList()
|
|
|
})
|
|
|
|
|
|
-onUnmounted(()=>{
|
|
|
+onUnmounted(() => {
|
|
|
clearTimeout(timeoutId)
|
|
|
})
|
|
|
-
|
|
|
</script>
|