|  |  |  | 
|---|
|  |  |  | <el-form-item label="身份证号" prop="idcardNo"> | 
|---|
|  |  |  | <el-input v-model="searchForm.idcardNo" placeholder="请输入身份证号" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="组织名称" prop="companyName"> | 
|---|
|  |  |  | <el-input v-model="searchForm.companyName" placeholder="请输入组织名称" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <el-form-item label="访客单位" prop="companyName"> | 
|---|
|  |  |  | <el-input v-model="searchForm.companyName" placeholder="请输入访客单位" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="审批状态" prop="status"> | 
|---|
|  |  |  | <el-select v-model="searchForm.status" placeholder="请选择"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | <!-- 表格和分页 --> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <!--            <ul class="toolbar" v-permissions="['business:visits:create', 'business:visits:delete']">--> | 
|---|
|  |  |  | <!--                <li><el-button type="primary" @click="$refs.operaVisitsWindow.open('新建访客申请信息表')" icon="el-icon-plus" v-permissions="['business:visits:create']">新建</el-button></li>--> | 
|---|
|  |  |  | <!--                <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:visits:delete']">删除</el-button></li>--> | 
|---|
|  |  |  | <!--            </ul>--> | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['business:visits:create', 'business:visits:exportExcel']"> | 
|---|
|  |  |  | <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus" v-permissions="['business:visits:create']">新建</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" :loading="isWorking.export" @click="exportExcel" v-permissions="['business:visits:exportExcel']">导出</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></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="companyName" label="组织名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="随访人员" min-width="100px"> | 
|---|
|  |  |  | <el-table-column label="施工人员" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span>{{row.memberNum || '-'}}</span> | 
|---|
|  |  |  | <span v-if="row.type == 0">否</span> | 
|---|
|  |  |  | <span v-if="row.type == 1">是</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="随访车辆" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span>{{row.carNum}}</span> | 
|---|
|  |  |  | <span>{{row.carNos}}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="status" fixed="right" label="状态" min-width="100px"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <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="$refs.OperaVisitsDesWindow.open('详情', row.id)" icon="el-icon-view">详情</el-button> --> | 
|---|
|  |  |  | <el-button type="text" @click="handleDetail(row)" 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> | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  | <!--      详情      --> | 
|---|
|  |  |  | <OperaVisitsDesWindow ref="OperaVisitsDesWindow" /> | 
|---|
|  |  |  | <!-- <OperaVisitsDesWindow ref="OperaVisitsDesWindow" /> --> | 
|---|
|  |  |  | <TaskDetail v-if="isShowDetail" ref="DetailRef" /> | 
|---|
|  |  |  | <!-- 新建 --> | 
|---|
|  |  |  | <OperaVisitsWindow @close="isShowEdit = false" @success="search"  v-if="isShowEdit" ref="operaVisitsWindowRef" /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | import TableLayout from '@/layouts/TableLayout' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import OperaVisitsDesWindow from '@/components/business/OperaVisitsDesWindow' | 
|---|
|  |  |  | import OperaVisitsWindow from '@/components/business/operaVisitsWindow' | 
|---|
|  |  |  | import TaskDetail from '@/views/task/visSubDetail.vue' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'Visits', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { TableLayout, Pagination, OperaVisitsDesWindow }, | 
|---|
|  |  |  | components: { TableLayout, Pagination, TaskDetail, OperaVisitsWindow }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | isShowEdit: false, | 
|---|
|  |  |  | isShowDetail: false, | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | companyName: '', | 
|---|
|  |  |  | idcardNo: '', | 
|---|
|  |  |  | status: '' | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | type: 0 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | departure(id) { | 
|---|
|  |  |  | handleDetail (row) { | 
|---|
|  |  |  | this.isShowDetail = true | 
|---|
|  |  |  | console.log('row', row); | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.DetailRef.id = row.id | 
|---|
|  |  |  | this.$refs.DetailRef.type = 0 | 
|---|
|  |  |  | this.$refs.DetailRef.getDetail() | 
|---|
|  |  |  | this.$refs.DetailRef.isShowModal = true | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleEdit () { | 
|---|
|  |  |  | this.isShowEdit = true | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.operaVisitsWindowRef.isShowModal = true | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | departure (id) { | 
|---|
|  |  |  | this.$confirm('确定离场吗, 是否继续?', '提示', { | 
|---|
|  |  |  | confirmButtonText: '确定', | 
|---|
|  |  |  | cancelButtonText: '取消', | 
|---|
|  |  |  | type: 'warning' | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | level(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.page = 1 | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.page = 1 | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }).catch(() => { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cancel(id) { | 
|---|
|  |  |  | cancel (id) { | 
|---|
|  |  |  | this.$confirm('确定取消预约吗, 是否继续?', '提示', { | 
|---|
|  |  |  | confirmButtonText: '确定', | 
|---|
|  |  |  | cancelButtonText: '取消', | 
|---|
|  |  |  | type: 'warning' | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | visitCancel(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.page = 1 | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.page = 1 | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }).catch(() => { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|