From 3a7c351a9790b9cc0ce6f74937b3e916f9f6214d Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 26 Jan 2026 16:47:16 +0800 Subject: [PATCH] =?UTF-8?q?1.0.55=20=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E8=B4=A6=E6=88=B7=E4=BF=A1=E6=81=AF=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E3=80=81=E6=88=91=E6=96=B9=E5=85=AC=E5=8F=B8=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E8=B4=A6=E6=88=B7=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/oa/crm/paymentAccount/index.ts | 76 +++++ src/api/oa/crm/paymentAccount/types.ts | 186 ++++++++++++ src/views/oa/crm/customerInfo/ourIndex.vue | 258 +++++++++++++++-- src/views/oa/crm/paymentAccount/index.vue | 322 +++++++++++++++++++++ 4 files changed, 823 insertions(+), 19 deletions(-) create mode 100644 src/api/oa/crm/paymentAccount/index.ts create mode 100644 src/api/oa/crm/paymentAccount/types.ts create mode 100644 src/views/oa/crm/paymentAccount/index.vue diff --git a/src/api/oa/crm/paymentAccount/index.ts b/src/api/oa/crm/paymentAccount/index.ts new file mode 100644 index 0000000..c921a44 --- /dev/null +++ b/src/api/oa/crm/paymentAccount/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PaymentAccountVO, PaymentAccountForm, PaymentAccountQuery } from '@/api/oa/crm/paymentAccount/types'; + +/** + * 查询付款账户信息列表 + * @param query + * @returns {*} + */ + +export const listPaymentAccount = (query?: PaymentAccountQuery): AxiosPromise => { + return request({ + url: '/oa/crm/paymentAccount/list', + method: 'get', + params: query + }); +}; + +/** + * 查询付款账户信息详细 + * @param paymentAccountId + */ +export const getPaymentAccount = (paymentAccountId: string | number): AxiosPromise => { + return request({ + url: '/oa/crm/paymentAccount/' + paymentAccountId, + method: 'get' + }); +}; + +/** + * 新增付款账户信息 + * @param data + */ +export const addPaymentAccount = (data: PaymentAccountForm) => { + return request({ + url: '/oa/crm/paymentAccount', + method: 'post', + data: data + }); +}; + +/** + * 修改付款账户信息 + * @param data + */ +export const updatePaymentAccount = (data: PaymentAccountForm) => { + return request({ + url: '/oa/crm/paymentAccount', + method: 'put', + data: data + }); +}; + +/** + * 删除付款账户信息 + * @param paymentAccountId + */ +export const delPaymentAccount = (paymentAccountId: string | number | Array) => { + return request({ + url: '/oa/crm/paymentAccount/' + paymentAccountId, + method: 'delete' + }); +}; + +/** + * 下拉框查询付款账户信息列表 + * @param query + * @returns {*} + */ +export function getCrmPaymentAccountList (query) { + return request({ + url: '/oa/crm/paymentAccount/getCrmPaymentAccountList', + method: 'get', + params: query + }); +}; diff --git a/src/api/oa/crm/paymentAccount/types.ts b/src/api/oa/crm/paymentAccount/types.ts new file mode 100644 index 0000000..5973f5d --- /dev/null +++ b/src/api/oa/crm/paymentAccount/types.ts @@ -0,0 +1,186 @@ +export interface PaymentAccountVO { + /** + * 付款账户ID + */ + paymentAccountId: string | number; + + /** + * 客户ID + */ + customerId: string | number; + + /** + * 账户类型(电汇/银行承兑/跨境美元/跨境欧元/跨境人民币) + */ + accountType: string; + + /** + * 账户名称 + */ + accountName: string; + + /** + * 账户号码 + */ + accountNumber: string; + + /** + * 开户行名称 + */ + bankName: string; + + /** + * 开户银行代码 + */ + bankCode: string; + + /** + * SWIFT代码 + */ + swiftCode: string; + + /** + * 货币类型(CNY/USD/EUR) + */ + currency: string; + + /** + * 排序顺序 + */ + sortOrder: number; + + /** + * 备注 + */ + remark: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag: string; + +} + +export interface PaymentAccountForm extends BaseEntity { + /** + * 付款账户ID + */ + paymentAccountId?: string | number; + + /** + * 客户ID + */ + customerId?: string | number; + + /** + * 账户类型(电汇/银行承兑/跨境美元/跨境欧元/跨境人民币) + */ + accountType?: string; + + /** + * 账户名称 + */ + accountName?: string; + + /** + * 账户号码 + */ + accountNumber?: string; + + /** + * 开户行名称 + */ + bankName?: string; + + /** + * 开户银行代码 + */ + bankCode?: string; + + /** + * SWIFT代码 + */ + swiftCode?: string; + + /** + * 货币类型(CNY/USD/EUR) + */ + currency?: string; + + /** + * 排序顺序 + */ + sortOrder?: number; + + /** + * 备注 + */ + remark?: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + +} + +export interface PaymentAccountQuery extends PageQuery { + + /** + * 客户ID + */ + customerId?: string | number; + + /** + * 账户类型(电汇/银行承兑/跨境美元/跨境欧元/跨境人民币) + */ + accountType?: string; + + /** + * 账户名称 + */ + accountName?: string; + + /** + * 账户号码 + */ + accountNumber?: string; + + /** + * 开户行名称 + */ + bankName?: string; + + /** + * 开户银行代码 + */ + bankCode?: string; + + /** + * SWIFT代码 + */ + swiftCode?: string; + + /** + * 货币类型(CNY/USD/EUR) + */ + currency?: string; + + /** + * 排序顺序 + */ + sortOrder?: number; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/views/oa/crm/customerInfo/ourIndex.vue b/src/views/oa/crm/customerInfo/ourIndex.vue index 6dd4008..da70b79 100644 --- a/src/views/oa/crm/customerInfo/ourIndex.vue +++ b/src/views/oa/crm/customerInfo/ourIndex.vue @@ -50,23 +50,9 @@ - - - - - - - - - - - - - - - - - + @@ -143,6 +129,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -453,6 +493,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -469,10 +552,12 @@ import { CustomerInfoVO, CustomerInfoQuery, CustomerInfoForm } from '@/api/oa/cr import { listUser, optionSelect } from '@/api/system/user'; import { UserVO } from '@/api/system/user/types'; import FileUpload from '@/components/FileUpload/index.vue'; +import { listPaymentAccount, getPaymentAccount, delPaymentAccount, addPaymentAccount, updatePaymentAccount } from '@/api/oa/crm/paymentAccount'; +import { PaymentAccountVO, PaymentAccountQuery, PaymentAccountForm } from '@/api/oa/crm/paymentAccount/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { customer_type, active_flag, industry_id, customer_source, customer_scale, customer_status, customer_level } = toRefs( - proxy?.useDict('customer_type', 'active_flag', 'industry_id', 'customer_source', 'customer_scale', 'customer_status', 'customer_level') +const { customer_type, active_flag, industry_id, customer_source, customer_scale, customer_status, customer_level, currency_type, account_type } = toRefs( + proxy?.useDict('customer_type', 'active_flag', 'industry_id', 'customer_source', 'customer_scale', 'customer_status', 'customer_level', 'currency_type', 'account_type') ); const customerInfoList = ref([]); @@ -494,6 +579,55 @@ const currentCustomer = ref({} as CustomerInfoVO); const queryFormRef = ref(); const customerInfoFormRef = ref(); +const paymentAccountFormRef = ref(); + +// 付款账户相关数据 +const paymentAccountList = ref([]); +const paymentAccountLoading = ref(false); +const paymentAccountButtonLoading = ref(false); +const paymentAccountIds = ref>([]); +const paymentAccountSingle = ref(true); +const paymentAccountMultiple = ref(true); +const paymentAccountTotal = ref(0); + +const paymentAccountDialog = reactive({ + visible: false, + title: '' +}); + +const initPaymentAccountFormData: PaymentAccountForm = { + paymentAccountId: undefined, + customerId: 1, // 默认 customer_id 为 1 + accountType: undefined, + accountName: undefined, + accountNumber: undefined, + bankName: undefined, + bankCode: undefined, + swiftCode: undefined, + currency: undefined, + sortOrder: undefined, + remark: undefined, + activeFlag: undefined +}; + +const paymentAccountData = reactive>({ + form: { ...initPaymentAccountFormData }, + queryParams: { + pageNum: 1, + pageSize: 10, + customerId: 1, // 默认 customer_id 为 1 + accountType: undefined, + currency: undefined, + params: {} + }, + rules: { + accountType: [{ required: true, message: '账户类型不能为空', trigger: 'change' }], + accountName: [{ required: true, message: '账户名称不能为空', trigger: 'blur' }], + accountNumber: [{ required: true, message: '账户号码不能为空', trigger: 'blur' }] + } +}); + +const { queryParams: paymentAccountQueryParams, form: paymentAccountForm, rules: paymentAccountRules } = toRefs(paymentAccountData); // 附件ID字符串转换(用于FileUpload组件) const ossIdString = computed({ @@ -818,7 +952,93 @@ const handleViewRelation = async (row: CustomerInfoVO) => { } }; +/** 查询付款账户信息列表 */ +const getPaymentAccountList = async () => { + paymentAccountLoading.value = true; + try { + const res = await listPaymentAccount(paymentAccountQueryParams.value); + paymentAccountList.value = res.rows; + paymentAccountTotal.value = res.total; + } catch (error) { + console.error('查询付款账户列表失败:', error); + } finally { + paymentAccountLoading.value = false; + } +}; + +/** 付款账户多选框选中数据 */ +const handlePaymentAccountSelectionChange = (selection: PaymentAccountVO[]) => { + paymentAccountIds.value = selection.map((item) => item.paymentAccountId); + paymentAccountSingle.value = selection.length != 1; + paymentAccountMultiple.value = !selection.length; +}; + +/** 新增付款账户按钮操作 */ +const handleAddPaymentAccount = () => { + resetPaymentAccount(); + paymentAccountForm.value.customerId = 1; // 设置默认 customer_id 为 1 + paymentAccountDialog.visible = true; + paymentAccountDialog.title = '添加付款账户信息'; +}; + +/** 修改付款账户按钮操作 */ +const handleUpdatePaymentAccount = async (row?: PaymentAccountVO) => { + resetPaymentAccount(); + const _paymentAccountId = row?.paymentAccountId || paymentAccountIds.value[0]; + const res = await getPaymentAccount(_paymentAccountId); + Object.assign(paymentAccountForm.value, res.data); + paymentAccountDialog.visible = true; + paymentAccountDialog.title = '修改付款账户信息'; +}; + +/** 付款账户表单重置 */ +const resetPaymentAccount = () => { + paymentAccountForm.value = { ...initPaymentAccountFormData }; + paymentAccountFormRef.value?.resetFields(); +}; + +/** 取消付款账户按钮 */ +const cancelPaymentAccount = () => { + resetPaymentAccount(); + paymentAccountDialog.visible = false; +}; + +/** 提交付款账户表单 */ +const submitPaymentAccountForm = () => { + paymentAccountFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + paymentAccountButtonLoading.value = true; + try { + // 确保 customer_id 为 1 + paymentAccountForm.value.customerId = 1; + if (paymentAccountForm.value.paymentAccountId) { + await updatePaymentAccount(paymentAccountForm.value); + } else { + await addPaymentAccount(paymentAccountForm.value); + } + proxy?.$modal.msgSuccess('操作成功'); + paymentAccountDialog.visible = false; + await getPaymentAccountList(); + } catch (error) { + console.error('提交付款账户失败:', error); + } finally { + paymentAccountButtonLoading.value = false; + } + } + }); +}; + +/** 删除付款账户按钮操作 */ +const handleDeletePaymentAccount = async (row?: PaymentAccountVO) => { + const _paymentAccountIds = row?.paymentAccountId || paymentAccountIds.value; + await proxy?.$modal.confirm('是否确认删除付款账户信息编号为"' + _paymentAccountIds + '"的数据项?').finally(() => (paymentAccountLoading.value = false)); + await delPaymentAccount(_paymentAccountIds); + proxy?.$modal.msgSuccess('删除成功'); + await getPaymentAccountList(); +}; + onMounted(() => { getList(); + getPaymentAccountList(); }); diff --git a/src/views/oa/crm/paymentAccount/index.vue b/src/views/oa/crm/paymentAccount/index.vue new file mode 100644 index 0000000..45ffd4c --- /dev/null +++ b/src/views/oa/crm/paymentAccount/index.vue @@ -0,0 +1,322 @@ + + +