Merge branch main into master

master
weizong song 2 months ago
commit 55a3e59692

@ -55,13 +55,14 @@ export function destroy(params) {
})
}
export function retry(params) {
export function retry(params, config = {}) {
return request({
method: "get",
url: "/api/admin/appointments/retry-appointment",
params
params,
headers: config.headers,
isLoading: config.isLoading
})
}

@ -0,0 +1,46 @@
import request from '@/utils/request'
/**
* 企查查企业户准入模块。
*
* 后端接口尚未实现时,此文件即为前后端联调契约:
* - candidates: 可发起准入的企业库候选项
* - enrollments: 准入单列表/状态筛选
* - submit: 创建并提交准入单
* - reconcile: 向元禾/企查查查询单条真实状态
*/
export function candidates(params, isLoading = false) {
return request({
method: 'get',
url: '/api/admin/qcc-enterprise-enrollments/candidates',
params,
isLoading
})
}
export function index(params, isLoading = false) {
return request({
method: 'get',
url: '/api/admin/qcc-enterprise-enrollments/index',
params,
isLoading
})
}
export function submit(data) {
return request({
method: 'post',
url: '/api/admin/qcc-enterprise-enrollments/submit',
data,
isLoading: true
})
}
export function reconcile(data) {
return request({
method: 'post',
url: '/api/admin/qcc-enterprise-enrollments/reconcile',
data,
isLoading: true
})
}

@ -37,8 +37,8 @@ export function getAuthMenu(token) {
export function getMsg(param) {
return request({
url: '/api/admin/auth/send-sms',
method: 'get',
params:param,
method: 'post',
data: param,
isLoading: false
})
}
@ -46,8 +46,8 @@ export function getMsg(param) {
export function loginMsg(param) {
return request({
url: '/api/admin/auth/sms-login',
method: 'get',
params:param,
method: 'post',
data: param,
isLoading: false
})
}

@ -76,14 +76,16 @@ const actions = {
loginMsg({
commit
}, userInfo) {
const {
mobile,
code
const {
mobile,
code,
challenge_id
} = userInfo
return new Promise((resolve, reject) => {
loginMsg({
mobile: mobile,
code: code
mobile: mobile,
code: code,
challenge_id: challenge_id
}).then(response => {
console.log(response)
const {

@ -80,7 +80,7 @@
<div style="text-align: left;width:800px;margin: 0 auto;display:flex;">
<div> 第三方记录</div>
<div style="margin-left:30px">
<el-button type="primary" size="small" @click="sendBook(id)">重新预约</el-button>
<el-button type="primary" size="small" :loading="retrying" :disabled="retrying" @click="sendBook(id)">重新预约</el-button>
</div>
</div>
@ -174,9 +174,10 @@
data() {
return {
isShow: false,
type: 'show',
id: '',
submitObj: {},
type: 'show',
id: '',
retrying: false,
submitObj: {},
thirdArr: [],
baseUrl: `${process.env.VUE_APP_BASE_API}`,
form: {
@ -220,16 +221,31 @@
this.$emit('refresh')
})
},
sendBook(id) {
retry({
id: id
}).then(res => {
this.$message({
type: 'success',
message: '重新发送预约成功'
})
this.getDetail()
})
async sendBook(id) {
const traceId = `retry-${id}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`
this.retrying = true
try {
await retry({
id: id
}, {
headers: {
'X-Retry-Trace-Id': traceId
},
isLoading: true
})
this.$message({
type: 'success',
message: `已提交重新预约(追踪号:${traceId})`
})
await this.getDetail()
} catch (error) {
const message = error.response && error.response.data && error.response.data.errmsg
? error.response.data.errmsg
: (error.message || '请求未收到响应')
this.$message.error(`重新预约失败:${message}(追踪号:${traceId})`)
} finally {
this.retrying = false
}
},
formatHH(val) {
if (val) {
@ -253,7 +269,8 @@
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.id = ''
this.retrying = false
this.submitObj = {}
this.$refs['dialog'].reset()
}

@ -96,9 +96,12 @@
hasSend: false,
count: 60,
sendTimer: null,
loginForm: {
username: '',
password: ''
loginForm: {
username: '',
password: '',
mobile: '',
code: '',
challenge_id: ''
},
loginRules: {
username: [{
@ -168,7 +171,8 @@
getMsg({
mobile: this.loginForm.mobile
}).then(res => {
this.base.showMessage("发送成功",'success')
this.base.showMessage("发送成功",'success')
this.loginForm.challenge_id = res.challenge_id
// this.$Message.success('发送成功')
// 短信发送后 60s
this.hasSend = true
@ -194,6 +198,10 @@
this.base.showMessage("请输入验证码",'error')
return
}
if (this.base.isNull(this.loginForm.challenge_id)) {
this.base.showMessage("请先获取验证码",'error')
return
}
this.loading = true
let that = this
this.$store.dispatch('user/loginMsg', this.loginForm).then(() => {

@ -0,0 +1,174 @@
<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>
</lx-header>
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
<el-tab-pane label="准入申请" name="apply">
<div class="toolbar">
<el-input v-model.trim="candidateQuery.keyword" clearable placeholder="企业名称或统一社会信用代码" style="width: 280px" @keyup.enter.native="searchCandidates" />
<el-button type="primary" size="small" @click="searchCandidates">查询企业库</el-button>
<el-button type="primary" size="small" :disabled="selectedCandidates.length === 0" @click="openSubmitDialog">发起准入申请</el-button>
</div>
<el-table :data="candidates" border stripe @selection-change="selectedCandidates = $event">
<el-table-column type="selection" width="50" />
<el-table-column prop="company_name" label="企业名称" min-width="220" />
<el-table-column prop="credit_code" label="统一社会信用代码" width="200">
<template slot-scope="scope">
<span :class="{ 'missing-credit-code': !scope.row.credit_code }">{{ scope.row.credit_code || '缺失,不能提交' }}</span>
</template>
</el-table-column>
<el-table-column prop="qcc_account_status_text" label="当前企业户状态" width="150">
<template slot-scope="scope"><status-tag :status="scope.row.qcc_account_status" :text="scope.row.qcc_account_status_text" /></template>
</el-table-column>
<el-table-column prop="updated_at" label="企业信息更新时间" width="180" />
</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="tasks">
<task-list v-if="activeTab === 'tasks'" :statuses="['approved', 'submitting', 'pending', 'unknown']" empty-text="暂无待处理的准入任务" @reconcile="reconcileEnrollment" />
</el-tab-pane>
<el-tab-pane label="已确认企业户" name="confirmed">
<task-list v-if="activeTab === 'confirmed'" :statuses="['confirmed']" empty-text="暂无已确认企业户" :readonly="true" />
</el-tab-pane>
<el-tab-pane label="异常处理" name="exceptions">
<task-list v-if="activeTab === 'exceptions'" :statuses="['rejected', 'conflict', 'unknown']" empty-text="暂无异常准入记录" @reconcile="reconcileEnrollment" />
</el-tab-pane>
</el-tabs>
<el-dialog title="确认发起企业户准入" :visible.sync="submitDialogVisible" width="620px" :close-on-click-modal="false">
<el-alert title="提交后将通知企查查平台(可能经元禾接口穿透)。平台确认成功后不可撤销。" type="error" :closable="false" show-icon />
<el-table :data="validCandidates" max-height="250" style="margin-top: 16px">
<el-table-column prop="company_name" label="企业名称" />
<el-table-column prop="credit_code" label="统一社会信用代码" width="200" />
</el-table>
<el-form label-width="90px" style="margin-top: 18px">
<el-form-item label="准入用途" required><el-input v-model.trim="submitForm.business_category" maxlength="100" placeholder="例如:企查查企业户准入" /></el-form-item>
<el-form-item label="备注"><el-input v-model.trim="submitForm.remark" type="textarea" :rows="3" maxlength="500" show-word-limit /></el-form-item>
</el-form>
<div slot="footer">
<el-button @click="submitDialogVisible = false">取消</el-button>
<el-button type="danger" :loading="submitting" :disabled="validCandidates.length === 0" @click="submitEnrollments">确认提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { candidates, index, submit, reconcile } from '@/api/qccEnterpriseAccount/index'
const statusMap = {
draft: ['info', '草稿'], approved: ['warning', '待提交'], submitting: ['warning', '提交中'],
pending: ['warning', '平台处理中'], confirmed: ['success', '已确认'], rejected: ['danger', '已拒绝'],
conflict: ['danger', '数据冲突'], unknown: ['danger', '状态未知']
}
const StatusTag = {
props: { status: String, text: String },
computed: {
type() { return (statusMap[this.status] || ['info'])[0] },
label() { return this.text || (statusMap[this.status] || ['info', '-'])[1] }
},
template: '<el-tag :type="type" size="mini">{{ label }}</el-tag>'
}
const TaskList = {
components: { StatusTag },
props: { statuses: Array, emptyText: String, readonly: Boolean },
data() { return { list: [], total: 0, page: 1, loading: false } },
watch: { statuses: { immediate: true, handler() { this.page = 1; this.load() } }},
methods: {
async load() {
this.loading = true
try {
const res = await index({ statuses: this.statuses, page: this.page, page_size: 10 })
this.list = res.data || []
this.total = res.total || 0
} finally { this.loading = false }
},
changePage(page) { this.page = page; this.load() }
},
template: `
<div v-loading="loading">
<el-table :data="list" border stripe empty-text="暂无数据">
<el-table-column prop="company_name" label="企业名称" min-width="200" />
<el-table-column prop="credit_code" label="统一社会信用代码" width="200" />
<el-table-column label="真实状态" width="130"><template slot-scope="scope"><status-tag :status="scope.row.status" :text="scope.row.status_text" /></template></el-table-column>
<el-table-column prop="external_request_id" label="平台请求号" min-width="180" />
<el-table-column prop="submitted_at" label="提交时间" width="180" />
<el-table-column prop="confirmed_at" label="确认时间" width="180" />
<el-table-column v-if="!readonly" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button v-if="scope.row.status !== 'rejected'" type="primary" size="mini" @click="$emit('reconcile', scope.row)">查询真实状态</el-button></template></el-table-column>
</el-table>
<el-pagination class="pagination" background layout="total, prev, pager, next" :current-page="page" :page-size="10" :total="total" @current-change="changePage" />
</div>`
}
export default {
name: 'QccEnterpriseAccount',
components: { StatusTag, TaskList },
data() {
return {
activeTab: 'apply', loading: false, candidates: [], candidateTotal: 0, selectedCandidates: [],
candidateQuery: { keyword: '', page: 1, page_size: 10 }, submitDialogVisible: false, submitting: false,
submitForm: { business_category: '', remark: '' }
}
},
computed: {
validCandidates() { return this.selectedCandidates.filter(item => item.credit_code && item.qcc_account_status !== 'confirmed') }
},
created() {
if (this.$route.query.company_id) this.candidateQuery.company_id = this.$route.query.company_id
this.searchCandidates()
},
methods: {
async searchCandidates() {
this.loading = true
try {
const res = await candidates(this.candidateQuery)
this.candidates = res.data || []
this.candidateTotal = res.total || 0
} finally { this.loading = false }
},
changeCandidatePage(page) { this.candidateQuery.page = page; this.searchCandidates() },
handleTabChange() {},
openSubmitDialog() {
if (this.validCandidates.length !== this.selectedCandidates.length) this.$message.warning('已自动排除缺少信用代码或已确认的企业')
if (!this.validCandidates.length) return
this.submitDialogVisible = true
},
async submitEnrollments() {
if (!this.submitForm.business_category) return this.$message.warning('请填写准入用途')
this.submitting = true
try {
await submit({ company_ids: this.validCandidates.map(item => item.id), business_category: this.submitForm.business_category, remark: this.submitForm.remark })
this.$message.success('已创建准入任务,请在“准入任务与对账”中查询平台真实状态')
this.submitDialogVisible = false
this.selectedCandidates = []
this.searchCandidates()
this.activeTab = 'tasks'
} finally { this.submitting = false }
},
async reconcileEnrollment(enrollment) {
await reconcile({ id: enrollment.id })
this.$message.success('已发起真实状态查询,请稍后刷新任务列表')
}
}
}
</script>
<style lang="scss" scoped>
.toolbar { display: flex; gap: 10px; margin-bottom: 15px; }
.pagination { margin-top: 16px; text-align: right; }
.missing-credit-code { color: #f56c6c; }
</style>

@ -32,7 +32,7 @@ module.exports = {
// outputDir: '/Users/mac/Documents/朗业/2024/s-苏州科技商学院/wx.sstbc.com/public/admin',
// 测试
// outputDir: '/Users/mac/Documents/朗业/2025/s-苏州科技商学院/wx.sstbc.com/public/admin',
outputDir: '/Users/mac/Documents/朗业/2026/s-苏州科技商学院/code/wx.sstbc.com/public/admin',
outputDir: '../backend/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save