Browse Source

资金账户页面增加余额展示

lxf 1 year ago
parent
commit
bb211d0a3b
2 changed files with 48 additions and 1 deletions
  1. 2 0
      src/lang/cnLXF.js
  2. 46 1
      src/views/fund/account/index.vue

+ 2 - 0
src/lang/cnLXF.js

@@ -45,6 +45,8 @@ export function cnLXF() {
       accountNameMsg: "请输入账户名",
       accountOpening: "银行账号",
       accountOpeningMsg: "请输入银行账号",
+      accountRemainder: "账户余额",
+      accountRemainderMsg: "多币种,请进入详情查看",
       interbankNumber: "联行号",
       foreignExchange: "外汇信息",
       beneficiaryName: "Beneficiary Name",

+ 46 - 1
src/views/fund/account/index.vue

@@ -42,7 +42,48 @@ const getList = (type) => {
   proxy
     .post("/accountManagement/page", req.value)
     .then((res) => {
-      listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
+      listData.value =
+        type === "refresh"
+          ? res.data.rows.map((item) => {
+              if (item.accountRemainderList && item.accountRemainderList.length > 0) {
+                let accountRemainder = "";
+                if (item.accountRemainderList.length === 1) {
+                  accountRemainder = item.accountRemainderList[0].currency + " " + item.accountRemainderList[0].remainder;
+                } else {
+                  accountRemainder = proxy.t("account.accountRemainderMsg");
+                }
+                return {
+                  ...item,
+                  accountRemainder: accountRemainder,
+                };
+              } else {
+                return {
+                  ...item,
+                  accountRemainder: "",
+                };
+              }
+            })
+          : listData.value.concat(
+              res.data.rows.map((item) => {
+                if (item.accountRemainderList && item.accountRemainderList.length > 0) {
+                  let accountRemainder = "";
+                  if (item.accountRemainderList.length === 1) {
+                    accountRemainder = item.accountRemainderList[0].currency + " " + item.accountRemainderList[0].remainder;
+                  } else {
+                    accountRemainder = proxy.t("account.accountRemainderMsg");
+                  }
+                  return {
+                    ...item,
+                    accountRemainder: accountRemainder,
+                  };
+                } else {
+                  return {
+                    ...item,
+                    accountRemainder: "",
+                  };
+                }
+              })
+            );
       if (req.value.pageNum * 10 >= res.data.total) {
         finished.value = true;
       }
@@ -75,6 +116,10 @@ const listConfig = ref([
     label: proxy.t("account.accountOpening"),
     prop: "accountOpening",
   },
+  {
+    label: proxy.t("account.accountRemainder"),
+    prop: "accountRemainder",
+  },
 ]);
 </script>