yxh
2 天以前 484b1f3e41a561e438ce4cdbec0e09958c932767
统计分析
已修改7个文件
已添加2个文件
1380 ■■■■■ 文件已修改
src/api/project/casePanorama.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/project/statistics.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/components/fundsummary/index.vue 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/fundstatistics/index.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/statistics/applyStatistics/index.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/statistics/casePanorama/index.vue 374 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/statistics/caseStatistics/index.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/statistics/chargeStatistics/index.vue 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/statistics/performanceStaristics/index.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/project/casePanorama.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
import request from '@/utils/request'
// æŸ¥è¯¢æ¡ˆä¾‹å…¨æ™¯
export function listCasePanorama(query) {
  return request({
    url: '/project/casePanorama/list',
    method: 'get',
    params: query
  })
}
// å¯¼å‡ºæ¡ˆä¾‹å…¨æ™¯
export function exportCasePanorama(query) {
  return request({
    url: '/project/casePanorama/export',
    method: 'get',
    params: query
  })
}
// ä¸šåŠ¡ç»„ä¸‹æ‹‰é€‰é¡¹
export function getCasePanoramaDeptOptions() {
  return request({
    url: '/project/casePanorama/deptOptions',
    method: 'get'
  })
}
src/api/project/statistics.js
@@ -16,6 +16,14 @@
    params: query
  })
}
// å¯¼å‡ºæ¡ˆä¾‹ç»Ÿè®¡ï¼ˆæŒ‰ä¸šåŠ¡ç»„ï¼‰
export function exportCaseDeptStatistics(query) {
  return request({
    url: '/project/spstatcase/exportDept',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç»©æ•ˆç»Ÿè®¡
export function listjixstatistics(query) {
    return request({
@@ -28,6 +36,14 @@
export function exportPerformanceStatistics(query) {
    return request({
      url: '/project/funddetail/exportBonus',
      method: 'get',
      params: query
    })
  }
  // å¯¼å‡ºç»©æ•ˆç»Ÿè®¡ï¼ˆæŒ‰ä¸šåŠ¡ç»„ï¼‰
export function exportPerformanceDeptStatistics(query) {
    return request({
      url: '/project/funddetail/exportBonusDept',
      method: 'get',
      params: query
    })
@@ -48,6 +64,14 @@
      params: query
    })
  }
  // å¯¼å‡ºè´¹ç”¨ç»Ÿè®¡ï¼ˆæŒ‰ä¸šåŠ¡ç»„ï¼‰
export function exportExpenseDeptStatistics(query) {
    return request({
      url: '/project/spstatexpense/exportDept',
      method: 'get',
      params: query
    })
  }
  // æŸ¥è¯¢æ”¶è´¹ç»Ÿè®¡
export function listsfeistatistics(query) {
    return request({
@@ -55,4 +79,12 @@
      method: 'post',
      data: query
    })
  }
  // å¯¼å‡ºæ”¶æ¬¾ç»Ÿè®¡
export function exportChargeStatistics(query) {
    return request({
      url: '/project/donorchargeorgan/exportChange',
      method: 'get',
      params: query
    })
  }
src/views/project/components/fundsummary/index.vue
@@ -1,8 +1,18 @@
<!--  -->
<template>
  <div class="app-container" :donorno="donorno">
    <el-alert
      v-if="noCostData"
      title="该案例暂无成本数据"
      type="info"
      :closable="false"
      show-icon
      style="margin-bottom: 10px"
    />
    <el-table
      v-loading="costLoading"
      border
      class="table-bordered"
      :data="fundList"
      :span-method="objectSpanMethod"
      label-width="96px"
@@ -622,19 +632,22 @@
      organMedicineSupportCostRowIndex: 0,
      //器官获取手术成本合并行数
      organMedicineSupportCostRowSpan: 0,
      curdorno: null,
      // æˆæœ¬æ˜Žç»†åŠ è½½ä¸­
      costLoading: false,
      // å½“前案例是否没有成本数据
      noCostData: false,
    };
  },
  //监听属性 ç±»ä¼¼äºŽdata概念
  computed: {},
  //监控data中的数据变化
  watch: {
    //监听donorno发生改变时触发
    curdorno(newVal) {
      this.curdorno = newVal;
      //alert(this.donorno);
      //console.log("监听到捐献编号变化" + this.curdorno);
      this.getCostData(this.curdorno);
    // ç›‘听案例 ID å˜åŒ–,立即加载成本明细
    donorno: {
      immediate: true,
      handler(val) {
        this.getCostData(val);
      },
    },
  },
  //方法集合
@@ -911,55 +924,65 @@
    //调用接口获取成本数据
    getCostData(donorno) {
      getDonationCost(donorno).then((res) => {
        if (res.code == 200) {
          let resList = res.data;
          var arr = [];
          for (var i in resList) {
            arr.push(resList[i]);
      if (donorno === null || donorno === undefined || donorno === "") {
        this.costLoading = false;
        this.noCostData = false;
        return;
      }
      this.costLoading = true;
      this.noCostData = false;
      this.resetCostAmounts();
      getDonationCost(donorno)
        .then((res) => {
          if (res.code == 200) {
            const data = res.data || {};
            const before = [];
            for (let i = 1; i <= 52; i++) {
              before.push(data["fy" + i]);
            }
            before.push(data.fyhj);
            const after = [];
            for (let i = 1; i <= 52; i++) {
              after.push(data["sh" + i]);
            }
            after.push(data.shhj);
            let hasData = false;
            before.forEach((value, index) => {
              const num = Number(value);
              if (!Number.isNaN(num) && num !== 0) {
                this.fundList[index].amount = num.toFixed(2);
                hasData = true;
              }
            });
            after.forEach((value, index) => {
              const num = Number(value);
              if (!Number.isNaN(num) && num !== 0) {
                this.fundList[index].amounted = num.toFixed(2);
                hasData = true;
              }
            });
            this.noCostData = !hasData;
          } else {
            this.$modal.msgError(res.msg || "获取成本明细失败");
          }
          let arr1 = arr.slice(0, 53);
          arr1.forEach((item, i) => {
            if (item !== 0) {
              this.fundList[i].amount = item.toFixed(2);
            }
          });
          arr1 = arr.slice(53, 106);
          arr1.forEach((item, i) => {
            if (item !== 0) {
              this.fundList[i].amounted = item.toFixed(2);
            }
          });
          // this.fundList = resList
          // for (let i = 0; i < resList.length; i++) {
          //   let itemIndex = this.fundList.findIndex(
          //     (item) => resList[i].itemname == item.itemname
          //   );
          //   console.log(itemIndex);
          //   if (itemIndex > -1) {
          //     if(resList[i].amount != "0.00"){
          //       this.fundList[itemIndex].amount =
          //       resList[i].amount;
          //     }else{
          //       this.fundList[itemIndex].amount =
          //       ""
          //     }
          //   }
          // }
        }
          this.costLoading = false;
        })
        .catch(() => {
          this.costLoading = false;
          this.$modal.msgError("获取成本明细失败");
        });
    },
    resetCostAmounts() {
      this.fundList.forEach((item) => {
        item.amount = "";
        item.amounted = "";
      });
    },
  },
  //生命周期 - åˆ›å»ºå®Œæˆï¼ˆå¯ä»¥è®¿é—®å½“前this实例)
  created() {
    this.calculateRowSpanConfig();
  },
  //生命周期 - æŒ‚载完成(可以访问DOM元素)
  mounted() {
    this.curdorno = this.donorno;
  },
  beforeCreate() {}, //生命周期 - åˆ›å»ºä¹‹å‰
  beforeMount() {}, //生命周期 - æŒ‚载之前
src/views/project/fundstatistics/index.vue
@@ -3,162 +3,77 @@
  <div class="app-container">
    <el-col :span="24" v-if="showType == 'list'">
      <el-card shadow="never">
        <el-form
      class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true">
        <el-form class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="姓名" prop="name">
            <el-input
              v-model="queryParams.name"
              placeholder="请输入姓名"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
            <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable size="small"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item label="捐献进度" prop="recordstate">
            <el-select
              v-model="queryParams.recordstate"
              placeholder="请选择当前进度"
              clearable
              size="small"
            >
              <el-option
                v-for="dict in dict.type.sys_DonationStatus"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            <el-select v-model="queryParams.recordstate" placeholder="请选择当前进度" clearable size="small">
              <el-option v-for="dict in dict.type.sys_DonationStatus" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重置</el-button
            >
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <!-- æçŒ®æ¡ˆä¾‹åˆ—表 -->
        <el-table
          v-loading="loading"
          style="width: 1240px"
          fit
          highlight-current-row
          header-align
          border
          :data="donationCaseTableData"
        >
          <el-table-column
            label="案例时间"
            align="center"
            prop="reporttime"
            width="150"
          >
        <el-table v-loading="loading" fit highlight-current-row header-align border
          :data="donationCaseTableData">
          <el-table-column label="案例时间" align="center" prop="reporttime" width="150">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.reporttime, "{y}-{m}-{d}") }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="姓名"
            width="120"
            align="center"
            prop="name"
          />
          <el-table-column label="姓名" width="120" align="center" prop="name" />
          <el-table-column label="性别" width="120" align="center" prop="sex">
          <el-table-column label="年龄" align="center" prop="age" width="100">
            <template slot-scope="scope">
              {{
                `${
                  scope.row.age && scope.row.age !== 0
                `${scope.row.age && scope.row.age !== 0
                    ? `${scope.row.age}${scope.row.ageunit}`
                    : ""
                } ${
                  scope.row.age2 && scope.row.age2 !== 0
                  } ${scope.row.age2 && scope.row.age2 !== 0
                    ? `${scope.row.age2}${scope.row.ageunit2}`
                    : ""
                }`.trim()
                  }`.trim()
              }}
            </template>
          </el-table-column>
          <el-table-column label="性别" width="120" align="center" prop="sex">
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.sys_user_sex"
                :value="scope.row.sex"
              />
              <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
            </template>
          </el-table-column>
          <el-table-column
            label="专职人员"
            align="center"
            prop="reportername"
            width="100"
          />
          <el-table-column
            label="业务组"
            align="center"
            prop="treatmenthospitalname"
          />
          <el-table-column label="捐献进度" align="center" prop="recordstate">
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.sys_donornode"
                :value="scope.row.workflow"
              />
              <dict-tag :options="dict.type.sys_donornode" :value="scope.row.workflow" />
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            align="center"
            class-name="small-padding fixed-width"
            width="200"
            fixed="right"
          >
          </el-table-column> <el-table-column label="捐献医院"align="center" prop="
treatmenthospitalname
" />
          <el-table-column label="专职人员" align="center" prop="reportername"/>
          <el-table-column label="业务组" align="center" prop="deptname" />
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-download"
                @click="exportSummary(scope.row.id)"
                v-hasPermi="['project:fundstatistics:summaryexoprt']"
                >导出</el-button
              >
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="jumptocost(scope.row)"
                v-hasPermi="['project:fundstatistics:list']"
                >查看成本汇总</el-button
              >
              <el-button size="mini" type="text" icon="el-icon-download" @click="exportSummary(scope.row.id)"
                v-hasPermi="['project:fundstatistics:summaryexoprt']">导出</el-button>
              <el-button size="mini" type="text" icon="el-icon-edit" @click="jumptocost(scope.row)"
                v-hasPermi="['project:fundstatistics:list']">查看明细</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- hide-on-single-page -->
        <pagination
          v-show="total > 0"
          style="margin-left: 100px"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getBaseInfoList"
        />
        <pagination v-show="total > 0" style="margin-left: 100px" :total="total" :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" />
      </el-card>
    </el-col>
    <el-col :span="24" v-if="showType == 'costinfo'">
      <el-form :model="curCaseInfo" ref="infoForm" :inline="true">
        <el-row>
          <el-col :span="3">
            <el-button
              type="primary"
              icon="el-icon-back"
              @click="backDonateList"
              >捐献列表</el-button
            >
            <el-button type="primary" icon="el-icon-back" @click="backDonateList">捐献列表</el-button>
          </el-col>
          <el-form-item label="捐献编号" prop="donorno">
            <el-input v-model="curCaseInfo.donorno" disabled />
@@ -247,11 +162,10 @@
      });
    },
    jumptocost(row) {
      this.showType = "costinfo";
      this.curdonorno = row.id;
      this.curCaseInfo.donorno = row.donorno;
      this.curCaseInfo.name = row.name;
      //console.log("dononro:" + this.curdonorno);
      this.showType = "costinfo";
    },
    backDonateList() {
@@ -308,14 +222,14 @@
    this.getBaseInfoList();
  },
  //生命周期 - æŒ‚载完成(可以访问DOM元素)
  mounted() {},
  beforeCreate() {}, //生命周期 - åˆ›å»ºä¹‹å‰
  beforeMount() {}, //生命周期 - æŒ‚载之前
  beforeUpdate() {}, //生命周期 - æ›´æ–°ä¹‹å‰
  updated() {}, //生命周期 - æ›´æ–°ä¹‹åŽ
  beforeDestroy() {}, //生命周期 - é”€æ¯ä¹‹å‰
  destroyed() {}, //生命周期 - é”€æ¯å®Œæˆ
  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  mounted() { },
  beforeCreate() { }, //生命周期 - åˆ›å»ºä¹‹å‰
  beforeMount() { }, //生命周期 - æŒ‚载之前
  beforeUpdate() { }, //生命周期 - æ›´æ–°ä¹‹å‰
  updated() { }, //生命周期 - æ›´æ–°ä¹‹åŽ
  beforeDestroy() { }, //生命周期 - é”€æ¯ä¹‹å‰
  destroyed() { }, //生命周期 - é”€æ¯å®Œæˆ
  activated() { } //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style scoped>
