|
@@ -142,7 +142,6 @@
|
|
|
<ImageUpload
|
|
<ImageUpload
|
|
|
v-model="form.businessLicenseImages"
|
|
v-model="form.businessLicenseImages"
|
|
|
:limit="5"
|
|
:limit="5"
|
|
|
- :file-size="10"
|
|
|
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
|
:isShowTip="false"
|
|
:isShowTip="false"
|
|
|
placeholder="请上传营业执照图片或PDF"
|
|
placeholder="请上传营业执照图片或PDF"
|
|
@@ -156,7 +155,6 @@
|
|
|
<ImageUpload
|
|
<ImageUpload
|
|
|
v-model="form.businessPermitImages"
|
|
v-model="form.businessPermitImages"
|
|
|
:limit="5"
|
|
:limit="5"
|
|
|
- :file-size="10"
|
|
|
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
|
:isShowTip="false"
|
|
:isShowTip="false"
|
|
|
placeholder="请上传经营许可证图片或PDF"
|
|
placeholder="请上传经营许可证图片或PDF"
|
|
@@ -170,7 +168,6 @@
|
|
|
<ImageUpload
|
|
<ImageUpload
|
|
|
v-model="form.otherCertImages"
|
|
v-model="form.otherCertImages"
|
|
|
:limit="10"
|
|
:limit="10"
|
|
|
- :file-size="10"
|
|
|
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
:file-type="['jpg', 'jpeg', 'png', 'pdf']"
|
|
|
placeholder="请上传其他相关证件图片或PDF"
|
|
placeholder="请上传其他相关证件图片或PDF"
|
|
|
/>
|
|
/>
|
|
@@ -346,6 +343,18 @@ function isInvoiceBlockFilled(): boolean {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 解析新增客户接口返回的客户 ID(data 优先;兼容旧版误将 ID 放在 msg) */
|
|
|
|
|
+function resolveNewCustomerId(res: { data?: string | number | null; msg?: string }): string | null {
|
|
|
|
|
+ const { data, msg } = res;
|
|
|
|
|
+ if (data != null && String(data).trim() !== '') {
|
|
|
|
|
+ return String(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (msg != null && /^\d+$/.test(String(msg).trim())) {
|
|
|
|
|
+ return String(msg).trim();
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function buildInvoicePayload(customerId: number | string): InvoiceInfoForm {
|
|
function buildInvoicePayload(customerId: number | string): InvoiceInfoForm {
|
|
|
const f = invoiceForm.value;
|
|
const f = invoiceForm.value;
|
|
|
// 必须字符串提交:JS Number 无法安全表示雪花 Long,JSON 会变成错误数值
|
|
// 必须字符串提交:JS Number 无法安全表示雪花 Long,JSON 会变成错误数值
|
|
@@ -501,9 +510,9 @@ const submitForm = () => {
|
|
|
proxy?.$modal.msgSuccess('修改成功');
|
|
proxy?.$modal.msgSuccess('修改成功');
|
|
|
} else {
|
|
} else {
|
|
|
const res = await addCustomer(form.value);
|
|
const res = await addCustomer(form.value);
|
|
|
- const newId = (res as { data?: string | number }).data;
|
|
|
|
|
|
|
+ const newId = resolveNewCustomerId(res as { data?: string | number | null; msg?: string });
|
|
|
if (newId != null && isInvoiceBlockFilled()) {
|
|
if (newId != null && isInvoiceBlockFilled()) {
|
|
|
- await syncInvoiceAfterCustomerSave(String(newId));
|
|
|
|
|
|
|
+ await syncInvoiceAfterCustomerSave(newId);
|
|
|
}
|
|
}
|
|
|
proxy?.$modal.msgSuccess('新增成功');
|
|
proxy?.$modal.msgSuccess('新增成功');
|
|
|
}
|
|
}
|