yxh
13 小时以前 ad5e7a527167a86ca7969e874df9950a5c4e2ff9
src/views/project/statistics/chargeStatistics/index.vue
@@ -1,62 +1,40 @@
<!--  -->
<template>
  <div class="app-container">
    绩效
    <el-form
      class="opo-query-form"
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      label-width="70px"
      v-show="showSearch"
      label-width="80px"
    >
      <el-row :gutter="8">
        <el-col :span="6">
          <el-form-item label="医院名称">
            <el-select
              v-model="queryParams.pabonustype"
              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 label="统计类型">
            <el-select
              v-model="queryParams.pabonustype"
              placeholder="请选择案例状态"
            >
              <el-option
                v-for="item in reportlist"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="8">
        <el-col :span="12">
          <el-form-item label="统计日期">
        <el-col :span="8">
          <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="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
@@ -74,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"
@@ -85,48 +80,18 @@
      :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="name" />
      <el-table-column label="业务组" align="center" prop="name">
      </el-table-column>
      <el-table-column label="专职人员" align="center" prop="age" />
      <el-table-column
        label="金额"
        align="center"
        prop="amount"
      />
      <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"
            @click="handleAdd(scope.row)"
            >医学评估</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>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <div style="margin: 10px;text-align: right;">
      <div>
        共 <span style="color:#1890FF ;">{{ total }}</span> 条数据
      </div>
    </div>
    <!-- 添加或修改家属确认对话框 -->
  </div>
@@ -140,7 +105,8 @@
  listsfeistatistics,
  listbxiaostatistics,
  listjixstatistics,
  listanlstatistics
  listanlstatistics,
  exportChargeStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -166,12 +132,11 @@
      countyname: "",
      cuuntry: "",
      selecttime: "",
      selecttime: [],
      reportervalue: "",
      reportlist: [
        { label: "月度", value: "1" },
        { label: "季度", value: "2" },
        { label: "年度", value: "3" }
        { label: "未收款", value: "0" },
        { label: "已收款", value: "1" }
      ],
      //省市区
      //默认值设置,可为空
@@ -237,7 +202,10 @@
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10
        pageSize: 20,
        pabegtime: "",
        paendtime: "",
        pahospitalname: ""
      },
      // 表单参数
@@ -266,61 +234,6 @@
  watch: {},
  //方法集合
  methods: {
    getTimeList(e) {
      if (this.selecttime != 0) {
        this.endtime = this.selecttime[1];
        this.starttime = this.selecttime[0];
        // if (this.endtime == this.starttime) {
        let num = Number(this.endtime.slice(5, 7));
        if (num < 9) {
          let mon = Number(this.endtime.slice(6, 7));
          this.endtime =
            this.endtime.slice(0, 5) +
            "0" +
            (mon + 1) +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
        }
        // this.endtime=this.endtime.slice(0,5)年
        else if (num >= 10) {
          this.endtime =
            this.endtime.slice(0, 5) +
            (num + 1) +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
        } else {
          this.endtime =
            this.endtime.slice(0, 5) +
            "10" +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
        }
        this.starttime = this.starttime + " " + "00" + ":" + "00" + ":" + "00";
        // }
      } else {
        // this.starttime = "1998-01-01 00:00:00";
        // this.endtime = "2998-01-01 00:00:00";
      }
    },
    resetArr(Arr) {
      var hash = {};
      Arr = Arr.reduce(function(arr, current) {
@@ -332,11 +245,42 @@
      return Arr;
    },
    /** 查询捐献基础列表 */
    /** 查询收款统计 */
    getList() {
      listsfeistatistics(this.queryParams).then(res => {
        this.jxidata = res.rows;
      });
      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;
        });
    },
    /** 导出按钮操作 */
    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;
        });
    },
    // 表单重置
@@ -350,46 +294,39 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeReporttime = [];
      this.reportervalue = "";
      this.form.treatmenthospitalno = "";
      this.queryParams = {
        doname: null,
        pageNum: 1,
        pageSize: 10,
        name: null,
        idcardno: null,
        residenceprovince: null,
        residencecity: null,
        residencetown: null,
        // "2"
        recordstate: null,
        treatmenthospitalname: null,
        donorno: null,
        acquisitiontissueno: null,
        reportername: null,
        reporttime: null,
        city: null
      };
      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();
    },
    /** 日期范围:案例时间,开始 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 = "";
        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 = ["applymonth", "deptmentName", "username"];
      var columnnames = ["hospitalname"];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";