src/views/project/statistics/applyStatistics/index.vue
@@ -24,21 +24,6 @@
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="费用类型">
            <el-select
              v-model="queryParams.paexpensetype"
              placeholder="请选择费用类型"
            >
              <el-option
                v-for="item in reportlist"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>        
        <el-col :span="6">
          <el-form-item align="left" label="报销部门" prop="padeptno">
@@ -111,39 +96,48 @@
      ></right-toolbar>
    </el-row>
    <!--<el-table v-loading="loading" border :data="donatebaseinfoList">     -->
    <el-table
      :data="jxidata"
      ref="table"
      border
      max-height="700"
      highlight-current-row
      :summary-method="getSummaries"
      show-summary
    >
      <el-table-column label="序号" align="center" prop="id" width="50" />
      <el-table-column label="统计月份" align="center" prop="applymonth" />
      <el-table-column label="业务组" align="center" prop="deptmentName" />
      <el-table-column label="专职人员" align="center" prop="username" />
      <el-table-column label="报销总金额" align="center" prop="amount" width="180" :formatter="amountFormatter" />
      <el-table-column label="专家费" align="center" prop="expertfee" width="160" :formatter="amountFormatter" />
      <el-table-column label="伦理专家费" align="center" prop="ethicalistfee" width="160" :formatter="amountFormatter" />
      <el-table-column label="医学成本" align="center" prop="medicalcost" width="160" :formatter="amountFormatter" />
      <el-table-column label="办公费" align="center" prop="officecost" width="160" :formatter="amountFormatter" />
      <el-table-column label="差旅费" align="center" prop="reimcost" width="160" :formatter="amountFormatter" />
    <el-tabs v-model="activeTab">
      <el-tab-pane label="按业务组" name="dept">
        <el-table :data="deptData" ref="deptTable" border max-height="700" highlight-current-row
          :summary-method="getDeptSummaries" show-summary>
          <el-table-column label="序号" align="center" prop="id" width="50" />
          <el-table-column label="业务组" align="center" prop="deptname" />
          <el-table-column label="报销总金额" align="center" prop="amount" width="180" :formatter="amountFormatter" />
          <el-table-column label="专家费" align="center" prop="expertfee" width="160" :formatter="amountFormatter" />
          <el-table-column label="伦理专家费" align="center" prop="ethicalistfee" width="160" :formatter="amountFormatter" />
          <el-table-column label="医学成本" align="center" prop="medicalcost" width="160" :formatter="amountFormatter" />
          <el-table-column label="办公费" align="center" prop="officecost" width="160" :formatter="amountFormatter" />
          <el-table-column label="差旅费" align="center" prop="reimcost" width="160" :formatter="amountFormatter" />
        </el-table>
      </el-tab-pane>
      <!-- <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit"
            >明细</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>
      <el-tab-pane label="按人员" name="person">
        <el-table :data="jxidata" ref="personTable" border max-height="700" highlight-current-row
          :summary-method="getSummaries" show-summary>
          <el-table-column label="序号" align="center" prop="id" width="50" />
          <el-table-column label="业务组" align="center" prop="deptmentName" />
          <el-table-column label="专职人员" align="center" prop="username" />
          <el-table-column label="报销总金额" align="center" prop="amount" width="180" :formatter="amountFormatter" />
          <el-table-column label="专家费" align="center" prop="expertfee" width="160" :formatter="amountFormatter" />
          <el-table-column label="伦理专家费" align="center" prop="ethicalistfee" width="160" :formatter="amountFormatter" />
          <el-table-column label="医学成本" align="center" prop="medicalcost" width="160" :formatter="amountFormatter" />
          <el-table-column label="办公费" align="center" prop="officecost" width="160" :formatter="amountFormatter" />
          <el-table-column label="差旅费" align="center" prop="reimcost" width="160" :formatter="amountFormatter" />
          <!-- <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit"
                >明细</el-button
              >
            </template>
          </el-table-column> -->
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <div style="margin: 10px;text-align: right;">
      <div>
        å…± <span style="color:#1890FF ;">{{ total }}</span> æ¡æ•°æ®
        å…± <span style="color:#1890FF ;">{{ tableTotal }}</span> æ¡æ•°æ®
      </div>
    </div>
