|
@@ -10,14 +10,14 @@
|
|
highlight-current-row
|
|
highlight-current-row
|
|
:action-list="[
|
|
:action-list="[
|
|
{
|
|
{
|
|
- text: '添加借款',
|
|
|
|
- action: () => addloan(),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
text: '导出Excel',
|
|
text: '导出Excel',
|
|
action: () => deriveExcel(),
|
|
action: () => deriveExcel(),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ text: '添加借款',
|
|
|
|
+ action: () => addloan(),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
text: '内部转账',
|
|
text: '内部转账',
|
|
action: () => openTransferMoney('add'),
|
|
action: () => openTransferMoney('add'),
|
|
},
|
|
},
|
|
@@ -97,7 +97,7 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 结汇 -->
|
|
<!-- 结汇 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="结汇"
|
|
|
|
|
|
+ title="结汇"
|
|
v-if="settlementModal"
|
|
v-if="settlementModal"
|
|
v-model="settlementModal"
|
|
v-model="settlementModal"
|
|
width="600"
|
|
width="600"
|
|
@@ -107,13 +107,15 @@
|
|
:formConfig="settlementFormConfig"
|
|
:formConfig="settlementFormConfig"
|
|
:formOption="formOption"
|
|
:formOption="formOption"
|
|
v-model="formData3.data"
|
|
v-model="formData3.data"
|
|
- :rules="rules"
|
|
|
|
- ref="submit"
|
|
|
|
|
|
+ :rules="rules3"
|
|
|
|
+ ref="submit3"
|
|
>
|
|
>
|
|
</byForm>
|
|
</byForm>
|
|
<template #footer>
|
|
<template #footer>
|
|
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
|
|
|
|
+ <el-button @click="settlementModal = false" size="large"
|
|
|
|
+ >取 消</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary" @click="settlementSubmitForm()" size="large"
|
|
>确 定</el-button
|
|
>确 定</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -332,8 +334,7 @@
|
|
<template #loanUserName>
|
|
<template #loanUserName>
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
<el-autocomplete
|
|
<el-autocomplete
|
|
- v-model="formData.loanData.loanUserName"
|
|
|
|
- value-key="loanUserName"
|
|
|
|
|
|
+ v-model="formData.data.loanUserName"
|
|
:fetch-suggestions="querySearch"
|
|
:fetch-suggestions="querySearch"
|
|
:disabled="submitType == 'edit'"
|
|
:disabled="submitType == 'edit'"
|
|
clearable
|
|
clearable
|
|
@@ -372,6 +373,7 @@ const { proxy } = getCurrentInstance();
|
|
const accountCurrency = ref([]);
|
|
const accountCurrency = ref([]);
|
|
const accountList = ref([]);
|
|
const accountList = ref([]);
|
|
const contractList = ref([]);
|
|
const contractList = ref([]);
|
|
|
|
+const contractList2 = ref([]);
|
|
const corporationList = ref([]);
|
|
const corporationList = ref([]);
|
|
const status = ref([
|
|
const status = ref([
|
|
{
|
|
{
|
|
@@ -737,9 +739,29 @@ const getDict = () => {
|
|
proxy
|
|
proxy
|
|
.post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 })
|
|
.post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- contractList.value = res.rows;
|
|
|
|
|
|
+ contractList.value = res.rows.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ label: item.code,
|
|
|
|
+ value: item.id,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ proxy
|
|
|
|
+ .post("/contract/page1", {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 9999,
|
|
|
|
+ isExchangeSettlement: 0,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ contractList2.value = res.rows.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ label: item.code,
|
|
|
|
+ value: item.id,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
});
|
|
});
|
|
-
|
|
|
|
proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
if (res.rows && res.rows.length > 0) {
|
|
if (res.rows && res.rows.length > 0) {
|
|
corporationList.value = res.rows.map((item) => {
|
|
corporationList.value = res.rows.map((item) => {
|
|
@@ -792,20 +814,69 @@ const formData = reactive({
|
|
|
|
|
|
const settlementModal = ref(false);
|
|
const settlementModal = ref(false);
|
|
const openSettlementModal = (type, row) => {
|
|
const openSettlementModal = (type, row) => {
|
|
- modalType.value = type;
|
|
|
|
- if (type == "add") {
|
|
|
|
- formData2.data = {
|
|
|
|
- transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
|
|
|
|
- };
|
|
|
|
- } else {
|
|
|
|
- formData2.data = { ...row };
|
|
|
|
- }
|
|
|
|
|
|
+ formData3.data = {
|
|
|
|
+ accountManagementId: null,
|
|
|
|
+ amount: null,
|
|
|
|
+ currency: null,
|
|
|
|
+ inAccountManagementId: null,
|
|
|
|
+ inAmount: null,
|
|
|
|
+ inCurrency: "CNY",
|
|
|
|
+ rate: null,
|
|
|
|
+ commissionAmount: null,
|
|
|
|
+ commissionCurrency: null,
|
|
|
|
+ remarks: null,
|
|
|
|
+ businessId: null,
|
|
|
|
+ };
|
|
settlementModal.value = true;
|
|
settlementModal.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
const formData3 = reactive({
|
|
const formData3 = reactive({
|
|
- data: {},
|
|
|
|
|
|
+ data: {
|
|
|
|
+ accountManagementId: null,
|
|
|
|
+ amount: null,
|
|
|
|
+ currency: null,
|
|
|
|
+ inAccountManagementId: null,
|
|
|
|
+ inAmount: null,
|
|
|
|
+ inCurrency: "CNY",
|
|
|
|
+ rate: null,
|
|
|
|
+ commissionAmount: null,
|
|
|
|
+ commissionCurrency: null,
|
|
|
|
+ remarks: null,
|
|
|
|
+ businessId: null,
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
+const submit3 = ref(null);
|
|
|
|
+const settlementSubmitForm = () => {
|
|
|
|
+ submit3.value.handleSubmit(() => {
|
|
|
|
+ //汇出汇入账号不能相同
|
|
|
|
+ if (
|
|
|
|
+ formData3.data.accountManagementId ===
|
|
|
|
+ formData3.data.inAccountManagementId
|
|
|
|
+ ) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "汇出汇入账号不能相同",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ loadingDialog.value = true;
|
|
|
|
+
|
|
|
|
+ proxy.post("/accountRunningWater/exchangeSettlement", formData3.data).then(
|
|
|
|
+ () => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "结汇成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ settlementModal.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ console.log(err);
|
|
|
|
+ loadingDialog.value = false;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
const settlementFormConfig = computed(() => {
|
|
const settlementFormConfig = computed(() => {
|
|
return [
|
|
return [
|
|
@@ -831,7 +902,6 @@ const settlementFormConfig = computed(() => {
|
|
fn: (value) => {
|
|
fn: (value) => {
|
|
//判断value的类型
|
|
//判断value的类型
|
|
if (isNaN(value)) {
|
|
if (isNaN(value)) {
|
|
- formData3.data.inCurrency = formData3.data.currency;
|
|
|
|
formData3.data.commissionCurrency = formData3.data.currency;
|
|
formData3.data.commissionCurrency = formData3.data.currency;
|
|
} else {
|
|
} else {
|
|
if (value != "") {
|
|
if (value != "") {
|
|
@@ -843,6 +913,11 @@ const settlementFormConfig = computed(() => {
|
|
}
|
|
}
|
|
formData3.data.inAmount = formData3.data.amount;
|
|
formData3.data.inAmount = formData3.data.amount;
|
|
}
|
|
}
|
|
|
|
+ if (formData3.data.amount && formData3.data.inAmount) {
|
|
|
|
+ formData3.data.rate = (
|
|
|
|
+ formData3.data.inAmount / formData3.data.amount
|
|
|
|
+ ).toFixed(4);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -853,9 +928,10 @@ const settlementFormConfig = computed(() => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "selectInput",
|
|
type: "selectInput",
|
|
- label: "汇出金额",
|
|
|
|
|
|
+ label: "汇入金额",
|
|
prop: "inAmount",
|
|
prop: "inAmount",
|
|
itemWidth: 60,
|
|
itemWidth: 60,
|
|
|
|
+ selectDisabled: true,
|
|
data: accountCurrency.value,
|
|
data: accountCurrency.value,
|
|
placeholder: "请输入",
|
|
placeholder: "请输入",
|
|
selectPlaceholder: "币种",
|
|
selectPlaceholder: "币种",
|
|
@@ -863,7 +939,6 @@ const settlementFormConfig = computed(() => {
|
|
fn: (value) => {
|
|
fn: (value) => {
|
|
//判断value的类型
|
|
//判断value的类型
|
|
if (isNaN(value)) {
|
|
if (isNaN(value)) {
|
|
- formData2.data.inCurrency = formData2.data.currency;
|
|
|
|
formData2.data.commissionCurrency = formData2.data.currency;
|
|
formData2.data.commissionCurrency = formData2.data.currency;
|
|
} else {
|
|
} else {
|
|
if (value != "") {
|
|
if (value != "") {
|
|
@@ -875,6 +950,11 @@ const settlementFormConfig = computed(() => {
|
|
}
|
|
}
|
|
formData2.data.inAmount = formData2.data.amount;
|
|
formData2.data.inAmount = formData2.data.amount;
|
|
}
|
|
}
|
|
|
|
+ if (formData3.data.amount && formData3.data.inAmount) {
|
|
|
|
+ formData3.data.rate = (
|
|
|
|
+ formData3.data.inAmount / formData3.data.amount
|
|
|
|
+ ).toFixed(4);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -882,6 +962,7 @@ const settlementFormConfig = computed(() => {
|
|
prop: "rate",
|
|
prop: "rate",
|
|
label: "汇率",
|
|
label: "汇率",
|
|
itemType: "text",
|
|
itemType: "text",
|
|
|
|
+ disabled: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "selectInput",
|
|
type: "selectInput",
|
|
@@ -893,6 +974,24 @@ const settlementFormConfig = computed(() => {
|
|
selectPlaceholder: "币种",
|
|
selectPlaceholder: "币种",
|
|
selectProp: "commissionCurrency",
|
|
selectProp: "commissionCurrency",
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ type: "input",
|
|
|
|
+ prop: "remarks",
|
|
|
|
+ label: "摘要",
|
|
|
|
+ itemType: "textarea",
|
|
|
|
+ },
|
|
|
|
+ //关联合同
|
|
|
|
+ {
|
|
|
|
+ type: "title",
|
|
|
|
+ title: "关联合同",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "select",
|
|
|
|
+ prop: "businessId",
|
|
|
|
+ label: "选择合同",
|
|
|
|
+ filterable: true,
|
|
|
|
+ data: contractList2.value,
|
|
|
|
+ },
|
|
];
|
|
];
|
|
});
|
|
});
|
|
const formConfig = computed(() => {
|
|
const formConfig = computed(() => {
|
|
@@ -1148,6 +1247,45 @@ const rules = ref({
|
|
// accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
|
|
// accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const validatePass4 = (rule, value, callback) => {
|
|
|
|
+ console.log(formData3.data.currency);
|
|
|
|
+ if (!formData3.data.currency) {
|
|
|
|
+ callback(new Error("请输入金额和选择币种"));
|
|
|
|
+ } else {
|
|
|
|
+ callback();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const validatePass3 = (rule, value, callback) => {
|
|
|
|
+ if (!formData3.data.inCurrency) {
|
|
|
|
+ callback(new Error("请输入金额和选择币种"));
|
|
|
|
+ } else {
|
|
|
|
+ callback();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const rules3 = ref({
|
|
|
|
+ accountManagementId: [
|
|
|
|
+ { required: true, message: "请选择账户", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ currency: [{ required: true, message: "请选择币种", trigger: "change" }],
|
|
|
|
+ received: [
|
|
|
|
+ { required: true, message: "请选择合同是否到账", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ amount: [
|
|
|
|
+ { required: true, message: "请输入金额和选择币种", trigger: "blur" },
|
|
|
|
+ { required: true, validator: validatePass4, trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ inAccountManagementId: [
|
|
|
|
+ { required: true, message: "请选择账户", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ inAmount: [
|
|
|
|
+ { required: true, message: "请输入金额和选择币种", trigger: "blur" },
|
|
|
|
+ { required: true, validator: validatePass3, trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ businessId: [{ required: true, message: "请选择合同", trigger: "change" }],
|
|
|
|
+});
|
|
|
|
+
|
|
const rules2 = ref({
|
|
const rules2 = ref({
|
|
accountManagementId: [
|
|
accountManagementId: [
|
|
{ required: true, message: "请选择账户", trigger: "change" },
|
|
{ required: true, message: "请选择账户", trigger: "change" },
|
|
@@ -1517,28 +1655,27 @@ const openLoanDialog = ref(false);
|
|
const byform = ref(null);
|
|
const byform = ref(null);
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
const submitType = ref("add");
|
|
const submitType = ref("add");
|
|
-const historyData = ref([]);
|
|
|
|
const addloan = () => {
|
|
const addloan = () => {
|
|
- proxy.get("/loanInfo/getLoanUserList").then((res) => {
|
|
|
|
- historyData.value = res.data;
|
|
|
|
- });
|
|
|
|
formData.loanData = {};
|
|
formData.loanData = {};
|
|
openLoanDialog.value = true;
|
|
openLoanDialog.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 querySearch = (queryString, callback) => {
|
|
|
|
+ proxy
|
|
|
|
+ .post("/loanInfo/getLoanUserList", { keyword: queryString })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res && res.length > 0) {
|
|
|
|
+ res = res.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ value: item.loanUserName,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ callback(res);
|
|
|
|
+ } else {
|
|
|
|
+ callback([]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
const handleSubmitLoan = () => {
|
|
const handleSubmitLoan = () => {
|