账户添加公司

This commit is contained in:
浅念
2025-09-12 18:10:03 +08:00
parent 3439b45d9a
commit 5503a14408
2 changed files with 29 additions and 7 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ export class CrmService {
} }
//国家下拉 //国家下拉
static getCountry() { static getCountry() {
return request.get<Api.Brand.BrandInfo>({ return request.get<any>({
url: '/crm/customer/getCountry' url: '/crm/customer/getCountry'
}) })
} }
+28 -6
View File
@@ -41,6 +41,7 @@
<ElTableColumn label="账户号码" prop="account_number" min-width="160" /> <ElTableColumn label="账户号码" prop="account_number" min-width="160" />
<ElTableColumn label="银行名称" prop="bank_name" min-width="140" /> <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"> <ElTableColumn label="货币" prop="currency_id" min-width="120">
<template #default="scope"> <template #default="scope">
<span>{{ getCurrencyLabel(scope.row.currency_id) }}</span> <span>{{ getCurrencyLabel(scope.row.currency_id) }}</span>
@@ -97,6 +98,16 @@
<ElFormItem label="开户支行" prop="bank_branch"> <ElFormItem label="开户支行" prop="bank_branch">
<ElInput v-model="form.bank_branch" placeholder="请输入开户支行" /> <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
v-for="account in companyList"
:key="account.id"
:label="account.name"
:value="account.id"
/>
</el-select>
</ElFormItem>
<ElFormItem label="账户货币类型" prop="currency_id"> <ElFormItem label="账户货币类型" prop="currency_id">
<el-select v-model="form.currency_id" placeholder="请选择货币" style="width: 100%"> <el-select v-model="form.currency_id" placeholder="请选择货币" style="width: 100%">
<el-option <el-option
@@ -140,7 +151,7 @@
import { financeService } from '@/api/financeApi' import { financeService } from '@/api/financeApi'
import { commonService } from '@/api/commonApi' import { commonService } from '@/api/commonApi'
import { useAuth } from '@/composables/useAuth' import { useAuth } from '@/composables/useAuth'
import { UserService } from '@/api/usersApi'
const { hasAuth } = useAuth() const { hasAuth } = useAuth()
defineOptions({ name: 'FinanceAccount' }) defineOptions({ name: 'FinanceAccount' })
@@ -162,6 +173,11 @@
currencyOptions.value = [] currencyOptions.value = []
} }
} }
const companyList = ref<any>()
const getcompanyList = async () => {
const response = await UserService.getCompanyList()
companyList.value = response || []
}
const form = reactive<any>({ const form = reactive<any>({
id: '', id: '',
@@ -172,7 +188,8 @@
bank_branch: '', bank_branch: '',
description: '', description: '',
account_number: '', account_number: '',
account_name: '' account_name: '',
corp_id: ''
}) })
const rules = reactive<FormRules>({ const rules = reactive<FormRules>({
@@ -190,6 +207,7 @@
const tableRef = ref() const tableRef = ref()
onMounted(() => { onMounted(() => {
getcompanyList()
loadCurrencyOptions() loadCurrencyOptions()
getAccountList() getAccountList()
}) })
@@ -240,7 +258,8 @@
bank_branch: row.bank_branch, bank_branch: row.bank_branch,
description: row.description, description: row.description,
account_number: row.account_number, account_number: row.account_number,
account_name: row.account_name account_name: row.account_name,
corp_id: row.corp_id
}) })
} else { } else {
Object.assign(form, { Object.assign(form, {
@@ -252,7 +271,8 @@
bank_branch: '', bank_branch: '',
description: '', description: '',
account_number: '', account_number: '',
account_name: '' account_name: '',
corp_id: ''
}) })
} }
} }
@@ -288,7 +308,8 @@
bank_branch: form.bank_branch, bank_branch: form.bank_branch,
description: form.description, description: form.description,
account_number: form.account_number, account_number: form.account_number,
account_name: form.account_name account_name: form.account_name,
corp_id: form.corp_id
}) })
ElMessage.success(message) ElMessage.success(message)
} else { } else {
@@ -301,7 +322,8 @@
bank_branch: form.bank_branch, bank_branch: form.bank_branch,
description: form.description, description: form.description,
account_number: form.account_number, account_number: form.account_number,
account_name: form.account_name account_name: form.account_name,
corp_id: form.corp_id
}) })
ElMessage.success(message) ElMessage.success(message)
} }