From 853e9591b3420658e074d0fcbc287ee843d5ef72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 10 Sep 2025 18:11:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=A4=87=E8=B4=A7?= =?UTF-8?q?=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 7 + src/api/crmApi.ts | 14 + src/composables/useStockingForm.ts | 53 +- src/config/index.ts | 2 +- src/views/admin/user/user_info.vue | 49 +- src/views/admin/vehicle/port.vue | 4 +- src/views/auth/signature/mobile.vue | 28 +- src/views/crmpc/approval/stocking_auth.vue | 2 +- src/views/crmpc/stocking/Add.vue | 436 ++++---- src/views/crmpc/stocking/final_add.vue | 464 +++++---- src/views/crmpc/stocking/stocking_edit.vue | 1078 ++++++++++++++++++++ src/views/crmpc/stocking/stocking_list.vue | 42 + src/views/system/user-center/index.vue | 31 +- 13 files changed, 1724 insertions(+), 486 deletions(-) create mode 100644 src/views/crmpc/stocking/stocking_edit.vue diff --git a/src/App.vue b/src/App.vue index 24903c9..ca27e2e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -258,4 +258,11 @@ top: 50%; transform: translateY(-50%); } + :deep(.el-table__empty-block) { + height: 100% !important; + min-height: 200px; + display: flex; + align-items: center; + justify-content: center; + } diff --git a/src/api/crmApi.ts b/src/api/crmApi.ts index bfb8dde..8ff6ef2 100644 --- a/src/api/crmApi.ts +++ b/src/api/crmApi.ts @@ -229,6 +229,20 @@ export class CrmService { params }) } + //编辑备货单 + static editStock(params: any) { + return request.post({ + url: '/crm/stock/order/update', + params + }) + } + //提交备货单 + static submitStock(params: any) { + return request.post({ + url: '/crm/stock/order/approval', + params + }) + } //打印 static printStock(params: any) { return request.get({ diff --git a/src/composables/useStockingForm.ts b/src/composables/useStockingForm.ts index e28ac64..958e222 100644 --- a/src/composables/useStockingForm.ts +++ b/src/composables/useStockingForm.ts @@ -28,6 +28,8 @@ export interface BaseForm { clearance_port_id: string clearance_port_snapshot: string latest_arrival_date: string + pick_up_date: string + collect_all_date: string contract_exchange_rate: string contract_exchange_rate_currency: string remark: string @@ -59,6 +61,9 @@ export interface ItemRow { handling_fee: string fob_transport_fee: number | undefined port_misc_fee: string + ocean_freight: string + ocean_freight_currency: string + ocean_freight_currency_snapshot: string retrofit_fee: string total_price: number | undefined official_price: number | undefined @@ -164,7 +169,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { is_final: isFinal ? '1' : '0', object_id: stockingId || '0', contract: '', - contract_url: '' + contract_url: '', + pick_up_date:'', + collect_all_date: '' }) // 创建新的订单项 @@ -186,6 +193,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { handling_fee: '', fob_transport_fee: undefined, port_misc_fee: '', + ocean_freight: '', + ocean_freight_currency: 'USD', + ocean_freight_currency_snapshot: '', retrofit_fee: '', total_price: undefined, official_price: undefined, @@ -392,19 +402,19 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { const fob = toUSD(it.fob_transport_fee ?? (it as any).fob_fee, (it as any).fob_fee_currency) const handling = toUSD(it.handling_fee ?? (it as any).helper_fee, (it as any).helper_fee_currency) const port = toUSD(it.port_misc_fee ?? (it as any).port_fee, (it as any).port_fee_currency) - + const ocean =toUSD(it.ocean_freight ?? (it as any).ocean_freight, (it as any).ocean_freight_currency) const mileageVal = Number(it.mileage ?? 0) if (mileageVal > 0) { // 二手车:用挂牌价与二手减价替代官方指导价与优惠 const listing = toUSD(it.listing_price ?? (it as any).listing_price, (it as any).listing_price_currency) const reduction = toUSD(it.reduction_price ?? (it as any).reduction_price, (it as any).reduction_price_currency) - return unit - (retrofit + fob + listing + reduction + handling + port) + return unit - (retrofit + fob + listing + reduction + handling + port + ocean) } // 新车/里程<=0:保持原有计算(官方指导价与优惠) const guide = toUSD(it.official_price ?? (it as any).guide_price, (it as any).guide_price_currency) const discount = toUSD(it.discount_price ?? (it as any).discount, (it as any).discount_currency) - return unit - (retrofit + fob + guide + discount + handling + port) + return unit - (retrofit + fob + guide + discount + handling + port + ocean) } // 合同文件相关方法 @@ -506,6 +516,8 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { const chooseCustomer = (row: any) => { baseForm.customer_id = row.id || '' baseForm.customer_snapshot = row.contacts || row.name || '' + baseForm.customer_country_id = row.country_id || '' + baseForm.customer_country_snapshot = row.country_name || '' customerDialog.visible = false } @@ -563,8 +575,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { // 数据回显方法 const populateFromDetail = (res: any) => { if (!res) return - // 基础信息 + baseForm.pick_up_date = res.pick_up_date || '' + baseForm.collect_all_date = res.collect_all_date || '' baseForm.pi_no = res.pi_no || '' baseForm.contract = res.contract || '' baseForm.biz_date = res.biz_date || '' @@ -615,6 +628,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { handling_fee: it.handling_fee?.amount ?? '', fob_transport_fee: it.fob_transport_fee?.amount ? Number(it.fob_transport_fee.amount) : undefined, port_misc_fee: it.port_misc_fee?.amount ?? '', + ocean_freight: it.ocean_freight?.amount ?? '', + ocean_freight_currency: it.ocean_freight?.currency || 'USD', + ocean_freight_currency_snapshot: '', retrofit_fee: it.retrofit_fee?.amount ?? '', total_price: it.total_price?.amount ? Number(it.total_price.amount) : undefined, official_price: it.official_price?.amount ? Number(it.official_price.amount) : undefined, @@ -674,7 +690,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { } // 提交方法 - const handleSubmit = async () => { + const handleSubmit = async (type: number, edit?: string) => { const mappedItems = items.value.map((it) => ({ sku_id: it.sku_id, vin: it.vin || '', @@ -696,6 +712,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { (it as any).port_fee_currency, '港杂费' ), + ocean_freight: wrapMoney(it.ocean_freight, (it as any).ocean_freight_currency, '海运费'), retrofit_fee: wrapMoney((it as any).retrofit_fee, (it as any).modify_fee_currency, '改装费'), modify_list: it.modify_list, total_price: wrapMoney(it.total_price, (it as any).total_price_currency, '总价'), @@ -713,15 +730,31 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { reduction_price: wrapMoney(it.reduction_price, (it as any).reduction_price_currency, '二手减价') })) + // 从提交参数中移除 contract_exchange_rate_currency + const baseFormWithoutCur = { ...(baseForm as any) } + delete (baseFormWithoutCur as any).contract_exchange_rate_currency + delete (baseFormWithoutCur as any).total_cif + delete (baseFormWithoutCur as any).total_cif_currency + delete (baseFormWithoutCur as any).total_cif_currency_snapshot + delete (baseFormWithoutCur as any).contract_url const payload = { - ...baseForm, + ...baseFormWithoutCur, veh_list: mappedItems, - account_list: paymentItems.value + account_list: paymentItems.value, + approval_status: type } try { - const { message } = await CrmService.addStock(payload as any) - ElMessage.success(message || '保存成功') + if (edit) { + const { message } = await CrmService.editStock({ + ...payload, + id: edit + } as any) + ElMessage.success(message || '保存成功') + } else { + const { message } = await CrmService.addStock(payload as any) + ElMessage.success(message || '保存成功') + } setTimeout(() => { window.location.href = '/crmpc/stocking/stocking_list' }, 1000) diff --git a/src/config/index.ts b/src/config/index.ts index 82ce903..b25752e 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -127,7 +127,7 @@ const appConfig: SystemConfig = { ] as const, // 系统其他项默认配置 systemSetting: { - defaultMenuWidth: 240, // 菜单宽度 + defaultMenuWidth: 200, // 菜单宽度 defaultCustomRadius: '0.75', // 自定义圆角 defaultTabStyle: 'tab-default' // 标签样式 } diff --git a/src/views/admin/user/user_info.vue b/src/views/admin/user/user_info.vue index ce1af79..d46af50 100644 --- a/src/views/admin/user/user_info.vue +++ b/src/views/admin/user/user_info.vue @@ -129,16 +129,16 @@
手机扫码重新签名
@@ -147,12 +147,12 @@
手机扫码进行签名
@@ -336,31 +336,18 @@ const userId = form.value?.id || userInfo.value?.id || '' const base = location.origin const params = new URLSearchParams({ userId: String(userId) }) - if (userStore?.accessToken) params.append('accessToken', userStore.accessToken) - if (userStore?.language) params.append('lang', userStore.language) - if (userStore?.companyabbr) params.append('companyabbr', userStore.companyabbr) - if (userStore?.companyid) params.append('companyid', userStore.companyid) - if (userStore?.loginType) params.append('loginType', userStore.loginType) - if (userStore?.systemsabbr) params.append('systemsabbr', userStore.systemsabbr) - if (userStore?.systemsid) params.append('systemsid', userStore.systemsid) + // 只保留必要的参数,减少URL长度 + if (userStore?.accessToken) params.append('token', userStore.accessToken) + if (userStore?.companyabbr) params.append('corp', userStore.companyabbr) + if (userStore?.companyid) params.append('corpid', userStore.companyid) + if (userStore?.systemsabbr) params.append('sys', userStore.systemsabbr) + if (userStore?.systemsid) params.append('sysid', userStore.systemsid) + if (userStore?.loginType) params.append('type', userStore.loginType) + if (userStore?.language) params.append('lang', userStore.language) + return `${base}/auth/signature/mobile?${params.toString()}` }) - const handleSignature = async () => { - const userStore = useUserStore() as any - const userId = form.value?.id || userInfo.value?.id || '' - const base = location.origin - const params = new URLSearchParams({ userId: String(userId) }) - if (userStore?.accessToken) params.append('accessToken', userStore.accessToken) - if (userStore?.language) params.append('lang', userStore.language) - if (userStore?.companyabbr) params.append('companyabbr', userStore.companyabbr) - if (userStore?.companyid) params.append('companyid', userStore.companyid) - - if (userStore?.loginType) params.append('loginType', userStore.loginType) - if (userStore?.systemsabbr) params.append('systemsabbr', userStore.systemsabbr) - if (userStore?.systemsid) params.append('systemsid', userStore.systemsid) - window.location.href = `${base}/auth/signature/mobile?${params.toString()}` - } const edit = async () => { if (isEdit.value) { const payload: any = { ...(form.value as any) } diff --git a/src/views/admin/vehicle/port.vue b/src/views/admin/vehicle/port.vue index ffa5e46..19df7a9 100644 --- a/src/views/admin/vehicle/port.vue +++ b/src/views/admin/vehicle/port.vue @@ -2,7 +2,9 @@
- 创建港口 + 创建港口
清空 - 横屏 + 保存 @@ -44,21 +44,33 @@ (route.query.accessToken as string | undefined) || (route.query.token as string | undefined) // 其他头部信息从URL透传(便于直达页调用接口) const urlLang = route.query.lang as string | undefined - const urlCorp = (route.query.companyabbr as string | undefined) || userStore.companyabbr - const urlLoginType = route.query.loginType as string | undefined - const urlSys = (route.query.systemsabbr as string | undefined) || userStore.systemsabbr || 'fdesk' + const urlCorp = + (route.query.companyabbr as string | undefined) || + (route.query.corp as string | undefined) || + userStore.companyabbr + const urlLoginType = + (route.query.loginType as string | undefined) || (route.query.type as string | undefined) + const urlSys = + (route.query.systemsabbr as string | undefined) || + (route.query.sys as string | undefined) || + userStore.systemsabbr || + 'fdesk' const effectiveToken = urlToken || userStore.accessToken // 从URL参数获取公司信息并存储到userStore(如果路由守卫没有处理) - const companyid = route.query.companyid as string | undefined - const companyabbr = route.query.companyabbr as string | undefined + const companyid = + (route.query.companyid as string | undefined) || (route.query.corpid as string | undefined) + const companyabbr = + (route.query.companyabbr as string | undefined) || (route.query.corp as string | undefined) if (companyid && companyabbr && (!userStore.companyid || !userStore.companyabbr)) { userStore.setCompany(companyid, companyabbr) } // 从URL参数获取系统信息并存储到userStore(如果路由守卫没有处理) - const systemsabbr = route.query.systemsabbr as string | undefined - const systemsid = route.query.systemsid as string | undefined + const systemsabbr = + (route.query.systemsabbr as string | undefined) || (route.query.sys as string | undefined) + const systemsid = + (route.query.systemsid as string | undefined) || (route.query.sysid as string | undefined) if (systemsid && systemsabbr && (!userStore.systemsid || !userStore.systemsabbr)) { userStore.setSystems(systemsid, systemsabbr) } diff --git a/src/views/crmpc/approval/stocking_auth.vue b/src/views/crmpc/approval/stocking_auth.vue index ca5b42a..95edfed 100644 --- a/src/views/crmpc/approval/stocking_auth.vue +++ b/src/views/crmpc/approval/stocking_auth.vue @@ -34,7 +34,7 @@