qinxianzhangyao
2024-03-15 ac6766c11f8a2b8de903b58c13a8f206fa01dccd
src/views/hosp/order/index.vue
@@ -26,6 +26,7 @@
          style="width: 170px"
          clearable
          @keyup.enter.native="handleQuery"
          @blur="hb"
        />
      </el-form-item>
      <el-form-item label="登记时间" prop="createTimeList">
@@ -37,7 +38,7 @@
          style="width: 300px"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:00:00']"
          :default-time="['00:00:00', '23:59:00']"
          format="yyyy-MM-dd HH:mm"
          value-format="yyyy-MM-dd HH:mm"
          @change="dateChangebirthday1"
@@ -171,6 +172,7 @@
          <template slot-scope="scope">
            <span v-if="scope.row.tjCustomerSex == '0'">男</span>
            <span v-if="scope.row.tjCustomerSex == '1'">女</span>
            <span v-if="scope.row.tjCustomerSex == '2'">未知</span>
          </template>
        </el-table-column>
        <el-table-column
@@ -318,6 +320,15 @@
              title="体检报告"
              @click="viewReport(scope.row)"
            ></el-button> -->
            <!-- <el-button
              type="text"
              size="mini"
              class="btn"
              icon="el-icon-view"
              title="个人信息表"
              v-if="scope.row.tjCategory == '02'"
              @click="viewReport(scope.row)"
            ></el-button> -->
            <el-button
              type="text"
@@ -401,21 +412,30 @@
    <el-dialog
      :title="title"
      :visible.sync="Projectopen"
      width="980px"
      width="1200px"
      style="height: 860px"
      append-to-body
    >
      <el-row type="flex" class="row-bg" justify="space-around">
        <el-col :span="6">
          <div style="text-align: center; margin-bottom: 10px;margin-top:10px">项目列表</div>
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
            项目列表
          </div>
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <div class="tab3">
            <div class="outside1">
              <el-tree
                v-loading="loading"
                :data="Treedata"
                show-checkbox
                node-key="proId"
                :props="defaultProps"
                @check-change="handleCurrentChecked"
                :filter-node-method="filterNode"
                ref="tree"
              >
              </el-tree>
            </div>
@@ -547,28 +567,38 @@
    <el-dialog
      :title="title"
      :visible.sync="Projectopen1"
      width="980px"
      width="1200px"
      style="height: 860px"
      append-to-body
    >
      <el-row type="flex" class="row-bg" justify="space-around">
        <el-col :span="6">
          <div style="text-align: center; margin-bottom: 10px;margin-top:10px">项目列表</div>
        <el-col :span="8">
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
            项目列表
          </div>
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <div class="tab3">
            <div class="outside1">
              <el-tree
                class="filter-tree"
                v-loading="loading"
                :data="Treedata"
                show-checkbox
                node-key="proId"
                :props="defaultProps"
                @check-change="handleCurrentChecked"
                :filter-node-method="filterNode"
                ref="tree"
              >
              </el-tree>
            </div>
          </div>
        </el-col>
        <el-col :span="18">
        <el-col :span="15">
          <div class="grid-content bg-purple">
            <template>
              <el-form :model="form">
