ll
liukangdong
2025-03-10 2bc4a739db642494accbf5be1fa55793f4652f44
admin/src/views/operation/serviceCar/apprRecord.vue
@@ -1,5 +1,5 @@
<template>
  <TableLayout :permissions="['business:empower:query']">
  <TableLayout :permissions="['business:carusebook:query']">
    <!-- 搜索表单 -->
    <div ref="QueryFormRef" slot="search-form">
      <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
@@ -29,7 +29,7 @@
            <el-option label="市外用车" value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出发时间" prop="startTime">
        <el-form-item label="申请时间" prop="startTime">
          <!-- <el-date-picker @change="seleTime" v-model="time" @keypress.enter.native="search" type="datetimerange"
            format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']"
            range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
@@ -64,7 +64,7 @@
          <el-button type="primary" @click="handleEx" v-permissions="['business:carusebook:exportExcel']">导出</el-button>
        </li>
      </ul>
      <el-table :max-height="tableHeight" v-loading="isWorking.search" :data="tableData.list" stripe
      <el-table :height="tableHeightNew" v-loading="isWorking.search" :data="tableData.list" stripe
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="carCode" label="车牌号" min-width="100px"></el-table-column>
@@ -101,15 +101,16 @@
        <el-table-column prop="createDate" label="申请时间" min-width="150px"></el-table-column>
        <el-table-column prop="editDate" label="操作时间" min-width="150px"></el-table-column>
        <el-table-column label="操作" min-width="160" align="center" fixed="right">
        <el-table-column label="操作" min-width="180" align="center" fixed="right">
          <template slot-scope="{ row }">
            <el-button type="text" icon="el-icon-edit"
              @click="$refs.OperaDetailsWindow.open('公务车申请详情', row)">查看详情</el-button>
            <!-- <el-button v-if="(row.status === 1 || row.status === 2) && new Date().getTime() < new Date(row.startTime).getTime()" type="text" icon="el-icon-delete" @click="rowRevokeClick(row)" >撤销</el-button> -->
            <el-button style="color: red"
              v-if="(row.status === 0 || row.status === 1 || row.status === 2) && new Date().getTime() < new Date(row.startTime).getTime()"
              type="text" icon="el-icon-delete" @click="rowRevokeClick(row)">撤销</el-button>
            <el-button style="color: red" type="text" icon="el-icon-delete" @click="deleteById(row)">删除</el-button>
            <el-button style="color: red" v-if="row.hasRole == 1" type="text" icon="el-icon-delete"
              @click="rowRevokeClick(row)">撤销</el-button>
            <!-- <el-button style="color: red"   v-if="(row.status === 0 && row.creator == userInfo.id)||((row.status === 0 || row.status === 1 ) || ( row.status === 2 && new Date().getTime() < new Date(row.startTime).getTime() ))"  type="text"  icon="el-icon-delete"   @click="rowRevokeClick(row)" >撤销</el-button>-->
            <el-button style="color: red" type="text" icon="el-icon-delete"
              v-permissions="['business:carusebook:delete']" @click="deleteById(row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -148,12 +149,13 @@
  components: { TableLayout, Pagination, OperaCarUseBookWindow, OperaCarUseBookParamWindow },
  data() {
    return {
      // userInfo: this.$store.state.userInfo,
      // 搜索
      searchForm: {
        memberName: '',
        companyName: '',
        startTime: '',
        endTime: '',
        queryStartTime: '',
        queryEndTime: '',
        type: null,
        status: null,
        radio: 0
@@ -179,11 +181,6 @@
    // this.search()
    this.changeRadio('0')
    this.loadParams()
  },
  mounted() {
    this.$nextTick(() => {
      this.tableHeight = document.body.scrollHeight - this.$refs.QueryFormRef.offsetHeight - 300
    })
  },
  methods: {
    rowRevokeClick(row) {
@@ -263,17 +260,27 @@
        })
    },
    seleTime(e) {
      this.searchForm.queryStartTime = e[0]
      this.searchForm.queryEndTime = e[1]
      this.searchForm.queryStartTime = null
      this.searchForm.queryEndTime = null
      if (e != null && e.length >= 2) {
        this.searchForm.queryStartTime = e[0]
        this.searchForm.queryEndTime = e[1]
      }
      this.searchForm.radio = null
      this.search()
    },
    reset() {
      this.$refs.searchForm.resetFields()
      this.searchForm = {}
      this.time = []
      // this.searchForm.radio = '0'
      // this.changeRadio('0')
      this.searchForm = {
        memberName: '',
        companyName: '',
        queryStartTime: '',
        queryEndTime: '',
        type: null,
        status: null,
        radio: ''
      }
      // this.changeRadio(0)
      this.search()
    }
  }