1
wwl
2025-03-05 cb1f69717eed3b6a61b6c61a8934bac752782b2d
src/views/team/reportresults/index.vue
@@ -7,13 +7,14 @@
      :inline="true"
      label-width="68px"
    >
      <el-form-item label="时间" prop="applicationTime">
      <el-form-item label="时间" prop="createTimeList">
        <el-date-picker
          clearable
          v-model="createTimeList"
          @change="dateChangebirthday1"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          :default-time="['00:00:00', '23:00:00']"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
@@ -96,6 +97,7 @@
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin: 0 15px;"
          >查询</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
@@ -106,15 +108,15 @@
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" size="mini" @click="tongji"
        <el-button type="primary" size="mini" @click="tongji"  style="margin: 0 15px;"
          >统计结果</el-button
        >
      </el-col>
      <el-col :span="1.5">
      <!-- <el-col :span="1.5">
        <el-button type="primary" size="mini" @click="clear"
          >清空已选输出列</el-button
        >
      </el-col>
      </el-col> -->
    </el-row>
    <div style="width: 100%; margin-left: 10px; display: flex">
@@ -163,6 +165,7 @@
            prop="company"
            label="单位"
            align="center"
            width="170px"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
@@ -175,41 +178,33 @@
          </el-table-column>
        </el-table>
      </div>
      <div style="width: 50%; display: flex">
        <el-tabs
        type="border-card"
        style="height: 560px; margin: 0 10px; width: 100%"
      >
        <el-tab-pane label="单项">
          <div class="tab3">
            <!-- <div class="tab2"> -->
            <v-tree-transfer
              :treeData="treedataList"
              :defaultProps="{ children: 'tjProjectList', label: 'proName' }"
              :defaultKeys="defaultKeys"
              @changeKeys="changeCategoryKeys"
              :key="datekey"
            ></v-tree-transfer>
            <!-- <el-tree ref="tree" :data="treedataList" show-checkbox node-key="proId" :props="defaultProps"
                :default-expanded-keys="treeId" :default-checked-keys="treeList" @check-change="handleCurrentChecked">
              </el-tree> -->
            <!-- </div> -->
            <!-- <el-button
                style="
                  width: 20px;
                  height: 100px;
                  margin-left: 10px;
                  margin-top: 20%;
                  font-size: 10px;
                "
                type="primary"
                size="mini"
                @click="submit"
                ><i style="font-size: 18px" class="el-icon-d-arrow-right"></i
              ></el-button> -->
          </div>
        </el-tab-pane>
      </el-tabs>
      <div style="width: 60%; display: flex">
        <div class="outside1">
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <el-tree
            ref="tree"
            v-loading="loading"
            :data="Treedata"
            show-checkbox
            node-key="proId"
            :props="defaultProps"
            @check-change="handleCurrentChecked"
            :filter-node-method="filterNode"
          >
          </el-tree>
        </div>
        <div>
          <el-table
            :data="DataList"
            style="width: 400px; margin-left: 40px"
            border
          >
            <el-table-column prop="proName" label="已选项目列表" align="center">
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
    <div style="margin-right: 64%">
@@ -240,12 +235,69 @@
      <el-dialog
        :title="title2"
        :visible.sync="open"
        width="1300px"
        width="1000px"
        append-to-body
      >
        <div style="height: 620px; margin-top: 10px">
        <!-- <div style="height: 620px; margin-top: 10px">
          <div id="main" style="width: 95%; height: 400px"></div>
        </div>
        </div> -->
        <!-- <el-card
          class="box-card"
          v-for="(item, index) in rongjiList"
          :key="index"
        >
          <div slot="header" class="clearfix">
            <span>{{ item.project.proName }}</span>
          </div>
          <div>
            <el-table :data="item.zhengchang" style="width: 100%">
               <el-table-column prop="orderDetailId" label="体检号" width="180">
              </el-table-column>
              <el-table-column prop="createBy" label="姓名" width="180">
              </el-table-column>
            </el-table>
             <el-table :data="item.yichang" style="width: 100%">
              <el-table-column prop="orderDetailId" label="体检号" width="180">
              </el-table-column>
              <el-table-column prop="createBy" label="姓名" width="180">
              </el-table-column>
            </el-table>
          </div>
        </el-card> -->
        <el-collapse v-model="activeNames">
          <el-collapse-item v-for="(item, index) in rongjiList" :key="index">
            <template slot="title">
              {{ item.project.proName }}
            </template>
            <div style="display: flex">
              <div style="display: flex;flex-direction: column;width:50%" >
                <span>正常</span>
                <el-table border :data="item.zhengchang" style="width: 100%">
                  <el-table-column
                    prop="tjNumber"
                    label="体检号"
                  >
                  </el-table-column>
                  <el-table-column prop="cusName" label="姓名" >
                  </el-table-column>
                </el-table>
              </div>
              <div style="display: flex;flex-direction: column;width:50%">
                <span>异常</span>
                <el-table border :data="item.yichang" style="width: 100%">
                <el-table-column
                  prop="tjNumber"
                  label="体检号"
                >
                </el-table-column>
                <el-table-column prop="cusName" label="姓名" >
                </el-table-column>
              </el-table>
              </div><br>
            </div>
          </el-collapse-item>
        </el-collapse>
      </el-dialog>
    </div>
  </div>
