cz il y a 1 an
Parent
commit
fe9e1962c8
2 fichiers modifiés avec 470 ajouts et 1 suppressions
  1. 1 1
      src/components/byForm/index.vue
  2. 469 0
      src/views/finance/fundManage/loan/index.vue

+ 1 - 1
src/components/byForm/index.vue

@@ -113,7 +113,7 @@
             @change="(e) => commonsEmit(e, i)"
             :disabled="i.disabled ? i.disabled : false"
             :format="i.format ? i.format : dateFormatInit(i.itemType)"
-            :value-format="i.format ? i.format : dateFormatInit(i.itemType)" />
+            :value-format="i.format ? i.format : dateFormatInit(i.itemType)" :style="i.style" />
           <el-switch
             :disabled="i.disabled ? i.disabled : false"
             v-else-if="i.type == 'switch'"

+ 469 - 0
src/views/finance/fundManage/loan/index.vue

@@ -0,0 +1,469 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      highlight-current-row
+      :selectConfig="selectConfig"
+      :action-list="[
+        {
+          text: '添加借款',
+          action: () => openModal(),
+        },
+      ]"
+      @moreSearch="moreSearch"
+      @get-list="getList"
+    >
+      <template #money="{ item }">
+        <div style="width: 100%">
+          <span>{{ item.currency }}{{ item.money }}</span>
+        </div>
+      </template>
+      <template #type="{ item }">
+        <div style="width: 100%">
+          <span
+            style="color: #409eff; cursor: pointer"
+            @click="lookRecords(item)"
+            >aa</span
+          >
+        </div>
+      </template>
+    </byTable>
+
+    <el-dialog
+      :title="submitType == 'add' ? '添加借款' : '还款'"
+      v-if="openAddDialog"
+      v-model="openAddDialog"
+      width="500"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        ref="byform"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="openAddDialog = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="handleSubmit()"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      :title="'还款记录'"
+      v-if="openRecordsDialog"
+      v-model="openRecordsDialog"
+      width="500"
+    >
+      <template #footer>
+        <el-button @click="openRecordsDialog = false" size="large"
+          >关 闭</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import useUserStore from "@/store/modules/user";
+import { reactive, ref } from "vue";
+import byForm from "@/components/byForm/index";
+import FundsPDF from "@/components/PDF/fundsPDF.vue";
+
+const loading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    status: "",
+    keyword: "",
+    corporationId: "",
+  },
+});
+const { proxy } = getCurrentInstance();
+const userList = ref([]);
+const accountCurrency = ref([]);
+const accountList = ref([]);
+const corporationList = ref([]);
+const status = ref([]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "归属公司",
+      prop: "type",
+      data: corporationList.value,
+    },
+    {
+      label: "还款状态",
+      prop: "status",
+      data: status.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "归属公司",
+        prop: "corporationName",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "借款人",
+        prop: "deptName",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "借款金额",
+
+        width: 150,
+        slot: "money",
+      },
+    },
+    {
+      attrs: {
+        label: "还款状态",
+        prop: "type",
+        width: 100,
+        slot: "type",
+      },
+    },
+    {
+      attrs: {
+        label: "借款时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+
+    {
+      attrs: {
+        label: "备注",
+        prop: "paymentRemarks",
+      },
+    },
+
+    {
+      attrs: {
+        label: "创建人",
+        prop: "accountManagementName",
+        width: 120,
+      },
+    },
+
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "accountPaymentStatus",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "还款",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handleEdit(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/accountRequestFunds/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const getDictData = () => {
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        userList.value = res.rows.map((item) => {
+          return {
+            deptId: item.deptId,
+            label: item.nickName,
+            value: item.userId,
+          };
+        });
+      }
+    });
+
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias + " (" + item.name + ")",
+            value: item.id,
+          };
+        });
+      }
+    });
+
+  proxy.getDictOne(["account_currency"]).then((res) => {
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDictData();
+getList();
+
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+
+const formConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "corporationId",
+      label: "归属公司",
+      data: corporationList.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "createUser",
+      label: "借款人",
+      data: userList.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "type",
+      label: "借款时间",
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "借款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      disabled: submitType.value != "add",
+      itemWidth: 25,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      disabled: submitType.value != "add",
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "createUser",
+      label: "付款账号",
+      data: userList.value,
+      disabled: submitType.value != "add",
+      itemWidth: 100,
+      clearable: true,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "paymentRemarks",
+      label: "备注",
+      disabled: submitType.value != "add",
+    },
+    submitType.value != "add"
+      ? {
+          type: "title",
+          title: "还款信息",
+        }
+      : {},
+    {
+      type: "select",
+      prop: "createUser",
+      label: "收款账号",
+      data: userList.value,
+      itemWidth: 100,
+      clearable: true,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "还款金额",
+      data: accountCurrency.value,
+      clearable: true,
+      itemWidth: 25,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 30,
+      isShow: submitType.value != "add",
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "type",
+      label: "借款时间",
+      itemWidth: 100,
+      isShow: submitType.value != "add",
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "paymentRemarks",
+      label: "备注",
+      isShow: submitType.value != "add",
+    },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const openAddDialog = ref(false);
+const byform = ref(null);
+const submitLoading = ref(false);
+const submitType = ref("add");
+
+const openModal = () => {
+  submitType.value = "add";
+  formData.data = {};
+  openAddDialog.value = true;
+};
+const handleSubmit = () => {
+  byform.value.handleSubmit(() => {
+    submitLoading.value = true;
+    proxy.post("/accountPayment/add", formData.data).then(
+      () => {
+        ElMessage({
+          message: "打款成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      () => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+const handleEdit = (row) => {
+  submitType.value = "edit";
+  formData.data = {};
+  openAddDialog.value = true;
+};
+const openRecordsDialog = ref(false);
+const lookRecords = (row) => {
+  openRecordsDialog.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>