|
@@ -3,26 +3,9 @@
|
|
<div class="customer-top-up">
|
|
<div class="customer-top-up">
|
|
<!-- 搜索条件区 -->
|
|
<!-- 搜索条件区 -->
|
|
<div class="search-section">
|
|
<div class="search-section">
|
|
- <a-form ref="formRef" :model="searchForm" layout="inline">
|
|
|
|
- <a-form-item
|
|
|
|
- field="name"
|
|
|
|
- :label="$t('financialManagement.searchForm.name')"
|
|
|
|
- >
|
|
|
|
- <a-input
|
|
|
|
- v-model="searchForm.name"
|
|
|
|
- :placeholder="$t('financialManagement.searchForm.placeholder')"
|
|
|
|
- allow-clear
|
|
|
|
- />
|
|
|
|
- </a-form-item>
|
|
|
|
- <a-form-item>
|
|
|
|
- <a-space>
|
|
|
|
- <a-button type="primary" @click="handleSearch">搜索</a-button>
|
|
|
|
- <a-button @click="resetSearch">重置</a-button>
|
|
|
|
- </a-space>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-form>
|
|
|
|
|
|
+ <Search @query="getTopUpRecordListFc" @reset="reset" :SearchForm="userType.userType == 1 ? AdminSearchForm : ClientSearchForm"></Search>
|
|
</div>
|
|
</div>
|
|
- <div class="audit-btn">
|
|
|
|
|
|
+ <div class="audit-btn" v-if="userType.userType == 1">
|
|
<a-button @click="openTopsUp" type="text">
|
|
<a-button @click="openTopsUp" type="text">
|
|
<template #icon>
|
|
<template #icon>
|
|
<icon-plus-circle />
|
|
<icon-plus-circle />
|
|
@@ -31,87 +14,43 @@
|
|
</a-button>
|
|
</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
- <a-table
|
|
|
|
- row-key="id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="tableData"
|
|
|
|
- :pagination="pagination"
|
|
|
|
- @page-change="onPageChange"
|
|
|
|
- @page-size-change="onPageSizeChange"
|
|
|
|
- :filter-icon-align-left="true"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-table row-key="id" :columns="userType.userType == 1 ? columns : UserAdiroColumns" :data="tableData"
|
|
|
|
+ :pagination="pagination" @page-change="onPageChange" @page-size-change="onPageSizeChange"
|
|
|
|
+ :filter-icon-align-left="true">
|
|
<template #name="{ record }">
|
|
<template #name="{ record }">
|
|
<div class="boldTxt">{{ record.name }}</div>
|
|
<div class="boldTxt">{{ record.name }}</div>
|
|
</template>
|
|
</template>
|
|
<template #status="{ record }">
|
|
<template #status="{ record }">
|
|
<div>{{ handleStatusTxt(record.status) }}</div>
|
|
<div>{{ handleStatusTxt(record.status) }}</div>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #image="{ record }">
|
|
|
|
+ <a-image width="60" height="60" :src="record.certificateImg" :preview-props="{
|
|
|
|
+ actionsLayout: ['rotateRight', 'zoomIn', 'zoomOut'],
|
|
|
|
+ }" style="cursor: pointer;">
|
|
|
|
+ </a-image>
|
|
|
|
+ </template>
|
|
</a-table>
|
|
</a-table>
|
|
- <a-modal
|
|
|
|
- :visible="showAdd"
|
|
|
|
- :title="$t('financialManagement.recharge')"
|
|
|
|
- @cancel="showAdd = false"
|
|
|
|
- @ok="submitAdd"
|
|
|
|
- okText="确定"
|
|
|
|
- width="800px"
|
|
|
|
- cancelText="关闭"
|
|
|
|
- :mask-closable="false"
|
|
|
|
- :loading="okLoading"
|
|
|
|
- unmount-on-close
|
|
|
|
- >
|
|
|
|
|
|
+ <a-modal :visible="showAdd" :title="$t('financialManagement.recharge')" @cancel="showAdd = false" @ok="submitAdd"
|
|
|
|
+ okText="确定" width="800px" cancelText="关闭" :mask-closable="false" :loading="okLoading" unmount-on-close>
|
|
<a-form ref="addFormRef" :rules="rules" :model="formAdd" auto-label-width>
|
|
<a-form ref="addFormRef" :rules="rules" :model="formAdd" auto-label-width>
|
|
- <a-form-item
|
|
|
|
- field="status"
|
|
|
|
- :label="$t('financialManagement.rechargeType')"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item field="status" :label="$t('financialManagement.rechargeType')">
|
|
<a-radio-group v-model="formAdd.status" :options="statusOptions" />
|
|
<a-radio-group v-model="formAdd.status" :options="statusOptions" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item
|
|
|
|
- field="userId"
|
|
|
|
- :label="$t('financialManagement.searchForm.name')"
|
|
|
|
- >
|
|
|
|
- <a-select
|
|
|
|
- :options="customerOptions"
|
|
|
|
- :style="{ width: '320px' }"
|
|
|
|
- :loading="customerLoading"
|
|
|
|
- :placeholder="$t('financialManagement.lenovoInput')"
|
|
|
|
- @search="customerSearch"
|
|
|
|
- :field-names="fieldNames"
|
|
|
|
- allow-search
|
|
|
|
- allow-clear
|
|
|
|
- @change="customerChange"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-form-item field="userId" :label="$t('financialManagement.searchForm.name')">
|
|
|
|
+ <a-select :options="customerOptions" :style="{ width: '320px' }" :loading="customerLoading"
|
|
|
|
+ :placeholder="$t('financialManagement.lenovoInput')" @search="customerSearch" :field-names="fieldNames"
|
|
|
|
+ allow-search allow-clear @change="customerChange" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item
|
|
|
|
- field="amount"
|
|
|
|
- :label="$t('financialManagement.rechargeAmount')"
|
|
|
|
- >
|
|
|
|
- <a-input-number
|
|
|
|
- v-model="formAdd.amount"
|
|
|
|
- :placeholder="$t('financialManagement.rechargeAmountPlace')"
|
|
|
|
- class="input-demo"
|
|
|
|
- :min="10"
|
|
|
|
- :max="100"
|
|
|
|
- :style="{ width: '320px' }"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-form-item field="amount" :label="$t('financialManagement.rechargeAmount')">
|
|
|
|
+ <a-input-number v-model="formAdd.amount" :placeholder="$t('financialManagement.rechargeAmountPlace')"
|
|
|
|
+ class="input-demo" :min="10" :max="100" :style="{ width: '320px' }" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item field="remarks" :label="$t('financialManagement.remarks')">
|
|
<a-form-item field="remarks" :label="$t('financialManagement.remarks')">
|
|
- <a-textarea
|
|
|
|
- :placeholder="$t('financialManagement.remarksPlace')"
|
|
|
|
- v-model="formAdd.remarks"
|
|
|
|
- allow-clear
|
|
|
|
- :style="{ width: '320px' }"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-textarea :placeholder="$t('financialManagement.remarksPlace')" v-model="formAdd.remarks" allow-clear
|
|
|
|
+ :style="{ width: '320px' }" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item
|
|
|
|
- field="certificateImg"
|
|
|
|
- :label="$t('financialManagement.voucher')"
|
|
|
|
- >
|
|
|
|
- <Upload
|
|
|
|
- v-model:modelValue="formAdd.certificateImg"
|
|
|
|
- :style="{ width: 'auto' }"
|
|
|
|
- beforeUpload
|
|
|
|
- />
|
|
|
|
|
|
+ <a-form-item field="certificateImg" :label="$t('financialManagement.voucher')">
|
|
|
|
+ <Upload v-model:modelValue="formAdd.certificateImg" :style="{ width: 'auto' }" beforeUpload />
|
|
<div class="text-box">
|
|
<div class="text-box">
|
|
<div class="text">1.{{ $t("financialManagement.uploadTip1") }}</div>
|
|
<div class="text">1.{{ $t("financialManagement.uploadTip1") }}</div>
|
|
<div class="text">2.{{ $t("financialManagement.uploadTip2") }}</div>
|
|
<div class="text">2.{{ $t("financialManagement.uploadTip2") }}</div>
|
|
@@ -125,9 +64,12 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, reactive, onMounted } from "vue";
|
|
import { ref, reactive, onMounted } from "vue";
|
|
import { Message } from "@arco-design/web-vue";
|
|
import { Message } from "@arco-design/web-vue";
|
|
-import { getTopUpRecordList, getCustomerList, topUpAs } from "@/api/finance.js";
|
|
|
|
|
|
+import { getTopUpRecordList, getCustomerList, topUpAs, getAdiroePuyList } from "@/api/path/finance.js";
|
|
import Upload from "@/components/upload/index.vue";
|
|
import Upload from "@/components/upload/index.vue";
|
|
-
|
|
|
|
|
|
+import { columns, handleStatusTxt, statusOptions, UserAdiroColumns, AdminSearchForm, ClientSearchForm } from '../config'
|
|
|
|
+const userType = ref(JSON.parse(localStorage.getItem('user_login_information')))
|
|
|
|
+import Search from '@/components/Search/index.vue'
|
|
|
|
+import { Getdictionary } from '@/mixins/index'
|
|
const rules = {
|
|
const rules = {
|
|
status: [
|
|
status: [
|
|
{
|
|
{
|
|
@@ -156,102 +98,20 @@ onMounted(() => {
|
|
getTopUpRecordListFc();
|
|
getTopUpRecordListFc();
|
|
});
|
|
});
|
|
|
|
|
|
-const initPage = {
|
|
|
|
- total: 0,
|
|
|
|
- current: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
-};
|
|
|
|
|
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
-const searchForm = ref({
|
|
|
|
- name: "",
|
|
|
|
-});
|
|
|
|
|
|
+const searchForm = ref();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
-const columns = [
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.orderNumber"),
|
|
|
|
- dataIndex: "index",
|
|
|
|
- align: "center",
|
|
|
|
- render: ({ rowIndex }) => rowIndex + 1,
|
|
|
|
- width: 60,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.customerId"),
|
|
|
|
- dataIndex: "id",
|
|
|
|
- ellipsis: true,
|
|
|
|
- tooltip: true,
|
|
|
|
- width: 180,
|
|
|
|
- align: "center",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.customerName"),
|
|
|
|
- dataIndex: "name",
|
|
|
|
- align: "center",
|
|
|
|
- slotName: "name",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.customerAccount"),
|
|
|
|
- dataIndex: "username",
|
|
|
|
- align: "center",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.rechargeAmountTab"),
|
|
|
|
- dataIndex: "rechargeAmount",
|
|
|
|
- align: "center",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.availableAmountTab"),
|
|
|
|
- dataIndex: "availableAmount",
|
|
|
|
- width: 140,
|
|
|
|
- align: "center",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.rechargeType"),
|
|
|
|
- dataIndex: "status",
|
|
|
|
- align: "center",
|
|
|
|
- slotName: "status",
|
|
|
|
- filterable: {
|
|
|
|
- filters: [
|
|
|
|
- {
|
|
|
|
- text: window.$t("financialManagement.recharge"),
|
|
|
|
- value: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- text: window.$t("financialManagement.offset"),
|
|
|
|
- value: "2",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- text: window.$t("financialManagement.deduct"),
|
|
|
|
- value: "3",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- filter: (value, record) => {
|
|
|
|
- return record.status === value[0];
|
|
|
|
- },
|
|
|
|
- multiple: true,
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: window.$t("financialManagement.updatedAt"),
|
|
|
|
- dataIndex: "updatedAt",
|
|
|
|
- width: 180,
|
|
|
|
- align: "center",
|
|
|
|
- },
|
|
|
|
-];
|
|
|
|
-const handleStatusTxt = (status) => {
|
|
|
|
- const obj = {
|
|
|
|
- 1: window.$t("financialManagement.recharge"),
|
|
|
|
- 2: window.$t("financialManagement.offset"),
|
|
|
|
- 3: window.$t("financialManagement.deduct"),
|
|
|
|
- };
|
|
|
|
- return obj[status];
|
|
|
|
-};
|
|
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
const pagination = ref({
|
|
const pagination = ref({
|
|
- ...initPage,
|
|
|
|
showTotal: true,
|
|
showTotal: true,
|
|
showJumper: true,
|
|
showJumper: true,
|
|
showPageSize: true,
|
|
showPageSize: true,
|
|
|
|
+ total: 0,
|
|
|
|
+ current: 1,
|
|
|
|
+ pageSize: 10,
|
|
});
|
|
});
|
|
|
|
|
|
const onPageChange = (page) => {
|
|
const onPageChange = (page) => {
|
|
@@ -275,11 +135,7 @@ const resetSearch = () => {
|
|
|
|
|
|
// 新增弹窗
|
|
// 新增弹窗
|
|
const addFormRef = ref();
|
|
const addFormRef = ref();
|
|
-const statusOptions = [
|
|
|
|
- { label: window.$t("financialManagement.recharge"), value: "1" },
|
|
|
|
- { label: window.$t("financialManagement.offset"), value: "2" },
|
|
|
|
- { label: window.$t("financialManagement.deduct"), value: "3" },
|
|
|
|
-];
|
|
|
|
|
|
+
|
|
const openTopsUp = () => {
|
|
const openTopsUp = () => {
|
|
getCustomerListFc();
|
|
getCustomerListFc();
|
|
showAdd.value = true;
|
|
showAdd.value = true;
|
|
@@ -310,15 +166,28 @@ const submitAdd = () => {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-const getTopUpRecordListFc = async () => {
|
|
|
|
|
|
+const getTopUpRecordListFc = async (item) => {
|
|
|
|
+ if(item){
|
|
|
|
+ searchForm.value = item
|
|
|
|
+ }
|
|
|
|
+ let res;
|
|
const param = {
|
|
const param = {
|
|
current: pagination.value.current,
|
|
current: pagination.value.current,
|
|
size: pagination.value.pageSize,
|
|
size: pagination.value.pageSize,
|
|
...searchForm.value,
|
|
...searchForm.value,
|
|
};
|
|
};
|
|
- const { data } = await getTopUpRecordList(param);
|
|
|
|
- tableData.value = data?.records || [];
|
|
|
|
- pagination.value.total = data.total;
|
|
|
|
|
|
+ if (userType.value.userType == 1) {
|
|
|
|
+ res = await getTopUpRecordList(param)
|
|
|
|
+ tableData.value = res.data?.records || [];
|
|
|
|
+ } else {
|
|
|
|
+ let puyType = await Getdictionary('puyType')
|
|
|
|
+ res = await getAdiroePuyList(param)
|
|
|
|
+ tableData.value = (res.data?.records || []).map(res=>{
|
|
|
|
+ res.payStatus = puyType.filter(item=>item.code == res.puyType)[0]?.label
|
|
|
|
+ return res
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ pagination.value.total = res.data.total;
|
|
};
|
|
};
|
|
|
|
|
|
// 客户选择
|
|
// 客户选择
|
|
@@ -346,6 +215,12 @@ const getCustomerListFc = async (value) => {
|
|
customerOptions.value = data?.records || [];
|
|
customerOptions.value = data?.records || [];
|
|
customerLoading.value = false;
|
|
customerLoading.value = false;
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const reset = (item)=>{
|
|
|
|
+ searchForm.value = item
|
|
|
|
+ pagination.value.current = 1
|
|
|
|
+ getTopUpRecordListFc()
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
.customer-top-up {
|
|
.customer-top-up {
|