This commit is contained in:
zlwu committed 2026-06-21 12:41:39 +08:00
1 parent 299609706c
commit e46c0480d4
87 files changed
+11975 -15543

No files matched your search

@@ -288,11 +288,11 @@
</template>
</SystemViewDialog>
<CustomerDetailDialog ref="customerDetailRef" />
<CustomerDetailDialog v-if="customerDialogActive" ref="customerDetailRef" />
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import { computed, ref, defineAsyncComponent, nextTick } from 'vue'
import {
CircleClose,
Delete,
@@ -306,7 +306,10 @@ import SystemViewDialog, {
type ViewSection
} from '@/components/business/system-view-dialog/index.vue'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import CustomerDetailDialog from '@/views/crm/customer/CustomerDetailDialog.vue'
const CustomerDetailDialog = defineAsyncComponent(
() => import('@/views/crm/customer/CustomerDetailDialog.vue')
)
import { useDictStore } from '@/store/modules/dict'
import { useQuotePerm } from '@/hooks/business/useQuotePerm'
import { $modal } from '@/utils/modal'
@@ -339,7 +342,8 @@ const visible = ref(false)
const loading = ref(false)
const quoteInfo = ref<QuoteVO>({} as QuoteVO)
const approvalList = ref<QuoteApprovalVO[]>([])
const customerDetailRef = ref<InstanceType<typeof CustomerDetailDialog> | null>(null)
const customerDetailRef = ref<{ open: (id: string | number) => Promise<void> } | null>(null)
const customerDialogActive = ref(false)
const currentQuoteId = ref<string | number>()
const isPurchase = computed(() => quoteInfo.value?.quoteType === 'purchase')
@@ -386,6 +390,16 @@ function getApprovalTimelineColor(result?: string) {
return '#94a3b8'
}
/** 8 列表格区块:禁用长字段独占行,保证每行尽量排满 4 组 */
function viewQuadTableSection(title: string, fields: ViewField[]): ViewSection {
return {
title,
fields: fields.map((field) => ({ ...field, long: false, fullSpan: false })),
fieldLayout: 'table',
tableMode: 'quad'
}
}
const viewHeroMeta = computed(() => {
void dictStore.loaded
const q = quoteInfo.value
@@ -444,7 +458,7 @@ const viewSections = computed<ViewSection[]>(() => {
]
const sections: ViewSection[] = [
{ title: '基本信息', fields: basicFields },
viewQuadTableSection('基本信息', basicFields),
{ title: '金额汇总', fields: amountFields },
{
title: '产品明细',
@@ -519,10 +533,11 @@ async function refresh() {
await loadDetail(currentQuoteId.value)
}
function handleViewCustomer() {
if (quoteInfo.value?.customerId) {
customerDetailRef.value?.open(quoteInfo.value.customerId as number)
}
async function handleViewCustomer() {
if (!quoteInfo.value?.customerId) return
customerDialogActive.value = true
await nextTick()
customerDetailRef.value?.open(quoteInfo.value.customerId as number)
}
function handleEdit() {