Przeglądaj źródła

资金流水页面

lxf 1 rok temu
rodzic
commit
e674927332

+ 1 - 0
src/components/testForm/index.vue

@@ -97,6 +97,7 @@
           <!-- 单选 -->
           <van-field
             v-if="i.type == 'picker' && i.itemType == 'onePicker'"
+            v-show="!i.showStatus"
             :label="i.label"
             :name="i.prop"
             v-model="formData[i.prop + 'Name']"

+ 31 - 0
src/lang/cn.js

@@ -1055,5 +1055,36 @@ export const lang = {
 		bbb:'油泵电机',
 		ccc:'蓄料电机',
 		ddd:'离心电机',
+	},
+	flowFunds: {
+		name: '资金流水',
+		company: '归属公司',
+		account: '资金账户',
+		amount: '交易金额',
+		amountMsg: '请输入交易金额',
+		tradingHour: '交易时间',
+		tradingHourMsg: '请选择交易时间',
+		digest: '摘要',
+		add: '添加流水',
+		edit: '编辑流水',
+		tradeInformation: '交易信息',
+		selectAccount: '选择账户',
+		selectAccountMsg: '请选择账户',
+		tradeType: '交易类型',
+		tradeTypeMsg: '请选择交易类型',
+		income: '收入',
+		disburse: '支出',
+		currency: '币种',
+		currencyMsg: '请选择币种',
+		contractArrival: '合同到账',
+		contractArrivalMsg: '请选择合同到账',
+		yes: '是',
+		no: '否',
+		peerInformation: '对方信息',
+		accountName: '账户名称',
+		bankDeposit: '开户银行',
+		bankAccountNumber: '银行账号',
+		otherInformation: '其他信息',
+		remark: '备注',
 	}
 }

+ 10 - 0
src/router/routerLXF.js

@@ -65,6 +65,16 @@ export function routesLXF() {
       name: "灭菌机",
       component: () => import("../views/equipment/sterilizationMachine.vue"),
     },
+    {
+      path: "flowOfFunds",
+      name: "资金流水",
+      component: () => import("../views/fund/flow-of-funds/index.vue"),
+    },
+    {
+      path: "flowOfFundsAdd",
+      name: "添加流水",
+      component: () => import("../views/fund/flow-of-funds/add.vue"),
+    },
   ];
   return routesLXF;
 }

+ 231 - 0
src/views/fund/flow-of-funds/add.vue

