Jelajahi Sumber

feat: 钱包信息处理

max 6 bulan lalu
induk
melakukan
714bd52ab8

+ 1 - 0
.gitignore

@@ -18,3 +18,4 @@ yarn-error.log*
 *.sln
 *.sw*
 dist.zip
+/stats.html

+ 7 - 1
src/modules/payment/views/components/business.vue

@@ -195,7 +195,13 @@ const Upsert = useUpsert({
 			},
 			required: true
 		}
-	],
+	].map((elm: any) => ({
+		...elm,
+		props: {
+			...(elm?.props ? {} : elm?.props),
+			labelWidth: '150px'
+		}
+	})),
 	dialog: {
 		title: '企业认证'
 	},

+ 3 - 3
src/modules/payment/views/order.vue

@@ -133,7 +133,7 @@ const Upsert = useUpsert({
 			label: '订单状态',
 			prop: 'status',
 			component: { name: 'el-input', props: { clearable: true } },
-			value: 'PENDING',
+			value: 'PENDING'
 		},
 		{
 			label: '订单类型:入金/出金',
@@ -153,10 +153,10 @@ const Upsert = useUpsert({
 	],
 	async onOpened(data) {
 		if (!data.merchantId) {
-			Upsert.value?.hideItem(['status'])
+			Upsert.value?.hideItem(['status']);
 		}
 		const typesObj = await service.dict.info.data({
-			types: ['payment_type', 'currency', 'order_type'],
+			types: ['payment_type', 'currency', 'order_type']
 		});
 		Upsert.value?.setOptions(
 			'payment_type',

+ 7 - 1
src/modules/payment/views/payee_address.vue

@@ -314,7 +314,13 @@ const Upsert = useUpsert({
 			},
 			component: { name: 'el-input', props: { type: 'textarea', rows: 4 } }
 		}
-	],
+	].map((elm: any) => ({
+		...elm,
+		props: {
+			...(elm?.props ? {} : elm?.props),
+			labelWidth: '150px'
+		}
+	})),
 	async onOpen() {
 		channelList.value = await service.payment.channel.list();
 		Upsert.value?.setOptions(

+ 20 - 16
src/modules/payment/views/rate.vue

@@ -33,7 +33,11 @@
 							channelList
 								.find(v => v.code == scope.channelId)
 								?.supportedCurrencies.includes(item.id)
-						)" :key="item.id" :label="item.label" :value="item.value" />
+						)"
+						:key="item.id"
+						:label="item.label"
+						:value="item.value"
+					/>
 				</el-select>
 			</template>
 		</cl-upsert>
@@ -41,8 +45,8 @@
 </template>
 
 <script lang="ts" name="payment-rate" setup>
-import { useConfig, useCrud, useTable, useUpsert, } from '@cool-vue/crud';
-import { useCool, } from '/@/cool';
+import { useConfig, useCrud, useTable, useUpsert } from '@cool-vue/crud';
+import { useCool } from '/@/cool';
 import { onMounted, onUnmounted, ref, toRaw } from 'vue';
 import { Key } from '@element-plus/icons-vue';
 
@@ -161,8 +165,10 @@ const Upsert = useUpsert({
 	},
 	async onOpened(data) {
 		const payment_type_list = await service.dict.info.list({
-			"type": "payment_type","sort":"desc","order":"orderNum"
-		})
+			type: 'payment_type',
+			sort: 'desc',
+			order: 'orderNum'
+		});
 		Upsert.value?.setOptions(
 			'roleIdList',
 			payment_type_list.map(e => {
@@ -172,11 +178,11 @@ const Upsert = useUpsert({
 				};
 			})
 		);
-		if(!data.currency) {
+		if (!data.currency) {
 			// 新增
-			console.log('新增');		
-			Upsert.value?.hideItem(['rate'])
-			Upsert.value?.hideItem(['method'])
+			console.log('新增');
+			Upsert.value?.hideItem(['rate']);
+			Upsert.value?.hideItem(['method']);
 			Upsert.value?.setOptions(
 				'DEPOSIT_method',
 				payment_type_list.map(e => ({
@@ -191,13 +197,13 @@ const Upsert = useUpsert({
 					value: e.value
 				}))
 			);
-			return
+			return;
 		}
 		// 编辑
 		console.log('编辑');
 		['DEPOSIT_rate', 'DEPOSIT_method', 'WITHDRAWAL_rate', 'WITHDRAWAL_method'].forEach(key => {
-			Upsert.value?.hideItem([key])
-		})
+			Upsert.value?.hideItem([key]);
+		});
 		Upsert.value?.setOptions(
 			'method',
 			payment_type_list.map(e => ({
@@ -205,11 +211,9 @@ const Upsert = useUpsert({
 				value: e.value
 			}))
 		);
-	},
+	}
 });
 
-
-
 // cl-table
 const Table = useTable({
 	columns: [
@@ -258,7 +262,7 @@ onMounted(() => {
 	// mitt.on('crud.proxyh', (data) => {
 	// 	console.log(241, data);
 	// });
-})
+});
 
 onUnmounted(() => {
 	mitt.off('crud.proxyh');

+ 105 - 16
src/modules/payment/views/wallet.vue

@@ -18,8 +18,12 @@
 			<cl-table ref="Table">
 				<template #slot-btn="{ scope }">
 					<el-button text bg type="success" @click="rechange(scope.row)">充值</el-button>
-					<el-button text bg type="success" @click="showWithdraw(scope.row)">提现</el-button>
-					<el-button text bg type="success" @click="showTransfer(scope.row)">划转</el-button>
+					<el-button text bg type="success" @click="showWithdraw(scope.row)"
+						>提现</el-button
+					>
+					<el-button text bg type="success" @click="showTransfer(scope.row)"
+						>划转</el-button
+					>
 				</template>
 			</cl-table>
 		</cl-row>
@@ -35,23 +39,93 @@
 			<template #slot-currency="{ scope }">
 				<el-select v-model="scope.currency" clearable>
 					<el-option
-v-for="item in currencyList.filter(
-					item =>
-						channelList
-							.find(v => v.code == scope.channel)
-							?.supportedCurrencies.includes(item.id) || item.type == '2'
-				)" :key="item.id" :label="item.label" :value="item.value" />
+						v-for="item in currencyList.filter(
+							item =>
+								channelList
+									.find(v => v.code == scope.channel)
+									?.supportedCurrencies.includes(item.id) || item.type == '2'
+						)"
+						:key="item.id"
+						:label="item.label"
+						:value="item.value"
+					/>
 				</el-select>
 			</template>
 		</cl-upsert>
 		<withdraw
-v-if="WithdrawVisible" :channel="channel" :currency="currency" v-model:show="WithdrawVisible"
-			@refresh="refresh" />
+			v-if="WithdrawVisible"
+			:channel="channel"
+			:currency="currency"
+			v-model:show="WithdrawVisible"
+			@refresh="refresh"
+		/>
 		<transfer
-v-if="TransferVisible" :fromWalletId="fromWalletId" :channel="channel" v-model:show="TransferVisible"
-			@refresh="refresh" />
-		<cl-dialog title="充值信息" v-model="rechangeVisible">
-			<pre class="json-content">{{ rechangeInfo.config }}</pre>
+			v-if="TransferVisible"
+			:fromWalletId="fromWalletId"
+			:channel="channel"
+			v-model:show="TransferVisible"
+			@refresh="refresh"
+		/>
+		<cl-dialog title="充值信息" v-model="rechangeVisible" width="80%">
+			<div v-if="rechangeInfo && rechangeInfo.currency === 'EUR'" class="currency-box">
+				<el-row style="margin-bottom: 12px">
+					<el-col :span="12">
+						<span class="label">bic:</span>
+						<span class="content">{{ rechangeInfo.config[0].bic }}</span>
+					</el-col>
+					<el-col :span="12">
+						<span class="label">iBan:</span
+						><span class="content">{{ rechangeInfo.config[0].iBan }}</span>
+					</el-col>
+				</el-row>
+				<el-row style="margin-bottom: 12px">
+					<el-col :span="12">
+						<span class="label">status:</span
+						><span class="content">{{ rechangeInfo.config[0].status }}</span>
+					</el-col>
+					<el-col :span="12">
+						<span class="label">bankName:</span
+						><span class="content">{{ rechangeInfo.config[0].bankName }}</span>
+					</el-col>
+				</el-row>
+				<el-row style="margin-bottom: 12px">
+					<el-col :span="12">
+						<span class="label">currency:</span
+						><span class="content">{{ rechangeInfo.config[0].currency }}</span>
+					</el-col>
+					<el-col :span="12">
+						<span class="label">bankAddress:</span
+						><span class="content">{{ rechangeInfo.config[0].bankAddress }}</span>
+					</el-col>
+				</el-row>
+				<el-row style="margin-bottom: 12px">
+					<el-col :span="12">
+						<span class="label">bankCountry:</span
+						><span class="content">{{ rechangeInfo.config[0].bankCountry }}</span>
+					</el-col>
+					<el-col :span="12">
+						<span class="label">accountNumber:</span
+						><span class="content">{{ rechangeInfo.config[0].accountNumber }}</span>
+					</el-col>
+				</el-row>
+				<el-row style="margin-bottom: 12px">
+					<el-col :span="12">
+						<span class="label">routingCodeEntries:</span
+						><span class="content">{{
+							rechangeInfo.config[0].routingCodeEntries
+						}}</span>
+					</el-col>
+					<el-col :span="12">
+						<span class="label">bankAccountHolderName:</span
+						><span class="content">{{
+							rechangeInfo.config[0].bankAccountHolderName
+						}}</span>
+					</el-col>
+				</el-row>
+			</div>
+			<div v-else>
+				<pre class="json-content">{{ rechangeInfo.config[0] }}</pre>
+			</div>
 		</cl-dialog>
 	</cl-crud>
 </template>
@@ -63,6 +137,7 @@ import { useCrud, useTable, useUpsert } from '@cool-vue/crud';
 import { useCool } from '/@/cool';
 import { ref } from 'vue';
 import { ElMessage } from 'element-plus';
+import ClCrud from '/~/crud/src/components/crud';
 const { service } = useCool();
 const WithdrawVisible = ref(false);
 const TransferVisible = ref(false);
@@ -91,7 +166,7 @@ const Upsert = useUpsert({
 			prop: 'currency',
 			component: { name: 'slot-currency', props: { clearable: true } },
 			required: true
-		},
+		}
 	],
 	async onOpen() {
 		channelList.value = await service.payment.channel.list();
@@ -103,7 +178,6 @@ const Upsert = useUpsert({
 		// getCustomerList.value = await service.payment.customer.list({ merchantId: 24 });
 		// console.log(1130000, getCustomerList.value);
 
-
 		// getCustomerList = await service.payment.customer.list({});
 	}
 });
@@ -188,4 +262,19 @@ function refresh(params?: any) {
 	overflow: auto;
 	/* 内容过多时显示滚动条 */
 }
+
+.currency-box {
+	.el-col-12 {
+		display: flex;
+		align-items: center;
+		.label {
+			flex: 0 0 200px;
+			font-weight: bold;
+			display: block;
+		}
+		.content {
+			display: block;
+		}
+	}
+}
 </style>