mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-19 13:35:07 +08:00
1:优化商户管理页面BUG
2:优化应用关闭页面 3:完成支付订单CURD 以及单元测试 4:将 Element UI 从 2.15.0 升级至 2.15.6
This commit is contained in:
@ -65,3 +65,14 @@ export function exportAppExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据商ID称搜索应用列表
|
||||
export function getAppListByMerchantId(merchantId) {
|
||||
return request({
|
||||
url: '/pay/app/list-merchant-id',
|
||||
params:{
|
||||
merchantId:merchantId
|
||||
},
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
54
yudao-admin-ui/src/api/pay/order.js
Executable file
54
yudao-admin-ui/src/api/pay/order.js
Executable file
@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建支付订单
|
||||
export function createOrder(data) {
|
||||
return request({
|
||||
url: '/pay/order/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新支付订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/pay/order/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除支付订单
|
||||
export function deleteOrder(id) {
|
||||
return request({
|
||||
url: '/pay/order/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得支付订单
|
||||
export function getOrder(id) {
|
||||
return request({
|
||||
url: '/pay/order/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得支付订单分页
|
||||
export function getOrderPage(query) {
|
||||
return request({
|
||||
url: '/pay/order/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出支付订单 Excel
|
||||
export function exportOrderExcel(query) {
|
||||
return request({
|
||||
url: '/pay/order/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
Binary file not shown.
2
yudao-admin-ui/src/assets/icons/svg/order.svg
Normal file
2
yudao-admin-ui/src/assets/icons/svg/order.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1638429990011" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1233" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: element-icons; src: url("chrome-extension://moombeodfomdpjnpocobemoiaemednkg/fonts/element-icons.woff") format("woff"), url("chrome-extension://moombeodfomdpjnpocobemoiaemednkg/fonts/element-icons.ttf ") format("truetype"); }
|
||||
</style></defs><path d="M459.954135 607.201246l233.733369 0c14.352893 0 25.941835-11.088546 25.941835-24.798802 0-13.623275-11.587919-24.710798-25.941835-24.710798l-233.733369 0c-14.352893 0-25.986861 11.087523-25.986861 24.710798C433.967274 596.1127 445.601242 607.201246 459.954135 607.201246zM382.017088 824.38673l287.564391-0.272199 0-0.633427c9.370415-1.494027 16.660448-9.233292 16.660448-19.053961 0-9.773598-7.290033-17.693987-16.660448-19.23304l0-0.633427L369.500007 784.560676c-27.275203 0-51.949162-38.46915-51.949162-65.214281l0-415.585113c0.181125-1.041726 0.633427-1.992377 0.633427-3.123131 0-10.997472-8.985652-20.00359-20.032242-20.00359-11.023054 0-20.010753 9.007141-20.010753 20.00359l0 418.708244C278.1423 773.383102 327.080895 824.38673 382.017088 824.38673zM693.687504 89.925079c-3.235694 0-311.669392-0.814552-311.669392-0.814552-51.2922 0-96.314603 39.10053-102.108562 88.294952-0.181125 1.085728-0.656963 2.036379-0.656963 3.168156 0 0.091074 0.023536 0.135076 0.023536 0.181125 0 0.046049-0.023536 0.090051-0.023536 0.181125l0.067538 0c0.181125 10.860349 9.031701 19.685341 19.942191 19.685341 10.933003 0 19.762089-8.824993 19.964704-19.685341l0.226151 0c6.043646-24.664749 27.027563-52.04433 50.04786-52.04433l284.755416 0c-0.406253 60.461023 0 118.435413 0 118.435413 0 54.531987 35.991726 91.642187 91.358731 91.642187 0 0 40.133046 0 90.428545 0l0 380.37724c0.338714 44.261063-33.70259 65.757656-62.180178 65.214281l0 0.272199c-10.229992 0.723477-18.425651 9.188266-18.425651 19.594267 0 10.454096 8.195659 18.736736 18.425651 19.417235l0 0.271176c0.248663 0 0.49835-0.091074 0.74599-0.091074 0.184195 0 0.340761 0.091074 0.522909 0.091074 0.971118 0 1.811252-0.407276 2.739391-0.544399 52.287877-3.755534 97.580432-52.314483 97.580432-104.22476L875.452267 299.777551 693.687504 89.925079zM745.615177 299.777551c-27.684526 0-51.927673-51.411927-51.927673-78.69941 0 0 0-27.606755 0-78.656431l0-0.045025 129.839137 157.400866L745.615177 299.777551zM459.954135 483.471246l233.733369 0c14.352893 0 25.941835-11.041474 25.941835-24.708751 0-13.667278-11.587919-24.7548-25.941835-24.7548l-233.733369 0c-14.352893 0-25.986861 11.087523-25.986861 24.7548C433.967274 472.430796 445.601242 483.471246 459.954135 483.471246zM716.709847 841.356216c-8.53335 0-15.32708 6.246261-17.113773 14.256702l-0.475837-0.045025c-21.73093 44.171012-40.426735 34.032094-62.294788 34.032094L252.179998 889.599987c-27.27725 0-64.466244-38.512129-64.466244-65.213257L187.713754 322.314847c0-24.800849 29.857005-58.606793 55.954383-63.403029l0-0.543376c10.571776-0.543376 19.082614-9.142218 19.082614-19.86749 0-10.68127-8.510838-19.279089-19.082614-19.777439l0-0.226151c-0.181125 0.044002-0.339738 0.091074-0.51984 0.091074-0.158612 0-0.272199-0.091074-0.429789-0.091074-1.245364 0-2.353604 0.497327-3.553942 0.724501-50.703799 5.203512-90.860381 52.134381-90.860381 103.092983l0 502.07086c0 54.034661 48.938596 105.038288 103.875812 105.038288l389.558343 0c47.104831 0 78.254272-17.198707 90.542132-61.683874 1.358951-2.533706 2.330068-5.250584 2.330068-8.326643C734.611565 849.546759 726.601124 841.356216 716.709847 841.356216z" p-id="1234"></path></svg>
|
After Width: | Height: | Size: 3.7 KiB |
@ -91,6 +91,9 @@ export const SysUserSocialTypeEnum = {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付渠道枚举
|
||||
*/
|
||||
export const PayChannelEnum = {
|
||||
WX_PUB: {
|
||||
"code": "wx_pub",
|
||||
@ -122,7 +125,65 @@ export const PayChannelEnum = {
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付类型枚举
|
||||
*/
|
||||
export const PayType = {
|
||||
WECHAT: "WECHAT",
|
||||
ALIPAY: "ALIPAY"
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单状态枚举
|
||||
*/
|
||||
export const payOrderStatusEnum = {
|
||||
WAITING: {
|
||||
status: 0,
|
||||
name: '未支付'
|
||||
},
|
||||
SUCCESS: {
|
||||
status: 10,
|
||||
name: '已支付'
|
||||
},
|
||||
CLOSED: {
|
||||
status: 20,
|
||||
name: '未支付'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单回调状态枚举
|
||||
*/
|
||||
export const payOrderNotifyStatusEnum = {
|
||||
NO: {
|
||||
status: 0,
|
||||
name: '未通知'
|
||||
},
|
||||
SUCCESS: {
|
||||
status: 10,
|
||||
name: '通知成功'
|
||||
},
|
||||
FAILURE: {
|
||||
status: 20,
|
||||
name: '通知失败'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单退款状态枚举
|
||||
*/
|
||||
export const payOrderRefundStatusEnum = {
|
||||
NO: {
|
||||
status: 0,
|
||||
name: '未退款'
|
||||
},
|
||||
SOME: {
|
||||
status: 10,
|
||||
name: '部分退款'
|
||||
},
|
||||
ALL: {
|
||||
status: 20,
|
||||
name: '全部退款'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,14 @@ export const DICT_TYPE = {
|
||||
PAY_CHANNEL_ALIPAY_MODE:'pay_channel_alipay_mode',
|
||||
// 支付宝网关地址
|
||||
PAY_CHANNEL_ALIPAY_SERVER_TYPE:'pay_channel_alipay_server_type',
|
||||
// 支付渠道编码类型
|
||||
PAY_CHANNEL_CODE_TYPE: 'pay_channel_code_type',
|
||||
// 商户支付订单回调状态
|
||||
PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status',
|
||||
// 商户支付订单状态
|
||||
PAY_ORDER_STATUS: 'pay_order_status',
|
||||
// 商户支付订单退款状态
|
||||
PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,66 +7,68 @@ const baseURL = process.env.VUE_APP_BASE_API
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') {
|
||||
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
export function resetForm(refName) {
|
||||
if (this.$refs[refName]) {
|
||||
this.$refs[refName].resetFields();
|
||||
}
|
||||
if (this.$refs[refName]) {
|
||||
this.$refs[refName].resetFields();
|
||||
}
|
||||
}
|
||||
|
||||
// 添加日期范围
|
||||
export function addDateRange(params, dateRange, propName) {
|
||||
const search = params;
|
||||
search.params = {};
|
||||
if (null != dateRange && '' !== dateRange) {
|
||||
if (typeof(propName) === "undefined") {
|
||||
search["beginTime"] = dateRange[0];
|
||||
search["endTime"] = dateRange[1];
|
||||
} else {
|
||||
search["begin" + propName] = dateRange[0];
|
||||
search["end" + propName] = dateRange[1];
|
||||
}
|
||||
}
|
||||
return search;
|
||||
if (null != dateRange && '' !== dateRange) {
|
||||
if (typeof (propName) === "undefined") {
|
||||
search["beginTime"] = dateRange[0];
|
||||
search["endTime"] = dateRange[1];
|
||||
} else {
|
||||
search["begin" + propName] = dateRange[0];
|
||||
search["end" + propName] = dateRange[1];
|
||||
}
|
||||
}
|
||||
return search;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,21 +100,21 @@ export function addBeginAndEndTime(params, dateRange, propName) {
|
||||
return params;
|
||||
}
|
||||
|
||||
// 回显数据字典
|
||||
// 回显数据字典 原若依所保留,请使用 dict.js 中的新方法
|
||||
export function selectDictLabel(datas, value) {
|
||||
var actions = [];
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].dictValue == ('' + value)) {
|
||||
actions.push(datas[key].dictLabel);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
return actions.join('');
|
||||
var actions = [];
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].dictValue == ('' + value)) {
|
||||
actions.push(datas[key].dictLabel);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
return actions.join('');
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function download(fileName) {
|
||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||
}
|
||||
|
||||
// 下载 Excel 方法
|
||||
@ -147,7 +149,7 @@ function download0(data, fileName, mineType) {
|
||||
window.URL = window.URL || window.webkitURL;
|
||||
let href = URL.createObjectURL(blob);
|
||||
let downA = document.createElement("a");
|
||||
downA.href = href;
|
||||
downA.href = href;
|
||||
downA.download = fileName;
|
||||
downA.click();
|
||||
// 销毁超连接
|
||||
@ -156,24 +158,24 @@ function download0(data, fileName, mineType) {
|
||||
|
||||
// 字符串格式化(%s )
|
||||
export function sprintf(str) {
|
||||
var args = arguments, flag = true, i = 1;
|
||||
str = str.replace(/%s/g, function () {
|
||||
var arg = args[i++];
|
||||
if (typeof arg === 'undefined') {
|
||||
flag = false;
|
||||
return '';
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
return flag ? str : '';
|
||||
var args = arguments, flag = true, i = 1;
|
||||
str = str.replace(/%s/g, function () {
|
||||
var arg = args[i++];
|
||||
if (typeof arg === 'undefined') {
|
||||
flag = false;
|
||||
return '';
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
return flag ? str : '';
|
||||
}
|
||||
|
||||
// 转换字符串,undefined,null等转化为""
|
||||
export function praseStrEmpty(str) {
|
||||
if (!str || str == "undefined" || str == "null") {
|
||||
return "";
|
||||
}
|
||||
return str;
|
||||
if (!str || str == "undefined" || str == "null") {
|
||||
return "";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,21 +187,42 @@ export function praseStrEmpty(str) {
|
||||
* @param {*} rootId 根Id 默认 0
|
||||
*/
|
||||
export function handleTree(data, id, parentId, children, rootId) {
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
children = children || 'children'
|
||||
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
|
||||
//对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
//循环所有项
|
||||
const treeData = cloneData.filter(father => {
|
||||
let branchArr = cloneData.filter(child => {
|
||||
//返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
});
|
||||
branchArr.length > 0 ? father.children = branchArr : '';
|
||||
//返回第一层
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
return treeData !== '' ? treeData : data;
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
children = children || 'children'
|
||||
rootId = rootId || Math.min.apply(Math, data.map(item => {
|
||||
return item[parentId]
|
||||
})) || 0
|
||||
//对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
//循环所有项
|
||||
const treeData = cloneData.filter(father => {
|
||||
let branchArr = cloneData.filter(child => {
|
||||
//返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
});
|
||||
branchArr.length > 0 ? father.children = branchArr : '';
|
||||
//返回第一层
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
return treeData !== '' ? treeData : data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间
|
||||
* @param timeStr 时分秒 字符串 格式为 xx:xx:xx
|
||||
*/
|
||||
export function getNowDateTime(timeStr) {
|
||||
let now = new Date();
|
||||
let year = now.getFullYear(); //得到年份
|
||||
let month = (now.getMonth() + 1).toString().padStart(2, "0"); //得到月份
|
||||
let day = now.getDate().toString().padStart(2, "0"); //得到日期
|
||||
|
||||
if (timeStr != null) {
|
||||
return `${year}-${month}-${day} ${timeStr}`;
|
||||
}
|
||||
let hours = now.getHours().toString().padStart(2, "0") // 得到小时;
|
||||
let minutes = now.getMinutes().toString().padStart(2, "0") // 得到分钟;
|
||||
let seconds = now.getSeconds().toString().padStart(2, "0") // 得到秒;
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
|
@ -195,7 +195,6 @@
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="form.merchantId" placeholder="请输入商户编号"/>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="开启状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
@ -221,7 +220,6 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<wechat-channel-form :transferParam="channelParam"></wechat-channel-form>
|
||||
<ali-pay-channel-form :transferParam="channelParam"></ali-pay-channel-form>
|
||||
</div>
|
||||
@ -312,6 +310,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.handleGetMerchantListByName(null);
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
|
@ -170,6 +170,7 @@ export default {
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行查询
|
||||
getMerchantPage(params).then(response => {
|
||||
console.log(response.data);
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
|
518
yudao-admin-ui/src/views/pay/order/index.vue
Executable file
518
yudao-admin-ui/src/views/pay/order/index.vue
Executable file
@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item label="所属商户" prop="merchantId">
|
||||
<el-select
|
||||
v-model="queryParams.merchantId"
|
||||
clearable
|
||||
@clear="()=>{queryParams.merchantId = null}"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择所属商户"
|
||||
@change="handleGetAppListByMerchantId"
|
||||
:remote-method="handleGetMerchantListByName"
|
||||
:loading="merchantLoading">
|
||||
<el-option
|
||||
v-for="item in merchantList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="应用编号" prop="appId">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="queryParams.appId"
|
||||
filterable
|
||||
placeholder="请选择应用信息">
|
||||
<el-option
|
||||
v-for="item in appList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="渠道编码" prop="channelCode">
|
||||
<el-select v-model="queryParams.channelCode" placeholder="请输入渠道编码" clearable
|
||||
size="small" @clear="()=>{queryParams.channelCode = null}">
|
||||
<el-option v-for="dict in payChannelCodeDictDatum" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户订单编号" prop="merchantOrderId">
|
||||
<el-input v-model="queryParams.merchantOrderId" placeholder="请输入商户订单编号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="渠道订单号" prop="channelOrderNo">
|
||||
<el-input v-model="queryParams.channelOrderNo" placeholder="请输入渠道订单号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择支付状态" clearable size="small">
|
||||
<el-option v-for="dict in payOrderDictDatum" :key="parseInt(dict.value)"
|
||||
:label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款状态" prop="refundStatus">
|
||||
<el-select v-model="queryParams.refundStatus" placeholder="请选择退款状态" clearable size="small">
|
||||
<el-option v-for="dict in payOrderRefundDictDatum" :key="parseInt(dict.value)"
|
||||
:label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回调商户状态" prop="notifyStatus">
|
||||
<el-select v-model="queryParams.notifyStatus" placeholder="请选择订单回调商户状态" clearable size="small">
|
||||
<el-option v-for="dict in payOrderNotifyDictDatum" :key="parseInt(dict.value)"
|
||||
:label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRangeCreateTime" size="small" style="width: 350px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-"
|
||||
:default-time="['00:00:00','23:59:59']" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</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-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['pay:order:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="订单编号" align="center" prop="id" width="80"/>
|
||||
<el-table-column label="商户名称" align="center" prop="merchantName" width="120"/>
|
||||
<el-table-column label="应用名称" align="center" prop="appName" width="120"/>
|
||||
<el-table-column label="渠道名称" align="center" prop="channelCodeName" width="130"/>
|
||||
<el-table-column label="商户订单编号" align="center" prop="merchantOrderId" width="140"/>
|
||||
<el-table-column label="渠道订单号" align="center" prop="channelOrderNo" width="140"/>
|
||||
<el-table-column label="商品标题" align="center" prop="subject" width="180" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="支付金额" align="center" prop="amount" width="100">
|
||||
<template slot-scope="scope">
|
||||
¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手续金额" align="center" prop="channelFeeAmount" width="100">
|
||||
<template slot-scope="scope">
|
||||
¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" align="center" prop="refundAmount" width="100">
|
||||
<template slot-scope="scope">
|
||||
¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_STATUS, scope.row.status) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款状态" align="center" prop="refundStatus">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_REFUND_STATUS, scope.row.refundStatus) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="回调状态" align="center" prop="notifyStatus" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS, scope.row.notifyStatus) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付时间" align="center" prop="successTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.successTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="handleQueryDetails(scope.row)"
|
||||
v-hasPermi="['pay:order:query']">查看详情
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['pay:order:update']">修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['pay:order:delete']">删除-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog title="订单详情" :visible.sync="open" width="50%">
|
||||
<el-descriptions :column="2" label-class-name="desc-label">
|
||||
<el-descriptions-item label="商户名称">{{ orderDetail.merchantName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="应用名称">{{ orderDetail.appName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="商品名称">{{ orderDetail.subject }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider></el-divider>
|
||||
<el-descriptions :column="2" label-class-name="desc-label">
|
||||
<el-descriptions-item label="商户订单号">
|
||||
<el-tag size="small">{{ orderDetail.merchantOrderId }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="渠道订单号">
|
||||
<el-tag class="tag-purple" size="small">{{ orderDetail.channelOrderNo }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付订单号">
|
||||
<el-tag v-if="orderDetail.payOrderExtension.no !== ''" class="tag-pink" size="small">
|
||||
{{ orderDetail.payOrderExtension.no }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="金额">
|
||||
<el-tag type="success" size="small">{{ parseFloat(orderDetail.amount / 100, 2) }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手续费">
|
||||
<el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeeAmount / 100, 2) }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手续费比例">
|
||||
{{ parseFloat(orderDetail.channelFeeRate / 100, 2) }}%
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付状态">
|
||||
<el-tag :type="statusType" size="small">
|
||||
{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_STATUS, orderDetail.status) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="回调状态">
|
||||
<el-tag :type="notifyStatusType" size="small">
|
||||
{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS, orderDetail.notifyStatus) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="回调地址">{{ orderDetail.notifyUrl }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ parseTime(orderDetail.createTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="支付时间">{{ parseTime(orderDetail.successTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="失效时间">{{ parseTime(orderDetail.expireTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="通知时间">{{ parseTime(orderDetail.notifyTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider></el-divider>
|
||||
<el-descriptions :column="2" label-class-name="desc-label">
|
||||
<el-descriptions-item label="支付渠道">{{ orderDetail.channelCodeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="支付IP">{{ orderDetail.userIp }}</el-descriptions-item>
|
||||
<el-descriptions-item label="退款状态">
|
||||
<el-tag :type="refundStatusType" size="small">
|
||||
{{ getDictDataLabel(DICT_TYPE.PAY_ORDER_REFUND_STATUS, orderDetail.refundStatus) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="退款次数">{{ orderDetail.refundTimes }}</el-descriptions-item>
|
||||
<el-descriptions-item label="退款金额">
|
||||
<el-tag type="warning">
|
||||
{{ parseFloat(orderDetail.refundAmount / 100, 2) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider></el-divider>
|
||||
<el-descriptions :column="1" label-class-name="desc-label" direction="vertical" border>
|
||||
<el-descriptions-item label="商品描述">
|
||||
{{ orderDetail.body }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付通道额外扩展参数">
|
||||
{{ orderDetail.payOrderExtension.channelExtras }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付通道异步回调内容">
|
||||
{{ orderDetail.payOrderExtension.channelNotifyData }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getOrder, getOrderPage, exportOrderExcel} from "@/api/pay/order";
|
||||
import {getMerchantListByName} from "@/api/pay/merchant";
|
||||
import {getAppListByMerchantId} from "@/api/pay/app";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import {payOrderNotifyStatusEnum, payOrderRefundStatusEnum, payOrderStatusEnum} from "@/utils/constants";
|
||||
import { getNowDateTime} from "@/utils/ruoyi";
|
||||
|
||||
const defaultOrderDetail = {
|
||||
merchantName: '',
|
||||
appName: '',
|
||||
channelCodeName: '',
|
||||
subject: '',
|
||||
merchantOrderId: null,
|
||||
channelOrderNo: '',
|
||||
body: '',
|
||||
amount: null,
|
||||
channelFeeRate: null,
|
||||
channelFeeAmount: null,
|
||||
userIp: '',
|
||||
status: null,
|
||||
notifyUrl: '',
|
||||
notifyStatus: null,
|
||||
refundStatus: null,
|
||||
refundTimes: '',
|
||||
refundAmount: null,
|
||||
createTime: '',
|
||||
successTime: '',
|
||||
notifyTime: '',
|
||||
expireTime: '',
|
||||
payOrderExtension: {
|
||||
channelExtras: '',
|
||||
channelNotifyData: '',
|
||||
no: ''
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 支付订单列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
dateRangeExpireTime: [],
|
||||
dateRangeSuccessTime: [],
|
||||
dateRangeNotifyTime: [],
|
||||
dateRangeCreateTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
merchantId: null,
|
||||
appId: null,
|
||||
channelId: null,
|
||||
channelCode: null,
|
||||
merchantOrderId: null,
|
||||
subject: null,
|
||||
body: null,
|
||||
notifyUrl: null,
|
||||
notifyStatus: null,
|
||||
amount: null,
|
||||
channelFeeRate: null,
|
||||
channelFeeAmount: null,
|
||||
status: null,
|
||||
userIp: null,
|
||||
successExtensionId: null,
|
||||
refundStatus: null,
|
||||
refundTimes: null,
|
||||
refundAmount: null,
|
||||
channelUserId: null,
|
||||
channelOrderNo: null,
|
||||
},
|
||||
// 商户加载遮罩层
|
||||
merchantLoading: false,
|
||||
// 商户列表集合
|
||||
merchantList: null,
|
||||
// 支付应用列表集合
|
||||
appList: null,
|
||||
// 支付渠道编码字典数据集合
|
||||
payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
|
||||
// 订单回调商户状态字典数据集合
|
||||
payOrderNotifyDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS),
|
||||
// 订单状态字典数据集合
|
||||
payOrderDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_STATUS),
|
||||
// 订单退款状态字典数据集合
|
||||
payOrderRefundDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_REFUND_STATUS),
|
||||
orderDetail: JSON.parse(JSON.stringify(defaultOrderDetail)),
|
||||
// el-tag订单状态type值
|
||||
statusType: '',
|
||||
// el-tag订单回调通知状态type值
|
||||
notifyStatusType: '',
|
||||
// el-tag订单退款状态type值
|
||||
refundStatusType: '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 初始化默认时间
|
||||
this.initTime();
|
||||
this.getList();
|
||||
this.handleGetMerchantListByName(null);
|
||||
},
|
||||
methods: {
|
||||
initTime(){
|
||||
this.dateRangeCreateTime = [getNowDateTime("00:00:00"), getNowDateTime("23:59:59")];
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
// 判断选择的日期是否超过了一个月
|
||||
let oneMonthTime = 31 * 24 * 3600 * 1000;
|
||||
if (this.dateRangeCreateTime == null){
|
||||
this.initTime();
|
||||
} else {
|
||||
let minDateTime = new Date(this.dateRangeCreateTime[0]).getTime();
|
||||
let maxDateTime = new Date(this.dateRangeCreateTime[1]).getTime()
|
||||
if (maxDateTime - minDateTime > oneMonthTime) {
|
||||
this.$message.error('时间范围最大为 31 天!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
this.addBeginAndEndTime(params, this.dateRangeExpireTime, 'expireTime');
|
||||
this.addBeginAndEndTime(params, this.dateRangeSuccessTime, 'successTime');
|
||||
this.addBeginAndEndTime(params, this.dateRangeNotifyTime, 'notifyTime');
|
||||
this.addDateRange(params, this.dateRangeCreateTime, 'CreateTime');
|
||||
// 执行查询
|
||||
getOrderPage(params).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRangeSuccessTime = [];
|
||||
this.dateRangeNotifyTime = [];
|
||||
this.dateRangeExpireTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.initTime();
|
||||
this.handleQuery();
|
||||
},
|
||||
/**
|
||||
* 查看订单详情
|
||||
*/
|
||||
handleQueryDetails(row) {
|
||||
this.orderDetail = JSON.parse(JSON.stringify(defaultOrderDetail));
|
||||
getOrder(row.id).then(response => {
|
||||
this.orderDetail = response.data;
|
||||
if (response.data.payOrderExtension === null) {
|
||||
this.orderDetail.payOrderExtension = Object.assign(defaultOrderDetail.payOrderExtension, {});
|
||||
}
|
||||
switch (this.orderDetail.status) {
|
||||
case payOrderStatusEnum.WAITING.status:
|
||||
this.statusType = "info";
|
||||
break;
|
||||
case payOrderStatusEnum.SUCCESS.status:
|
||||
this.statusType = "success";
|
||||
break;
|
||||
case payOrderStatusEnum.CLOSED.status:
|
||||
this.statusType = "danger";
|
||||
break;
|
||||
}
|
||||
switch (this.orderDetail.notifyStatus) {
|
||||
case payOrderNotifyStatusEnum.NO.status:
|
||||
this.notifyStatusType = "info";
|
||||
break;
|
||||
case payOrderNotifyStatusEnum.SUCCESS.status:
|
||||
this.notifyStatusType = "success";
|
||||
break;
|
||||
case payOrderNotifyStatusEnum.FAILURE.status:
|
||||
this.notifyStatusType = "danger";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (this.orderDetail.refundStatus) {
|
||||
case payOrderRefundStatusEnum.NO.status:
|
||||
this.refundStatusType = "success";
|
||||
break;
|
||||
case payOrderRefundStatusEnum.SOME.status:
|
||||
this.refundStatusType = "warning";
|
||||
break;
|
||||
case payOrderRefundStatusEnum.ALL.status:
|
||||
this.refundStatusType = "danger";
|
||||
break;
|
||||
}
|
||||
this.open = true;
|
||||
});
|
||||
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.addBeginAndEndTime(params, this.dateRangeExpireTime, 'expireTime');
|
||||
this.addBeginAndEndTime(params, this.dateRangeSuccessTime, 'successTime');
|
||||
this.addBeginAndEndTime(params, this.dateRangeNotifyTime, 'notifyTime');
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行导出
|
||||
this.$confirm('是否确认导出所有支付订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportOrderExcel(params);
|
||||
}).then(response => {
|
||||
this.downloadExcel(response, '支付订单.xls');
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 根据商户名称模糊匹配商户信息
|
||||
* @param name 商户名称
|
||||
*/
|
||||
handleGetMerchantListByName(name) {
|
||||
getMerchantListByName(name).then(response => {
|
||||
this.merchantList = response.data;
|
||||
this.merchantLoading = false;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 根据商户 ID 查询支付应用信息
|
||||
*/
|
||||
handleGetAppListByMerchantId() {
|
||||
this.queryParams.appId = null;
|
||||
getAppListByMerchantId(this.queryParams.merchantId).then(response => {
|
||||
this.appList = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.desc-label {
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
.tag-purple {
|
||||
color: #722ed1;
|
||||
background: #f9f0ff;
|
||||
border-color: #d3adf7;
|
||||
}
|
||||
|
||||
.tag-cyan {
|
||||
color: #13c2c2;
|
||||
background: #e6fffb;
|
||||
border-color: #87e8de;
|
||||
}
|
||||
|
||||
.tag-pink {
|
||||
color: #eb2f96;
|
||||
background: #fff0f6;
|
||||
border-color: #ffadd2;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user