|
|
@@ -856,6 +856,13 @@ const handleEditContact = (row: CustomerContactForm, index: number) => {
|
|
|
|
|
|
// 确认添加/编辑联系人
|
|
|
const handleContactConfirm = (data: CustomerContactForm) => {
|
|
|
+ // 如果新增/编辑的是主联系人(isPrimary === '0'),将其他所有联系人设置为非主联系人
|
|
|
+ if (data.isPrimary === '0') {
|
|
|
+ contactList.value.forEach((item) => {
|
|
|
+ item.isPrimary = '1';
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (currentContactIndex.value >= 0) {
|
|
|
// 编辑
|
|
|
contactList.value[currentContactIndex.value] = data;
|
|
|
@@ -881,7 +888,9 @@ const removeContact = (index: number) => {
|
|
|
|
|
|
// 打开添加开票信息对话框
|
|
|
const handleAddInvoice = () => {
|
|
|
- currentInvoice.value = undefined;
|
|
|
+ currentInvoice.value = {};
|
|
|
+ currentInvoice.value.taxId = businessForm.socialCreditCode;
|
|
|
+ currentInvoice.value.address = businessForm.businessAddress;
|
|
|
currentInvoiceIndex.value = -1;
|
|
|
invoiceDialogVisible.value = true;
|
|
|
};
|
|
|
@@ -895,6 +904,13 @@ const handleEditInvoice = (row: InvoiceInfoForm, index: number) => {
|
|
|
|
|
|
// 确认添加/编辑开票信息
|
|
|
const handleInvoiceConfirm = (data: InvoiceInfoForm) => {
|
|
|
+ // 如果新增/编辑的是主账号(isPrimaryAccount === '0'),将其他所有账号设置为非主账号
|
|
|
+ if (data.isPrimaryAccount === '0') {
|
|
|
+ invoiceList.value.forEach((item) => {
|
|
|
+ item.isPrimaryAccount = '1';
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (currentInvoiceIndex.value >= 0) {
|
|
|
// 编辑
|
|
|
invoiceList.value[currentInvoiceIndex.value] = data;
|