添加 账户简称
This commit is contained in:
@@ -37,10 +37,11 @@
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<template #default>
|
||||
<ElTableColumn label="账户简称" prop="short_desc" min-width="160" />
|
||||
<ElTableColumn label="账户名称" prop="account_name" min-width="160" />
|
||||
<ElTableColumn label="账户号码" prop="account_number" min-width="160" />
|
||||
<ElTableColumn label="银行名称" prop="bank_name" min-width="140" />
|
||||
<ElTableColumn label="开户支行" prop="bank_branch" min-width="160" />
|
||||
<!-- <ElTableColumn label="开户支行" prop="bank_branch" min-width="160" /> -->
|
||||
<ElTableColumn label="公司名称" prop="corp_name" min-width="160" />
|
||||
<ElTableColumn label="货币" prop="currency_id" min-width="120">
|
||||
<template #default="scope">
|
||||
@@ -86,6 +87,9 @@
|
||||
width="700px"
|
||||
>
|
||||
<ElForm ref="formRef" :model="form" :rules="rules" label-width="110px" class="form">
|
||||
<ElFormItem label="账户简称" prop="short_desc">
|
||||
<ElInput v-model="form.short_desc" placeholder="请输入账户简称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="账户名称" prop="account_name">
|
||||
<ElInput v-model="form.account_name" placeholder="请输入账户名称" />
|
||||
</ElFormItem>
|
||||
@@ -95,9 +99,9 @@
|
||||
<ElFormItem label="银行名称" prop="bank_name">
|
||||
<ElInput v-model="form.bank_name" placeholder="请输入银行名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="开户支行" prop="bank_branch">
|
||||
<!-- <ElFormItem label="开户支行" prop="bank_branch">
|
||||
<ElInput v-model="form.bank_branch" placeholder="请输入开户支行" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="公司名称" prop="corp_id">
|
||||
<el-select v-model="form.corp_id" placeholder="请选择公司" style="width: 100%">
|
||||
<el-option
|
||||
@@ -182,6 +186,7 @@
|
||||
const form = reactive<any>({
|
||||
id: '',
|
||||
currency_id: undefined,
|
||||
short_desc: '',
|
||||
status: 1,
|
||||
sort: 0,
|
||||
bank_name: '',
|
||||
@@ -193,7 +198,7 @@
|
||||
})
|
||||
|
||||
const rules = reactive<FormRules>({
|
||||
currency_id: [{ required: true, message: '请选择账户货币类型', trigger: 'change' }],
|
||||
short_desc: [{ required: true, message: '请输入账户简称', trigger: 'blur' }],
|
||||
account_name: [{ required: true, message: '请输入账户名称', trigger: 'blur' }],
|
||||
account_number: [{ required: true, message: '请输入账户号码', trigger: 'blur' }]
|
||||
})
|
||||
@@ -251,6 +256,7 @@
|
||||
if (type === 'edit' && row) {
|
||||
Object.assign(form, {
|
||||
id: row.id,
|
||||
short_desc: row.short_desc,
|
||||
currency_id: row.currency_id,
|
||||
status: row.status,
|
||||
sort: row.sort ?? 0,
|
||||
@@ -264,6 +270,7 @@
|
||||
} else {
|
||||
Object.assign(form, {
|
||||
id: '',
|
||||
short_desc: '',
|
||||
currency_id: undefined,
|
||||
status: 1,
|
||||
sort: 0,
|
||||
@@ -302,6 +309,7 @@
|
||||
if (dialogType.value === 'add') {
|
||||
const { message } = await financeService.accountAdd({
|
||||
currency_id: form.currency_id,
|
||||
short_desc: form.short_desc,
|
||||
status: form.status,
|
||||
sort: form.sort,
|
||||
bank_name: form.bank_name,
|
||||
@@ -316,6 +324,7 @@
|
||||
const { message } = await financeService.accountEdit({
|
||||
id: form.id,
|
||||
currency_id: form.currency_id,
|
||||
short_desc: form.short_desc,
|
||||
status: form.status,
|
||||
sort: form.sort,
|
||||
bank_name: form.bank_name,
|
||||
|
||||
@@ -668,14 +668,13 @@
|
||||
@change="
|
||||
(val) =>
|
||||
(payment.account_name_snapshot =
|
||||
(accountOptions || []).find((x: any) => x.id === val)?.account_number ||
|
||||
'')
|
||||
(accountOptions || []).find((x: any) => x.id === val)?.short_desc || '')
|
||||
"
|
||||
>
|
||||
<ElOption
|
||||
v-for="item in accountOptions"
|
||||
:key="item.id"
|
||||
:label="item.account_number"
|
||||
:label="item.short_desc"
|
||||
:value="item.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
|
||||
@@ -653,15 +653,14 @@
|
||||
@change="
|
||||
(val) =>
|
||||
(payment.account_id =
|
||||
(accountOptions || []).find((x: any) => x.account_number === val)?.id ||
|
||||
'')
|
||||
(accountOptions || []).find((x: any) => x.short_desc === val)?.id || '')
|
||||
"
|
||||
>
|
||||
<ElOption
|
||||
v-for="item in accountOptions"
|
||||
:key="item.id"
|
||||
:label="item.account_number"
|
||||
:value="item.account_number"
|
||||
:label="item.short_desc"
|
||||
:value="item.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
<ElInput v-model="payment.account_id" type="hidden" />
|
||||
|
||||
@@ -743,14 +743,14 @@
|
||||
@change="
|
||||
(val) =>
|
||||
(payment.account_id =
|
||||
(accountOptions || []).find((x: any) => x.account_number === val)?.id || '')
|
||||
(accountOptions || []).find((x: any) => x.short_desc === val)?.id || '')
|
||||
"
|
||||
>
|
||||
<ElOption
|
||||
v-for="item in accountOptions"
|
||||
:key="item.id"
|
||||
:label="item.account_number"
|
||||
:value="item.account_number"
|
||||
:label="item.short_desc"
|
||||
:value="item.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
<ElInput v-model="payment.account_id" type="hidden" />
|
||||
|
||||
@@ -657,13 +657,13 @@
|
||||
<ElSelect v-model="payment.account_name_snapshot" placeholder="请选择账户" @change="
|
||||
(val) =>
|
||||
(payment.account_id =
|
||||
(accountOptions || []).find((x: any) => x.account_number === val)?.id || '')
|
||||
(accountOptions || []).find((x: any) => x.short_desc === val)?.id || '')
|
||||
">
|
||||
<ElOption
|
||||
v-for="item in accountOptions"
|
||||
:key="item.id"
|
||||
:label="item.account_number"
|
||||
:value="item.account_number"
|
||||
:label="item.short_desc"
|
||||
:value="item.id"
|
||||
/>
|
||||
</ElSelect>
|
||||
<ElInput v-model="payment.account_id" type="hidden" />
|
||||
|
||||
Reference in New Issue
Block a user