Skip to content

Commit 7625e67

Browse files
committed
code review:优化收银台的实现,解决 TODO
1 parent 551ebbd commit 7625e67

File tree

8 files changed

+54
-183
lines changed

8 files changed

+54
-183
lines changed

src/api/pay/app/index.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ export interface AppPageReqVO extends PageParam {
2222
createTime?: Date[]
2323
}
2424

25-
export interface AppExportReqVO {
26-
name?: string
27-
status?: number
28-
remark?: string
29-
payNotifyUrl?: string
30-
refundNotifyUrl?: string
31-
merchantName?: string
32-
createTime?: Date[]
33-
}
34-
3525
export interface AppUpdateStatusReqVO {
3626
id: number
3727
status: number
@@ -67,16 +57,7 @@ export const deleteApp = (id: number) => {
6757
return request.delete({ url: '/pay/app/delete?id=' + id })
6858
}
6959

70-
// 导出支付应用
71-
export const exportApp = (params: AppExportReqVO) => {
72-
return request.download({ url: '/pay/app/export-excel', params })
73-
}
74-
75-
// 根据商ID称搜索应用列表
76-
export const getAppListByMerchantId = (merchantId: number) => {
77-
return request.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } })
78-
}
79-
60+
// 获得支付应用列表
8061
export const getAppList = () => {
8162
return request.get({
8263
url: '/pay/app/list'

src/api/pay/notify/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import request from '@/config/axios'
22

3+
// 获得支付通知明细
34
export const getNotifyTaskDetail = (id) => {
45
return request.get({
56
url: '/pay/notify/get-detail?id=' + id

src/api/pay/order/index.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,11 @@ export const getOrderDetail = async (id: number) => {
9393
return await request.get({ url: '/pay/order/get-detail?id=' + id })
9494
}
9595

96-
// 新增支付订单
97-
export const createOrder = async (data: OrderVO) => {
96+
// 提交支付订单
97+
export const submitOrder = async (data: any) => {
9898
return await request.post({ url: '/pay/order/submit', data })
9999
}
100100

101-
// 修改支付订单
102-
export const updateOrder = async (data: OrderVO) => {
103-
return await request.put({ url: '/pay/order/update', data })
104-
}
105-
106-
// 删除支付订单
107-
export const deleteOrder = async (id: number) => {
108-
return await request.delete({ url: '/pay/order/delete?id=' + id })
109-
}
110-
111101
// 导出支付订单
112102
export const exportOrder = async (params: OrderExportReqVO) => {
113103
return await request.download({ url: '/pay/order/export-excel', params })

src/utils/constants.ts

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -177,80 +177,6 @@ export const PayOrderStatusEnum = {
177177
}
178178
}
179179

180-
/**
181-
* 支付订单回调状态枚举
182-
*/
183-
export const PayOrderNotifyStatusEnum = {
184-
NO: {
185-
status: 0,
186-
name: '未通知'
187-
},
188-
SUCCESS: {
189-
status: 10,
190-
name: '通知成功'
191-
},
192-
FAILURE: {
193-
status: 20,
194-
name: '通知失败'
195-
}
196-
}
197-
198-
/**
199-
* 支付订单退款状态枚举
200-
*/
201-
export const PayOrderRefundStatusEnum = {
202-
NO: {
203-
status: 0,
204-
name: '未退款'
205-
},
206-
SOME: {
207-
status: 10,
208-
name: '部分退款'
209-
},
210-
ALL: {
211-
status: 20,
212-
name: '全部退款'
213-
}
214-
}
215-
216-
/**
217-
* 支付退款订单状态枚举
218-
*/
219-
export const PayRefundStatusEnum = {
220-
CREATE: {
221-
status: 0,
222-
name: '退款订单生成'
223-
},
224-
SUCCESS: {
225-
status: 1,
226-
name: '退款成功'
227-
},
228-
FAILURE: {
229-
status: 2,
230-
name: '退款失败'
231-
},
232-
PROCESSING_NOTIFY: {
233-
status: 3,
234-
name: '退款中,渠道通知结果'
235-
},
236-
PROCESSING_QUERY: {
237-
status: 4,
238-
name: '退款中,系统查询结果'
239-
},
240-
UNKNOWN_RETRY: {
241-
status: 5,
242-
name: '状态未知,请重试'
243-
},
244-
UNKNOWN_QUERY: {
245-
status: 6,
246-
name: '状态未知,系统查询结果'
247-
},
248-
CLOSE: {
249-
status: 99,
250-
name: '退款关闭'
251-
}
252-
}
253-
254180
/**
255181
* 商品 SPU 状态
256182
*/

src/utils/dict.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,8 @@ export enum DICT_TYPE {
130130
BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type',
131131

132132
// ========== PAY 模块 ==========
133-
PAY_CHANNEL_WECHAT_VERSION = 'pay_channel_wechat_version', // 微信渠道版本
134-
PAY_CHANNEL_ALIPAY_SIGN_TYPE = 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
135-
PAY_CHANNEL_ALIPAY_MODE = 'pay_channel_alipay_mode', // 支付宝公钥类型
136-
PAY_CHANNEL_ALIPAY_SERVER_TYPE = 'pay_channel_alipay_server_type', // 支付宝网关地址
137133
PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
138134
PAY_CHANNEL_CODE_TYPE = 'pay_channel_code_type', // 支付渠道编码类型
139-
// PAY_ORDER_NOTIFY_STATUS = 'pay_order_notify_status', // 商户支付订单回调状态
140135
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
141136
PAY_ORDER_REFUND_STATUS = 'pay_order_refund_status', // 商户支付订单退款状态
142137
PAY_REFUND_ORDER_STATUS = 'pay_refund_order_status', // 退款订单状态

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</el-radio>
2222
</el-radio-group>
2323
</el-form-item>
24-
<el-form-item label="支付结果的回调地址" prop="payNotifyUrl">
25-
<el-input v-model="formData.payNotifyUrl" placeholder="请输入支付结果的回调地址" />
24+
<el-form-item label="支付结果的回调地址" prop="orderNotifyUrl">
25+
<el-input v-model="formData.orderNotifyUrl" placeholder="请输入支付结果的回调地址" />
2626
</el-form-item>
2727
<el-form-item label="退款结果的回调地址" prop="refundNotifyUrl">
2828
<el-input v-model="formData.refundNotifyUrl" placeholder="请输入退款结果的回调地址" />
@@ -66,7 +66,7 @@ const formData = ref({
6666
const formRules = reactive({
6767
name: [{ required: true, message: '应用名不能为空', trigger: 'blur' }],
6868
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }],
69-
payNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }],
69+
orderNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }],
7070
refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }]
7171
})
7272
const formRef = ref() // 表单 Ref
@@ -122,7 +122,7 @@ const resetForm = () => {
122122
name: undefined,
123123
status: CommonStatusEnum.ENABLE,
124124
remark: undefined,
125-
payNotifyUrl: undefined,
125+
orderNotifyUrl: undefined,
126126
refundNotifyUrl: undefined
127127
}
128128
formRef.value?.resetFields()

src/views/pay/app/index.vue

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@
5454
>
5555
<Icon icon="ep:plus" class="mr-5px" /> 新增
5656
</el-button>
57-
<el-button
58-
type="success"
59-
plain
60-
@click="handleExport"
61-
:loading="exportLoading"
62-
v-hasPermi="['system:tenant:export']"
63-
>
64-
<Icon icon="ep:download" class="mr-5px" /> 导出
65-
</el-button>
6657
</el-form-item>
6758
</el-form>
6859
</ContentWrap>
@@ -392,20 +383,6 @@ const handleDelete = async (id: number) => {
392383
} catch {}
393384
}
394385
395-
/** 导出按钮操作 */
396-
const handleExport = async () => {
397-
try {
398-
// 导出的二次确认
399-
await message.exportConfirm()
400-
// 发起导出
401-
exportLoading.value = true
402-
const data = await AppApi.exportApp(queryParams)
403-
download.excel(data, '支付应用信息.xls')
404-
} finally {
405-
exportLoading.value = false
406-
}
407-
}
408-
409386
/**
410387
* 根据渠道编码判断渠道列表中是否存在
411388
*

0 commit comments

Comments
 (0)