|
@@ -13,62 +13,28 @@
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ @get-list="getList">
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '添加账户' : '编辑账户'"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="600"
|
|
|
- v-loading="loadingDialog"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加账户' : '编辑账户'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #balance>
|
|
|
<div style="width: 100%">
|
|
|
<el-button type="primary" @click="clickBalance">添加</el-button>
|
|
|
- <el-table
|
|
|
- :data="formData.data.accountRemainderList"
|
|
|
- style="width: 100%; margin-top: 16px"
|
|
|
- >
|
|
|
+ <el-table :data="formData.data.accountRemainderList" style="width: 100%; margin-top: 16px">
|
|
|
<el-table-column label="币种">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'accountRemainderList.' + $index + '.currency'"
|
|
|
- :rules="rules.currency"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="row.currency"
|
|
|
- placeholder="请选择币种"
|
|
|
- style="width: 100%"
|
|
|
- :disabled="row.id"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in accountCurrency"
|
|
|
- :key="item.dictKey"
|
|
|
- :label="item.dictValue"
|
|
|
- :value="item.dictKey"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'accountRemainderList.' + $index + '.currency'" :rules="rules.currency" :inline-message="true">
|
|
|
+ <el-select v-model="row.currency" placeholder="请选择币种" style="width: 100%" :disabled="row.id">
|
|
|
+ <el-option v-for="item in accountCurrency" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="余额">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'accountRemainderList.' + $index + '.remainder'"
|
|
|
- :rules="rules.remainder"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="'accountRemainderList.' + $index + '.remainder'" :rules="rules.remainder" :inline-message="true">
|
|
|
<el-input-number
|
|
|
v-model="row.remainder"
|
|
|
placeholder="请输入余额"
|
|
@@ -76,20 +42,13 @@
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- :disabled="row.id"
|
|
|
- />
|
|
|
+ :disabled="row.id" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="80">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- @click="handleRemove($index)"
|
|
|
- v-if="!row.id"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)" v-if="!row.id">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -98,9 +57,7 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -184,15 +141,11 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久删除该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
proxy
|
|
|
.post("/accountManagement/delete", {
|
|
|
id: row.id,
|
|
@@ -229,15 +182,13 @@ const getDict = () => {
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
- proxy
|
|
|
- .post("/accountManagement/page", sourceList.value.pagination)
|
|
|
- .then((res) => {
|
|
|
- sourceList.value.data = res.rows;
|
|
|
- sourceList.value.pagination.total = res.total;
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 200);
|
|
|
- });
|
|
|
+ proxy.post("/accountManagement/page", sourceList.value.pagination).then((res) => {
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
};
|
|
|
getDict();
|
|
|
getList();
|
|
@@ -254,6 +205,9 @@ const formOption = reactive({
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
+ label: "基本信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "input",
|
|
|
prop: "alias",
|
|
|
label: "账户别名",
|
|
@@ -294,6 +248,51 @@ const formConfig = computed(() => {
|
|
|
itemType: "text",
|
|
|
},
|
|
|
{
|
|
|
+ label: "外汇信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryName",
|
|
|
+ label: "Beneficiary Name",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryBank",
|
|
|
+ label: "Beneficiary Bank",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryBankAddress",
|
|
|
+ label: "Beneficiary Bank Address",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryAccountNumber",
|
|
|
+ label: "Beneficiary Account Number",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "swiftCode",
|
|
|
+ label: "Swift Code",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryAddress",
|
|
|
+ label: "Beneficiary Address",
|
|
|
+ required: true,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "slot",
|
|
|
slotName: "balance",
|
|
|
label: "账户余额",
|
|
@@ -322,18 +321,13 @@ const openModal = (val) => {
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
const clickBalance = () => {
|
|
|
- if (
|
|
|
- formData.data.accountRemainderList &&
|
|
|
- formData.data.accountRemainderList.length > 0
|
|
|
- ) {
|
|
|
+ if (formData.data.accountRemainderList && formData.data.accountRemainderList.length > 0) {
|
|
|
formData.data.accountRemainderList.push({
|
|
|
currency: "",
|
|
|
remainder: undefined,
|
|
|
});
|
|
|
} else {
|
|
|
- formData.data.accountRemainderList = [
|
|
|
- { currency: "", remainder: undefined },
|
|
|
- ];
|
|
|
+ formData.data.accountRemainderList = [{ currency: "", remainder: undefined }];
|
|
|
}
|
|
|
};
|
|
|
const handleRemove = (index) => {
|
|
@@ -349,10 +343,7 @@ const isRepeat = (arr) => {
|
|
|
};
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
- if (
|
|
|
- formData.data.accountRemainderList &&
|
|
|
- formData.data.accountRemainderList.length > 0
|
|
|
- ) {
|
|
|
+ if (formData.data.accountRemainderList && formData.data.accountRemainderList.length > 0) {
|
|
|
if (isRepeat(formData.data.accountRemainderList)) {
|
|
|
return ElMessage("请勿重复添加货币余额");
|
|
|
} else {
|