su
su1124
2024-01-26 5771eee59795899b8adc1fe5cc51cb47bf8c7f0b
src/views/team/reportresults/index.vue
@@ -110,11 +110,11 @@
          >统计结果</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 +163,7 @@
            prop="company"
            label="单位"
            align="center"
            width="170px"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
@@ -175,41 +176,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 +233,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>
@@ -258,20 +308,7 @@
require("echarts/lib/component/legend");
require("echarts/lib/chart/pie");
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 +317,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: [],
@@ -364,31 +404,51 @@
    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 = [];
      // }
    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.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();
@@ -474,96 +534,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 +606,14 @@
.el-pagination {
  margin-left: 47%;
}
.tab3 {
  width: 100%;
// .tab3 {
//   width: 100%;
//   display: flex;
// }
.outside1 {
  width: 500px;
  display: flex;
  margin-top: 8px;
  flex-direction: column;
}
</style>