<template>
|
<div class="cardCurrentStyle1 thirdPartLogStyle">
|
<!-- {{activeName}} -->
|
<el-tabs type="card" v-model="activeName" @tab-click="pcc">
|
<el-tab-pane label="发货物流推送日志" name="deliveryPushLog"></el-tab-pane>
|
<el-tab-pane label="发货物流回传日志" name="deliveryReturnLog"></el-tab-pane>
|
<el-tab-pane label="未发货拦截日志" name="noDeliveryInterceptLog"></el-tab-pane>
|
<el-tab-pane label="退款申请推送日志" name="refundPushLog"></el-tab-pane>
|
<el-tab-pane label="退款结果回传日志" name="refundReturnLog"></el-tab-pane>
|
<!-- <el-tab-pane label="订单接收日志" name="fifth"></el-tab-pane> -->
|
</el-tabs>
|
<!-- {{listQuery}} -->
|
<list-condition-template ref="table" :form="listQuery" :formLabel="formLabel"
|
:tableData="tableData" :total="total"
|
@page-info-change="handlePageInfoChange" :pageParams="pageInfo">
|
<template slot="otherElement">
|
<el-col :span="6" :offset="0">
|
<el-form-item>
|
<el-button size="mini" type="primary" @click="queryData">查询</el-button>
|
<el-button size="mini" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-col>
|
</template>
|
<template slot="columns">
|
<el-table-column label="接口" prop="identification" width="160" show-overflow-tooltip>
|
</el-table-column>
|
<el-table-column label="订单编号" prop="orderId" show-overflow-tooltip width="180">
|
<template slot-scope="scope">
|
<el-link class="urlLink" @click="lookOrderInfo(scope.row)">{{ scope.row.orderId }}
|
</el-link>
|
</template>
|
</el-table-column>
|
<el-table-column label="订单来源" prop="orderSource" width="160" show-overflow-tooltip>
|
<template slot-scope="scope">
|
{{getLabel(scope.row.orderSource, 'orderSource')}}
|
</template>
|
</el-table-column>
|
<el-table-column label="物流服务商" width="120px" show-overflow-tooltip>
|
<template slot-scope="scope">
|
{{
|
scope.row.logisticSupplier
|
? getText(logisticSupplierData, scope.row.logisticSupplier)
|
: '-'
|
}}</template>
|
</el-table-column>
|
<template v-if="activeName === 'deliveryPushLog' || activeName === 'refundPushLog'">
|
<el-table-column label="推送状态" prop="responseResult" :key="Math.random()" width="150">
|
<template slot-scope="scope">
|
{{scope.row.responseResult === '1' ? "推送成功" : scope.row.responseResult === '2' ? "推送失败" : ' '}}
|
</template>
|
</el-table-column>
|
<el-table-column label="推送失败原因" prop="message" :key="Math.random()">
|
<template slot-scope="scope">
|
<span>{{scope.row.message}}</span>
|
</template>
|
</el-table-column>
|
</template>
|
<template v-if="activeName === 'deliveryReturnLog'">
|
<el-table-column label="物流回传状态" prop="responseResult" :key="Math.random()">
|
<template slot-scope="scope">
|
{{scope.row.responseResult === '1' ? "回传成功" : scope.row.responseResult === '2' ? "回传失败" : ' '}}
|
</template>
|
</el-table-column>
|
<el-table-column label="回传失败原因" prop="message" :key="Math.random()">
|
<template slot-scope="scope">
|
<span>{{scope.row.message}}</span>
|
</template>
|
</el-table-column>
|
</template>
|
<template v-if="activeName === 'refundReturnLog'">
|
<el-table-column label="退款结果回传" prop="responseResult" :key="Math.random()">
|
<template slot-scope="scope">
|
{{scope.row.responseResult === '1' ? "回传成功" : scope.row.responseResult === '2' ? "回传失败" : ' '}}
|
</template>
|
</el-table-column>
|
<el-table-column label="退款结果失败原因" prop="message" :key="Math.random()">
|
<template slot-scope="scope">
|
<span>{{scope.row.message}}</span>
|
</template>
|
</el-table-column>
|
</template>
|
<template v-if="activeName === 'noDeliveryInterceptLog'">
|
<el-table-column label="拦截类型" prop="interceptType" :key="Math.random()">
|
<template slot-scope="scope">
|
{{scope.row.interceptType === '1' ? "系统拦截" : scope.row.interceptType === '2' ? "手动拦截" : ' '}}
|
</template>
|
</el-table-column>
|
<el-table-column label="拦截状态" prop="responseResult" :key="Math.random()">
|
<template slot-scope="scope">
|
{{scope.row.responseResult === '1' ? "拦截成功" : scope.row.responseResult === '2' ? "拦截失败" : ' '}}
|
</template>
|
</el-table-column>
|
<el-table-column label="拦截失败原因" prop="message" :key="Math.random()">
|
<template slot-scope="scope">
|
<span>{{scope.row.message}}</span>
|
</template>
|
</el-table-column>
|
</template>
|
<el-table-column label="开始时间" prop="requestTiem" width="180">
|
<template slot-scope="scope">
|
<span>{{scope.row.requestTiem}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" :width="`${$store.getters.colSize + 20}px`">
|
<template slot-scope="scope">
|
<wly-btn @click="logInfo(scope.row)">查看</wly-btn>
|
</template>
|
</el-table-column>
|
</template>
|
</list-condition-template>
|
</div>
|
</template>
|
|
<script>
|
import orderSourceArr from '@/utils/constant/orderSourceArr'
|
import orderMgtApi from '@/api/orderMgt'
|
import logThirdPartySystemApi from '@/api/LogId'
|
import { getDate } from '@/utils/getDate'
|
import { getArrayLable } from '@/utils/getArrayLable'
|
|
export default {
|
data() {
|
return {
|
activeName: 'deliveryPushLog',
|
listQuery: {
|
orderSourceArr: null,
|
orderSource: null,
|
responseResult: null,
|
message: null,
|
identification: null,
|
orderId: null,
|
createTime: null,
|
timeSlot: [],
|
type: '',
|
interceptType: null
|
},
|
formLabel: [
|
{
|
model: 'identification',
|
label: '接口名',
|
type: 'input'
|
},
|
{
|
model: 'responseResult',
|
label: '',
|
type: 'select',
|
opts: []
|
},
|
{
|
model: 'timeSlot',
|
label: '选择时间',
|
type: 'date',
|
flag: 'daterange',
|
valueFormat: 'yyyy-MM-dd'
|
},
|
{
|
model: 'orderSource',
|
label: '订单来源',
|
type: 'select',
|
multiple: false,
|
opts: orderSourceArr
|
},
|
{
|
model: 'interceptType',
|
label: '拦截类型',
|
type: 'select',
|
isHide: true,
|
opts: [
|
{
|
id: '1',
|
name: '系统拦截'
|
},
|
{
|
id: '2',
|
name: '手动拦截'
|
}
|
]
|
},
|
{
|
model: 'orderId',
|
label: '订单号',
|
type: 'input',
|
flag: 'textarea',
|
rule: /[^\w]/g // 可输入数字字母
|
}
|
],
|
tableData: [],
|
total: 0,
|
form: {},
|
pushArr: [ // 推送状态
|
{
|
id: '1',
|
name: '推送成功'
|
},
|
{
|
id: '2',
|
name: '推送失败'
|
}
|
],
|
returnArr: [ // 回传状态
|
{
|
id: '1',
|
name: '回传成功'
|
},
|
{
|
id: '2',
|
name: '回传失败'
|
}
|
],
|
interceptArr: [ // 拦截状态
|
{
|
id: '1',
|
name: '拦截成功'
|
},
|
{
|
id: '2',
|
name: '拦截失败'
|
}
|
],
|
deliveryPushLog: {
|
tableData: [],
|
total: 0
|
},
|
deliveryReturnLog: {
|
tableData: [],
|
total: 0,
|
pageNum: 1,
|
pageSize: 10
|
},
|
refundPushLog: {
|
tableData: [],
|
total: 0,
|
pageNum: 1,
|
pageSize: 10
|
},
|
refundReturnLog: {
|
tableData: [],
|
total: 0,
|
pageNum: 1,
|
pageSize: 10
|
},
|
noDeliveryInterceptLog: {
|
tableData: [],
|
total: 0,
|
pageNum: 1,
|
pageSize: 10
|
},
|
pageInfo: {
|
pageNum: 1,
|
pageSize: 10
|
},
|
logisticSupplierData: [],
|
}
|
},
|
activated() {
|
// this.queryList(this.$refs.table.getPageInfo())
|
},
|
mounted() {
|
this.initFormLabel()
|
// 获取物流服务商
|
this.getLogisticsProvidersData();
|
},
|
methods: {
|
/**
|
* 获取物流服务商
|
*/
|
async getLogisticsProvidersData() {
|
let arr = [];
|
const res = await orderMgtApi.getWarehouseTree({})
|
if (res.code === '200' && res.data.length) {
|
res.data.forEach((item) => {
|
arr.push({
|
id: item.warehouseService,
|
name: item.warehouseServiceName,
|
})
|
})
|
this.logisticSupplierData = arr;
|
}
|
},
|
/**
|
* 查看订单详情
|
*/
|
lookOrderInfo(row) {
|
this.$router.push({
|
name: 'orderMgtInfo',
|
query: {
|
orderId: row.orderId
|
// promotionStatus: row.promotionStatus
|
}
|
})
|
},
|
initFormLabel() {
|
this.formLabel.forEach((item) => {
|
if (item.model === 'responseResult') {
|
if (this.activeName === 'deliveryPushLog' || this.activeName === 'refundPushLog') {
|
item.label = '推送状态'
|
item.opts = this.pushArr
|
} else if (this.activeName === 'deliveryReturnLog' || this.activeName === 'refundReturnLog') {
|
item.opts = this.returnArr
|
item.label = '回传状态'
|
} else if (this.activeName === 'noDeliveryInterceptLog') {
|
item.opts = this.interceptArr
|
item.label = '拦截状态'
|
}
|
} else if (this.activeName === 'noDeliveryInterceptLog' && item.model === 'interceptType') {
|
item.isHide = false
|
} else if (item.model === 'interceptType') {
|
item.isHide = true
|
}
|
})
|
},
|
pcc() {
|
this.initFormLabel();
|
this.tableData = this[this.activeName].tableData;
|
this.total = this[this.activeName].total;
|
this.pageInfo = {
|
pageNum: this[this.activeName].pageNum,
|
pageSize: this[this.activeName].pageSize,
|
}
|
// this.resetQuery()
|
},
|
/**
|
* 获取数组的label
|
*/
|
getLabel(id, orderSource) {
|
let lableText = ''
|
this.formLabel.forEach((item) => {
|
if (item.model === orderSource) {
|
item.opts.forEach((list) => {
|
if (id === list.id) {
|
lableText = list.name
|
}
|
})
|
}
|
})
|
return lableText
|
},
|
getText(array, id) {
|
return getArrayLable(array, id)
|
},
|
/**
|
* '分页信息改变时查询列表
|
*/
|
handlePageInfoChange(pageInfo) {
|
this.queryList(pageInfo)
|
},
|
/**
|
* 重置
|
*/
|
resetQuery() {
|
this.$refs.table.reloadCurrent()
|
},
|
/**
|
* 点击查询按钮
|
*
|
},
|
*/
|
queryData() {
|
this.$refs.table.changeCondition()
|
},
|
/**
|
* 点击查看
|
*/
|
logInfo(row) {
|
this.$router.push({
|
name: 'thirdPartLogInfo',
|
query: {
|
logId: row.logId,
|
state: this.activeName
|
}
|
})
|
},
|
/**
|
* 查询列表
|
*/
|
fomeState(type) {
|
switch (type) {
|
case 'deliveryPushLog':
|
return '1'
|
case 'deliveryReturnLog':
|
return '2'
|
case 'refundPushLog':
|
return '3'
|
case 'refundReturnLog':
|
return '4'
|
case 'noDeliveryInterceptLog':
|
return '5'
|
default:
|
break
|
}
|
},
|
/**
|
* 当初始条件为空时 设置时间为当前的一个月
|
*/
|
initOrderTime() {
|
let queryIsNull = true
|
let initTime = null
|
for (const i in this.listQuery) {
|
if ((Array.isArray(this.listQuery[i]) && this.listQuery[i].length) || (!Array.isArray(this.listQuery[i]) && this.listQuery[i])) {
|
queryIsNull = false
|
break
|
}
|
}
|
if (queryIsNull) {
|
initTime = getDate(-30)
|
}
|
return initTime
|
},
|
queryList(pageInfo = { pageNum: 1, pageSize: 10 }) {
|
const param = JSON.parse(JSON.stringify(this.listQuery))
|
param.type = this.fomeState(this.activeName)
|
const initTime = this.initOrderTime()
|
if (initTime) {
|
param.startTime = initTime[0] + ' 00:00:00'
|
param.endTime = initTime[1] + ' 23:59:59'
|
}
|
if (param.timeSlot && param.timeSlot.length) {
|
param.startTime = param.timeSlot[0] + ' 00:00:00'
|
param.endTime = param.timeSlot[1] + ' 23:59:59'
|
}
|
logThirdPartySystemApi.getList({
|
...pageInfo,
|
param
|
}).then((res) => {
|
if (res.data) {
|
this.tableData = this[this.activeName].tableData = res.data.list;
|
this.total = this[this.activeName].total = res.data.total;
|
this[this.activeName].pageNum = pageInfo.pageNum;
|
this[this.activeName].pageSize = pageInfo.pageSize;
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.thirdPartLogStyle {
|
background-color: rgb(242, 242, 242);
|
// padding:20px;
|
.el-tabs__header {
|
// height:20px;
|
background-color: #fff !important;
|
border-top-right-radius: 6px;
|
padding: 20px 20px 0;
|
border-bottom: none;
|
.el-tabs__nav-wrap {
|
border-bottom: 1px solid #e4e7ed !important;
|
}
|
}
|
}
|
</style>
|