liukangdong
2024-07-01 f549372d6796835fcf12391abc8dee8375810d42
admin/src/views/operation/serviceCar/apprRecord.vue
@@ -34,6 +34,7 @@
            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="结束日期">
@@ -51,8 +52,9 @@
    </el-form>
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:empower:create', 'business:empower:delete']">
        <!--<li><el-button type="primary" v-permissions="['business:empower:exportExcel']" @click="exportExcel">导出</el-button></li> -->
      <ul class="toolbar" v-permissions="['business:carusebook:create','business:carusebook:exportExcel']">
        <li><el-button type="primary" @click="handleEdit" icon="el-icon-plus" v-permissions="['business:carusebook:create']">新建</el-button></li>
        <li><el-button type="primary" @click="handleEx" v-permissions="['business:carusebook:exportExcel']">导出</el-button></li>
      </ul>
      <el-table
          v-loading="isWorking.search"
@@ -71,13 +73,13 @@
          </template>
        </el-table-column>
        <el-table-column prop="planUseDate" label="出发时间" min-width="150px"></el-table-column>
        <el-table-column label="目的地类型" min-width="100px">
        <el-table-column label="目的地" min-width="200px">
          <template slot-scope="{row}">
            <span class="status-green" v-if="row.type === 0">市内用车</span>
            <span class="status-red"   v-if="row.type === 1">市外用车</span>
            <span class="status-green" v-if="row.type === 0">【市内】</span>
            <span class="status-red"   v-if="row.type === 1">【市外】</span>
            <span >{{ row.addr }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="addr" label="目的地" min-width="200px"></el-table-column>
        <el-table-column label="状态" min-width="100px">
          <template slot-scope="{row}">
            <span class="status-blue"  v-if="row.status === 0">申请中</span>
@@ -97,7 +99,7 @@
            fixed="right"
        >
          <template slot-scope="{row}">
            <el-button type="text" icon="el-icon-edit" @click="$refs.OperaHiddenDangerWindow.open('隐患随手拍详情',row)" >查看详情</el-button>
            <el-button type="text" icon="el-icon-edit" @click="$refs.OperaDetailsWindow.open('公务车申请详情',row)" >查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -108,7 +110,8 @@
      >
      </pagination>
    </template>
    <OperaHiddenDangerWindow ref="OperaHiddenDangerWindow" @success="handlePageChange"/>
    <OperaCarUseBookWindow ref="OperaDetailsWindow" @success="handlePageChange"/>
    <OperaCarUseBookParamWindow ref="OperaParamWindow" @success="search"/>
  </TableLayout>
</template>
@@ -116,13 +119,15 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaHiddenDangerWindow from '@/components/business/OperaHiddenDangerWindow'
import OperaCarUseBookWindow from '@/components/business/OperaCarUseBookWindow'
import OperaCarUseBookParamWindow from '@/components/operation/OperCarUseBookParamWindow.vue'
import { timeForMat } from '@/utils/util'
import { allList } from '@/api/business/hiddenDangerParam'
import { carUseBookRecordEx } from '@/api/business/carUseBook'
export default {
  name: 'Empower',
  extends: BaseTable,
  components: { TableLayout, Pagination ,OperaHiddenDangerWindow},
  components: { TableLayout, Pagination, OperaCarUseBookWindow, OperaCarUseBookParamWindow },
  data () {
    return {
      // 搜索
@@ -132,7 +137,8 @@
        queryStartTime: '',
        queryEndTime: '',
        type: null,
        status:null
        status: null,
        radio: 0
      },
      cateList: [],
      areaList: [],
@@ -151,6 +157,24 @@
    this.loadParams()
  },
  methods: {
    handleEx () {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.exLoading = true
          carUseBookRecordEx({
            model: this.searchForm
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.exLoading = false
            })
        })
    },
    changeRadio (e) {
      this.searchForm.radio = e
      if (e === '0') {
@@ -168,26 +192,29 @@
      }
      this.search()
    },
    handleEdit () {
      this.$refs.OperaParamWindow.open()
    },
    loadParams () {
      allList({
      })
          .then(res => {
            if (res != null && res.length) {
              res.forEach(item => {
                if (item && item.type != null && item.type === 0) {
                  this.areaList.push(item)
                }
                if (item && item.type != null && item.type === 1) {
                  this.cateList.push(item)
                }
              })
            }
          })
          .catch(e => {
            // this.$tip.apiFailed(e)
          })
          .finally(() => {
          })
        .then(res => {
          if (res != null && res.length) {
            res.forEach(item => {
              if (item && item.type != null && item.type === 0) {
                this.areaList.push(item)
              }
              if (item && item.type != null && item.type === 1) {
                this.cateList.push(item)
              }
            })
          }
        })
        .catch(e => {
          // this.$tip.apiFailed(e)
        })
        .finally(() => {
        })
    },
    seleTime (e) {
      this.searchForm.queryStartTime = e[0]