update
This commit is contained in:
@@ -421,6 +421,41 @@ const merchant = {
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getWithdrawalInfo: async (id) => {
|
||||
return request({
|
||||
url: '/index/business/getWithdrawalInfo',
|
||||
method: Method.POST,
|
||||
data: {id}
|
||||
});
|
||||
},
|
||||
editWithdrawal: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/editWithdrawal',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
delWithdrawal: async (id) => {
|
||||
return request({
|
||||
url: '/index/business/delWithdrawal',
|
||||
method: Method.POST,
|
||||
data: {id}
|
||||
});
|
||||
},
|
||||
getBusinessMoneyLog: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/getBusinessMoneyLog',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getPurpose: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/getPurpose',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
export default merchant;
|
||||
|
||||
@@ -1,22 +1,80 @@
|
||||
<script setup>
|
||||
import {reactive, ref} from 'vue';
|
||||
import {reactive, ref, useTemplateRef, watch} from 'vue';
|
||||
import Api from "../../../api/index.js";
|
||||
import VerificationCode from "../../../components/VerificationCode/index.vue";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const {id} = defineProps({
|
||||
id: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
});
|
||||
const visible = ref(false);
|
||||
const emits = defineEmits(['success']);
|
||||
const formRef = useTemplateRef('formRef');
|
||||
const state = reactive({
|
||||
timer: null,
|
||||
sendTimeout: 0,
|
||||
});
|
||||
const form = reactive({
|
||||
type: null,
|
||||
type: 1,
|
||||
id: null,
|
||||
mobile: null,
|
||||
captcha: null,
|
||||
realname: null,
|
||||
id_card: null,
|
||||
account: null,
|
||||
});
|
||||
const rules = {
|
||||
realname: [
|
||||
{
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
},
|
||||
{
|
||||
match: /^[\u4e00-\u9fa5]{1}(?:·?[\u4e00-\u9fa5]){1,24}$|^[\u4e00-\u9fa5]{2,25}$/,
|
||||
message: '姓名错误',
|
||||
}
|
||||
],
|
||||
account: [{
|
||||
required: true,
|
||||
message: '账号不能为空',
|
||||
}],
|
||||
id_card: [
|
||||
{
|
||||
required: true,
|
||||
message: '身份证不能为空',
|
||||
},
|
||||
{
|
||||
match: /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/,
|
||||
message: '身份证号错误',
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不能为空',
|
||||
},
|
||||
{
|
||||
match: /^1[3-9]\d{9}$/,
|
||||
message: '手机号错误',
|
||||
}
|
||||
],
|
||||
captcha: [{
|
||||
required: true,
|
||||
message: '验证码不能为空',
|
||||
},]
|
||||
};
|
||||
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
if (val && id) Api.merchant.getWithdrawalInfo(id).then(({data}) => {
|
||||
Object.assign(form, data);
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
const sendMessage = () => {
|
||||
state.sendTimeout = 10;
|
||||
@@ -29,9 +87,32 @@ const sendMessage = () => {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
const success = async () => {
|
||||
const success = () => {
|
||||
if (!form.id) {
|
||||
formRef.value.validate().then(async (res) => {
|
||||
if (res) {
|
||||
const firstKey = Object.keys(res)[0];
|
||||
Message.warning(res[firstKey].message);
|
||||
} else {
|
||||
const {msg} = await Api.merchant.addWithdrawal(form);
|
||||
Message.success(msg);
|
||||
visible.value = false;
|
||||
emits('success');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
formRef.value.validate().then(async (res) => {
|
||||
if (res) {
|
||||
const firstKey = Object.keys(res)[0];
|
||||
Message.warning(res[firstKey].message);
|
||||
} else {
|
||||
const {msg} = await Api.merchant.editWithdrawal(form);
|
||||
Message.success(msg);
|
||||
visible.value = false;
|
||||
emits('success');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -43,25 +124,30 @@ const success = async () => {
|
||||
|
||||
<a-modal
|
||||
title-align="start"
|
||||
title="添加提现信息"
|
||||
:ok-text="`确定${id?'修改':'添加'}`"
|
||||
:title="`${id?'修改':'添加'}提现信息`"
|
||||
@ok="success"
|
||||
v-model:visible="visible">
|
||||
<a-form>
|
||||
<a-tabs type="rounded">
|
||||
<a-tab-pane title="添加支付宝" key="1">
|
||||
<a-form-item label="收款姓名">
|
||||
@cancel="visible = false"
|
||||
:visible="visible">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules">
|
||||
<a-tabs type="rounded" destroy-on-hide v-model:active-key="form.type">
|
||||
<a-tab-pane title="添加支付宝" :key="1">
|
||||
<a-form-item label="收款姓名" field="realname">
|
||||
<a-input v-model:model-value="form.realname" placeholder="请输入收款人的姓名"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="支付宝账号">
|
||||
<a-form-item label="支付宝账号" field="account">
|
||||
<a-input v-model:model-value="form.account" placeholder="请输入支付宝账号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="身份证号">
|
||||
<a-form-item label="身份证号" field="id_card">
|
||||
<a-input v-model:model-value="form.id_card" placeholder="请输入身份证号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号">
|
||||
<a-form-item label="手机号" field="mobile">
|
||||
<a-input v-model:model-value="form.mobile" placeholder="请输入手机号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<a-form-item label="验证码" field="captcha">
|
||||
<VerificationCode
|
||||
:type="6"
|
||||
:api="Api.merchant.sendSms"
|
||||
@@ -70,18 +156,18 @@ const success = async () => {
|
||||
</VerificationCode>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane title="添加银行卡" key="2">
|
||||
<a-form-item label="真实姓名">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入真实姓名"></a-input>
|
||||
<a-tab-pane title="添加银行卡" :key="2">
|
||||
<a-form-item label="真实姓名" field="realname">
|
||||
<a-input v-model:model-value="form.realname" placeholder="请输入真实姓名"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="身份证号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入身份证号"></a-input>
|
||||
<a-form-item label="身份证号" field="id_card">
|
||||
<a-input v-model:model-value="form.id_card" placeholder="请输入身份证号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="银行卡号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入银行卡号"></a-input>
|
||||
<a-form-item label="银行卡号" field="account">
|
||||
<a-input v-model:model-value="form.account" placeholder="请输入银行卡号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入手机号"></a-input>
|
||||
<a-form-item label="手机号" field="mobile">
|
||||
<a-input v-model:model-value="form.mobile" placeholder="请输入手机号"></a-input>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
@@ -25,6 +25,8 @@ watch(
|
||||
money: money,
|
||||
}).then(({data}) => {
|
||||
Object.assign(detail, data);
|
||||
}).catch(() => {
|
||||
visible.value = false;
|
||||
});
|
||||
},
|
||||
{deep: true}
|
||||
|
||||
@@ -17,7 +17,7 @@ const form = reactive({
|
||||
<a-form>
|
||||
<a-form-item label="立即充值">
|
||||
<a-input-number v-model:model-value="form.money" class="w-1/2" placeholder="输入金额"
|
||||
:precision="2" :min="1"></a-input-number>
|
||||
:precision="2" :min="0.01"></a-input-number>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="mt-[40px]">
|
||||
|
||||
@@ -5,6 +5,7 @@ import {onMounted, reactive, ref} from "vue";
|
||||
import AddWithdrawalInformationModal from "../../../components/AddWithdrawalInformationModal.vue";
|
||||
import LookWithdrawalInformationModal from "../../../components/LookWithdrawalInformationModal.vue";
|
||||
import Api from "../../../../../api/index.js";
|
||||
import {Message, Modal} from "@arco-design/web-vue";
|
||||
|
||||
const {businessInfo} = defineProps({
|
||||
businessInfo: {
|
||||
@@ -21,6 +22,20 @@ const getData = async () => {
|
||||
withdrawalList.push(...data);
|
||||
}
|
||||
|
||||
const deleteAccount = (v) => {
|
||||
console.log(v)
|
||||
Modal.warning({
|
||||
title: '确定删除吗?',
|
||||
content: `账号: ${v.account}`,
|
||||
hideCancel: false,
|
||||
onOk: async () => {
|
||||
const {msg} = await Api.merchant.delWithdrawal(v.id);
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
@@ -47,14 +62,16 @@ onMounted(() => {
|
||||
<img class="w-[15px] h-[15px] object-cover" :src="v.type === 1 ? ZFBICON : YHKICON"
|
||||
alt=""/>
|
||||
<div class="ml-[14px]">{{ v.type_text }}</div>
|
||||
<div class="ml-[12px]">{{ v.mobile }}</div>
|
||||
<div class="ml-[12px] mr-auto">{{ v.mobile }}</div>
|
||||
|
||||
<icon-edit class="ml-auto cursor-pointer"/>
|
||||
<AddWithdrawalInformationModal :id="v.id" @success="getData">
|
||||
<icon-edit class="cursor-pointer"/>
|
||||
</AddWithdrawalInformationModal>
|
||||
</div>
|
||||
<icon-delete class="ml-[8px]"/>
|
||||
<icon-delete @click="deleteAccount(v)" class="ml-[8px]"/>
|
||||
</div>
|
||||
</a-radio>
|
||||
<AddWithdrawalInformationModal>
|
||||
<AddWithdrawalInformationModal @success="getData">
|
||||
<div
|
||||
class="input-card flex w-[306px] items-center ml-[28px] cursor-pointer hover:!bg-[var(--color-neutral-2)] duration-500 gap-[10px] justify-center">
|
||||
<icon-plus/>
|
||||
@@ -69,14 +86,14 @@ onMounted(() => {
|
||||
<div class="max-w-[768px] flex gap-[20px] items-center">
|
||||
<a-input-number v-model:model-value="money" :precision="2"
|
||||
:placeholder="`最多可提现${businessInfo.money}元`"></a-input-number>
|
||||
<a-link :hoverable="false" class="whitespace-nowrap">全部提现</a-link>
|
||||
<a-link :hoverable="false" class="whitespace-nowrap" @click="money=businessInfo.money">全部提现</a-link>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="mt-[40px]">
|
||||
<!-- <a-button type="primary" @click="openWithdrawalStatus">立即提现</a-button>-->
|
||||
<LookWithdrawalInformationModal :id="withdrawalList[radioValue]?.id" :money="money">
|
||||
<a-button type="primary">立即提现</a-button>
|
||||
<a-button type="primary" :disabled="!withdrawalList[radioValue]?.id || !money">立即提现</a-button>
|
||||
</LookWithdrawalInformationModal>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
@@ -7,113 +7,101 @@ import Api from "../../../../api/index.js";
|
||||
const columns = [
|
||||
{
|
||||
title: '动账日期',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'createtime1'
|
||||
},
|
||||
{
|
||||
title: '动账时间',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'createtime2'
|
||||
},
|
||||
{
|
||||
title: '交易流水号',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'sn'
|
||||
},
|
||||
{
|
||||
title: '动账渠道',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'platform_name'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'status',
|
||||
slotName: 'status'
|
||||
},
|
||||
{
|
||||
title: '动账用途',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'purpose_name'
|
||||
},
|
||||
{
|
||||
title: '动账金额(元)',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'money'
|
||||
},
|
||||
{
|
||||
title: '付款人账户',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'account'
|
||||
},
|
||||
{
|
||||
title: '关联任务ID',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'task_id'
|
||||
},
|
||||
{
|
||||
title: '子任务ID',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'task_children_id'
|
||||
},
|
||||
{
|
||||
title: '钱包余额(元) ',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'business_money'
|
||||
},
|
||||
{
|
||||
title: '任务款余额(元)',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'business_coin'
|
||||
},
|
||||
{
|
||||
title: '资产合计(元)',
|
||||
dataIndex: 'value'
|
||||
dataIndex: 'sum',
|
||||
slotName: 'sum'
|
||||
},
|
||||
];
|
||||
const FilterConfig = computed(() => [
|
||||
{
|
||||
key: 'wd',
|
||||
key: 'platform',
|
||||
type: 'select',
|
||||
label: '动账渠道',
|
||||
placeholder: '全部',
|
||||
api: async () => ({
|
||||
data: [
|
||||
{
|
||||
name: '选项一',
|
||||
name: '全部',
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
name: '支付宝',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '选项二',
|
||||
name: '/',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '选项三',
|
||||
id: 3,
|
||||
},
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
key: 'wd',
|
||||
key: 'purpose',
|
||||
type: 'select',
|
||||
label: '动账用途',
|
||||
placeholder: '全部',
|
||||
api: async () => ({
|
||||
data: [
|
||||
{
|
||||
name: '选项一',
|
||||
id: 1,
|
||||
api: async () => Api.merchant.getPurpose()
|
||||
},
|
||||
{
|
||||
name: '选项二',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '选项三',
|
||||
id: 3,
|
||||
},
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
key: 'wd',
|
||||
key: 'task_id',
|
||||
type: 'input',
|
||||
label: '关联ID',
|
||||
placeholder: '请输入任务ID',
|
||||
},
|
||||
{
|
||||
key: 'wd',
|
||||
key: 'rangeTime',
|
||||
start: 'start_time',
|
||||
end: 'end_time',
|
||||
type: 'datetime',
|
||||
label: '动账日期',
|
||||
placeholder: '全部',
|
||||
},
|
||||
]);
|
||||
const vo = reactive({
|
||||
@@ -127,7 +115,7 @@ const po = reactive({
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
api: Api.merchant.getBusinessMoneyLog,
|
||||
callback: (data) => {
|
||||
Object.assign(vo, data);
|
||||
console.log(vo);
|
||||
@@ -162,6 +150,13 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
:loading="loading"
|
||||
class="flex-grow"
|
||||
:columns="columns">
|
||||
<template v-slot:status="{record}">
|
||||
<div v-if="record.status===1" class="status success">成功</div>
|
||||
<div v-if="record.status===0" class="status warning">失败</div>
|
||||
</template>
|
||||
<template v-slot:sum="{record}">
|
||||
{{ (record.business_money + record.business_coin).toFixed(2) }}
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</template>
|
||||
@@ -175,4 +170,36 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
letter-spacing: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.status {
|
||||
@apply flex whitespace-nowrap items-center gap-[6px];
|
||||
&::before {
|
||||
content: '';
|
||||
@apply block size-[6px] rounded-[50%];
|
||||
}
|
||||
}
|
||||
|
||||
.success {
|
||||
&::before {
|
||||
@apply bg-[rgb(var(--green-6))];
|
||||
}
|
||||
}
|
||||
|
||||
.danger {
|
||||
&::before {
|
||||
@apply bg-[rgb(var(--red-6))];
|
||||
}
|
||||
}
|
||||
|
||||
.warning {
|
||||
&::before {
|
||||
@apply bg-[rgb(var(--orange-6))];
|
||||
}
|
||||
}
|
||||
|
||||
.primary {
|
||||
&::before {
|
||||
@apply bg-[rgb(var(--arcoblue-6))];
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user