MrShi
107 分钟以前 4e9e7ee05efb824d08cccafd97071415708d8cad
admin/src/views/business/reportRecord.vue
@@ -1,5 +1,5 @@
<template>
  <div class="main_app">
  <div class="main_app" >
    <QueryForm
      v-model="filters"
      :query-form-config="queryFormConfig"
@@ -11,6 +11,7 @@
      <el-button type="primary" :loading="exLoading" @click="exportExcel" v-permissions="['business:visits:exportExcel']">导出</el-button>
    </div>
    <el-table
      :height="tableHeightNew"
      v-loading="loading"
      :data="dataList"
      stripe
@@ -76,19 +77,19 @@
          <span v-if="row.status === 4" style="color: gray">取消</span>
          <span v-if="row.status === 5" style="color: green">下发成功</span>
          <span v-if="row.status === 6" style="color: gray">下发失败</span>
          <span v-if="row.status === 7" style="color: green">拜访中</span>
          <span v-if="row.status === 7" style="color: green">已登记</span>
          <span v-if="row.status === 8" style="color: red">已签离</span>
          <span v-if="row.status === 9" style="color: gray">已失效</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" width="100" fixed="right">
      <el-table-column label="操作" align="center" width="240" fixed="right">
        <template slot-scope="{ row }">
          <el-button
            type="text"
            @click="handleDetail(row)"
            v-permissions="['business:company:update']"
            >查看详情</el-button
          >
            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="cancel(row.id)"   v-permissions="['business:visits:cancel']"  v-if="(row.status == 0 || row.status == 1 || row.status == 2|| row.status == 5)"  icon="el-icon-delete" style="color: red"  >取消预约</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -108,8 +109,11 @@
// import ReportDetail from './page-components/ReportDetail.vue'
import ReportDetail from '@/views/task/visReportDetail.vue'
import OperaVisitsReportWindow from '@/components/business/operaVisitsReportWindow.vue'
import { fetchList, exportExcel } from '@/api/business/visits'
import { fetchList, exportExcel, deleteById ,visitsCancel} from '@/api/business/visits'
import BasePage from '@/components/base/BasePage'
import {mapState } from "vuex";
export default {
  extends: BasePage,
  components: {
    ReportDetail,
    QueryForm,
@@ -138,6 +142,12 @@
            filed: 'companyName',
            type: 'input',
            label: '公司名称'
          },
          {
            filed1: 'queryStarttime',
            filed2: 'queryEndtime',
            type: 'datetime',
            label: '拜访时间'
          }
        ],
        online: true
@@ -149,15 +159,33 @@
      },
      pagination: {
        capacity: 10,
        page: 1
        page: 1,
        total: 0
      },
      total: 0
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.getList()
  },
  methods: {
    cancel (id) {
      this.$confirm('确定取消预约吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        visitsCancel(id)
          .then(res => {
            this.pagination.page = 1
            this.getList()
          })
      }).catch(() => {
      })
    },
    exportExcel () {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
@@ -184,6 +212,21 @@
        this.$refs.operaVisitsWindowRef.isShowModal = true
      })
    },
    deleteById (row) {
      this.$confirm('确定删除该记录吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteById(row.id)
          .then(res => {
            this.$message.success('操作成功')
            this.page = 1
            this.getList()
          })
      }).catch(() => {
      })
    },
    handleDetail (row) {
      this.isShowReport = true
      this.$nextTick(() => {
@@ -203,6 +246,7 @@
        ...pagination
      }).then(res => {
        this.dataList = res.records || []
        this.pagination.total = res.total
      })
    },
    clear () {
@@ -213,10 +257,25 @@
    },
    handleSizeChange (capacity) {
      this.pagination.capacity = capacity
      this.getList(1)
    }
  }
}
</script>
<style lang="scss" scoped>
.table-pagination {
  margin-left: 0px;
  padding: 16px 0px ;
  text-align: left;
  display: block;
  z-index: 100;
  width: -webkit-fill-available;
  /* width: 80%; */
  position: fixed;
  bottom: 0px;
  background-color: white;
  margin-right: 50px;
}
</style>