|
@@ -18,15 +18,15 @@
|
|
|
>
|
|
|
<template #money="{ item }">
|
|
|
<div style="width: 100%">
|
|
|
- <span>{{ item.currency }}{{ item.money }}</span>
|
|
|
+ <span>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #type="{ item }">
|
|
|
+ <template #repaymentStatus="{ item }">
|
|
|
<div style="width: 100%">
|
|
|
<span
|
|
|
style="color: #409eff; cursor: pointer"
|
|
|
@click="lookRecords(item)"
|
|
|
- >aa</span
|
|
|
+ >{{ dictValueLabel(item.repaymentStatus, status) }}</span
|
|
|
>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -37,13 +37,28 @@
|
|
|
v-if="openAddDialog"
|
|
|
v-model="openAddDialog"
|
|
|
width="500"
|
|
|
+ destroy-on-close
|
|
|
>
|
|
|
<byForm
|
|
|
:formConfig="formConfig"
|
|
|
:formOption="formOption"
|
|
|
+ :rules="rules"
|
|
|
v-model="formData.data"
|
|
|
ref="byform"
|
|
|
>
|
|
|
+ <template #loanUserName>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="formData.data.loanUserName"
|
|
|
+ value-key="loanUserName"
|
|
|
+ clearable
|
|
|
+ :fetch-suggestions="querySearch"
|
|
|
+ :disabled="submitType == 'edit'"
|
|
|
+ class="inline-input w-50"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="openAddDialog = false" size="large">取 消</el-button>
|
|
@@ -63,6 +78,19 @@
|
|
|
v-model="openRecordsDialog"
|
|
|
width="500"
|
|
|
>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in recordsData"
|
|
|
+ :key="item.id"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ >
|
|
|
+ <div style="margin-top: 5px; color: #bbbbbb">
|
|
|
+ {{ item.repaymentTime }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 还款金额:{{ item.currency }} {{ moneyFormat(item.amount, 2) }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">登记人:{{ item.createUserName }}</div>
|
|
|
+ </div>
|
|
|
<template #footer>
|
|
|
<el-button @click="openRecordsDialog = false" size="large"
|
|
|
>关 闭</el-button
|
|
@@ -78,6 +106,7 @@ import useUserStore from "@/store/modules/user";
|
|
|
import { reactive, ref } from "vue";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import FundsPDF from "@/components/PDF/fundsPDF.vue";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
|
const loading = ref(false);
|
|
|
const sourceList = ref({
|
|
@@ -86,7 +115,7 @@ const sourceList = ref({
|
|
|
total: 0,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- status: "",
|
|
|
+ repaymentStatus: "",
|
|
|
keyword: "",
|
|
|
corporationId: "",
|
|
|
},
|
|
@@ -96,17 +125,30 @@ const userList = ref([]);
|
|
|
const accountCurrency = ref([]);
|
|
|
const accountList = ref([]);
|
|
|
const corporationList = ref([]);
|
|
|
-const status = ref([]);
|
|
|
+const status = ref([
|
|
|
+ {
|
|
|
+ label: "未还款",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "部分还款",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已还款",
|
|
|
+ value: "2",
|
|
|
+ },
|
|
|
+]);
|
|
|
const selectConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
label: "归属公司",
|
|
|
- prop: "type",
|
|
|
+ prop: "corporationId",
|
|
|
data: corporationList.value,
|
|
|
},
|
|
|
{
|
|
|
label: "还款状态",
|
|
|
- prop: "status",
|
|
|
+ prop: "repaymentStatus",
|
|
|
data: status.value,
|
|
|
},
|
|
|
];
|
|
@@ -123,14 +165,13 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "借款人",
|
|
|
- prop: "deptName",
|
|
|
+ prop: "loanUserName",
|
|
|
width: 120,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "借款金额",
|
|
|
-
|
|
|
width: 150,
|
|
|
slot: "money",
|
|
|
},
|
|
@@ -138,30 +179,28 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "还款状态",
|
|
|
- prop: "type",
|
|
|
width: 100,
|
|
|
- slot: "type",
|
|
|
+ slot: "repaymentStatus",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "借款时间",
|
|
|
- prop: "createTime",
|
|
|
+ prop: "loanTime",
|
|
|
width: 160,
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "备注",
|
|
|
- prop: "paymentRemarks",
|
|
|
+ prop: "remarks",
|
|
|
},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "创建人",
|
|
|
- prop: "accountManagementName",
|
|
|
+ prop: "createUserName",
|
|
|
width: 120,
|
|
|
},
|
|
|
},
|
|
@@ -169,7 +208,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "创建时间",
|
|
|
- prop: "accountPaymentStatus",
|
|
|
+ prop: "createTime",
|
|
|
width: 160,
|
|
|
},
|
|
|
},
|
|
@@ -182,17 +221,19 @@ const config = computed(() => {
|
|
|
},
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "还款",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- handleEdit(row);
|
|
|
- },
|
|
|
- },
|
|
|
+ row.repaymentStatus != 2
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "还款",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ handleEdit(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
];
|
|
|
},
|
|
|
},
|
|
@@ -201,15 +242,13 @@ const config = computed(() => {
|
|
|
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);
|
|
|
- });
|
|
|
+ proxy.post("/loanInfo/page", sourceList.value.pagination).then((message) => {
|
|
|
+ sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const getDictData = () => {
|
|
@@ -224,6 +263,7 @@ const getDictData = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
proxy
|
|
|
.get("/tenantUser/list", {
|
|
|
pageNum: 1,
|
|
@@ -271,7 +311,25 @@ const formOption = reactive({
|
|
|
itemWidth: 100,
|
|
|
rules: [],
|
|
|
});
|
|
|
-
|
|
|
+const rules = ref({
|
|
|
+ corporationId: [
|
|
|
+ { required: true, message: "请选择归属公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ loanUserName: [{ required: true, message: "请输入借款人", trigger: "blur" }],
|
|
|
+ loanTime: [{ required: true, message: "请选择借款时间", trigger: "change" }],
|
|
|
+ currency: [{ required: true, message: "请选择币种", trigger: "change" }],
|
|
|
+ amount: [{ required: true, message: "请输入借款金额", trigger: "blur" }],
|
|
|
+ loanAccountId: [
|
|
|
+ { required: true, message: "请选择付款账户", trigger: "change" },
|
|
|
+ ],
|
|
|
+ repaymentAccountId: [
|
|
|
+ { required: true, message: "请选择收款账户", trigger: "change" },
|
|
|
+ ],
|
|
|
+ amountOne: [{ required: true, message: "请输入还款金额", trigger: "blur" }],
|
|
|
+ repaymentTime: [
|
|
|
+ { required: true, message: "请选择还款时间", trigger: "change" },
|
|
|
+ ],
|
|
|
+});
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -287,11 +345,10 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- type: "select",
|
|
|
- prop: "createUser",
|
|
|
+ type: "slot",
|
|
|
+ prop: "loanUserName",
|
|
|
label: "借款人",
|
|
|
- data: userList.value,
|
|
|
- clearable: true,
|
|
|
+ slotName: "loanUserName",
|
|
|
disabled: submitType.value != "add",
|
|
|
itemWidth: 100,
|
|
|
style: {
|
|
@@ -301,7 +358,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "date",
|
|
|
itemType: "datetime",
|
|
|
- prop: "type",
|
|
|
+ prop: "loanTime",
|
|
|
label: "借款时间",
|
|
|
disabled: submitType.value != "add",
|
|
|
itemWidth: 100,
|
|
@@ -336,9 +393,9 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "createUser",
|
|
|
- label: "付款账号",
|
|
|
- data: userList.value,
|
|
|
+ prop: "loanAccountId",
|
|
|
+ label: "付款账户",
|
|
|
+ data: accountList.value,
|
|
|
disabled: submitType.value != "add",
|
|
|
itemWidth: 100,
|
|
|
clearable: true,
|
|
@@ -349,7 +406,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
itemType: "textarea",
|
|
|
- prop: "paymentRemarks",
|
|
|
+ prop: "remarks",
|
|
|
label: "备注",
|
|
|
disabled: submitType.value != "add",
|
|
|
},
|
|
@@ -361,9 +418,9 @@ const formConfig = computed(() => {
|
|
|
: {},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "createUser",
|
|
|
- label: "收款账号",
|
|
|
- data: userList.value,
|
|
|
+ prop: "repaymentAccountId",
|
|
|
+ label: "收款账户",
|
|
|
+ data: accountList.value,
|
|
|
itemWidth: 100,
|
|
|
clearable: true,
|
|
|
isShow: submitType.value != "add",
|
|
@@ -379,13 +436,14 @@ const formConfig = computed(() => {
|
|
|
clearable: true,
|
|
|
itemWidth: 25,
|
|
|
isShow: submitType.value != "add",
|
|
|
+ disabled: true,
|
|
|
style: {
|
|
|
width: "100%",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
type: "number",
|
|
|
- prop: "amount",
|
|
|
+ prop: "amountOne",
|
|
|
label: " ",
|
|
|
precision: 2,
|
|
|
min: 0,
|
|
@@ -399,8 +457,8 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "date",
|
|
|
itemType: "datetime",
|
|
|
- prop: "type",
|
|
|
- label: "借款时间",
|
|
|
+ prop: "repaymentTime",
|
|
|
+ label: "还款时间",
|
|
|
itemWidth: 100,
|
|
|
isShow: submitType.value != "add",
|
|
|
style: {
|
|
@@ -410,7 +468,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
itemType: "textarea",
|
|
|
- prop: "paymentRemarks",
|
|
|
+ prop: "remarksOne",
|
|
|
label: "备注",
|
|
|
isShow: submitType.value != "add",
|
|
|
},
|
|
@@ -423,22 +481,47 @@ const openAddDialog = ref(false);
|
|
|
const byform = ref(null);
|
|
|
const submitLoading = ref(false);
|
|
|
const submitType = ref("add");
|
|
|
-
|
|
|
+const historyData = ref([]);
|
|
|
const openModal = () => {
|
|
|
+ proxy.get("/loanInfo/getLoanUserList").then((res) => {
|
|
|
+ historyData.value = res.data;
|
|
|
+ });
|
|
|
submitType.value = "add";
|
|
|
formData.data = {};
|
|
|
openAddDialog.value = true;
|
|
|
};
|
|
|
+
|
|
|
+const querySearch = (queryString, cb) => {
|
|
|
+ const results = queryString
|
|
|
+ ? historyData.value.filter(createFilter(queryString))
|
|
|
+ : historyData.value;
|
|
|
+ cb(results);
|
|
|
+};
|
|
|
+
|
|
|
+const createFilter = (queryString) => {
|
|
|
+ return (restaurant) => {
|
|
|
+ return (
|
|
|
+ restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
|
+ );
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
const handleSubmit = () => {
|
|
|
byform.value.handleSubmit(() => {
|
|
|
submitLoading.value = true;
|
|
|
- proxy.post("/accountPayment/add", formData.data).then(
|
|
|
+ let requestUrl = "/loanInfo/add";
|
|
|
+ if (submitType.value != "add") {
|
|
|
+ requestUrl = "/repaymentRecords/add";
|
|
|
+ formData.data.amount = formData.data.amountOne;
|
|
|
+ formData.data.remarks = formData.data.remarksOne;
|
|
|
+ }
|
|
|
+ proxy.post(requestUrl, formData.data).then(
|
|
|
() => {
|
|
|
ElMessage({
|
|
|
- message: "打款成功",
|
|
|
+ message: "操作成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
- dialogVisible.value = false;
|
|
|
+ openAddDialog.value = false;
|
|
|
submitLoading.value = false;
|
|
|
getList();
|
|
|
},
|
|
@@ -450,11 +533,17 @@ const handleSubmit = () => {
|
|
|
};
|
|
|
const handleEdit = (row) => {
|
|
|
submitType.value = "edit";
|
|
|
- formData.data = {};
|
|
|
+ proxy.post("/loanInfo/detail", { id: row.id }).then((res) => {
|
|
|
+ formData.data = { ...res, loanId: row.id };
|
|
|
+ });
|
|
|
openAddDialog.value = true;
|
|
|
};
|
|
|
const openRecordsDialog = ref(false);
|
|
|
+const recordsData = ref([]);
|
|
|
const lookRecords = (row) => {
|
|
|
+ proxy.post("/repaymentRecords/list", { loanId: row.id }).then((res) => {
|
|
|
+ recordsData.value = res;
|
|
|
+ });
|
|
|
openRecordsDialog.value = true;
|
|
|
};
|
|
|
</script>
|