|
|
|
|
@ -1,17 +1,18 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div v-loading="loading" class="qcc-enterprise-account">
|
|
|
|
|
<lx-header icon="md-business" :text="$route.meta.title || '企查查企业户标注'" style="margin: 15px 0 10px; border: 0">
|
|
|
|
|
<div slot="content"><el-alert title="纳入候选池不会调用企查查。首次调用明确成功后即标记为已占额且不可撤销;状态未知时需先人工确认。" type="warning" :closable="false" show-icon /></div>
|
|
|
|
|
<div slot="content"><el-alert title="纳入候选池不会调用企查查。首次调用明确成功后即标记为已占额且不可撤销;状态未知时需先人工确认。不占额企业不参与新闻采集。" type="warning" :closable="false" show-icon /></div>
|
|
|
|
|
</lx-header>
|
|
|
|
|
|
|
|
|
|
<el-tabs v-model="activeTab">
|
|
|
|
|
<el-tab-pane label="候选企业" name="candidates">
|
|
|
|
|
<div class="toolbar">
|
|
|
|
|
<el-input v-model.trim="candidateQuery.keyword" clearable placeholder="企业名称或统一社会信用代码" style="width: 280px" @keyup.enter.native="resetCandidatePage" />
|
|
|
|
|
<el-select v-model="candidateQuery.status" clearable placeholder="企业户状态" style="width: 150px"><el-option label="未纳入" value="none" /><el-option label="候选" value="selected" /><el-option label="已占额" value="occupied" /><el-option label="待人工确认" value="unknown" /></el-select>
|
|
|
|
|
<el-select v-model="candidateQuery.status" clearable placeholder="企业户状态" style="width: 150px"><el-option label="未纳入" value="none" /><el-option label="候选" value="selected" /><el-option label="不占额企业" value="non_occupying" /><el-option label="已占额" value="occupied" /><el-option label="待人工确认" value="unknown" /></el-select>
|
|
|
|
|
<student-filters :value="candidateQuery" @search="resetCandidatePage" />
|
|
|
|
|
<el-button type="primary" size="small" @click="resetCandidatePage">查询</el-button>
|
|
|
|
|
<el-button type="primary" size="small" :disabled="selectedCompanies.length === 0" @click="selectCompanies">纳入候选池</el-button>
|
|
|
|
|
<el-button type="primary" size="small" :disabled="selectedCompanies.length === 0 || enrolling" @click="selectCompanies">纳入候选池</el-button>
|
|
|
|
|
<el-button type="primary" size="small" :disabled="selectedCompanies.length === 0 || enrolling" @click="selectNonOccupyingCompanies">纳入不占额企业</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="candidateList" border stripe @selection-change="selectedCompanies = $event">
|
|
|
|
|
<el-table-column type="selection" width="50" :selectable="isSelectable" />
|
|
|
|
|
@ -24,6 +25,7 @@
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-pagination class="pagination" background layout="total, prev, pager, next" :current-page="candidateQuery.page" :page-size="candidateQuery.page_size" :total="candidateTotal" @current-change="changeCandidatePage" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="不占额企业" name="non_occupying"><account-list v-if="activeTab === 'non_occupying'" status="non_occupying" empty-text="暂无不占额企业" /></el-tab-pane>
|
|
|
|
|
<el-tab-pane label="已占额企业" name="occupied"><account-list v-if="activeTab === 'occupied'" status="occupied" empty-text="暂无已占额企业" /></el-tab-pane>
|
|
|
|
|
<el-tab-pane label="待人工确认" name="unknown"><account-list v-if="activeTab === 'unknown'" ref="unknownList" status="unknown" empty-text="暂无待人工确认企业" @confirm="openUnknownConfirm" /></el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
@ -40,15 +42,15 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { candidates, select, cancel, unknownConfirm } from '@/api/qccEnterpriseAccount/index'
|
|
|
|
|
import { candidates, select, selectNonOccupying, cancel, unknownConfirm } from '@/api/qccEnterpriseAccount/index'
|
|
|
|
|
import AccountList from './components/AccountList'
|
|
|
|
|
import StudentFilters from './components/StudentFilters'
|
|
|
|
|
import StudentInfo from './components/StudentInfo'
|
|
|
|
|
|
|
|
|
|
const statusMap = { none: ['info', '未纳入'], selected: ['warning', '候选'], occupied: ['success', '已占额'], unknown: ['danger', '待人工确认'] }
|
|
|
|
|
const statusMap = { none: ['info', '未纳入'], selected: ['warning', '候选'], non_occupying: ['info', '不占额企业'], occupied: ['success', '已占额'], unknown: ['danger', '待人工确认'] }
|
|
|
|
|
export default {
|
|
|
|
|
name: 'QccEnterpriseAccount', components: { AccountList, StudentFilters, StudentInfo },
|
|
|
|
|
data() { return { activeTab: 'candidates', loading: false, candidateList: [], candidateTotal: 0, selectedCompanies: [], candidateQuery: { user_name: '', is_schoolmate: '', course_type_id: '', course_name: '', keyword: '', status: '', page: 1, page_size: 20 }, confirmDialogVisible: false, confirming: false, confirmForm: { id: '', decision: 'retry', evidence: '' }} },
|
|
|
|
|
data() { return { activeTab: 'candidates', loading: false, enrolling: false, candidateList: [], candidateTotal: 0, selectedCompanies: [], candidateQuery: { user_name: '', is_schoolmate: '', course_type_id: '', course_name: '', keyword: '', status: '', page: 1, page_size: 20 }, confirmDialogVisible: false, confirming: false, confirmForm: { id: '', decision: 'retry', evidence: '' }} },
|
|
|
|
|
created() { this.loadCandidates() },
|
|
|
|
|
methods: {
|
|
|
|
|
accountStatus(company) { return company.qcc_account ? company.qcc_account.status : 'none' },
|
|
|
|
|
@ -58,7 +60,18 @@ export default {
|
|
|
|
|
async loadCandidates() { this.loading = true; this.selectedCompanies = []; try { const res = await candidates(this.candidateQuery); this.candidateList = res.data || []; this.candidateTotal = res.total || 0 } finally { this.loading = false } },
|
|
|
|
|
resetCandidatePage() { this.candidateQuery.page = 1; this.loadCandidates() },
|
|
|
|
|
changeCandidatePage(page) { this.candidateQuery.page = page; this.loadCandidates() },
|
|
|
|
|
async selectCompanies() { await select({ company_ids: this.selectedCompanies.map(item => item.id) }); this.$message.success('已纳入候选池,尚未发生外部调用'); this.selectedCompanies = []; this.loadCandidates() },
|
|
|
|
|
selectCompanies() { return this.enrollCompanies(false) },
|
|
|
|
|
selectNonOccupyingCompanies() { return this.enrollCompanies(true) },
|
|
|
|
|
async enrollCompanies(nonOccupying) {
|
|
|
|
|
if (this.enrolling || !this.selectedCompanies.length) return
|
|
|
|
|
this.enrolling = true
|
|
|
|
|
try {
|
|
|
|
|
const action = nonOccupying ? selectNonOccupying : select
|
|
|
|
|
await action({ company_ids: this.selectedCompanies.map(item => item.id) })
|
|
|
|
|
this.$message.success(nonOccupying ? '已纳入不占额企业' : '已纳入候选池,尚未发生外部调用')
|
|
|
|
|
await this.loadCandidates()
|
|
|
|
|
} catch (_) { /* Request interceptor displays errors. */ } finally { this.enrolling = false }
|
|
|
|
|
},
|
|
|
|
|
async cancelCandidate(id) { await this.$confirm('仅候选状态可取消,确认继续吗?', '取消候选', { type: 'warning' }); await cancel({ id }); this.$message.success('已取消候选关系'); this.loadCandidates() },
|
|
|
|
|
openUnknownConfirm(account) { this.confirmForm = { id: account.id, decision: 'retry', evidence: '' }; this.confirmDialogVisible = true },
|
|
|
|
|
async confirmUnknown() { if (!this.confirmForm.evidence) return this.$message.warning('请填写核验依据'); if (this.confirmForm.decision === 'occupied') await this.$confirm('确认已占额后不可撤销,确认继续吗?', '不可撤销确认', { type: 'warning' }); this.confirming = true; try { await unknownConfirm(this.confirmForm); this.$message.success('状态已确认'); this.confirmDialogVisible = false; if (this.$refs.unknownList) this.$refs.unknownList.load(); this.loadCandidates() } finally { this.confirming = false } }
|
|
|
|
|
|