1
This commit is contained in:
23
src/api/jarvis/wecomShareLinkLogistics.js
Normal file
23
src/api/jarvis/wecomShareLinkLogistics.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function listWecomShareLinkLogisticsJob(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/wecom/shareLinkLogisticsJob/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWecomShareLinkLogisticsJob(jobKey) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/wecom/shareLinkLogisticsJob/' + encodeURIComponent(jobKey),
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function backfillShareLinkLogisticsFromTrace() {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/wecom/shareLinkLogisticsJob/backfillFromInboundTrace',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
208
src/views/jarvis/wecomShareLinkLogistics/index.vue
Normal file
208
src/views/jarvis/wecomShareLinkLogistics/index.vue
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="88px">
|
||||||
|
<el-form-item label="发送人" prop="fromUserName">
|
||||||
|
<el-input v-model="queryParams.fromUserName" placeholder="企微 UserID" clearable style="width: 140px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="全部" clearable style="width: 120px">
|
||||||
|
<el-option label="待扫描" value="PENDING" />
|
||||||
|
<el-option label="等待运单/重试" value="WAITING" />
|
||||||
|
<el-option label="已推送" value="PUSHED" />
|
||||||
|
<el-option label="已放弃" value="ABANDONED" />
|
||||||
|
<el-option label="历史补录" value="IMPORTED" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="短链" prop="trackingUrl">
|
||||||
|
<el-input v-model="queryParams.trackingUrl" placeholder="3.cn 片段" clearable style="width: 180px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="运单号" prop="waybillNo">
|
||||||
|
<el-input v-model="queryParams.waybillNo" placeholder="模糊" clearable style="width: 120px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入队时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
type="daterange"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始"
|
||||||
|
end-placeholder="结束"
|
||||||
|
style="width: 240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-alert
|
||||||
|
title="用于排查企微 3.cn 分享链物流:WAITING + no_waybill_yet 未出单;push_failed 推送未成功;ABANDONED 超限;IMPORTED 为从「企微消息跟踪」表补录,仅作留痕,不表示实时推送结果。"
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
class="mb8"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-upload2"
|
||||||
|
size="mini"
|
||||||
|
:loading="backfillLoading"
|
||||||
|
v-hasPermi="['jarvis:wecom:shareLinkLog:import']"
|
||||||
|
@click="handleBackfill"
|
||||||
|
>从追踪补录历史</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="list" border>
|
||||||
|
<el-table-column label="ID" prop="id" width="72" />
|
||||||
|
<el-table-column label="发送人" prop="fromUserName" width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column label="推送目标" prop="touserPush" width="140" show-overflow-tooltip />
|
||||||
|
<el-table-column label="状态" prop="status" width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.status === 'PUSHED'" type="success" size="small">{{ scope.row.status }}</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.status === 'WAITING'" type="warning" size="small">{{ scope.row.status }}</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.status === 'ABANDONED'" type="danger" size="small">{{ scope.row.status }}</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.status === 'IMPORTED'" type="info" size="small">{{ scope.row.status }}</el-tag>
|
||||||
|
<el-tag v-else type="info" size="small">{{ scope.row.status || '—' }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="扫描次数" prop="scanAttempts" width="88" align="center" />
|
||||||
|
<el-table-column label="运单号" prop="waybillNo" width="140" show-overflow-tooltip />
|
||||||
|
<el-table-column label="最近说明" prop="lastNote" min-width="140" show-overflow-tooltip />
|
||||||
|
<el-table-column label="短链" prop="trackingUrl" min-width="160" show-overflow-tooltip />
|
||||||
|
<el-table-column label="创建时间" prop="createTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="88" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" icon="el-icon-view" @click="openDetail(scope.row)">详情</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-dialog title="任务详情" :visible.sync="detailOpen" width="720px" append-to-body>
|
||||||
|
<el-descriptions v-if="detail" :column="1" border size="small">
|
||||||
|
<el-descriptions-item label="jobKey">{{ detail.jobKey }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="发送人">{{ detail.fromUserName || '—' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="推送接收人">{{ detail.touserPush || '—' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="状态">{{ detail.status }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="扫描次数">{{ detail.scanAttempts }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="运单号">{{ detail.waybillNo || '—' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最近说明">{{ detail.lastNote || '—' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="短链">
|
||||||
|
<span style="word-break:break-all">{{ detail.trackingUrl }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="用户备注">
|
||||||
|
<pre class="trace-pre">{{ detail.userRemark || '(空)' }}</pre>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="创建时间">{{ parseTime(detail.createTime) }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="更新时间">{{ parseTime(detail.updateTime) }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listWecomShareLinkLogisticsJob, getWecomShareLinkLogisticsJob, backfillShareLinkLogisticsFromTrace } from '@/api/jarvis/wecomShareLinkLogistics'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WecomShareLinkLogistics',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
backfillLoading: false,
|
||||||
|
loading: true,
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
dateRange: [],
|
||||||
|
detailOpen: false,
|
||||||
|
detail: null,
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
fromUserName: null,
|
||||||
|
status: null,
|
||||||
|
trackingUrl: null,
|
||||||
|
waybillNo: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
const q = { ...this.queryParams, params: {} }
|
||||||
|
if (this.dateRange && this.dateRange.length === 2) {
|
||||||
|
q.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] }
|
||||||
|
}
|
||||||
|
listWecomShareLinkLogisticsJob(q).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => { this.loading = false })
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
openDetail(row) {
|
||||||
|
getWecomShareLinkLogisticsJob(row.jobKey).then(res => {
|
||||||
|
this.detail = res.data
|
||||||
|
this.detailOpen = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBackfill() {
|
||||||
|
this.$modal.confirm('从「企微消息跟踪」补录历史分享链任务(状态 IMPORTED),已存在的 jobKey 将跳过。是否继续?').then(() => {
|
||||||
|
this.backfillLoading = true
|
||||||
|
return backfillShareLinkLogisticsFromTrace()
|
||||||
|
}).then(res => {
|
||||||
|
const d = res.data || {}
|
||||||
|
const parts = [
|
||||||
|
'扫描 ' + (d.scannedRemarkDoneRows != null ? d.scannedRemarkDoneRows : '—') + ' 条',
|
||||||
|
'新增 ' + (d.imported != null ? d.imported : 0),
|
||||||
|
'跳过已有 ' + (d.skippedDuplicate != null ? d.skippedDuplicate : 0),
|
||||||
|
'无短链 ' + (d.skippedNoUrl != null ? d.skippedNoUrl : 0)
|
||||||
|
]
|
||||||
|
this.$modal.msgSuccess(parts.join(','))
|
||||||
|
this.getList()
|
||||||
|
}).catch(() => {}).finally(() => { this.backfillLoading = false })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.trace-pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
|
margin: 0;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 13px;
|
||||||
|
max-height: 280px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.mb8 {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user