更新了审核功能
This commit is contained in:
parent
71b5252526
commit
22f9d1b967
@ -39,3 +39,4 @@ export function refundLog(params?: any) {
|
|||||||
export function refundStat(params?: any) {
|
export function refundStat(params?: any) {
|
||||||
return request.get({ url: '/finance.refund/stat', params })
|
return request.get({ url: '/finance.refund/stat', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,3 +24,8 @@ export function apiWithdrawDelete(params: any) {
|
|||||||
export function apiWithdrawDetail(params: any) {
|
export function apiWithdrawDetail(params: any) {
|
||||||
return request.get({ url: '/finance.withdraw/detail', params })
|
return request.get({ url: '/finance.withdraw/detail', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//提现审核
|
||||||
|
export function withdrawAudit(params?: any) {
|
||||||
|
return request.post({ url: '/finance.withdraw/audit', params })
|
||||||
|
}
|
||||||
|
@ -47,22 +47,24 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||||
<el-button v-perms="['withdraw/add']" type="primary" @click="handleAdd">
|
<!--
|
||||||
|
<el-button v-perms="['withdraw/add']" type="primary" @click="handleAdd">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon name="el-icon-Plus" />
|
<icon name="el-icon-Plus" />
|
||||||
</template>
|
</template>
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-perms="['withdraw/delete']"
|
v-perms="['withdraw/delete']"
|
||||||
:disabled="!selectData.length"
|
:disabled="!selectData.length"
|
||||||
@click="handleDelete(selectData)"
|
@click="handleDelete(selectData)"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<!-- <el-table-column type="selection" width="55" /> -->
|
||||||
|
<el-table-column label="ID" prop="id" width="110" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="订单编号"
|
label="订单编号"
|
||||||
prop="order_sn"
|
prop="order_sn"
|
||||||
@ -89,7 +91,7 @@
|
|||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="120" fixed="right">
|
<el-table-column label="操作" width="120" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<!-- <el-button
|
||||||
v-perms="['withdraw/edit']"
|
v-perms="['withdraw/edit']"
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
@ -97,7 +99,7 @@
|
|||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-perms="['withdraw/delete']"
|
v-perms="['withdraw/delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
link
|
link
|
||||||
@ -105,6 +107,15 @@
|
|||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
-->
|
||||||
|
<el-button
|
||||||
|
v-perms="['withdraw/audit']"
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleAudit(row)"
|
||||||
|
>
|
||||||
|
审核
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -120,6 +131,13 @@
|
|||||||
@success="getLists"
|
@success="getLists"
|
||||||
@close="showEdit = false"
|
@close="showEdit = false"
|
||||||
/>
|
/>
|
||||||
|
<audit-popup
|
||||||
|
v-if="showAudit"
|
||||||
|
ref="auditRef"
|
||||||
|
:dict-data="dictData"
|
||||||
|
@success="getLists"
|
||||||
|
@close="showAudit = false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -130,10 +148,13 @@ import { apiWithdrawLists, apiWithdrawDelete } from "@/api/withdraw";
|
|||||||
import { timeFormat } from "@/utils/util";
|
import { timeFormat } from "@/utils/util";
|
||||||
import feedback from "@/utils/feedback";
|
import feedback from "@/utils/feedback";
|
||||||
import EditPopup from "./edit.vue";
|
import EditPopup from "./edit.vue";
|
||||||
|
import AuditPopup from "./audit.vue";
|
||||||
|
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||||
|
const auditRef = shallowRef<InstanceType<typeof AuditPopup>>();
|
||||||
// 是否显示编辑框
|
// 是否显示编辑框
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
|
const showAudit = ref(false);
|
||||||
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
@ -196,6 +217,14 @@ const handleEdit = async (data: any) => {
|
|||||||
editRef.value?.setFormData(data);
|
editRef.value?.setFormData(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 审核
|
||||||
|
const handleAudit = async (data: any) => {
|
||||||
|
showAudit.value = true;
|
||||||
|
await nextTick();
|
||||||
|
auditRef.value?.open("edit");
|
||||||
|
auditRef.value?.setFormData(data);
|
||||||
|
};
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = async (id: number | any[]) => {
|
const handleDelete = async (id: number | any[]) => {
|
||||||
await feedback.confirm("确定要删除?");
|
await feedback.confirm("确定要删除?");
|
||||||
|
225
src/views/finance/audit.vue
Normal file
225
src/views/finance/audit.vue
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<div class="edit-popup">
|
||||||
|
<popup
|
||||||
|
ref="popupRef"
|
||||||
|
:title="popupTitle"
|
||||||
|
:async="true"
|
||||||
|
width="550px"
|
||||||
|
@confirm="handleSubmit"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
label-width="90px"
|
||||||
|
:rules="formRules"
|
||||||
|
>
|
||||||
|
<el-form-item label="订单编号" prop="order_sn">
|
||||||
|
<el-input
|
||||||
|
readonly
|
||||||
|
v-model="formData.order_sn"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入订单编号"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提现金额" prop="amount">
|
||||||
|
<el-input
|
||||||
|
readonly
|
||||||
|
v-model="formData.amount"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入提现金额"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio :label="1">通过</el-radio>
|
||||||
|
<el-radio :label="2">拒绝</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="formData.status == 2" label="备注" prop="notes">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.notes"
|
||||||
|
clearable
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="转账凭证" prop="transfer_voucher">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
style="width: 100%"
|
||||||
|
drag
|
||||||
|
:headers="{ Token: userStore.token }"
|
||||||
|
:action="base_url + '/upload/file'"
|
||||||
|
:limit="1"
|
||||||
|
:on-success="handleFile"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
ref="upload"
|
||||||
|
>
|
||||||
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
|
<div class="el-upload__text">文件拖入或点击上传</div>
|
||||||
|
<template #tip>
|
||||||
|
<div class="el-upload__tip">请上传JPG/JPEG/PNG/GIF/PDF文件</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="withdrawEdit">
|
||||||
|
import type { FormInstance, UploadRawFile } from "element-plus";
|
||||||
|
import Popup from "@/components/popup/index.vue";
|
||||||
|
import {
|
||||||
|
apiWithdrawAdd,
|
||||||
|
apiWithdrawEdit,
|
||||||
|
apiWithdrawDetail,
|
||||||
|
withdrawAudit,
|
||||||
|
} from "@/api/withdraw";
|
||||||
|
import { timeFormat } from "@/utils/util";
|
||||||
|
import type { PropType } from "vue";
|
||||||
|
import useUserStore from "@/stores/modules/user";
|
||||||
|
import { genFileId } from "element-plus";
|
||||||
|
import { inject } from "vue";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const base_url: any = inject("base_url");
|
||||||
|
defineProps({
|
||||||
|
dictData: {
|
||||||
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const emit = defineEmits(["success", "close"]);
|
||||||
|
const formRef = shallowRef<FormInstance>();
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||||
|
const mode = ref("add");
|
||||||
|
|
||||||
|
// 弹窗标题
|
||||||
|
const popupTitle = computed(() => {
|
||||||
|
return mode.value == "edit" ? "审核提现申请" : "新增提现申请";
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
id: "",
|
||||||
|
order_sn: "",
|
||||||
|
user_id: "",
|
||||||
|
admin_id: "",
|
||||||
|
amount: "",
|
||||||
|
status: "",
|
||||||
|
transfer_voucher: "",
|
||||||
|
notes: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表单验证
|
||||||
|
const formRules = reactive<any>({
|
||||||
|
status: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
// message: "请选择审核是否通过",
|
||||||
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
|
if (value == 1 || value == 2) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
callback(new Error("请选择审核是否通过!"));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: ["blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
transfer_voucher: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请先上传凭证",
|
||||||
|
trigger: ["blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写拒绝原因",
|
||||||
|
trigger: ["blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
for (const key in formData) {
|
||||||
|
if (data[key] != null && data[key] != undefined) {
|
||||||
|
//@ts-ignore
|
||||||
|
formData[key] = data[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
const data = await apiWithdrawDetail({
|
||||||
|
id: row.id,
|
||||||
|
});
|
||||||
|
setFormData(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const fileTypeList = [
|
||||||
|
"application/pdf",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/gif",
|
||||||
|
"image/png",
|
||||||
|
];
|
||||||
|
// 限制上传类型
|
||||||
|
const beforeUpload = (rawFile: UploadRawFile) => {
|
||||||
|
if (!fileTypeList.includes(rawFile.type)) {
|
||||||
|
ElMessage.error("请上传JPG/JPEG/PNG/GIF/PDF文件");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 文件选择
|
||||||
|
const upload = ref(null);
|
||||||
|
const handleExceed = (files: any) => {
|
||||||
|
upload.value!.clearFiles();
|
||||||
|
const file = files[0] as UploadRawFile;
|
||||||
|
file.uid = genFileId();
|
||||||
|
upload.value!.handleStart(file);
|
||||||
|
upload.value!.submit();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
const handleFile = (e: any) => {
|
||||||
|
if (e.code == 0 && e.show == 1) {
|
||||||
|
formData.transfer_voucher = "";
|
||||||
|
upload.value!.clearFiles();
|
||||||
|
return ElMessage.error(e.msg || "上传失败");
|
||||||
|
}
|
||||||
|
formData.transfer_voucher = e.data.uri;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
await formRef.value?.validate();
|
||||||
|
const data = { ...formData };
|
||||||
|
mode.value == (await withdrawAudit(data));
|
||||||
|
popupRef.value?.close();
|
||||||
|
emit("success");
|
||||||
|
};
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = (type = "add") => {
|
||||||
|
mode.value = type;
|
||||||
|
popupRef.value?.open();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
getDetail,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user