@@ -724,14 +754,13 @@
<script>
import {
  listOrder,
  getNumber,
  hasReportEnd,
  hasReport,
  gettoPdf,
  getPdf,
  getOrderList,
  getNewDateList,
} from "@/api/hosp/order";
import moment from "moment";
import { getwater } from "@/api/hosp/customer";
import ViewPdf from "@/components/ViewPdf";
import { projectGetList, getaddtTransition } from "@/api/system/tijian";
@@ -743,6 +772,7 @@
  name: "Order",
  data() {
    return {
      filterText: "",
      orderIds: "",
      tjnumbers: "",
      cusIds: "",
@@ -851,9 +881,15 @@
      },
    };
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
  },
  created() {
    this.getNowTime();
    this.getList();
    // this.getNowTime();
    this.getdate();
  },
  mounted() {
    this.$nextTick(() => {
@@ -861,37 +897,53 @@
    });
  },
  methods: {
    getdate() {
      getNewDateList().then((res) => {
        if(res.data){
          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;
    },
    // / 处理默认选中当前日期
    getNowTime() {
      var curDate = new Date(new Date().setHours(0, 0, 0, 0)).getTime();
      var dayNum = 7 * 24 * 3600 * 1000;
      var threeDays = curDate - dayNum;
      var sDay = this.getLocalTime(threeDays);
      var end = this.getLocalTime(curDate);
      this.createTimeList = [sDay, end];
    },
    add0(m) {
      return m < 10 ? "0" + m : m;
    },
    getLocalTime(nS) {
      var time = new Date(nS);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      return (
        y +
        "-" +
        this.add0(m) +
        "-" +
        this.add0(d) +
        " " +
        this.add0(h) +
        ":" +
        this.add0(mm)
      );
    },
    // getNowTime() {
    //   var curDate = new Date(new Date().setHours(0, 0, 0, 0)).getTime();
    //   var dayNum = 7 * 24 * 3600 * 1000;
    //   var threeDays = curDate - dayNum;
    //   var sDay = this.getLocalTime(threeDays);
    //   var end = this.getLocalTime(curDate);
    //   this.createTimeList = [sDay, end];
    // },
    // add0(m) {
    //   return m < 10 ? "0" + m : m;
    // },
    // getLocalTime(nS) {
    //   var time = new Date(nS);
    //   var y = time.getFullYear();
    //   var m = time.getMonth() + 1;
    //   var d = time.getDate();
    //   var h = time.getHours();
    //   var mm = time.getMinutes();
    //   return (
    //     y +
    //     "-" +
    //     this.add0(m) +
    //     "-" +
    //     this.add0(d) +
    //     " " +
    //     this.add0(h) +
    //     ":" +
    //     this.add0(mm)
    //   );
    // },
    dateChangebirthday1(val) {
      this.startTime = val;
    },
@@ -900,10 +952,18 @@
    },
    /** 查询体检记录列表 */
    getList() {
      this.queryParams.djbeginTime = this.startTime[0];
      this.queryParams.djendTime = this.startTime[1];
      this.queryParams.bgbeginTime = this.startTime1[0];
      this.queryParams.bgendTime = this.startTime1[1];
      if (this.startTime) {
        this.queryParams.djbeginTime = this.startTime[0];
        this.queryParams.djendTime = this.startTime[1];
      }else{
         this.queryParams.djbeginTime = this.createTimeList[0];
        this.queryParams.djendTime = this.createTimeList[1];
      }
      if (this.startTime1) {
        this.queryParams.bgbeginTime = this.startTime1[0];
        this.queryParams.bgendTime = this.startTime1[1];
      }
      this.loading = true;
      getOrderList(this.queryParams).then((response) => {
        this.orderList = response.data.list;
@@ -1004,6 +1064,7 @@
    },
    // 表单重置
    reset() {
      this.form = {
        orderId: null,
        userId: null,
@@ -1029,6 +1090,11 @@
      };
      this.resetForm("form");
    },
    hb() {
      if (this.queryParams.tjNum != undefined) {
        this.handleQuery();
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
@@ -1036,6 +1102,9 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.startTime = []
      this.startTime1 = []
      this.createTimeList = []
      this.resetForm("queryForm");
      this.handleQuery();
    },
@@ -1088,6 +1157,7 @@
    // 补录项目
    handleProject(row) {
      this.loading = true;
      this.orderId = row.orderId;
      this.cusId = row.tjCusIdCard;
      this.userId = row.userId;
@@ -1105,12 +1175,14 @@
      /** 查询部门下拉树结构 */
      projectGetList().then((response) => {
        this.Treedata = response.data.list;
        this.loading = false;
      });
      this.Projectopen = true;
      this.title = "补录项目";
    },
    // 补录项目
    handleProject1(row) {
      this.loading = true;
      this.orderId = this.ids;
      this.cusId = this.cusIds;
      this.userId = this.userIds;
@@ -1127,7 +1199,8 @@
      }
      /** 查询部门下拉树结构 */
      projectGetList().then((response) => {
        this.Treedata = response.data;
        this.Treedata = response.data.list;
        this.loading = false;
      });
      this.Projectopen1 = true;
      this.title = "补录项目";
@@ -1163,7 +1236,9 @@
        this.list1 = false;
        this.DataList.forEach((item) => {
          this.TotalPrice1 = item.proPrice + this.TotalPrice1;
          this.proIds.push(item.proId);
          item.tjProjectList.forEach((item1) => {
            this.proIds.push(item1.proId);
          });
        });
      }
    },
@@ -1340,6 +1415,11 @@
  margin-top: 8px;
}
.tab3 {
  max-height: 500px;
  overflow-y: auto;
}
.outside1 {
  width: 700px;
  display: flex;