Skip to content

Commit 8d724ed

Browse files
committed
mall + pay:简化 pay 的复杂度
1. 移除 merchant 表设计 2. 移除 app 和 channel 的导出
1 parent ad300cc commit 8d724ed

File tree

9 files changed

+14
-540
lines changed

9 files changed

+14
-540
lines changed

src/api/pay/channel.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ export function deleteChannel(id) {
2727
})
2828
}
2929

30-
// 获得支付渠道
31-
// export function getChannel(id) {
32-
// return request({
33-
// url: '/pay/channel/get?id=' + id,
34-
// method: 'get'
35-
// })
36-
// }
37-
38-
39-
4030
// 获得支付渠道分页
4131
export function getChannelPage(query) {
4232
return request({
@@ -46,22 +36,11 @@ export function getChannelPage(query) {
4636
})
4737
}
4838

49-
// 导出支付渠道Excel
50-
export function exportChannelExcel(query) {
51-
return request({
52-
url: '/pay/channel/export-excel',
53-
method: 'get',
54-
params: query,
55-
responseType: 'blob'
56-
})
57-
}
58-
5939
// 获得支付渠道
60-
export function getChannel(merchantId,appId,code) {
40+
export function getChannel(appId,code) {
6141
return request({
6242
url: '/pay/channel/get-channel',
6343
params:{
64-
merchantId:merchantId,
6544
appId:appId,
6645
code:code
6746
},

src/api/pay/merchant.js

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/views/pay/app/components/aliPayChannelForm.vue

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ const defaultForm = {
131131
remark: '',
132132
feeRate: null,
133133
appId: '',
134-
merchantId: null,
135134
aliPayConfig: {
136135
appId: '',
137136
serverUrl: null,
@@ -161,13 +160,6 @@ export default {
161160
"appId": null,
162161
// 渠道编码
163162
"payCode": null,
164-
// 商户对象
165-
"payMerchant": {
166-
// 编号
167-
"id": null,
168-
// 名称
169-
"name": null
170-
},
171163
}
172164
},
173165
data() {
@@ -249,7 +241,6 @@ export default {
249241
if (newVal.aliPayOpen) {
250242
this.form.code = newVal.payCode;
251243
this.form.appId = newVal.appId;
252-
this.form.merchantId = newVal.payMerchant.id;
253244
// 只有在初次进来为编辑 并且为加载中的时候才回去请求数据
254245
if (newVal.edit === true && newVal.loading) {
255246
this.title = "编辑支付渠道";
@@ -264,7 +255,7 @@ export default {
264255
265256
methods: {
266257
init() {
267-
getChannel(this.transferParam.payMerchant.id, this.transferParam.appId, this.transferParam.payCode)
258+
getChannel(this.transferParam.appId, this.transferParam.payCode)
268259
.then(response => {
269260
this.form.id = response.data.id;
270261
this.form.feeRate = response.data.feeRate;

src/views/pay/app/components/wechatChannelForm.vue

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ const defaultForm = {
9595
remark: '',
9696
feeRate: null,
9797
appId: '',
98-
merchantId: null,
9998
weChatConfig: {
10099
appId: '',
101100
mchId: '',
@@ -123,13 +122,6 @@ export default {
123122
"appId": null,
124123
// 渠道编码
125124
"payCode": null,
126-
// 商户对象
127-
"payMerchant": {
128-
// 编号
129-
"id": null,
130-
// 名称
131-
"name": null
132-
},
133125
}
134126
},
135127
data() {
@@ -200,7 +192,6 @@ export default {
200192
if (newVal.wechatOpen) {
201193
this.form.code = newVal.payCode;
202194
this.form.appId = newVal.appId;
203-
this.form.merchantId = newVal.payMerchant.id;
204195
// 只有在初次进来为编辑 并且为加载中的时候才回去请求数据
205196
if (newVal.edit && newVal.loading) {
206197
this.title = "编辑支付渠道";
@@ -214,7 +205,7 @@ export default {
214205
},
215206
methods: {
216207
init() {
217-
getChannel(this.transferParam.payMerchant.id, this.transferParam.appId, this.transferParam.payCode)
208+
getChannel(this.transferParam.appId, this.transferParam.payCode)
218209
.then(response => {
219210
this.form.id = response.data.id;
220211
this.form.feeRate = response.data.feeRate;

src/views/pay/app/index.vue

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
<el-input v-model="queryParams.name" placeholder="请输入应用名" clearable
88
@keyup.enter.native="handleQuery"/>
99
</el-form-item>
10-
<el-form-item label="商户名称" prop="merchantName">
11-
<el-input v-model="queryParams.merchantName" placeholder="请输入商户名称" clearable
12-
@keyup.enter.native="handleQuery"/>
13-
</el-form-item>
1410
<el-form-item label="开启状态" prop="status">
1511
<el-select v-model="queryParams.status" placeholder="请选择开启状态" clearable>
1612
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label"
@@ -34,11 +30,6 @@
3430
v-hasPermi="['pay:app:create']">新增
3531
</el-button>
3632
</el-col>
37-
<el-col :span="1.5">
38-
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
39-
v-hasPermi="['pay:app:export']">导出
40-
</el-button>
41-
</el-col>
4233
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
4334
</el-row>
4435

@@ -174,23 +165,6 @@
174165
<el-form-item label="应用名" prop="name">
175166
<el-input v-model="form.name" placeholder="请输入应用名"/>
176167
</el-form-item>
177-
<el-form-item label="所属商户" prop="merchantId">
178-
<el-select
179-
v-model="form.merchantId"
180-
filterable
181-
remote
182-
reserve-keyword
183-
placeholder="请选择所属商户"
184-
:remote-method="handleGetMerchantListByName"
185-
:loading="loading">
186-
<el-option
187-
v-for="item in merchantList"
188-
:key="item.id"
189-
:label="item.name"
190-
:value="item.id">
191-
</el-option>
192-
</el-select>
193-
</el-form-item>
194168
<el-form-item label="开启状态" prop="status">
195169
<el-radio-group v-model="form.status">
196170
<el-radio v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="parseInt(dict.value)">
@@ -221,10 +195,9 @@
221195
</template>
222196

223197
<script>
224-
import {createApp, updateApp, changeAppStatus, deleteApp, getApp, getAppPage, exportAppExcel} from "@/api/pay/app";
225-
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
226-
import {PayType, PayChannelEnum, CommonStatusEnum} from "@/utils/constants";
227-
import {getMerchantListByName} from "@/api/pay/merchant";
198+
import { createApp, updateApp, changeAppStatus, deleteApp, getApp, getAppPage } from "@/api/pay/app";
199+
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
200+
import { PayType, PayChannelEnum, CommonStatusEnum } from "@/utils/constants";
228201
import wechatChannelForm from "@/views/pay/app/components/wechatChannelForm";
229202
import aliPayChannelForm from "@/views/pay/app/components/aliPayChannelForm";
230203
@@ -254,10 +227,6 @@ export default {
254227
pageSize: 10,
255228
name: null,
256229
status: null,
257-
remark: null,
258-
payNotifyUrl: null,
259-
refundNotifyUrl: null,
260-
merchantName: null,
261230
createTime: []
262231
},
263232
// 表单参数
@@ -268,7 +237,6 @@ export default {
268237
status: [{required: true, message: "开启状态不能为空", trigger: "blur"}],
269238
payNotifyUrl: [{required: true, message: "支付结果的回调地址不能为空", trigger: "blur"}],
270239
refundNotifyUrl: [{required: true, message: "退款结果的回调地址不能为空", trigger: "blur"}],
271-
merchantId: [{required: true, message: "商户编号不能为空", trigger: "blur"}],
272240
},
273241
// 数据字典
274242
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
@@ -277,8 +245,6 @@ export default {
277245
payChannelEnum: PayChannelEnum,
278246
// 支付类型
279247
payType: PayType,
280-
// 商户列表
281-
merchantList: [],
282248
// 是否显示支付窗口
283249
payOpen: false,
284250
// 微信组件传参参数
@@ -305,7 +271,6 @@ export default {
305271
},
306272
created() {
307273
this.getList();
308-
this.handleGetMerchantListByName(null);
309274
},
310275
methods: {
311276
/** 查询列表 */
@@ -332,7 +297,6 @@ export default {
332297
remark: undefined,
333298
payNotifyUrl: undefined,
334299
refundNotifyUrl: undefined,
335-
merchantId: undefined,
336300
};
337301
this.resetForm("form");
338302
},
@@ -411,36 +375,13 @@ export default {
411375
});
412376
});
413377
},
414-
/** 导出按钮操作 */
415-
handleExport() {
416-
// 处理查询参数
417-
let params = {...this.queryParams};
418-
params.pageNo = undefined;
419-
params.pageSize = undefined;
420-
// 执行导出
421-
this.$modal.confirm('是否确认导出所有支付应用信息数据项?').then(function () {
422-
return exportAppExcel(params);
423-
}).then(response => {
424-
this.$download.excel(response, '支付应用信息.xls');
425-
}).catch(() => {});
426-
},
427-
/**
428-
* 根据商户名称模糊匹配商户信息
429-
* @param name 商户名称
430-
*/
431-
handleGetMerchantListByName(name) {
432-
getMerchantListByName(name).then(response => {
433-
this.merchantList = response.data;
434-
});
435-
},
436378
/**
437379
* 修改支付渠道信息
438380
*/
439381
handleUpdateChannel(row, payCode, type) {
440382
this.settingChannelParam(row, payCode, type)
441383
this.channelParam.edit = true;
442384
this.channelParam.loading = true;
443-
444385
},
445386
/**
446387
* 新增支付渠道信息
@@ -475,9 +416,6 @@ export default {
475416
*/
476417
judgeChannelExist(channels, channelCode) {
477418
return channels.indexOf(channelCode) !== -1;
478-
},
479-
refreshTable() {
480-
this.getList();
481419
}
482420
}
483421
};

src/views/pay/demo/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979

8080
<script>
8181
import {createDemoOrder, getDemoOrderPage, refundDemoOrder} from "@/api/pay/demo";
82-
import {deleteMerchant} from "@/api/pay/merchant";
8382
8483
export default {
8584
name: "PayDemoOrder",

0 commit comments

Comments
 (0)