jiangping
2024-05-09 6cde03a3ede89b4dfe95938d6e405b38ba4b1ab1
admin/src/views/business/visits.vue
@@ -49,10 +49,19 @@
                <el-table-column prop="companyName" label="公司名称" min-width="100px"></el-table-column>
                <el-table-column prop="receptMemberName" label="被访人" min-width="100px"></el-table-column>
                <el-table-column prop="reason" label="拜访事由" min-width="100px"></el-table-column>
                <el-table-column label="拜访时间" min-width="170px">
                <el-table-column label="预约时间" min-width="170px">
                    <template slot-scope="{row}">
                        <span>起:{{row.starttime}}</span><br/>
                        <span>止:{{row.endtime}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="签到时间" min-width="170px">
                    <template slot-scope="{row}">
                        <div v-if="row.inDate && row.outDate">
                            <span>起:{{row.inDate}}</span><br/>
                            <span>止:{{row.outDate}}</span>
                        </div>
                        <span v-else>-</span>
                    </template>
                </el-table-column>
                <el-table-column label="随访人员" min-width="100px">
@@ -68,15 +77,15 @@
                <el-table-column prop="status" fixed="right" label="状态" min-width="100px">
                    <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">审批中</span>
                        <span v-if="row.status === 2">审核通过</span>
                        <span style="color: red;" v-if="row.status === 3">审核不通过</span>
                        <span v-if="row.status === 4">取消</span>
                        <span v-if="row.status === 5">预约成功</span>
                        <span v-if="row.status === 6">预约失败</span>
                        <span v-if="row.status === 7">拜访中</span>
                        <span v-if="row.status === 8">已签离</span>
                      <span v-if="row.status === 9">已失效</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>
                        <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 === 8" style="color: red">已签离</span>
                      <span v-if="row.status === 9" style="color: gray">已失效</span>
                    </template>
                </el-table-column>
                <el-table-column
@@ -86,7 +95,9 @@
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.OperaVisitsDesWindow.open('详情', row.id)" v-permissions="['business:visits:update']">查看详情</el-button>
                      <el-button type="text" @click="departure(row.id)" v-permissions="['business:visits:level']" icon="el-icon-delete" style="color: red" v-if="row.status == 7">离厂</el-button>
                      <el-button type="text" @click="cancel(row.id)" v-permissions="['business:visits:cancel']" icon="el-icon-delete"   style="color: red" v-if="row.status == 5">取消预约</el-button>
                        <el-button type="text" @click="$refs.OperaVisitsDesWindow.open('详情', row.id)" icon="el-icon-view">详情</el-button>
<!--                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:visits:delete']">查询审批结果</el-button>-->
                    </template>
                </el-table-column>
@@ -108,6 +119,7 @@
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaVisitsDesWindow from '@/components/business/OperaVisitsDesWindow'
import {level, visitCancel} from "@/api/business/staging";
export default {
  name: 'Visits',
@@ -133,5 +145,37 @@
    })
    this.search()
  },
  methods: {
    departure (id) {
      this.$confirm('确定离场吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        level(id)
          .then(res => {
            this.page = 1
            this.getData()
          })
      }).catch(() => {
      })
    },
    cancel (id) {
      this.$confirm('确定取消预约吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        visitCancel(id)
          .then(res => {
            this.page = 1
            this.getData()
          })
      }).catch(() => {
      })
    }
  }
}
</script>