|
@@ -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'),
|
|
},
|
|
},
|
|
@@ -107,13 +107,13 @@
|
|
:formConfig="settlementFormConfig"
|
|
:formConfig="settlementFormConfig"
|
|
:formOption="formOption"
|
|
:formOption="formOption"
|
|
v-model="formData3.data"
|
|
v-model="formData3.data"
|
|
- :rules="rules"
|
|
+ :rules="rules3"
|
|
- ref="submit"
|
|
+ ref="submit3"
|
|
>
|
|
>
|
|
</byForm>
|
|
</byForm>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
+ <el-button type="primary" @click="settlementSubmitForm()" size="large"
|
|
>确 定</el-button
|
|
>确 定</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -372,6 +372,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 +738,25 @@ 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) => {
|
|
@@ -804,8 +821,40 @@ const openSettlementModal = (type, row) => {
|
|
};
|
|
};
|
|
|
|
|
|
const formData3 = reactive({
|
|
const formData3 = reactive({
|
|
- data: {},
|
|
+ data: {
|
|
|
|
+ accountManagementId:null,
|
|
|
|
+ amount:null,
|
|
|
|
+ currency:null,
|
|
|
|
+ inAccountManagementId:null,
|
|
|
|
+ inAmount:null,
|
|
|
|
+ inCurrency:null,
|
|
|
|
+ rate:null,
|
|
|
|
+ commissionAmount:null,
|
|
|
|
+ commissionCurrency:null,
|
|
|
|
+ remarks:null,
|
|
|
|
+ businessId:null,
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
+const submit3 = ref(null);
|
|
|
|
+const settlementSubmitForm = () => {
|
|
|
|
+ submit3.value.handleSubmit(() => {
|
|
|
|
+ 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 [
|
|
@@ -829,10 +878,13 @@ const settlementFormConfig = computed(() => {
|
|
selectPlaceholder: "币种",
|
|
selectPlaceholder: "币种",
|
|
selectProp: "currency",
|
|
selectProp: "currency",
|
|
fn: (value) => {
|
|
fn: (value) => {
|
|
|
|
+
|
|
//判断value的类型
|
|
//判断value的类型
|
|
if (isNaN(value)) {
|
|
if (isNaN(value)) {
|
|
formData3.data.inCurrency = formData3.data.currency;
|
|
formData3.data.inCurrency = formData3.data.currency;
|
|
formData3.data.commissionCurrency = formData3.data.currency;
|
|
formData3.data.commissionCurrency = formData3.data.currency;
|
|
|
|
+ console.log(formData3.data.inAmount)
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if (value != "") {
|
|
if (value != "") {
|
|
if (value.indexOf(".") > -1) {
|
|
if (value.indexOf(".") > -1) {
|
|
@@ -843,6 +895,9 @@ 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,7 +908,7 @@ const settlementFormConfig = computed(() => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "selectInput",
|
|
type: "selectInput",
|
|
- label: "汇出金额",
|
|
+ label: "汇入金额",
|
|
prop: "inAmount",
|
|
prop: "inAmount",
|
|
itemWidth: 60,
|
|
itemWidth: 60,
|
|
data: accountCurrency.value,
|
|
data: accountCurrency.value,
|
|
@@ -865,6 +920,7 @@ const settlementFormConfig = computed(() => {
|
|
if (isNaN(value)) {
|
|
if (isNaN(value)) {
|
|
formData2.data.inCurrency = formData2.data.currency;
|
|
formData2.data.inCurrency = formData2.data.currency;
|
|
formData2.data.commissionCurrency = formData2.data.currency;
|
|
formData2.data.commissionCurrency = formData2.data.currency;
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if (value != "") {
|
|
if (value != "") {
|
|
if (value.indexOf(".") > -1) {
|
|
if (value.indexOf(".") > -1) {
|
|
@@ -875,6 +931,9 @@ 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 +941,7 @@ const settlementFormConfig = computed(() => {
|
|
prop: "rate",
|
|
prop: "rate",
|
|
label: "汇率",
|
|
label: "汇率",
|
|
itemType: "text",
|
|
itemType: "text",
|
|
|
|
+ disabled: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "selectInput",
|
|
type: "selectInput",
|
|
@@ -893,6 +953,23 @@ const settlementFormConfig = computed(() => {
|
|
selectPlaceholder: "币种",
|
|
selectPlaceholder: "币种",
|
|
selectProp: "commissionCurrency",
|
|
selectProp: "commissionCurrency",
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ type: "input",
|
|
|
|
+ prop: "remarks",
|
|
|
|
+ label: "摘要",
|
|
|
|
+ itemType: "textarea",
|
|
|
|
+ },
|
|
|
|
+ //关联合同
|
|
|
|
+ {
|
|
|
|
+ type: "title",
|
|
|
|
+ title: "关联合同",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "select",
|
|
|
|
+ prop: "businessId",
|
|
|
|
+ label: "选择合同",
|
|
|
|
+ data: contractList2.value,
|
|
|
|
+ },
|
|
];
|
|
];
|
|
});
|
|
});
|
|
const formConfig = computed(() => {
|
|
const formConfig = computed(() => {
|
|
@@ -1148,6 +1225,49 @@ 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" },
|