@@ -160,7 +154,8 @@
  listbxiaostatistics,
  listjixstatistics,
  listanlstatistics,
  exportExpenseStatistics
  exportExpenseStatistics,
  exportExpenseDeptStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -252,6 +247,10 @@
      donatebaseinfoList: [],
      // æçŒ®åŸºç¡€è¡¨æ ¼æ•°æ®
      jxidata: [],
      // å½“前页签:dept=按业务组,person=按人员
      activeTab: "dept",
      // æŒ‰ä¸šåŠ¡ç»„èšåˆæ•°æ®
      deptData: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
@@ -282,7 +281,11 @@
    };
  },
  //监听属性 ç±»ä¼¼äºŽdata概念
  computed: {},
  computed: {
    tableTotal() {
      return this.activeTab === "dept" ? this.deptData.length : this.jxidata.length;
    }
  },
  activated() {},
  mounted() {},
@@ -341,6 +344,36 @@
        this.jxidata.forEach(($obj, $index) => {
          $obj.id = $index + 1;
        });
        this.buildDeptData();
      });
    },
    /** æŒ‰ä¸šåŠ¡ç»„èšåˆï¼š6 ä¸ªé‡‘额分别求和 */
    buildDeptData() {
      const map = new Map();
      this.jxidata.forEach(row => {
        const key = row.deptmentno || row.deptmentName || "未分组";
        if (!map.has(key)) {
          map.set(key, {
            deptname: row.deptmentName || "未分组",
            amount: 0,
            expertfee: 0,
            ethicalistfee: 0,
            medicalcost: 0,
            officecost: 0,
            reimcost: 0
          });
        }
        const item = map.get(key);
        item.amount += Number(row.amount) || 0;
        item.expertfee += Number(row.expertfee) || 0;
        item.ethicalistfee += Number(row.ethicalistfee) || 0;
        item.medicalcost += Number(row.medicalcost) || 0;
        item.officecost += Number(row.officecost) || 0;
        item.reimcost += Number(row.reimcost) || 0;
      });
      this.deptData = Array.from(map.values()).map((item, index) => {
        item.id = index + 1;
        return item;
      });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
@@ -352,11 +385,15 @@
        pauserno: this.queryParams.pauserno,
        paexpensetype: this.queryParams.paexpensetype
      };
      const exportApi =
        this.activeTab === "dept"
          ? exportExpenseDeptStatistics
          : exportExpenseStatistics;
      this.$modal
        .confirm("是否确认导出当前筛选条件下的费用统计数据?")
        .confirm("是否确认导出当前列表的费用统计数据?")
        .then(() => {
          this.exportLoading = true;
          return exportExpenseStatistics(queryParams);
          return exportApi(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
@@ -412,7 +449,7 @@
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      var columnnames = ["applymonth", "deptmentName", "username"];
      var columnnames = ["deptmentName", "username"];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
@@ -440,6 +477,26 @@
        }
      });
      return sums;
    },
    /** æŒ‰ä¸šåŠ¡ç»„è¡¨æ ¼åˆè®¡ */
    getDeptSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (column.property === "deptname") {
          return;
        }
        const total = data.reduce(
          (prev, item) => prev + (Number(item[column.property]) || 0),
          0
        );
        sums[index] = total === 0 ? "" : Number(total).toFixed(2);
      });
      return sums;
    }
  },
