parent
508c8526ac
commit
49499deb60
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-07-04 15:20:02
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 11:37:32
|
||||
* @Description: file content
|
||||
*/
|
||||
import request from '@/utils/request.js';
|
||||
export const detail = (mchPrimaryId) => {
|
||||
return request({
|
||||
url: `/payCenter/appInfo/${mchPrimaryId}`,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
export const getOrderList = (params) => {
|
||||
return request({
|
||||
url: '/payCenter/payOrder/page',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
};
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-07-04 15:20:02
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 11:37:26
|
||||
* @Description: file content
|
||||
*/
|
||||
import request from '@/utils/request.js';
|
||||
export const detail = (mchPrimaryId) => {
|
||||
return request({
|
||||
url: `/payCenter/appInfo/${mchPrimaryId}`,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
export const getOrderList = (params) => {
|
||||
return request({
|
||||
url: '/payCenter/refundOrder/page',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
};
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-07-04 15:21:30
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 11:37:49
|
||||
* @Description: file content
|
||||
*/
|
||||
import * as appApi from '@/api/pay/application.js';
|
||||
import * as mchApi from '@/api/pay/merchant.js';
|
||||
import * as api from '@/api/pay/payOrder.js';
|
||||
import { ElMessage } from '@/plugins/element-plus';
|
||||
const state = {
|
||||
code: 'PayCenterPayOrderManagement',
|
||||
list: [],
|
||||
detail: {},
|
||||
total: 0,
|
||||
opts: {
|
||||
notifyStatus: [
|
||||
{
|
||||
value: 1,
|
||||
label: '未通知',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已通知',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '已响应',
|
||||
},
|
||||
],
|
||||
payStatus: [
|
||||
{
|
||||
value: 1,
|
||||
label: '支付中',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已关闭',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '支付成功',
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '支付失败',
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '部分退款',
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
label: '全额退款',
|
||||
},
|
||||
],
|
||||
merchant: [],
|
||||
payType: [],
|
||||
application: [],
|
||||
},
|
||||
};
|
||||
const getters = {};
|
||||
const mutations = {
|
||||
setList: (state, data) => (state.list = data),
|
||||
setPayType: (state, data) => (state.opts.payType = data),
|
||||
setMerchant: (state, data) => (state.opts.merchant = data),
|
||||
setApplication: (state, data) => (state.opts.application = data),
|
||||
setTotal: (state, data) => (state.total = data),
|
||||
setDetail: (state, data) => (state.detail = data),
|
||||
};
|
||||
const actions = {
|
||||
async search({ rootGetters, commit }, params) {
|
||||
const res = await api.getOrderList({
|
||||
...rootGetters['local/page'](state.code),
|
||||
...params,
|
||||
});
|
||||
if (res) {
|
||||
commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []);
|
||||
commit('setTotal', res?.total || 0);
|
||||
}
|
||||
},
|
||||
detail: async (context, id) => {
|
||||
let res = await api.detail(id);
|
||||
if (!res) {
|
||||
ElMessage.error('加载详情失败');
|
||||
}
|
||||
return res;
|
||||
},
|
||||
async getMerchantList({ commit }) {
|
||||
const res = await mchApi.getMerchantSelector();
|
||||
if (res) {
|
||||
commit('setMerchant', res || []);
|
||||
}
|
||||
},
|
||||
async getApplicationList({ commit }) {
|
||||
const res = await appApi.getApplicationSelector();
|
||||
if (res) {
|
||||
commit('setApplication', res || []);
|
||||
}
|
||||
},
|
||||
async getPayType({ commit }) {
|
||||
const res = await appApi.getPayType();
|
||||
if (res) {
|
||||
commit('setPayType', res || []);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
state,
|
||||
getters,
|
||||
mutations,
|
||||
actions,
|
||||
};
|
@ -0,0 +1,107 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-07-04 15:21:30
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 11:56:12
|
||||
* @Description: file content
|
||||
*/
|
||||
import * as appApi from '@/api/pay/application.js';
|
||||
import * as mchApi from '@/api/pay/merchant.js';
|
||||
import * as api from '@/api/pay/refundOrder.js';
|
||||
import { ElMessage } from '@/plugins/element-plus';
|
||||
const state = {
|
||||
code: 'PayCenterRefundOrderManagement',
|
||||
list: [],
|
||||
detail: {},
|
||||
total: 0,
|
||||
opts: {
|
||||
notifyStatus: [
|
||||
{
|
||||
value: 1,
|
||||
label: '未通知',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已通知',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '已响应',
|
||||
},
|
||||
],
|
||||
refundStatus: [
|
||||
{
|
||||
value: 1,
|
||||
label: '退款中',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '退款关闭',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '退款成功',
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '退款失败',
|
||||
},
|
||||
],
|
||||
merchant: [],
|
||||
payType: [],
|
||||
application: [],
|
||||
},
|
||||
};
|
||||
const getters = {};
|
||||
const mutations = {
|
||||
setList: (state, data) => (state.list = data),
|
||||
setPayType: (state, data) => (state.opts.payType = data),
|
||||
setMerchant: (state, data) => (state.opts.merchant = data),
|
||||
setApplication: (state, data) => (state.opts.application = data),
|
||||
setTotal: (state, data) => (state.total = data),
|
||||
setDetail: (state, data) => (state.detail = data),
|
||||
};
|
||||
const actions = {
|
||||
async search({ rootGetters, commit }, params) {
|
||||
const res = await api.getOrderList({
|
||||
...rootGetters['local/page'](state.code),
|
||||
...params,
|
||||
});
|
||||
if (res) {
|
||||
commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []);
|
||||
commit('setTotal', res?.total || 0);
|
||||
}
|
||||
},
|
||||
detail: async (context, id) => {
|
||||
let res = await api.detail(id);
|
||||
if (!res) {
|
||||
ElMessage.error('加载详情失败');
|
||||
}
|
||||
return res;
|
||||
},
|
||||
async getMerchantList({ commit }) {
|
||||
const res = await mchApi.getMerchantSelector();
|
||||
if (res) {
|
||||
commit('setMerchant', res || []);
|
||||
}
|
||||
},
|
||||
async getApplicationList({ commit }) {
|
||||
const res = await appApi.getApplicationSelector();
|
||||
if (res) {
|
||||
commit('setApplication', res || []);
|
||||
}
|
||||
},
|
||||
async getPayType({ commit }) {
|
||||
const res = await appApi.getPayType();
|
||||
if (res) {
|
||||
commit('setPayType', res || []);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
state,
|
||||
getters,
|
||||
mutations,
|
||||
actions,
|
||||
};
|
@ -0,0 +1,229 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-15 17:29:32
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 11:29:41
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<table-list
|
||||
v-loading="loading"
|
||||
:code="code"
|
||||
:config="config"
|
||||
:data="list"
|
||||
:operation="['search']"
|
||||
:reset="handleReset"
|
||||
:total="total"
|
||||
@search="handleSearch"
|
||||
>
|
||||
<template #search>
|
||||
<el-form inline>
|
||||
<el-form-item label="支付订单号">
|
||||
<el-input v-model="state.condition.payOrderNo" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属商户">
|
||||
<el-select v-model="state.condition.mchPrimaryId">
|
||||
<el-option
|
||||
v-for="item in opts.merchant"
|
||||
:key="item.mchPrimaryId"
|
||||
:label="item.mchName"
|
||||
:value="item.mchPrimaryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属应用">
|
||||
<el-select v-model="state.condition.appPrimaryId">
|
||||
<el-option
|
||||
v-for="item in opts.application"
|
||||
:key="item.appPrimaryId"
|
||||
:label="item.appName"
|
||||
:value="item.appPrimaryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式">
|
||||
<el-select v-model="state.condition.payCode">
|
||||
<el-option
|
||||
v-for="(item, idx) in opts.payType"
|
||||
:key="idx"
|
||||
:label="item.text"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单状态">
|
||||
<el-select v-model="state.condition.payStatus">
|
||||
<el-option
|
||||
v-for="(item, idx) in opts.payStatus"
|
||||
:key="idx"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知状态">
|
||||
<el-select v-model="state.condition.notifyStatus">
|
||||
<el-option
|
||||
v-for="(item, idx) in opts.notifyStatus"
|
||||
:key="idx"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单时间" prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="state.condition.dateRange"
|
||||
:default-time="[new Date(0, 0, 0, 0, 0, 0), new Date(0, 0, 0, 23, 59, 59)]"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</table-list>
|
||||
</template>
|
||||
<script setup lang="jsx">
|
||||
import ElButton from '@/components/extra/ElButton.vue';
|
||||
import ElSwitch from '@/components/extra/ElSwitch.vue';
|
||||
const router = useRouter();
|
||||
const store = useStore();
|
||||
const loading = ref(false);
|
||||
// 页面字典表数据
|
||||
const opts = computed(() => store.state.payOrder.opts);
|
||||
// 表格数据
|
||||
const code = computed(() => store.state.payOrder.code);
|
||||
const list = computed(() => _.cloneDeep(store.state.payOrder.list));
|
||||
const total = computed(() => store.state.payOrder.total);
|
||||
// 表格查询参数
|
||||
const _condition = {
|
||||
mchPrimaryId: '',
|
||||
appPrimaryId: '',
|
||||
payOrderNo: '',
|
||||
payCode: '',
|
||||
payStatus: '',
|
||||
notifyStatus: '',
|
||||
dateRange: '',
|
||||
};
|
||||
const state = reactive({
|
||||
condition: { ..._condition },
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
const handleSearch = async () => {
|
||||
loading.value = true;
|
||||
let par = { ...state.condition };
|
||||
if (par.dateRange?.length) {
|
||||
par.startTime = par.dateRange[0];
|
||||
par.endTime = par.dateRange[1];
|
||||
delete par.dateRange;
|
||||
}
|
||||
await store.dispatch('payOrder/search', par);
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
store.dispatch('payOrder/getMerchantList');
|
||||
store.dispatch('payOrder/getApplicationList');
|
||||
store.dispatch('payOrder/getPayType');
|
||||
onActivated(handleSearch);
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
const handleReset = () => {
|
||||
state.condition = { ..._condition };
|
||||
};
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
name: 'UpdateApplication',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
};
|
||||
const config = reactive({
|
||||
columns: [
|
||||
{
|
||||
label: '所属商户',
|
||||
align: 'left',
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.mchInfo?.mchName}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '所属应用',
|
||||
align: 'left',
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.appInfo?.appName}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '支付订单号',
|
||||
width: 250,
|
||||
prop: 'payOrderNo',
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.payOrderNo}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '支付方式',
|
||||
width: 150,
|
||||
prop: 'payCodeText',
|
||||
},
|
||||
{
|
||||
label: '订单金额',
|
||||
prop: 'amount',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
label: '订单状态',
|
||||
width: 90,
|
||||
prop: 'payStatusText',
|
||||
},
|
||||
{
|
||||
label: '通知状态',
|
||||
width: 90,
|
||||
prop: 'notifyStatusText',
|
||||
},
|
||||
{
|
||||
label: '下单时间',
|
||||
prop: 'createTime',
|
||||
width: 100,
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.createTime}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
width: 120,
|
||||
slots: {
|
||||
default: ({ row }) => (
|
||||
<div>
|
||||
<ElButton type="text" onClick={() => handleDetail(row.appPrimaryId)}>
|
||||
详情
|
||||
</ElButton>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.batch-show-hide {
|
||||
margin-left: 20px;
|
||||
}
|
||||
:deep(.row-ellipsis) {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
:deep(.ctx-link) {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,227 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-15 17:29:32
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-07 14:09:28
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<table-list
|
||||
v-loading="loading"
|
||||
:code="code"
|
||||
:config="config"
|
||||
:data="list"
|
||||
:operation="['search']"
|
||||
:reset="handleReset"
|
||||
:total="total"
|
||||
@search="handleSearch"
|
||||
>
|
||||
<template #search>
|
||||
<el-form inline>
|
||||
<el-form-item label="支付订单号">
|
||||
<el-input v-model="state.condition.payOrderNo" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退款订单号">
|
||||
<el-input v-model="state.condition.refundOrderNo" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属商户">
|
||||
<el-select v-model="state.condition.mchPrimaryId">
|
||||
<el-option
|
||||
v-for="item in opts.merchant"
|
||||
:key="item.mchPrimaryId"
|
||||
:label="item.mchName"
|
||||
:value="item.mchPrimaryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属应用">
|
||||
<el-select v-model="state.condition.appPrimaryId">
|
||||
<el-option
|
||||
v-for="item in opts.application"
|
||||
:key="item.appPrimaryId"
|
||||
:label="item.appName"
|
||||
:value="item.appPrimaryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款状态">
|
||||
<el-select v-model="state.condition.refundStatus">
|
||||
<el-option
|
||||
v-for="(item, idx) in opts.refundStatus"
|
||||
:key="idx"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知状态">
|
||||
<el-select v-model="state.condition.notifyStatus">
|
||||
<el-option
|
||||
v-for="(item, idx) in opts.notifyStatus"
|
||||
:key="idx"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请时间" prop="dateRange">
|
||||
<el-date-picker
|
||||
v-model="state.condition.dateRange"
|
||||
:default-time="[new Date(0, 0, 0, 0, 0, 0), new Date(0, 0, 0, 23, 59, 59)]"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</table-list>
|
||||
</template>
|
||||
<script setup lang="jsx">
|
||||
import ElButton from '@/components/extra/ElButton.vue';
|
||||
import ElSwitch from '@/components/extra/ElSwitch.vue';
|
||||
const router = useRouter();
|
||||
const store = useStore();
|
||||
const loading = ref(false);
|
||||
// 页面字典表数据
|
||||
const opts = computed(() => store.state.refundOrder.opts);
|
||||
// 表格数据
|
||||
const code = computed(() => store.state.refundOrder.code);
|
||||
const list = computed(() => _.cloneDeep(store.state.refundOrder.list));
|
||||
const total = computed(() => store.state.refundOrder.total);
|
||||
// 表格查询参数
|
||||
const _condition = {
|
||||
mchPrimaryId: '',
|
||||
appPrimaryId: '',
|
||||
payOrderNo: '',
|
||||
refundOrderNo: '',
|
||||
refundStatus: '',
|
||||
notifyStatus: '',
|
||||
dateRange: '',
|
||||
};
|
||||
const state = reactive({
|
||||
condition: { ..._condition },
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
const handleSearch = async () => {
|
||||
loading.value = true;
|
||||
let par = { ...state.condition };
|
||||
if (par.dateRange?.length) {
|
||||
par.startTime = par.dateRange[0];
|
||||
par.endTime = par.dateRange[1];
|
||||
delete par.dateRange;
|
||||
}
|
||||
await store.dispatch('refundOrder/search', par);
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
store.dispatch('refundOrder/getMerchantList');
|
||||
store.dispatch('refundOrder/getApplicationList');
|
||||
store.dispatch('refundOrder/getPayType');
|
||||
onActivated(handleSearch);
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
const handleReset = () => {
|
||||
state.condition = { ..._condition };
|
||||
};
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
name: 'UpdateApplication',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
};
|
||||
const config = reactive({
|
||||
columns: [
|
||||
{
|
||||
label: '所属商户',
|
||||
align: 'left',
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.mchInfo?.mchName}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '所属应用',
|
||||
align: 'left',
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.appInfo?.appName}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '支付订单号',
|
||||
width: 250,
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.payOrderInfo?.payOrderNo}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '退款订单号',
|
||||
width: 250,
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.refundOrderNo}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '订单金额',
|
||||
width: 90,
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.payOrderInfo.amount}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '退款金额',
|
||||
prop: 'refundAmount',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
label: '退款状态',
|
||||
width: 90,
|
||||
prop: 'refundStatusText',
|
||||
},
|
||||
{
|
||||
label: '通知状态',
|
||||
width: 90,
|
||||
prop: 'notifyStatusText',
|
||||
},
|
||||
{
|
||||
label: '申请时间',
|
||||
prop: 'createTime',
|
||||
width: 100,
|
||||
slots: {
|
||||
default: ({ row }) => <span>{row.createTime}</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
width: 120,
|
||||
slots: {
|
||||
default: ({ row }) => (
|
||||
<div>
|
||||
<ElButton type="text" onClick={() => handleDetail(row.appPrimaryId)}>
|
||||
详情
|
||||
</ElButton>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.row-ellipsis) {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
:deep(.ctx-link) {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue