|
@@ -0,0 +1,237 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ContentWrap>
|
|
|
|
|
+ <!-- 搜索工作栏 -->
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ class="-mb-15px"
|
|
|
|
|
+ :model="queryParams"
|
|
|
|
|
+ ref="queryFormRef"
|
|
|
|
|
+ :inline="true"
|
|
|
|
|
+ label-width="100px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <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-form-item>
|
|
|
|
|
+ <el-form-item label="缴费单号" prop="elderName">
|
|
|
|
|
+ <el-input @keyup.enter="handleQuery" v-model="queryParams.orderNumber" placeholder="请输入缴费单号" class="!w-240px" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="账单归属月" prop="billingMonth">
|
|
|
|
|
+ <TgDatePicker v-model="queryParams.billingMonth" type="month" class="!w-240px" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="使用状态" prop="subsidyDestination">
|
|
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择" class="!w-240px">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(dict, index) in [{value: 0, label: '未抵扣'}, {value: 1, label: '已抵扣'}]"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+<!-- <el-form-item label="补贴状态" prop="status">-->
|
|
|
|
|
+<!-- <el-select v-model="queryParams.status" placeholder="请选择" class="!w-240px">-->
|
|
|
|
|
+<!-- <el-option-->
|
|
|
|
|
+<!-- v-for="(dict, index) in getStrDictOptions(DICT_TYPE.COMMON_STATUS2)"-->
|
|
|
|
|
+<!-- :key="index"-->
|
|
|
|
|
+<!-- :label="dict.label"-->
|
|
|
|
|
+<!-- :value="dict.value"-->
|
|
|
|
|
+<!-- />-->
|
|
|
|
|
+<!-- </el-select>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
|
|
|
+ <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </ContentWrap>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
|
+ <ContentWrap>
|
|
|
|
|
+ <TabBarBtn @add="openForm()" @import="handleImport" @export="handleExport"/>
|
|
|
|
|
+
|
|
|
|
|
+ <Table2
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ :columns="expenseAllowanceColumn"
|
|
|
|
|
+ :queryParams="queryParams"
|
|
|
|
|
+ :opWidth="270"
|
|
|
|
|
+ :showEditCondition="showEditCondition"
|
|
|
|
|
+ @edit="openForm"
|
|
|
|
|
+ @del="h_delete"
|
|
|
|
|
+ @detail="(arg) => openForm(arg, true)"
|
|
|
|
|
+ >
|
|
|
|
|
+<!-- <template #pre="scope">-->
|
|
|
|
|
+<!-- <el-button-->
|
|
|
|
|
+<!-- link-->
|
|
|
|
|
+<!-- type="primary"-->
|
|
|
|
|
+<!-- @click="handleOpenDetails(scope.scope)"-->
|
|
|
|
|
+<!-- v-hasPermi="['consumption-coupon:details']"-->
|
|
|
|
|
+<!-- >-->
|
|
|
|
|
+<!-- 明细-->
|
|
|
|
|
+<!-- </el-button>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+ </Table2>
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <Pagination
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ v-model:page="queryParams.pageNo"
|
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
|
+ @pagination="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+ </ContentWrap>
|
|
|
|
|
+
|
|
|
|
|
+ <Form ref="formRef" @success="getList" />
|
|
|
|
|
+ <Details ref="detailsRef" />
|
|
|
|
|
+
|
|
|
|
|
+ <Import
|
|
|
|
|
+ ref="importRef"
|
|
|
|
|
+ @success="getList"
|
|
|
|
|
+ :config="{
|
|
|
|
|
+ title: '导入',
|
|
|
|
|
+ downloadUrl: '/elderly/expenseSubsidy/downloadExpenseSubsidyExcel',
|
|
|
|
|
+ excelTempName: '长护险导入模板',
|
|
|
|
|
+ importUrl: '/elderly/expenseSubsidy/importExpenseSubsidy',
|
|
|
|
|
+ failExportUrl: ''
|
|
|
|
|
+ }"
|
|
|
|
|
+ />
|
|
|
|
|
+</template>
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
+import {expenseSubsidyDelete, getExpenseSubsidyPage} from '@/api/elderly/fee/expense-allowance'
|
|
|
|
|
+import { expenseAllowanceColumn } from './column'
|
|
|
|
|
+import Form from './Form.vue'
|
|
|
|
|
+import Details from './Details.vue'
|
|
|
|
|
+import Import from "@/components/ImportFile/index.vue";
|
|
|
|
|
+import { useUserStore } from '@/store/modules/user'
|
|
|
|
|
+import {ElMessageBox} from "element-plus";
|
|
|
|
|
+import {exportWithCustomHeaders} from "@/utils/excel-export";
|
|
|
|
|
+import {formatToDateTime} from "@/utils/dateUtil";
|
|
|
|
|
+import {
|
|
|
|
|
+ consumerVouchersDelete,
|
|
|
|
|
+ getConsumerVouchersPage
|
|
|
|
|
+} from "@/api/elderly/fee/consumpotion-coupon";
|
|
|
|
|
+defineOptions({ name: 'ExpenseAllowance' })
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
|
|
+const { t } = useI18n() // 国际化
|
|
|
|
|
+
|
|
|
|
|
+const loading = ref(true) // 列表的加载中
|
|
|
|
|
+const total = ref(0) // 列表的总页数
|
|
|
|
|
+const list = ref([]) // 列表的数据
|
|
|
|
|
+const queryParams = reactive({
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ elderName: undefined,
|
|
|
|
|
+ billingMonth: undefined,
|
|
|
|
|
+ status: undefined,
|
|
|
|
|
+ orderNumber: undefined,
|
|
|
|
|
+ tenantIds: userStore.orgTenantId
|
|
|
|
|
+})
|
|
|
|
|
+const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
+
|
|
|
|
|
+/** 查询列表 */
|
|
|
|
|
+const getList = async () => {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ try {
|
|
|
|
|
+ const data = await getConsumerVouchersPage(queryParams)
|
|
|
|
|
+ list.value = data.list
|
|
|
|
|
+ total.value = data.total
|
|
|
|
|
+ return list.value
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 搜索按钮操作 */
|
|
|
|
|
+const handleQuery = async () => {
|
|
|
|
|
+ if (!queryFormRef.value) return
|
|
|
|
|
+ const valid = await queryFormRef.value.validate()
|
|
|
|
|
+ if (!valid) return
|
|
|
|
|
+ queryParams.pageNo = 1
|
|
|
|
|
+ queryParams.status=undefined
|
|
|
|
|
+ getList()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 重置按钮操作 */
|
|
|
|
|
+const resetQuery = () => {
|
|
|
|
|
+ queryFormRef.value.resetFields()
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//删除
|
|
|
|
|
+const h_delete = (id) =>{
|
|
|
|
|
+ ElMessageBox.confirm('确定要删除该消费券?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确 认',
|
|
|
|
|
+ cancelButtonText: '取 消'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(async () => {
|
|
|
|
|
+ const res = await consumerVouchersDelete(id)
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ message.success("删除成功")
|
|
|
|
|
+ await getList()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((_) =>{})
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 添加/修改操作 */
|
|
|
|
|
+const formRef = ref()
|
|
|
|
|
+const openForm = (row: any = {}, isDetail: boolean = false) => {
|
|
|
|
|
+ if(queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1 && !row.tenantId){
|
|
|
|
|
+ message.error('新增只能选择一个机构')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ formRef.value.open(row.tenantId || queryParams.tenantIds[0], row.id, isDetail)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const detailsRef = ref()
|
|
|
|
|
+const handleOpenDetails = (row) => {
|
|
|
|
|
+ detailsRef.value.open(row.id)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const showEditCondition = (row) => {
|
|
|
|
|
+ return row.status == 0
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 用户导入 */
|
|
|
|
|
+const importRef = ref()
|
|
|
|
|
+const handleImport = () => {
|
|
|
|
|
+ importRef.value.open()
|
|
|
|
|
+}
|
|
|
|
|
+//导出
|
|
|
|
|
+const handleExport = async ()=>{
|
|
|
|
|
+ if(loading.value){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ queryParams.pageSize = 10000
|
|
|
|
|
+ const list = await getList()
|
|
|
|
|
+ if (list.length <= 0) {
|
|
|
|
|
+ message.error('暂无数据可以导出!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const headers = [
|
|
|
|
|
+ { key: 'elderName', title: '长者姓名' },
|
|
|
|
|
+ { key: 'month', title: '所属月份' },
|
|
|
|
|
+ { key: 'subsidyDestination', title: '补贴去向(1线下返还,2账单抵扣)' },
|
|
|
|
|
+ { key: 'status', title: '使用状态(1已抵扣,0未抵扣)' },
|
|
|
|
|
+ { key: 'amount', title: '补贴金额' },
|
|
|
|
|
+ { key: 'deductionBillMonth', title: '抵扣账单月' },
|
|
|
|
|
+ { key: 'remarks', title: '备注' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ exportWithCustomHeaders(list, headers, `长护险-${formatToDateTime()}.xlsx`, '长护险补贴')
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ message.error('暂无数据可以导出!')
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ }finally {
|
|
|
|
|
+ queryParams.pageSize = 10
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+/** 初始化 **/
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ getList()
|
|
|
|
|
+})
|
|
|
|
|
+</script>
|