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

Merge branch 'master' of http://47.107.245.0:3000/xiongxing/kyj-yanglao-web-new

unknown пре 4 месеци
родитељ
комит
d41ad4e747

+ 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
+  })
+}

+ 65 - 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,43 @@ 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 = () => {
+  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 // 重置结果状态

+ 22 - 0
src/views/system/food/CateringPlan/index.vue

@@ -69,6 +69,7 @@
         <Icon icon="ep:delete" class="mr-5px" />
         复制计划
       </el-button>
+      <!-- <el-button type="success" @click="openImport"><Icon icon="ep:download" class="mr-5px" />导入</el-button> -->
     </div>
 
     <el-table
@@ -163,6 +164,8 @@
 
   <AddForm ref="addFoodRef" @success="getList" />
   <DetailsForm ref="foodDetailsForm" @success="getList" />
+  <!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
+  <Import ref="importRef" :config="importConfig" @success="getList" />
 </template>
 
 <script setup lang="ts">
@@ -172,6 +175,7 @@ import AddForm from '@/views/system/food/CateringPlan/AddForm.vue'
 import DetailsForm from '@/views/system/food/CateringPlan/DetailsForm.vue'
 import { chargeCategoryDel } from '@/api/elderly/fee/chargeCategory'
 import {cateringPlanDelete, getCateringPlanPage, getListRestaurant} from "@/api/system/foods";
+import Import from '@/components/ImportFile/index.vue'
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 
@@ -367,6 +371,24 @@ const cancelDelete = async (id: number) => {
   } catch {}
 }
 
+// 导入(复用 ImportFile 组件)
+const importRef = ref()
+const importConfig = reactive({
+  title: '餐饮计划导入',
+  // TODO: 替换成你的真实导入接口
+  importUrl: '/materialInfo/import',
+  excelTempName: '餐饮计划导入模板',
+  // TODO: 替换成你的真实模板下载接口
+  downloadUrl: '/materialInfo/downloadExcel',
+  desc: '餐饮计划',
+  // TODO: 如果后端支持失败信息导出,填真实接口;不支持可留空
+  failExportUrl: '',
+})
+
+const openImport = () => {
+  importRef.value?.open?.()
+}
+
 /** 初始化 **/
 onMounted(() => {
   getList()