jiangping
2024-05-09 6cde03a3ede89b4dfe95938d6e405b38ba4b1ab1
admin/src/views/business/visits.vue
@@ -13,13 +13,16 @@
            </el-form-item>
            <el-form-item label="审批状态" prop="status">
                <el-select v-model="searchForm.status" placeholder="请选择">
                    <el-option label="待审核" value="0"></el-option>
                    <el-option label="已提交ERP审批" value="1"></el-option>
                    <el-option label="待提交审批" value="0"></el-option>
                    <el-option label="审批中" value="1"></el-option>
                    <el-option label="审核通过" value="2"></el-option>
                    <el-option label="审核不通过" value="3"></el-option>
                    <el-option label="取消" value="4"></el-option>
                    <el-option label="下发成功" value="5"></el-option>
                    <el-option label="下发失败" value="6"></el-option>
                    <el-option label="预约成功" value="5"></el-option>
                    <el-option label="预约失败" value="6"></el-option>
                    <el-option label="拜访中" value="7"></el-option>
                    <el-option label="已签离" value="8"></el-option>
                    <el-option label="已失效" value="9"></el-option>
                </el-select>
            </el-form-item>
            <section>
@@ -46,44 +49,56 @@
                <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>
                        <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">
                    <template slot-scope="{row}">
                        <span v-if="row.visitsList && row.visitsList.length > 0">{{row.visitsList.length}}</span>
                        <span>0</span>
                        <span>{{row.memberNum || '-'}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="随访车辆" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.carNos">{{row.carNos.split(',').length}}</span>
                        <span>0</span>
                        <span>{{row.carNum}}</span>
                    </template>
                </el-table-column>
                <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">已提交ERP审批</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 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>
                        <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
                    v-if="containPermissions(['business:visits:update', 'business:visits:delete'])"
                    label="操作"
                    min-width="190"
                    min-width="100"
                    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="deleteById(row)" icon="el-icon-delete" v-permissions="['business:visits:delete']">查询审批结果</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>
            </el-table>
@@ -104,6 +119,8 @@
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',
  extends: BaseTable,
@@ -127,6 +144,38 @@
      'field.main': 'id'
    })
    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>