@@ -0,0 +1,231 @@
+<template>
+    <div class="form">
+      <van-nav-bar :title="$t('flowFunds.' + route.query.type)" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft"> </van-nav-bar>
+      <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"> </testForm>
+    </div>
+  </template>
+  
+  <script setup>
+  import { ref, getCurrentInstance, onMounted, reactive } from "vue";
+  import { showSuccessToast } from "vant";
+  import { useRoute } from "vue-router";
+  import { getUserInfo, formatDate } from "@/utils/auth";
+  import testForm from "@/components/testForm/index.vue";
+  
+  const proxy = getCurrentInstance().proxy;
+  const onClickLeft = () => history.back();
+  const route = useRoute();
+  const getDict = () => {
+    proxy
+      .post("/dictTenantData/page", {
+        pageNum: 1,
+        pageSize: 999,
+        dictCode: "account_currency",
+        tenantId: getUserInfo().tenantId,
+      })
+      .then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          formConfig[4].data = res.data.rows.map((item) => {
+            return {
+              text: item.dictValue,
+              value: item.dictKey,
+            };
+          });
+        }
+      });
+    proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[1].data = res.data.rows.map((item) => {
+          return {
+            text: item.alias,
+            value: item.id,
+          };
+        });
+      }
+    });
+  };
+  getDict();
+  const formData = reactive({
+    data: {
+      accountManagementId: null,
+      status: null,
+      amount: null,
+      currency: null,
+      name: null,
+      openingBank: null,
+      accountOpening: null,
+      transactionTime: formatDate(new Date(), "yyyy-MM-dd"),
+      remarks: null,
+      received: "20",
+    },
+  });
+  const formDom = ref(null);
+  const formOption = reactive({
+    readonly: false, //用于控制整个表单是否只读
+    disabled: false,
+    labelAlign: "top",
+    scroll: true,
+    labelWidth: "62pk",
+  });
+  const formConfig = reactive([
+    {
+      type: "title",
+      title: proxy.t("flowFunds.tradeInformation"),
+    },
+    {
+      type: "picker",
+      label: proxy.t("flowFunds.selectAccount"),
+      prop: "accountManagementId",
+      itemType: "onePicker",
+      showPicker: false,
+      fieldNames: {
+        text: "text",
+        value: "value",
+      },
+      data: [],
+    },
+    {
+      type: "picker",
+      label: proxy.t("flowFunds.tradingHour"),
+      prop: "transactionTime",
+      itemType: "datePicker",
+      showPicker: false,
+      split: "-",
+      columnsType: ["year", "month", "day"],
+    },
+    {
+      type: "picker",
+      label: proxy.t("flowFunds.tradeType"),
+      prop: "status",
+      itemType: "onePicker",
+      showPicker: false,
+      fieldNames: {
+        text: "label",
+        value: "value",
+      },
+      data: [
+        {
+          label: proxy.t("flowFunds.income"),
+          value: "10",
+        },
+        {
+          label: proxy.t("flowFunds.disburse"),
+          value: "20",
+        },
+      ],
+      changeFn: (option, item, index) => {
+        formData.data[item.prop] = option.selectedOptions[0].value;
+        formData.data[item.prop + "Name"] = option.selectedOptions[0].label;
+        formConfig[index].showPicker = false;
+        formData.data.received = "20";
+        formData.data.receivedName = "否";
+        if (option.selectedOptions[0].value == "10") {
+          formConfig[6].showStatus = false;
+        } else {
+          formConfig[6].showStatus = true;
+        }
+      },
+    },
+    {
+      type: "picker",
+      label: proxy.t("flowFunds.currency"),
+      prop: "currency",
+      itemType: "onePicker",
+      showPicker: false,
+      fieldNames: {
+        text: "text",
+        value: "value",
+      },
+      data: [],
+    },
+    {
+      type: "input",
+      label: proxy.t("flowFunds.amount"),
+      prop: "amount",
+      itemType: "number",
+    },
+    {
+      type: "picker",
+      label: proxy.t("flowFunds.contractArrival"),
+      prop: "received",
+      itemType: "onePicker",
+      showPicker: false,
+      showStatus: true,
+      fieldNames: {
+        text: "label",
+        value: "value",
+      },
+      data: [
+        {
+          label: proxy.t("flowFunds.yes"),
+          value: "10",
+        },
+        {
+          label: proxy.t("flowFunds.no"),
+          value: "20",
+        },
+      ],
+    },
+    {
+      type: "title",
+      title: proxy.t("flowFunds.peerInformation"),
+    },
+    {
+      type: "input",
+      itemType: "text",
+      label: proxy.t("flowFunds.accountName"),
+      prop: "name",
+      clearable: true,
+    },
+    {
+      type: "input",
+      itemType: "text",
+      label: proxy.t("flowFunds.bankDeposit"),
+      prop: "openingBank",
+      clearable: true,
+    },
+    {
+      type: "input",
+      itemType: "text",
+      label: proxy.t("flowFunds.bankAccountNumber"),
+      prop: "accountOpening",
+      clearable: true,
+    },
+    {
+      type: "title",
+      title: proxy.t("flowFunds.otherInformation"),
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      label: proxy.t("flowFunds.remark"),
+      prop: "remarks",
+      clearable: true,
+    },
+  ]);
+  const rules = {
+    accountManagementId: [{ required: true, message: proxy.t("flowFunds.selectAccountMsg") }],
+    transactionTime: [{ required: true, message: proxy.t("flowFunds.tradingHourMsg") }],
+    status: [{ required: true, message: proxy.t("flowFunds.tradeTypeMsg") }],
+    currency: [{ required: true, message: proxy.t("flowFunds.currencyMsg") }],
+    amount: [{ required: true, message: proxy.t("flowFunds.amountMsg") }],
+    received: [{ required: true, message: proxy.t("flowFunds.contractArrivalMsg") }],
+  };
+  const onSubmit = () => {
+    formData.data.transactionTime = formData.data.transactionTime + " " + formatDate(new Date(), "hh:mm:ss");
+    proxy.post("/accountRunningWater/" + route.query.type, formData.data).then(() => {
+      showSuccessToast(proxy.t("common.addSuccess"));
+      setTimeout(() => {
+        history.back();
+      }, 500);
+    });
+  };
+  onMounted(() => {
+    if (route.query.id) {
+      proxy.post("/accountRunningWater/detail", { id: route.query.id }).then((res) => {
+        formData.data = res.data;
+      });
+    }
+  });
+  </script>
+  

+ 114 - 0
src/views/fund/flow-of-funds/index.vue

@@ -0,0 +1,114 @@
+<template>
+    <van-nav-bar :title="$t('flowFunds.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("/accountRunningWater/page", req.value)
+      .then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          res.data.rows = res.data.rows.map((item) => {
+            let status = "";
+            let style = "color: #04cb04";
+            if (item.status == 20) {
+              status = "-";
+              style = "color: red";
+            }
+            let currency = "";
+            if (item.currency) {
+              currency = item.currency;
+            }
+            return {
+              ...item,
+              currencyAmount: currency + " " + status + item.amount,
+              style: style,
+            };
+          });
+        }
+        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) => {
+    proxy.$router.push({
+      path: "flowOfFundsAdd",
+      query: {
+        id: row.id,
+        type: "edit",
+      },
+    });
+  };
+  const listConfig = ref([
+    {
+      label: proxy.t("flowFunds.company"),
+      prop: "corporationName",
+    },
+    {
+      label: proxy.t("flowFunds.account"),
+      prop: "accountManagementName",
+    },
+    {
+      label: proxy.t("flowFunds.amount"),
+      prop: "currencyAmount",
+      style: "style",
+    },
+    {
+      label: proxy.t("flowFunds.tradingHour"),
+      prop: "transactionTime",
+    },
+    {
+      label: proxy.t("flowFunds.digest"),
+      prop: "remarks",
+    },
+  ]);
+  </script>
+  
+  <style lang="scss" scoped>
+  .list {
+    min-height: 70vh;
+  }
+  </style>
+