src/views/project/statistics/casePanorama/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,374 @@
<!-- æ¡ˆä¾‹å…¨æ™¯ -->
<template>
  <div class="app-container">
    <el-form
      class="opo-query-form"
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="65px"
    >
      <el-row :gutter="0">
        <el-col :span="5">
          <el-form-item label="捐献者" prop="donorName">
            <el-input
              v-model="queryParams.donorName"
              placeholder="请输入捐献者姓名"
              clearable
              size="small"
              style="width: 140px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="捐献日期">
            <el-date-picker
              v-model="dateRange"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
              style="width: 250px"
              @change="handleDateChange"
            />
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item label="业务组" prop="deptName">
            <el-select
              v-model="queryParams.deptName"
              placeholder="请选择业务组"
              clearable
              filterable
              style="width: 140px"
            >
              <el-option
                v-for="item in deptOptions"
                :key="item"
                :label="item"
                :value="item"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item label="人员" prop="reporterName">
            <el-input
              v-model="queryParams.reporterName"
              placeholder="请输入业务姓名"
              clearable
              size="small"
              style="width: 140px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          >导出</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <el-table
      v-loading="loading"
      :data="caseList"
      border
      class="table-bordered"
      max-height="700"
      highlight-current-row
      :summary-method="getSummaries"
      show-summary
      style="width: 100%"
    >
      <el-table-column type="index" label="序号" width="55" align="center" fixed="left" />
      <el-table-column label="捐献者姓名" prop="donorName" width="110" align="center" fixed="left" show-overflow-tooltip />
      <el-table-column label="捐献日期" prop="donateTime" width="110" align="center" fixed="left" />
      <el-table-column label="上报日期" prop="reportTime" width="110" align="center" fixed="left" />
      <el-table-column label="业务组" prop="deptName" width="130" align="center" show-overflow-tooltip />
      <el-table-column label="业务人员" prop="reporterName" width="110" align="center" show-overflow-tooltip />
      <el-table-column label="案例终止" prop="terminationFlag" width="90" align="center" />
      <el-table-column label="当前状态" prop="workflow" width="120" align="center">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_donornode" :value="scope.row.workflow" />
        </template>
      </el-table-column>
      <el-table-column label="捐献医院" prop="donationHospital" width="200" align="center" show-overflow-tooltip />
      <el-table-column label="捐献器官" prop="organName" width="120" align="left">
        <template slot-scope="scope">
          <div class="organ-cell" v-html="formatOrganName(scope.row.organName)"></div>
        </template>
      </el-table-column>
      <el-table-column label="获取器官" prop="organProcurement" width="120" align="center">
        <template slot-scope="scope">
          <div class="organ-cell" v-html="highlightOrgan(scope.row.organProcurement)"></div>
        </template>
      </el-table-column>
      <el-table-column label="移植器官" prop="organTransplantation" width="120" align="center">
        <template slot-scope="scope">
          <div class="organ-cell" v-html="highlightOrgan(scope.row.organTransplantation)"></div>
        </template>
      </el-table-column>
      <el-table-column label="成本合计" prop="totalCost" width="130" align="right" :formatter="amountFormatter" />
      <el-table-column label="家属费用" prop="donorFamilyCost" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="医学成本小计" prop="medCost" width="130" align="right" :formatter="amountFormatter" />
      <el-table-column label="专家成本小计" prop="expertCost" width="130" align="right" :formatter="amountFormatter" />
      <el-table-column label="其他成本小计" prop="itemCode34" width="130" align="right" :formatter="amountFormatter" />
      <el-table-column label="手术室使用费" prop="itemCode42" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="器官保存灌注" prop="itemCode46" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="器官保存设备" prop="itemCode50" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="肝脏三维重建" prop="itemCode44" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="病理穿刺活检" prop="itemCode47" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="HLA配型" prop="itemCode48" width="110" align="right" :formatter="amountFormatter" />
      <el-table-column label="留存标本成本" prop="itemCode21" width="120" align="right" :formatter="amountFormatter" />
      <el-table-column label="标本运输费" prop="itemCode12" width="110" align="right" :formatter="amountFormatter" />
      <el-table-column label="转运车费" prop="itemCode17" width="110" align="right" :formatter="amountFormatter" />
      <el-table-column label="遗体运输" prop="itemCode23" width="110" align="right" :formatter="amountFormatter" />
      <el-table-column label="尸检" prop="itemCode25" width="90" align="right" :formatter="amountFormatter" />
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import {
  listCasePanorama,
  exportCasePanorama,
  getCasePanoramaDeptOptions
} from "@/api/project/casePanorama";
export default {
  name: "CasePanorama",
  dicts: ["sys_donornode"],
  data() {
    return {
      // é®ç½©å±‚
      loading: false,
      // å¯¼å‡ºé®ç½©å±‚
      exportLoading: false,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // æ¡ˆä¾‹å…¨æ™¯æ•°æ®
      caseList: [],
      // ä¸šåŠ¡ç»„é€‰é¡¹
      deptOptions: [],
      // æ¡ˆä¾‹æ—¶é—´èŒƒå›´
      dateRange: [],
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        donorName: null,
        donateTimeBegin: null,
        donateTimeEnd: null,
        deptName: null,
        reporterName: null
      }
    };
  },
  created() {
    this.getDeptOptions();
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢æ¡ˆä¾‹å…¨æ™¯ */
    getList() {
      this.loading = true;
      listCasePanorama(this.queryParams)
        .then(res => {
          this.caseList = res.rows;
          this.total = res.total;
          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
    },
    /** ä¸šåŠ¡ç»„é€‰é¡¹ */
    getDeptOptions() {
      getCasePanoramaDeptOptions().then(res => {
        this.deptOptions = res.data || [];
      });
    },
    /** æ¡ˆä¾‹æ—¶é—´èŒƒå›´å˜åŒ– */
    handleDateChange(val) {
      if (val && val.length === 2) {
        this.queryParams.donateTimeBegin = val[0];
        this.queryParams.donateTimeEnd = val[1];
      } else {
        this.queryParams.donateTimeBegin = null;
        this.queryParams.donateTimeEnd = null;
      }
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.dateRange = [];
      this.queryParams = {
        pageNum: 1,
        pageSize: 20,
        donorName: null,
        donateTimeBegin: null,
        donateTimeEnd: null,
        deptName: null,
        reporterName: null
      };
      this.resetForm("queryForm");
      this.getList();
    },
    /** æçŒ®å™¨å®˜ï¼šæŒ‰å™¨å®˜é€ä¸ªæ¢è¡Œæ˜¾ç¤º */
    formatOrganName(text) {
      if (!text) {
        return "";
      }
      const escaped = String(text)
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;");
      return escaped
        .split(/[,,、\n]/)
        .map(item => item.trim())
        .filter(item => item)
        .join("<br/>");
    },
    /** å™¨å®˜èŽ·å–/移植:填纳、弃用标红;保留换行 */
    highlightOrgan(text) {
      if (!text) {
        return "";
      }
      const escaped = String(text)
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/\n/g, "<br/>");
      return escaped
        .replace(/\(填纳\)/g, '<span style="color:#F56C6C">(填纳)</span>')
        .replace(/\(弃用\)/g, '<span style="color:#F56C6C">(弃用)</span>');
    },
    /** é‡‘额显示:保留两位小数,0 æ˜¾ç¤ºä¸ºç©º */
    formatAmount(value) {
      if (value === null || value === undefined || value === "") {
        return "";
      }
      const num = Number(value);
      if (!Number.isFinite(num) || num === 0) {
        return "";
      }
      return num.toFixed(2);
    },
    amountFormatter(row, column, cellValue) {
      return this.formatAmount(cellValue);
    },
    /** è´¹ç”¨åˆ—合计 */
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      const textColumns = [
        "donorName",
        "reportTime",
        "deptName",
        "reporterName",
        "terminationFlag",
        "workflow",
        "donateTime",
        "donationHospital",
        "organName",
        "organProcurement",
        "organTransplantation"
      ];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (textColumns.indexOf(column.property) > -1) {
          return;
        }
        const total = data.reduce(
          (prev, item) => prev + (Number(item[column.property]) || 0),
          0
        );
        sums[index] = total === 0 ? "" : Number(total).toFixed(2);
      });
      return sums;
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      const queryParams = { ...this.queryParams };
      delete queryParams.pageNum;
      delete queryParams.pageSize;
      this.$modal
        .confirm("是否确认导出当前筛选条件下的案例全景数据?")
        .then(() => {
          this.exportLoading = true;
          return exportCasePanorama(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
          this.exportLoading = false;
        })
        .catch(() => {
          this.exportLoading = false;
        });
    }
  }
};
</script>
<style scoped>
.opo-query-form ::v-deep .el-form-item {
  margin-right: 8px;
  margin-bottom: 0;
}
.organ-cell {
  white-space: normal;
  line-height: 1.4;
  text-align: left;
  word-break: break-all;
}
</style>
src/views/project/statistics/caseStatistics/index.vue
@@ -86,50 +86,71 @@
      ></right-toolbar>
    </el-row>
    <!--<el-table v-loading="loading" border :data="donatebaseinfoList">     -->
    <el-table
      v-loading="loading"
      :data="jxidata"
      ref="table"
      border
      max-height="700"
      highlight-current-row
      :summary-method="getSummaries"
      show-summary
    >
      <el-table-column label="序号" align="center" prop="id" width="50" />
      <el-table-column label="统计月份" align="center" prop="donationmonth" />
      <el-table-column label="业务组" align="center" prop="deptname">      </el-table-column>
      <el-table-column label="专职人员" align="center" prop="reportername" />
      <el-table-column label="案例累计" align="center" prop="casesum" />
      <el-table-column label="潜在捐献" align="center" prop="workflow0" width="100" />
      <el-table-column label="医学评估" align="center" prop="workflow1" width="100" />
      <el-table-column label="家属确认" align="center" prop="workflow2" width="100" />
      <el-table-column label="伦理审查" align="center" prop="workflow3" width="100" />
      <el-table-column label="器官分配" align="center" prop="workflow4" width="100" />
      <el-table-column label="获取见证" align="center" prop="workflow5" width="100" />
      <el-table-column label="捐献完成" align="center" prop="workflow6" width="100" />
      <el-table-column label="归档撤销" align="center" prop="workflow7" width="100" />
      <el-table-column label="案例归档" align="center" prop="workflow8" width="100" />
      <!-- <el-table-column label="案例终止" align="center" prop="workflow9" width="90" /> -->
      <el-table-column label="终止案例" align="center" prop="terminationcase" width="100" />
    <el-tabs v-model="activeTab">
      <el-tab-pane label="按业务组" name="dept">
        <el-table
          v-loading="loading"
          :data="deptData"
          ref="deptTable"
          border
          max-height="700"
          highlight-current-row
          :summary-method="getDeptSummaries"
          show-summary
        >
          <el-table-column label="序号" align="center" prop="id" width="50" />
          <el-table-column label="业务组" align="center" prop="deptname" width="250" />
          <el-table-column label="累计案例" align="center" prop="caseTotal" width="150" />
          <el-table-column label="终止案例" align="center" prop="terminationTotal" width="150" />
        </el-table>
      </el-tab-pane>
      <!-- <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        fixed="right"
      >
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit"
            >明细</el-button
      <el-tab-pane label="按人员" name="person">
        <el-table
          v-loading="loading"
          :data="jxidata"
          ref="personTable"
          border
          max-height="700"
          highlight-current-row
          :summary-method="getSummaries"
          show-summary
        >
          <el-table-column label="序号" align="center" prop="id" width="50" />
          <el-table-column label="业务组" align="center" prop="deptname" width="250" >      </el-table-column>
          <el-table-column label="专职人员" align="center" prop="reportername" width="150" />
          <!-- <el-table-column label="登记案例累计" align="center" prop="casesum" width="100" /> -->
          <!-- <el-table-column label="潜在捐献" align="center" prop="workflow0" width="100" />
          <el-table-column label="医学评估" align="center" prop="workflow1" width="100" />
          <el-table-column label="家属确认" align="center" prop="workflow2" width="100" />
          <el-table-column label="伦理审查" align="center" prop="workflow3" width="100" />
          <el-table-column label="器官分配" align="center" prop="workflow4" width="100" />
          <el-table-column label="获取见证" align="center" prop="workflow5" width="100" />
          <el-table-column label="捐献完成" align="center" prop="workflow6" width="100" />
          <el-table-column label="归档撤销" align="center" prop="workflow7" width="100" />
          <el-table-column label="案例归档" align="center" prop="workflow8" width="100" /> -->
          <el-table-column label="案例累计" align="center" prop="workflowsum" width="200" />
          <el-table-column label="终止案例" align="center" prop="terminationcase" width="100" />
          <!-- <el-table-column
            label="操作"
            align="center"
            class-name="small-padding fixed-width"
            fixed="right"
          >
        </template>
      </el-table-column> -->
    </el-table>
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit"
                >明细</el-button
              >
            </template>
          </el-table-column> -->
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <div style="margin: 10px;text-align: right;">
      <div>
        å…± <span style="color:#1890FF ;">{{ total }}</span> æ¡æ•°æ®
        å…± <span style="color:#1890FF ;">{{ tableTotal }}</span> æ¡æ•°æ®
      </div>
    </div>
