|
@@ -0,0 +1,119 @@
|
|
|
+<template>
|
|
|
+ <van-nav-bar :title="$t('funds.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
|
|
|
+ <template #right>{{ $t("common.add") }}</template>
|
|
|
+ </van-nav-bar>
|
|
|
+ <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
|
|
|
+ <van-pull-refresh v-model="loading" @refresh="onRefresh">
|
|
|
+ <div class="list">
|
|
|
+ <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList" style="margin-bottom: 60px">
|
|
|
+ <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
|
|
|
+ </van-list>
|
|
|
+ </div>
|
|
|
+ </van-pull-refresh>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import { ref, getCurrentInstance } from "vue";
|
|
|
+import commonList from "@/components/common-list.vue";
|
|
|
+
|
|
|
+const proxy = getCurrentInstance().proxy;
|
|
|
+const onClickLeft = () => proxy.$router.push("/main/working");
|
|
|
+const onClickRight = () => {
|
|
|
+ // proxy.$router.push({
|
|
|
+ // path: "flowOfFundsAdd",
|
|
|
+ // query: {
|
|
|
+ // type: "add",
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+};
|
|
|
+const req = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ keyword: null,
|
|
|
+});
|
|
|
+const finished = ref(false);
|
|
|
+const onRefresh = () => {
|
|
|
+ req.value.pageNum = 1;
|
|
|
+ finished.value = false;
|
|
|
+ getList("refresh");
|
|
|
+};
|
|
|
+const loading = ref(false);
|
|
|
+const listData = ref([]);
|
|
|
+const getList = (type) => {
|
|
|
+ loading.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/accountRequestFunds/page", req.value)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.rows && res.data.rows.length > 0) {
|
|
|
+ res.data.rows = res.data.rows.map((item) => {
|
|
|
+ let fundsText = "";
|
|
|
+ if (item.status == 10) {
|
|
|
+ fundsText = "审批中";
|
|
|
+ } else if (item.status == 20) {
|
|
|
+ fundsText = "驳回";
|
|
|
+ } else if (item.status == 30) {
|
|
|
+ fundsText = "审批通过";
|
|
|
+ }
|
|
|
+ if (item.accountPaymentStatus == "10") {
|
|
|
+ fundsText = fundsText + ", " + "已打款";
|
|
|
+ } else if (item.accountPaymentStatus == "20") {
|
|
|
+ fundsText = fundsText + ", " + "未打款";
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ currencyTotal: item.currency + " " + item.total,
|
|
|
+ fundsText: fundsText,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
|
|
|
+ if (req.value.pageNum * 10 >= res.data.total) {
|
|
|
+ finished.value = true;
|
|
|
+ }
|
|
|
+ req.value.pageNum++;
|
|
|
+ loading.value = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+};
|
|
|
+const toDtl = (row) => {
|
|
|
+ // if (row.status == "10") {
|
|
|
+ // proxy.$router.push({
|
|
|
+ // path: "accountPaymentDetail",
|
|
|
+ // query: {
|
|
|
+ // id: row.id,
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // } else if (row.status == "20") {
|
|
|
+ // proxy.$router.push({
|
|
|
+ // path: "accountPaymentAdd",
|
|
|
+ // query: {
|
|
|
+ // id: row.id,
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+};
|
|
|
+const listConfig = ref([
|
|
|
+ {
|
|
|
+ label: proxy.t("funds.createTime"),
|
|
|
+ prop: "createTime",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: proxy.t("funds.currencyTotal"),
|
|
|
+ prop: "currencyTotal",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: proxy.t("funds.paymentRemarks"),
|
|
|
+ prop: "paymentRemarks",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: proxy.t("funds.fundsText"),
|
|
|
+ prop: "fundsText",
|
|
|
+ },
|
|
|
+]);
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.list {
|
|
|
+ min-height: 70vh;
|
|
|
+}
|
|
|
+</style>
|