소스 검색

Merge branch 'dev' of http://39.101.143.165:8090/dong_k/tenant-Platform into dev

祁鹏飞 2 달 전
부모
커밋
89098621f4
3개의 변경된 파일63개의 추가작업 그리고 19개의 파일을 삭제
  1. 9 9
      src/views/insurancePolicy/modules/Equities.vue
  2. 0 1
      src/views/receivable/handingFee/invoiceRecord.vue
  3. 54 9
      src/views/receivable/handingFee/ticket.vue

+ 9 - 9
src/views/insurancePolicy/modules/Equities.vue

@@ -33,7 +33,7 @@
               <div class="flex f-c a-c benefit">
                 <div class="benefitList flex f-c">
                   <span class="item " v-for="(item, index) in benefitPackageList"
-                    :class="{ 'active': item.rightsId == selectedPackageDetail.rightsId }" :key="item.rightsId"
+                    :class="{ 'active': item.id == selectedPackageDetail.id }" :key="item.id"
                     @click="rightsDetails(item, index)">{{
                       item.equityPackageName }}</span>
                 </div>
@@ -41,7 +41,7 @@
                   v-model:page-size="pageInfo.pageSize" :page-sizes="pageInfo.sizes" layout="prev,pager,next,total"
                   :total="pageInfo.total" />
               </div>
-              <div class="benefitDetails" v-if="selectedPackageDetail.rightsId">
+              <div class="benefitDetails" v-if="selectedPackageDetail.id">
                 <div class="header">
                   <span class="title">套餐明细</span>
                   <div class="configuration flex a-c j-s ">
@@ -67,7 +67,7 @@
                   <div class="Details-list">
                     <div class="view flex a-c  " v-for="item in selectedPackageDetail.rightsDetailsList">
                       <div class="item">{{ item.rightsName }}</div>
-                      <div class="item">¥{{ item.settlePrice }}元</div>
+                      <div class="item">¥{{ item.contractRate }}元</div>
                     </div>
                   </div>
                 </div>
@@ -78,17 +78,17 @@
             <!-- 权益单品 -->
             <el-table :data="privilegeItem" style="width: 100%" max-height="300px" overflow="auto">
               <el-table-column prop="rightsName" label="权益名称" width="180" align="center" />
-              <el-table-column prop="settlePrice" label="单价" width="180" align="center" />
+              <el-table-column prop="contractRate" label="单价" width="180" align="center" />
               <el-table-column prop="rightsCount" label="发放数量" align="center">
                 <template #default="scope">
                   <el-input-number size="small" :model-value="scope.row.rightsCount"
-                    @update:model-value="val => onRightsCountChange(val, scope.$index, 'privilegeItem', 'settlePrice')"
+                    @update:model-value="val => onRightsCountChange(val, scope.$index, 'privilegeItem', 'contractRate')"
                     :min="0" />
                 </template>
               </el-table-column>
               <el-table-column prop="totalsum" label="总价" align="center">
                 <template #default="scope">
-                  <span>{{ scope.row.settlePrice * scope.row.rightsCount }}</span>
+                  <span>{{ scope.row.contractRate * scope.row.rightsCount }}</span>
                 </template>
               </el-table-column>
             </el-table>
@@ -116,7 +116,7 @@
                 </div>
                 <div class="mt-5 flex a-c j-s">
                   <span v-if="item.totalNumber">数量:{{ item.totalNumber }}张</span>
-                  <span>价格:{{ item.packagePrice || item.settlePrice }}元</span>
+                  <span>价格:{{ item.packagePrice || item.contractRate }}元</span>
                   <el-icon @click="removeSelectedRight(item)">
                     <Delete />
                   </el-icon>
