123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <template>
- <!-- 消息中心 -->
- <div style="display: flex">
- <el-card style="width: 18%; margin-right: 18px; border-radius: 6px">
- <el-tabs
- v-model="activeNametree"
- type="card"
- @tab-click="tabClick"
- stretch
- >
- <!-- <el-tab-pane label="按分类" name="grp"></el-tab-pane> -->
- <el-tab-pane label="按机构" name="org"></el-tab-pane>
- </el-tabs>
- <el-tree
- :data="data"
- :props="defaultProps"
- node-key="spdId"
- @node-click="handleNodeClick"
- default-expand-all="true"
- style="margin-top: 10px"
- >
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <div>{{ node.label }}</div>
- </span>
- </el-tree>
- </el-card>
- <div class="right-common-box">
- <el-form :model="listQuery" ref="queryForm" :inline="true">
- <el-form-item label="时间" prop="docmkDate" class="long">
- <el-date-picker
- v-model="listQuery.docmkDate"
- type="daterange"
- range-separator="至"
- :editable="false"
- value-format="yyyy-MM-dd HH:mm:ss"
- start-placeholder="开始时间"
- end-placeholder="结束时间"
- style="width: 230px"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getorderData('search')"
- >查询
- </el-button>
- <el-button @click="reset">重置</el-button>
- </el-form-item>
- </el-form>
- <div class="right-btn">
- <el-button
- type="primary"
- icon="el-icon-download"
- @click="DownloadData()"
- >导出</el-button
- >
- </div>
- <el-table
- v-loading="listLoading"
- element-loading-text="加载中"
- :data="list"
- fit
- stripe
- border
- show-summary
- :summary-method="getSummaries"
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="机构名称" prop="orgName" />
- <el-table-column label="对账金额" prop="dzje" />
- <el-table-column label="退货金额" prop="thje" />
- <el-table-column label="应付总金额" prop="yfzje" />
- <el-table-column label="卫生院(非4+7)" prop="wsyfjcje" />
- <el-table-column label="卫生院(4+7)" prop="wsyjcje" />
- <el-table-column label="卫生室(非4+7)" prop="wssfjcje" />
- <el-table-column label="卫生室(4+7)" prop="wssfjcje" />
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="total > 0"
- :total="total"
- :page.sync="listQuery.current"
- :limit.sync="listQuery.size"
- @pagination="getorderData"
- />
- </div>
- </div>
- </template>
- <script>
- import ylPagination from "@/components/yl-pagination";
- import {
- getMcsOrdPageSpler,
- getMcsOrdPageYqrSpler,
- selectSpdList
- } from "@/api/orderManage-sup/index";
- import { exportData } from "./const";
- import {
- getSelectRkAmtPage,
- exportRkAmtList
- } from "@/api/report-sup/consum-report";
- import moment from "moment";
- const startOfMonth = moment()
- .startOf("month")
- .format("YYYY-MM-DD HH:mm:ss");
- const endOfMonth = moment()
- .endOf("month")
- .format("YYYY-MM-DD HH:mm:ss");
- export default {
- components: {
- ylPagination
- },
- data() {
- return {
- activeNametree: "org",
- data: [],
- spdId: null,
- defaultProps: {
- children: "children",
- label: "spdName"
- },
- listQuery: {
- current: 1,
- size: 10,
- docmkDateStart: "",
- docmkDateEnd: "",
- docmkDate: [startOfMonth, endOfMonth],
- spdId: ""
- },
- options: [],
- listLoading: false,
- list: [],
- total: 0
- };
- },
- mounted() {
- this.getData();
- },
- methods: {
- //数据导出
- DownloadData() {
- exportRkAmtList({
- ...this.listQuery
- }).then(res => {
- const _res = res.data;
- exportData(_res);
- });
- },
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "总计";
- return;
- }
- const values = data.map(item => Number(item[column.property]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- let newCont = Number(prev) + Number(curr);
- return newCont.toFixed(4);
- } else {
- return prev;
- }
- }, 0);
- sums[index] += " ";
- } else {
- sums[index] = "";
- }
- });
- return sums;
- },
- tabClick(tab) {
- if (tab.label == "按机构") {
- this.defaultProps.label = "spdName";
- }
- },
- // 获取医院列表
- getData(type) {
- this.data = [];
- selectSpdList()
- .then(res => {
- this.listQuery.spdId = res.data[0].spdId;
- this.data = res.data;
- this.getorderData("search");
- })
- .catch(err => {});
- },
- getorderData(type) {
- if (type == "search") {
- this.listQuery.current = 1;
- }
- this.listLoading = true;
- this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
- this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
- getSelectRkAmtPage(this.listQuery)
- .then(res => {
- this.list = res.data;
- this.listLoading = false;
- })
- .catch(err => {
- this.listLoading = false;
- });
- },
- // 点击获取耗材列表
- handleNodeClick(data) {
- this.listLoading = true;
- this.spdId = data.spdId;
- this.listQuery.spdId = this.spdId;
- this.getorderData("");
- },
- reset() {
- this.$refs.queryForm.resetFields();
- this.getorderData();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .long .el-input__inner {
- width: 199px;
- }
- .right-common-box ::v-deep .el-table__fixed {
- height: 100% !important;
- }
- .right-common-box ::v-deep .el-table__fixed-right {
- height: 100% !important;
- }
- .custom-tree-node {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .custom-tree-node ::v-deep .redTit {
- min-width: 30px;
- background-color: #f56c6c;
- min-height: 1px;
- border-radius: 10px;
- text-align: center;
- margin-left: 10px;
- padding: 1px;
- color: #fff;
- }
- .right-btn {
- width: 100px;
- height: 40px;
- position: absolute;
- right: 20px;
- top: 30px;
- }
- </style>
|