提交代码
This commit is contained in:
@@ -28,6 +28,7 @@ import { useFirstLegOrdersStore } from '@/modules/first-leg/store/firstLegOrders
|
||||
import { useTenantAdministrationStore } from '@/modules/tenant-management/public'
|
||||
import { useAuthStore } from '@/modules/auth/public'
|
||||
import { useUnsavedWorkRegistration } from '@/navigation/workspace-tabs/unsavedWork'
|
||||
import { useWorkspaceTabsStore } from '@/navigation/workspace-tabs/workspaceTabs'
|
||||
import type { FirstLegPartyRole, FirstLegPartySnapshot } from '@/modules/first-leg/data/firstLegParties'
|
||||
import type { FirstLegCargoItem, FirstLegOrder, FirstLegOrderDraft } from '@/modules/first-leg/types/firstLegOrder'
|
||||
import type { MerchantInboundBilling } from '@/modules/first-leg/types/inboundBilling'
|
||||
@@ -45,6 +46,7 @@ import { createPriceEstimateBreakdown } from '@/modules/first-leg/utils/priceEst
|
||||
|
||||
const store = useFirstLegOrdersStore()
|
||||
const tenantStore = useTenantAdministrationStore()
|
||||
const workspace = useWorkspaceTabsStore()
|
||||
const auth = useAuthStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -581,6 +583,10 @@ onMounted(() => {
|
||||
void loadPageData()
|
||||
})
|
||||
|
||||
watch(() => auth.isAuthenticated, (authenticated, wasAuthenticated) => {
|
||||
if (authenticated && !wasAuthenticated && !isCreatePage.value) void loadPageData()
|
||||
})
|
||||
|
||||
watch(isCreatePage, (isCreate, wasCreate) => {
|
||||
if (!isCreate || wasCreate) return
|
||||
if (routeDraftId.value) return
|
||||
@@ -1500,7 +1506,12 @@ async function submitOrder() {
|
||||
const order = await store.submitSaved(savedOrder.id, knownCompanyAuditStatus)
|
||||
markEditorClean()
|
||||
editorOpen.value = false
|
||||
if (isCreatePage.value) await router.push({ name: 'first-leg-orders' })
|
||||
if (isCreatePage.value) {
|
||||
workspace.close(['first-leg-order-create', 'first-leg-order-edit'])
|
||||
await router.push({ name: 'first-leg-orders' })
|
||||
ElMessage.success('订单已提交,等待平台审核')
|
||||
return
|
||||
}
|
||||
detailId.value = order.id
|
||||
detailOpen.value = true
|
||||
ElMessage.success('订单已提交,等待平台审核')
|
||||
|
||||
Reference in New Issue
Block a user