@@ -201,7 +201,7 @@ const totalPriceCount = computed(() => {
   // 计算权益单品的总价
   const itemTotal = privilegeItem.value?.reduce((sum: Decimal, item: any) => {
     if (item.rightsCount > 0) {
-      const itemTotal = new Decimal(item.settlePrice || 0).times(new Decimal(item.rightsCount || 0));
+      const itemTotal = new Decimal(item.contractRate || 0).times(new Decimal(item.rightsCount || 0));
       return sum.plus(itemTotal);
     }
     return sum;
@@ -320,7 +320,7 @@ const rightsDetails = async (item: any, index: any) => {
   selectedPackageDetail.value = item;
   benefitPackageIndex.value = index;
   try {
-    const response = await api.additionalApi.rightsGrant(item.rightsId);
+    const response = await api.additionalApi.rightsGrant(item.id);
     selectedPackageDetail.value.rightsDetailsList = response.data || {};
   } catch (error) {
     console.error('获取权益套餐详情失败:', error);

+ 0 - 1
src/views/receivable/handingFee/invoiceRecord.vue

@@ -80,7 +80,6 @@
           </el-popover>
         </template>
       </el-table-column>
-      <el-table-column prop="paymentReason" label="差额原因" width="120"></el-table-column>
       <el-table-column prop="taxPoint" label="税点" width="120"></el-table-column>
       <el-table-column prop="receivableSupervisePremium" label="开票金额" width="120"></el-table-column>
       <el-table-column prop="settlementStatus" label="结算状态" width="120">

+ 54 - 9
src/views/receivable/handingFee/ticket.vue

@@ -68,7 +68,8 @@
       <p>应收明细</p>
       <el-button type="primary" @click="addTicket">添加应收</el-button>
     </div>
-    <el-table :data="tableData" style="height: calc(100% - 300px)">
+    <el-table :data="tableData" style="height: calc(100% - 300px)" show-summary
+    :summary-method="val => getSummaries(val,['jqPremium','jqSuperviseCostsProportion','syPremium','sySuperviseCostsProportion','receivableAmount','receivableAmount4Car','receivableAmount4Other'])">
       <template #empty>
         <div v-if="noData">暂无应收,点击<el-button link type="primary" @click="batchShow = true">导入应收</el-button></div>
         <div v-else>没有符合的应收单据~</div>
@@ -87,13 +88,9 @@
       <el-table-column prop="jqSuperviseCostsProportion" label="交强险手续费比例"></el-table-column>
       <el-table-column prop="syPremium" label="商业险保费"></el-table-column>
       <el-table-column prop="sySuperviseCostsProportion" label="商业险手续费比例"></el-table-column>
-      <el-table-column label="应收金额">
-        <template #default="scope">
-          {{ scope.row.productId === '0330' || scope.row.productId === '0330034002' || scope.row.productId ===
-            '034002' ? scope.row.jqSuperviseCostsPremiums : scope.row.productId === '034001' || scope.row.productId ===
-              '0330034001' ? scope.row.sySuperviseCostsPremiums : '' }}
-        </template>
-      </el-table-column>
+      <el-table-column prop="receivableAmount" label="总应收"></el-table-column>
+      <el-table-column v-if="route.query.invoiceType == '1'" prop="receivableAmount4Car" label="车险应收"></el-table-column>
+      <el-table-column v-if="route.query.invoiceType == '3'" prop="receivableAmount4Other" label="非车险应收"></el-table-column>
     </el-table>
     <div class="footer">
       <el-button plain @click="handleBack">取消</el-button>
@@ -561,7 +558,55 @@ const handleTicket = (bool) => {
     }
   })
 }
-
+const getSummaries = (param, list) => {
+  console.log(param)
+  const { columns, data } = param
+  const sums: (string | VNode)[] = []
+  // 指定需要计算的字段列表(可根据需求添加字段名)
+  const specifiedFields = list || [] // 替换为您需要的字段名
+
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = h('div', { style: { textDecoration: 'underline' } }, [
+        '',
+      ])
+      return
+    }
+    // 计算数字类型字段和指定字段
+    const values = data.map((item) => {
+      const val = item[column.property]
+      // 排除空值
+      if (val === '' || val === null || val === undefined) {
+        return NaN
+      }
+      // 如果是数字类型,直接参与计算
+      if (typeof val === 'number') {
+        return val
+      }
+      // 如果字段在指定列表中,尝试转换为数字
+      if (specifiedFields.includes(column.property)) {
+        const num = Number(val)
+        return Number.isNaN(num) ? NaN : num
+      }
+      // 其他情况不参与计算
+      return NaN
+    })
+    if (!values.every((value) => Number.isNaN(value))) {
+      const total = values.reduce((prev, curr) => {
+        if (!Number.isNaN(curr)) {
+          return prev + curr
+        } else {
+          return prev
+        }
+      }, 0)
+      // 保留五位小数
+      sums[index] = ` ${total.toFixed(5)}`
+    } else {
+      sums[index] = '-'
+    }
+  })
+  return sums
+}
 const receivableSupervisePremium = ref(0)
 const calBeforeInvoice = async (params: any) => {
   const res = await api.financeApi.calBeforeInvoice(params)