zouyu
2025-03-11 0bb447f57ab45b86db18b0cfd7c2fda36da817d3
src/views/CNAS/resourceDemand/device/component/resource-reservation.vue
@@ -2,8 +2,7 @@
<template>
  <div class="role_manage">
    <el-row class="title">
      <el-col :span="8" style="text-align: left;">预定总览</el-col>
      <el-col :span="16" style="text-align: right;padding-bottom:10px">
      <el-col :span="24" style="text-align: right;padding:10px 0">
        <el-date-picker
          v-model="startTime"
          format="yyyy-MM-dd"
@@ -19,7 +18,7 @@
          size="mini"
          type="date"
          value-format="yyyy-MM-dd"/>
        <el-button size="mini" type="primary" @click="ValidateAndQuery">查 询</el-button>
        <el-button size="mini" type="primary" @click="ValidateAndQuery" style="margin-left: 10px">查 询</el-button>
      </el-col>
    </el-row>
    <div class="table-container">
@@ -134,7 +133,6 @@
    }
  },
  data() {
    return {
      timeSlots: ['09:00-12:00', '13:00-18:00', '18:00-22:00'],
      dates: [],
@@ -154,7 +152,6 @@
      startTime: '',
      endTime: '',
      entity: {
        deviceName: null,
        laboratoryName: '',
        storagePoint: '',
      },
@@ -169,15 +166,6 @@
        reservationSpecification: ''
      },
      total: '',
      componentData: {
        entity: {
          largeCategory: null,
          orderBy: {
            field: 'id',
            order: 'asc'
          }
        },
      },
      yuyue: null,
      yuyuetime: '',
      rules: {
@@ -202,14 +190,12 @@
      this.clickSidebar(newVal)
    }
  },
  created() {
    this.clickSidebar(this.clickNodeVal)
    this.initDate();
  },
  mounted() {
    this.getStartTimeAndEndTime();
    // this.getStartTimeAndEndTime();
  },
  methods: {
    isBeforeDate() {
@@ -218,7 +204,7 @@
      const appointment = this.appointment && this.appointment.split('-')
      let appointment0 = ''
      let appointment1 = ''
      if (appointment !== '') {
      if (appointment) {
        appointment0 = appointment[0].slice(0, 2)
        appointment1 = appointment[1].slice(0, 2)
      }
@@ -238,7 +224,7 @@
      if (!row || row.dateList === null || row.dateList === undefined || row.dateList === "") {
        return '预约';
      }
      var dateLst = row.dateList
      const dateLst = row.dateList
      for (const dateLstElement of dateLst) {
        if (dateLstElement.date === date) {
          if (dateLstElement.value === 0) {
@@ -312,12 +298,16 @@
    getStartTimeAndEndTime() {
      //查询逻辑
      this.tableLoading = true;
      reservationSelectDevice({
          current: this.currentPage,
          size: this.pageSize,
        ...this.entity,
        laboratoryNameIsNull: this.laboratoryNameIsNull
      }).then(res => {
      const params = {
        current: this.currentPage,
        size: this.pageSize,
        starttime: this.startTime,
        endtime: this.endTime,
        laboratoryNameIsNull: this.laboratoryNameIsNull,
        laboratoryName: this.entity.laboratoryName,
        storagePoint: this.entity.storagePoint,
      }
      reservationSelectDevice(params).then(res => {
        this.tableLoading = false;
        if (res.code === 200) {
          this.tableData = res.data;
@@ -326,17 +316,20 @@
        this.tableLoading = false;
      })
    },
    // 打开预约弹框
    openModal(date, row) {
      console.log('date', date);
      console.log('row', row);
      this.yuyue = row;
      this.yuyuetime = date;
      this.appointment = row.time
      this.showModal = true;
      this.getList();
    },
    // 打开新建预定弹框
    openAdd() {
      this.addVisiable = true;
      this.addReservation.deviceId = this.yuyue.id;
      // this.addReservation.deviceNumber = this.yuyue.deviceNumber;
      this.addReservation.deviceName = this.yuyue.deviceName;
      this.addReservation.reservationTime = this.yuyuetime + " " + this.yuyue.time;
      this.addReservation.specificTime = this.yuyue.time;
@@ -393,9 +386,10 @@
        }
      });
    },
    // 预定信息查询
    getList() {
      const params = {
        selectReservationParameterPage: this.yuyue.id,
        deviceId: this.yuyue.id,
        reservationTime: this.yuyuetime,
        specificTime: this.yuyue.time,
      }