@@ -146,7 +167,8 @@
  listbxiaostatistics,
  listjixstatistics,
  listanlstatistics,
  exportCaseStatistics
  exportCaseStatistics,
  exportCaseDeptStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -230,6 +252,10 @@
      donatebaseinfoList: [],
      // æçŒ®åŸºç¡€è¡¨æ ¼æ•°æ®
      jxidata: [],
      // å½“前页签:dept=按业务组,person=按人员
      activeTab: "dept",
      // æŒ‰ä¸šåŠ¡ç»„èšåˆæ•°æ®
      deptData: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
@@ -260,7 +286,11 @@
    };
  },
  //监听属性 ç±»ä¼¼äºŽdata概念
  computed: {},
  computed: {
    tableTotal() {
      return this.activeTab === "dept" ? this.deptData.length : this.jxidata.length;
    }
  },
  activated() {},
  mounted() {},
@@ -316,6 +346,28 @@
          $obj.id = $index + 1;
        });
        this.total = res.total;
        this.buildDeptData();
      });
    },
    /** æŒ‰ä¸šåŠ¡ç»„èšåˆï¼šç´¯è®¡æ¡ˆä¾‹ = Î£workflowsum,终止案例 = Î£terminationcase */
    buildDeptData() {
      const map = new Map();
      this.jxidata.forEach(row => {
        const key = row.deptid || row.deptname || "未分组";
        if (!map.has(key)) {
          map.set(key, {
            deptname: row.deptname || "未分组",
            caseTotal: 0,
            terminationTotal: 0
          });
        }
        const item = map.get(key);
        item.caseTotal += Number(row.workflowsum) || 0;
        item.terminationTotal += Number(row.terminationcase) || 0;
      });
      this.deptData = Array.from(map.values()).map((item, index) => {
        item.id = index + 1;
        return item;
      });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
@@ -326,11 +378,15 @@
        padeptno: this.queryParams.padeptno,
        pausername: this.queryParams.pausername
      };
      const exportApi =
        this.activeTab === "dept"
          ? exportCaseDeptStatistics
          : exportCaseStatistics;
      this.$modal
        .confirm("是否确认导出当前筛选条件下的案例统计数据?")
        .confirm("是否确认导出当前列表的案例统计数据?")
        .then(() => {
          this.exportLoading = true;
          return exportCaseStatistics(queryParams);
          return exportApi(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
@@ -343,7 +399,7 @@
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      var columnnames = ["donationmonth", "deptname", "reportername"];
      var columnnames = ["deptname", "reportername"];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
@@ -371,6 +427,26 @@
      });
      return sums;
    },
    /** æŒ‰ä¸šåŠ¡ç»„è¡¨æ ¼åˆè®¡ */
    getDeptSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (column.property === "deptname") {
          return;
        }
        const total = data.reduce(
          (prev, item) => prev + (Number(item[column.property]) || 0),
          0
        );
        sums[index] = data.length === 0 ? "" : total;
      });
      return sums;
    },
    // è¡¨å•重置
    reset() {
src/views/project/statistics/chargeStatistics/index.vue
@@ -6,33 +6,35 @@
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      label-width="70px"
      v-show="showSearch"
      label-width="80px"
    >
      <el-row :gutter="8">
        <el-col :span="8">
          <el-form-item label="月份范围">
          <el-form-item label="案例时间">
            <el-date-picker
              style="width: 100%"
              v-model="selecttime"
              type="monthrange"
              type="daterange"
              range-separator="至"
              start-placeholder="开始月份"
              end-placeholder="结束月份"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
              style="width: 100%"
              @change="getTimeList"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="医院名称">
            <org-selecter
              ref="orgSelecter"
              :org-type="'4'"
              v-model="queryParams.pahospitalno"
            />
          </el-form-item>
        </el-col>
        </el-col>
        <el-col :span="7">
          <el-form-item label="医院名称">
            <el-input
              v-model="queryParams.pahospitalname"
              placeholder="请输入医院名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item>
            <el-button
@@ -50,7 +52,24 @@
      </el-row>
    </el-form>
    <!--<el-table v-loading="loading" border :data="donatebaseinfoList">     -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          >导出</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <el-table
      v-loading="loading"
      :data="jxidata"
@@ -61,36 +80,11 @@
      :summary-method="getSummaries"
      show-summary
    >
      <el-table-column label="序号" align="center" prop="id" width="100">
      </el-table-column>
      <el-table-column label="统计月份" align="center" prop="receivemonth" />
      <el-table-column label="医院名称" align="center" prop="hospitalname">
      </el-table-column>
      <el-table-column label="已收金额" align="center" prop="amount">
      </el-table-column>
      <el-table-column label="未收金额" align="center" prop="nonpayment">
      </el-table-column>
      <el-table-column label="应收金额" align="center" prop="organcharge">
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        fixed="right"
      >
        <template slot-scope="scope">
          <!--           v-if="scope.row.recordstate==2"
 -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            >说明</el-button
          >
        </template>
      </el-table-column>
      <el-table-column label="序号" align="center" prop="id" width="80" />
      <el-table-column label="医院名称" align="center" prop="hospitalname" show-overflow-tooltip width="260" />
      <el-table-column label="应收金额" align="center" prop="organcharge" width="160" :formatter="amountFormatter" />
      <el-table-column label="已收金额" align="center" prop="amount" width="160" :formatter="amountFormatter" />
      <el-table-column label="未收金额" align="center" prop="nonpayment" width="160" :formatter="amountFormatter" />
    </el-table>
    <div style="margin: 10px;text-align: right;">
@@ -111,7 +105,8 @@
  listsfeistatistics,
  listbxiaostatistics,
  listjixstatistics,
  listanlstatistics
  listanlstatistics,
  exportChargeStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -137,7 +132,7 @@
      countyname: "",
      cuuntry: "",
      selecttime: "",
      selecttime: [],
      reportervalue: "",
      reportlist: [
        { label: "未收款", value: "0" },
@@ -205,7 +200,13 @@
      // èŽ·å–ç»„ç»‡åç§°æ—¶é—´èŒƒå›´
      daterangeReporttime: [],
      // æŸ¥è¯¢å‚æ•°
      queryParams: {},
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        pabegtime: "",
        paendtime: "",
        pahospitalname: ""
      },
      // è¡¨å•参数
      form: {},
@@ -244,15 +245,42 @@
      return Arr;
    },
    /** æŸ¥è¯¢æçŒ®åŸºç¡€åˆ—表 */
    /** æŸ¥è¯¢æ”¶æ¬¾ç»Ÿè®¡ */
    getList() {
      listsfeistatistics(this.queryParams).then(res => {
        this.jxidata = res.rows;
        this.jxidata.forEach(($obj, $index) => {
          $obj.id = $index + 1;
      this.loading = true;
      listsfeistatistics(this.queryParams)
        .then(res => {
          this.jxidata = res.rows || [];
          this.jxidata.forEach(($obj, $index) => {
            $obj.id = $index + 1;
          });
          this.total = res.total;
          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
        this.total = res.total;
      });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      const queryParams = {
        pabegtime: this.queryParams.pabegtime,
        paendtime: this.queryParams.paendtime,
        pahospitalname: this.queryParams.pahospitalname
      };
      this.$modal
        .confirm("是否确认导出当前筛选条件下的收款统计数据?")
        .then(() => {
          this.exportLoading = true;
          return exportChargeStatistics(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
          this.exportLoading = false;
        })
        .catch(() => {
          this.exportLoading = false;
        });
    },
    // è¡¨å•重置
@@ -266,48 +294,39 @@
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.daterangeReporttime = [];
      this.reportervalue = "";
      this.queryParams = {};
      this.selecttime = [];
      this.getTimeList();
      this.searchAddress = {
        sheng: "",
        shi: "",
        qu: "",
        organizationname: null
      this.queryParams = {
        pageNum: 1,
        pageSize: 20,
        pabegtime: "",
        paendtime: "",
        pahospitalname: ""
      };
      this.resetForm("queryForm");
      this.handleQuery();
      this.getList();
    },
    getTimeList(e) {
      if (this.selecttime != 0) {
        this.queryParams.pabegtime = this.selecttime[0];
        this.queryParams.paendtime = this.selecttime[1];
        // if (this.queryParams.paendtime == this.queryParams.pabegtime) {
        // ç»“束时间取"所选结束月的次月 1 å·",以包含整个结束月。
        // åŽŸå®žçŽ°æŠŠæœˆä»½ +1 åŽç›´æŽ¥æ‹¼å­—符串,12 æœˆä¼šå¾—到 13 æœˆï¼ˆ2026-13-01),
        // MySQL æŠ¥ Incorrect datetime value,存储过程直接 500。
        this.queryParams.paendtime = this.$moment(this.queryParams.paendtime)
          .startOf("month")
          .add(1, "month")
          .format("YYYY-MM")
          .concat("-01 00:00:00");
        this.queryParams.pabegtime =
          this.queryParams.pabegtime + " " + "00" + ":" + "00" + ":" + "00";
        // }
    /** æ—¥æœŸèŒƒå›´ï¼šæ¡ˆä¾‹æ—¶é—´ï¼Œå¼€å§‹ 00:00:00,结束 23:59:59 */
    getTimeList() {
      if (this.selecttime && this.selecttime.length === 2) {
        this.queryParams.pabegtime = this.selecttime[0] + " 00:00:00";
        this.queryParams.paendtime = this.selecttime[1] + " 23:59:59";
      } else {
        // this.queryParams.pabegtime = "1998-01-01 00:00:00";
        // this.queryParams.paendtime = "2998-01-01 00:00:00";
        this.queryParams.pabegtime = "";
        this.queryParams.paendtime = "";
      }
    },
    /** é‡‘额显示:保留两位小数,0 æ˜¾ç¤º 0.00 */
    amountFormatter(row, column, cellValue) {
      if (cellValue === null || cellValue === undefined || cellValue === "") {
        return "0.00";
      }
      const num = Number(cellValue);
      return Number.isFinite(num) ? num.toFixed(2) : "0.00";
    },
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      var columnnames = ["receivemonth", "hospitalname"];
      var columnnames = ["hospitalname"];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
src/views/project/statistics/performanceStaristics/index.vue
@@ -25,14 +25,7 @@
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="绩效类型">
            <el-radio-group v-model="queryParams.pabonustype">
              <el-radio v-for="item in reporttype" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="5">
        <el-col :span="10">
          <el-form-item label="绩效人员" prop="pauserno">
            <el-input v-model="queryParams.pausername" placeholder="请输入姓名" clearable size="small"
              @keyup.enter.native="handleQuery" />
@@ -55,24 +48,41 @@
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <!--<el-table v-loading="loading" border :data="donatebaseinfoList">     -->
    <el-table v-loading="loading" :data="jxidata" ref="table" border max-height="700" highlight-current-row
      :summary-method="getSummaries" show-summary>
      <el-table-column label="序号" align="center" prop="id" width="100">
      </el-table-column>
      <el-table-column label="统计月份" align="center" prop="bonusmonth" />
      <el-table-column label="科室业务组" align="center" prop="deptName">      </el-table-column>
      <el-table-column label="绩效人员/医院" align="center" prop="beneficiaryname" />
      <el-table-column label="绩效金额" align="center" prop="amount" :formatter="amountFormatter" />
      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit">明细</el-button>
        </template>
      </el-table-column> -->
    </el-table>
    <el-tabs v-model="activeTab">
      <el-tab-pane label="按业务组" name="dept">
        <el-table v-loading="loading" :data="deptData" ref="deptTable" border max-height="700"
          highlight-current-row :summary-method="getDeptSummaries" show-summary>
          <el-table-column label="序号" align="center" prop="id" width="80" />
          <el-table-column label="业务组" align="center" prop="deptname" />
          <el-table-column label="绩效金额" align="center" prop="amount" :formatter="amountFormatter" />
          <el-table-column label="月度绩效" align="center" prop="mamount" :formatter="amountFormatter" />
          <el-table-column label="季度绩效" align="center" prop="samount" :formatter="amountFormatter" />
          <el-table-column label="年度绩效" align="center" prop="yamount" :formatter="amountFormatter" />
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="按人员" name="person">
        <el-table v-loading="loading" :data="jxidata" ref="personTable" border max-height="700"
          highlight-current-row :summary-method="getSummaries" show-summary>
          <el-table-column label="序号" align="center" prop="id" width="80" />
          <el-table-column label="业务组" align="center" prop="deptName" />
          <el-table-column label="绩效人员/医院" align="center" prop="beneficiaryname" />
          <el-table-column label="绩效金额" align="center" prop="amount" :formatter="amountFormatter" />
          <el-table-column label="月度绩效" align="center" prop="mamount" :formatter="amountFormatter" />
          <el-table-column label="季度绩效" align="center" prop="samount" :formatter="amountFormatter" />
          <el-table-column label="年度绩效" align="center" prop="yamount" :formatter="amountFormatter" />
          <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit">明细</el-button>
            </template>
          </el-table-column> -->
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <div style="margin: 10px;text-align: right;">
      <div>
        å…± <span style="color:#1890FF ;">{{ total }}</span> æ¡æ•°æ®
        å…± <span style="color:#1890FF ;">{{ tableTotal }}</span> æ¡æ•°æ®
      </div>
    </div>
@@ -90,7 +100,8 @@
  listbxiaostatistics,
  listjixstatistics,
  listanlstatistics,
  exportPerformanceStatistics
  exportPerformanceStatistics,
  exportPerformanceDeptStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -120,12 +131,6 @@
      selecttime: "",
      reportervalue: "",
      reporttype: [
        { label: "全部", value: "0" },
        { label: "月度", value: "68" },
        { label: "季度", value: "69" },
        { label: "年度", value: "70" }
      ],
      //省市区
      //默认值设置,可为空
      searchAddress: {
@@ -182,6 +187,10 @@
      donatebaseinfoList: [],
      // æçŒ®åŸºç¡€è¡¨æ ¼æ•°æ®
      jxidata: [],
      // å½“前页签:dept=按业务组,person=按人员
      activeTab: "dept",
      // æŒ‰ä¸šåŠ¡ç»„èšåˆæ•°æ®
      deptData: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
@@ -190,7 +199,6 @@
      daterangeReporttime: [],
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pabonustype: "0",
        pabegtime: null,
        paendtime: null,
        pausername: "",
@@ -215,7 +223,11 @@
    };
  },
  //监听属性 ç±»ä¼¼äºŽdata概念
  computed: {},
  computed: {
    tableTotal() {
      return this.activeTab === "dept" ? this.deptData.length : this.jxidata.length;
    }
  },
  activated() { },
  mounted() { },
@@ -256,16 +268,13 @@
      return Arr;
    },
    /** ç»„装查询参数:未选择统计日期时查全部,绩效类型为空按全部 */
    /** ç»„装查询参数:未选择统计日期时查全部 */
    buildQueryParams() {
      const query = { ...this.queryParams };
      if (!query.pabegtime || !query.paendtime) {
        // æ–° SP é»˜è®¤å–è¿‘ 6 ä¸ªæœˆï¼Œè€Œç»©æ•ˆ jxrq æ•°æ®é›†ä¸­åœ¨ 2023-08~2024-01,默认会查不到
        query.pabegtime = "2000-01-01 00:00:00";
        query.paendtime = "2999-12-31 23:59:59";
      }
      if (!query.pabonustype) {
        query.pabonustype = "0";
      }
      return query;
    },
@@ -278,16 +287,46 @@
          $obj.id = $index + 1;
        });
        this.total = res.total;
        this.buildDeptData();
      });
    },
    /** æŒ‰ä¸šåŠ¡ç»„èšåˆï¼šç»©æ•ˆé‡‘é¢/月度/季度/年度分别求和 */
    buildDeptData() {
      const map = new Map();
      this.jxidata.forEach(row => {
        const key = row.deptId || row.deptName || "未分组";
        if (!map.has(key)) {
          map.set(key, {
            deptname: row.deptName || "未分组",
            amount: 0,
            mamount: 0,
            samount: 0,
            yamount: 0
          });
        }
        const item = map.get(key);
        item.amount += Number(row.amount) || 0;
        item.mamount += Number(row.mamount) || 0;
        item.samount += Number(row.samount) || 0;
        item.yamount += Number(row.yamount) || 0;
      });
      this.deptData = Array.from(map.values()).map((item, index) => {
        item.id = index + 1;
        return item;
      });
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      const queryParams = this.buildQueryParams();
      const exportApi =
        this.activeTab === "dept"
          ? exportPerformanceDeptStatistics
          : exportPerformanceStatistics;
      this.$modal
        .confirm("是否确认导出当前筛选条件下的绩效统计数据?")
        .confirm("是否确认导出当前列表的绩效统计数据?")
        .then(() => {
          this.exportLoading = true;
          return exportPerformanceStatistics(queryParams);
          return exportApi(queryParams);
        })
        .then(response => {
          this.$download.name(response.msg);
@@ -320,7 +359,6 @@
      this.queryParams = {
        pabonustype: "0",
        pabegtime: null,
        paendtime: null,
        pausername: "",
@@ -355,7 +393,7 @@
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      var columnnames = ["applymonth", "deptmentName", "username", "deptName", "beneficiaryname"];
      var columnnames = ["deptName", "beneficiaryname"];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
@@ -383,6 +421,26 @@
        }
      });
      return sums;
    },
    /** æŒ‰ä¸šåŠ¡ç»„è¡¨æ ¼åˆè®¡ */
    getDeptSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (column.property === "deptname") {
          return;
        }
        const total = data.reduce(
          (prev, item) => prev + (Number(item[column.property]) || 0),
          0
        );
        sums[index] = total === 0 ? "" : Number(total).toFixed(2);
      });
      return sums;
    }
  },