liukangdong
2025-02-27 e80fb1e51d652d0ccecc27688c72a168c8297075
admin/src/views/business/reportRecord.vue
@@ -1,77 +1,35 @@
<template>
  <div class="main_app">
    <QueryForm
      v-model="filters"
      :query-form-config="queryFormConfig"
      @handleQuery="getList(1)"
      @clear="clear"
    />
    <div class="query_btns" style="margin: 16px 0 0" v-permissions="['business:visits:create', 'business:visits:exportExcel']">
      <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" v-permissions="['business:visits:create']">新建</el-button>
      <el-button type="primary" :loading="exLoading" @click="exportExcel" v-permissions="['business:visits:exportExcel']">导出</el-button>
    <div ref="QueryFormRef">
      <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    </div>
    <el-table
      v-loading="loading"
      :data="dataList"
      stripe
      row-key="id"
      default-expand-all
    >
    <div class="query_btns" style="margin: 16px 0 0"
      v-permissions="['business:visits:create', 'business:visits:exportExcel']">
      <el-button type="primary" @click="handleEdit()" icon="el-icon-plus"
        v-permissions="['business:visits:create']">新建</el-button>
      <el-button type="primary" :loading="exLoading" @click="exportExcel"
        v-permissions="['business:visits:exportExcel']">导出</el-button>
    </div>
    <el-table :max-height="tableHeight" v-loading="loading" :data="dataList" stripe row-key="id" default-expand-all>
      <el-table-column type="selection" width="55" align="center"></el-table-column>
      <el-table-column
        prop="carNos"
        label="入园车辆"
        min-width="100px"
      ></el-table-column>
      <el-table-column
        prop="companyName"
        label="公司名称"
        min-width="100px"
      ></el-table-column>
      <el-table-column
        prop="name"
        label="联系人信息"
        min-width="100px"
      ></el-table-column>
      <el-table-column
        prop="phone"
        label="手机号"
        min-width="100px"
      ></el-table-column>
      <el-table-column
        prop="receptMemberName"
        label="被访人"
        min-width="100px"
      ></el-table-column>
      <el-table-column prop="carNos" label="入园车辆" min-width="100px"></el-table-column>
      <el-table-column prop="companyName" label="公司名称" min-width="100px"></el-table-column>
      <el-table-column prop="name" label="联系人信息" min-width="100px"></el-table-column>
      <el-table-column prop="phone" label="手机号" min-width="100px"></el-table-column>
      <el-table-column prop="receptMemberName" label="被访人" min-width="100px"></el-table-column>
      <el-table-column label="拜访时间" min-width="160px">
        <template slot-scope="{ row }">
          <span>起:{{ row.starttime }}</span
          ><br />
          <span>起:{{ row.starttime }}</span><br />
          <span>止:{{ row.endtime }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="reason"
        label="拜访事由"
        min-width="100"
      ></el-table-column>
      <el-table-column
        prop="status"
        fixed="right"
        label="状态"
        align="center"
        min-width="100"
      >
      <el-table-column prop="reason" label="拜访事由" min-width="100"></el-table-column>
      <el-table-column prop="status" fixed="right" label="状态" align="center" min-width="100">
        <template slot-scope="{ row }">
          <span style="color: rgba(245, 154, 35, 0.996)" v-if="row.status === 0"
            >待提交审批</span
          >
          <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996)"
            >处理中</span
          >
          <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996)"
            >已同意</span
          >
          <span style="color: rgba(245, 154, 35, 0.996)" v-if="row.status === 0">待提交审批</span>
          <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996)">处理中</span>
          <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996)">已同意</span>
          <span style="color: gray" v-if="row.status === 3">已拒绝</span>
          <span v-if="row.status === 4" style="color: gray">取消</span>
          <span v-if="row.status === 5" style="color: green">下发成功</span>
@@ -83,21 +41,16 @@
      </el-table-column>
      <el-table-column label="操作" align="center" width="180" fixed="right">
        <template slot-scope="{ row }">
          <el-button
            type="text"
            @click="handleDetail(row)"
            v-permissions="['business:company:update']">查看详情</el-button>
          <el-button  type="text"  icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:visits:delete']">删除</el-button>
          <el-button type="text" @click="handleDetail(row)" v-permissions="['business:company:update']">查看详情</el-button>
          <el-button type="text" icon="el-icon-delete" @click="deleteById(row)" style="color: red"
            v-permissions="['business:visits:delete']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      @size-change="handleSizeChange"
      @current-change="getList"
      :pagination="pagination"
    />
    <pagination class="mt10" @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
    <ReportDetail v-if="isShowReport" ref="VisReportDetailRef" />
    <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList"  v-if="isShowEdit" ref="operaVisitsWindowRef" />
    <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList" v-if="isShowEdit"
      ref="operaVisitsWindowRef" />
  </div>
</template>
@@ -115,10 +68,11 @@
    Pagination,
    OperaVisitsReportWindow
  },
  data () {
  data() {
    return {
      isShowEdit: false,
      exLoading: false,
      tableHeight: 400,
      isShowReport: false,
      activeTab: '0',
@@ -154,11 +108,16 @@
      total: 0
    }
  },
  created () {
  created() {
    this.getList()
  },
  mounted() {
    this.$nextTick(() => {
      this.tableHeight = document.body.scrollHeight - this.$refs.QueryFormRef.offsetHeight - 300
    })
  },
  methods: {
    exportExcel () {
    exportExcel() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.exLoading = true
@@ -178,13 +137,13 @@
            })
        })
    },
    handleEdit () {
    handleEdit() {
      this.isShowEdit = true
      this.$nextTick(() => {
        this.$refs.operaVisitsWindowRef.isShowModal = true
      })
    },
    deleteById (row) {
    deleteById(row) {
      this.$confirm('确定删除该记录吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -199,7 +158,7 @@
      }).catch(() => {
      })
    },
    handleDetail (row) {
    handleDetail(row) {
      this.isShowReport = true
      this.$nextTick(() => {
        this.$nextTick(() => {
@@ -210,7 +169,7 @@
        })
      })
    },
    getList (page) {
    getList(page) {
      const { pagination, filters } = this
      pagination.page = page || pagination.page
      fetchList({
@@ -221,13 +180,13 @@
        this.pagination.total = res.total
      })
    },
    clear () {
    clear() {
      this.filters = {
        type: 2
      }
      this.getList(0)
    },
    handleSizeChange (capacity) {
    handleSizeChange(capacity) {
      this.pagination.capacity = capacity
      this.getList()
    }
@@ -235,5 +194,4 @@
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>