@@ -257,21 +309,10 @@
require("echarts/lib/component/tooltip");
require("echarts/lib/component/legend");
require("echarts/lib/chart/pie");
import { getNewDateList } from "@/api/hosp/order";
import moment from "moment";
import VTreeTransfer from "../../system/tijian/TreeTransfer.vue";
import {
  deptTreeSelect,
  projectGetList,
  getOrder,
  getCusIdcard,
  getPackageListName,
  getaddtTransition,
  getTransitionList,
  getByTeamNo,
  getLoadFile,
  getIsRequired,
  getconfigKey,
  getHistryTjOrderProByCusIdCard,
} from "@/api/system/tijian";
import { projectGetList } from "@/api/system/tijian";
import {
  getPeopleList,
  getDeptAndDwDeptByComp,
@@ -280,20 +321,23 @@
  getStatist,
} from "@/api/team/disease";
import { listComp } from "@/api/system/comp";
import { getJieGuoFenXi } from "@/api/team/reportresults";
export default {
  components: {
    VTreeTransfer,
  },
  data() {
    return {
      datekey: Date.now(),
      defaultKeys: [],
      activeNames: ["1"],
      proIds: [],
      filterText: "",
      DataList: [],
      loading: false,
      defaultProps: {
        children: "tjProjectList",
        label: "proName",
      },
      tjProjectList: [],
      treedataList: [],
      Treedata: [],
      rongjiList: [],
      aids: [],
      tjNums: [],
@@ -358,37 +402,72 @@
    };
  },
  created() {
    this.getdate();
    this.getNowTime();
    this.getList();
    this.getcomp();
    this.getData();
    this.datekey = Date.now();
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
  },
  methods: {
    changeCategoryKeys(val) {
        console.log(val);
      this.proIds = [];
      this.proIds = val;
      // if (this.DataList.length != 0) {
      //   this.DataList.forEach((item) => {
      //     this.proIds.push(item.proId);
      //   });
      // } else {
      //   this.proIds = [];
      // }
    getdate() {
      getNewDateList().then((res) => {
        this.createTimeList = [
          moment(res.data).format("YYYY-MM-DD 00:00:00"),
          moment(res.data).format("YYYY-MM-DD 23:59:00"),
        ];
        this.getList();
      });
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.proName.indexOf(value) !== -1;
    },
    getData() {
      /** 查询部门下拉树结构 */
      this.loading = true;
      /** 查询部门下拉树结构 */
      projectGetList().then((response) => {
        this.treedataList = response.data.list;
        console.log(this.treedataList);
        this.dXData = response.data.list;
        this.Treedata = response.data.list;
        this.Treedata.forEach(item => {
          if(item.proParentId == "0"){
            item.disabled = true
          }
        })
        this.loading = false;
        return;
      });
    },
    // 点击获取每个树节点
    handleCurrentChecked(data, checked, checkedNodes) {
      // if (!data.tjProjectList) {
      //   return;
      // }
      if (data.proParentId != "0") {
        if (checked === true) {
          this.DataList.push(data);
        } else {
          this.DataList.pop(data);
          this.list1 = true;
        }
      }
      // this.TotalPrice1 = 0;
      // this.proIds = [];
      // if (this.DataList.length != 0) {
      //   this.list1 = false;
      //   this.DataList.forEach((item) => {
      //     this.TotalPrice1 = item.proPrice + this.TotalPrice1;
      //     item.tjProjectList.forEach((item1) => {
      //       this.proIds.push(item1.proId);
      //     });
      //   });
      // }
    },
    // / 处理默认选中当前日期
    getNowTime() {
      var curDate = new Date().getTime();
@@ -410,8 +489,14 @@
    },
    // 团检病种页面查询人员列表
    getList() {
      this.queryParams.beginTime = this.createTimeList[0];
      if(this.createTimeList){
        this.queryParams.beginTime = this.createTimeList[0];
      this.queryParams.endTime = this.createTimeList[1];
      }else if(this.createTimeList == null){
        this.queryParams.beginTime = null;
      this.queryParams.endTime = null;
      }
      getPeopleList(this.queryParams).then((res) => {
        this.tableData = res.data.voList;
        this.total = res.data.total;
@@ -420,11 +505,11 @@
    handleSizeChange(val) {
      this.queryParam.pageSize = val;
      this.geticd();
      // this.geticd();
    },
    handleCurrentChange(val) {
      this.queryParam.page = val;
      this.geticd();
      // this.geticd();
    },
    /** 查询体检单位信息维护列表 */
    getcomp() {
@@ -460,11 +545,12 @@
    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
      this.queryParam.page = 1;
      this.geticd();
      // this.queryParam.page = 1;
      // this.geticd();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = []
      this.resetForm("queryForm");
      this.handleQuery();
      this.loading = true;
@@ -474,96 +560,66 @@
    },
    tongji() {
      this.title2 = "统计图表";
      let tjRulesStatisticsDto = {
        aids: this.aids,
        tjNums: this.tjNums,
      };
      console.log(tjRulesStatisticsDto);
      if (
        tjRulesStatisticsDto.aids.length === 0 ||
        tjRulesStatisticsDto.tjNums.length === 0
      ) {
      if (this.tjNums.length === 0 || this.DataList === 0) {
        this.$message.warning("请选择人员和病种!");
      } else {
        this.DataList.forEach((item) => {
          this.proIds.push(item.proId);
        });
        let dto = {
          proIds: this.proIds,
          tjNums: this.tjNums,
        };
        this.open = true;
        getStatist(tjRulesStatisticsDto).then((res) => {
        getJieGuoFenXi(dto).then((res) => {
          this.rongjiList = res.data;
          // this.$nextTick(() => {
          //   var chartDom = document.getElementById("main");
          //   var myChart = echarts.init(chartDom);
          //   var option;
          this.$nextTick(() => {
            var chartDom = document.getElementById("main");
            var myChart = echarts.init(chartDom);
            var option;
            option = {
              title: {
                text: "病种统计",
                left: "center",
              },
              tooltip: {
                trigger: "item",
                formatter: "{a} <br/>{b} : {c} ({d}%)",
              },
              legend: {
                // type: 'scroll',
                orient: "vertical",
                right: 10,
                top: 80,
                bottom: 20,
                data: this.rongjiList,
              },
              series: [
                {
                  name: "病种名称",
                  type: "pie",
                  radius: "55%",
                  center: ["25%", "60%"],
                  data: this.rongjiList,
                  emphasis: {
                    itemStyle: {
                      shadowBlur: 10,
                      shadowOffsetX: 0,
                      shadowColor: "rgba(0, 0, 0, 0.5)",
                    },
                  },
                },
              ],
            };
            option && myChart.setOption(option);
            let sizeFun = function () {
              myChart.resize();
            };
            window.addEventListener("resize", sizeFun);
          });
          // let dataValue1 = [];
          // this.dateAll = [];
          // this.rongjiList.forEach((item) => {
          //   console.log(item);
          //   this.dateAll.push(item.bingzhong);
          //   dataValue1.push(item.num);
          // });
          // let myChart = this.$echarts.init(document.getElementById("main"));
          // myChart.setOption({
          //   legend: {},
          //   tooltip: {},
          //   xAxis: {
          //     type: "category",
          //     name: "病种名称",
          //     data: this.dateAll,
          //   },
          //   yAxis: {
          //     type:'value'
          //   },
          //   series: [
          //     {
          //       name: "人数",
          //       type: "bar",
          //       data: dataValue1,
          //   option = {
          //     title: {
          //       text: "病种统计",
          //       left: "center",
          //     },
          //   ],
          //     tooltip: {
          //       trigger: "item",
          //       formatter: "{a} <br/>{b} : {c} ({d}%)",
          //     },
          //     legend: {
          //       // type: 'scroll',
          //       orient: "vertical",
          //       right: 10,
          //       top: 80,
          //       bottom: 20,
          //       data: this.rongjiList,
          //     },
          //     series: [
          //       {
          //         name: "病种名称",
          //         type: "pie",
          //         radius: "55%",
          //         center: ["25%", "60%"],
          //         data: this.rongjiList,
          //         emphasis: {
          //           itemStyle: {
          //             shadowBlur: 10,
          //             shadowOffsetX: 0,
          //             shadowColor: "rgba(0, 0, 0, 0.5)",
          //           },
          //         },
          //       },
          //     ],
          //   };
          //   option && myChart.setOption(option);
          //   let sizeFun = function () {
          //     myChart.resize();
          //   };
          //   window.addEventListener("resize", sizeFun);
          // });
        });
      }
@@ -576,8 +632,16 @@
.el-pagination {
  margin-left: 47%;
}
.tab3 {
  width: 100%;
// .tab3 {
//   width: 100%;
//   display: flex;
// }
.outside1 {
  width: 500px;
  max-height: 500px;
  overflow-y:auto;
  display: flex;
  margin-top: 8px;
  flex-direction: column;
}
</style>