This commit is contained in:
zlwu committed 2026-08-03 00:48:46 +08:00
1 parent 272c68af4b
commit 40fc54942b
76 files changed
+464684 -14130

No files matched your search

@@ -734,6 +734,44 @@ body .el-table thead {
}
}
// 名称列(客户/产品/合同等):Excel 式自动换行 + 左对齐,覆盖全局 nowrap/居中
// 用法:el-table-column 增加 class-name="col-name-wrap" label-class-name="col-name-wrap",
// 并设 align="left" header-align="left",去掉 show-overflow-tooltip
.el-table {
th.el-table__cell.col-name-wrap,
td.el-table__cell.col-name-wrap {
vertical-align: middle;
height: auto;
text-align: left !important;
> .cell {
white-space: normal !important;
word-break: break-word;
overflow-wrap: anywhere;
line-height: 1.45;
text-overflow: unset;
overflow: visible;
height: auto;
text-align: left !important;
justify-content: flex-start !important;
}
}
td.el-table__cell.col-name-wrap {
.el-link,
.el-link > span {
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
display: inline;
vertical-align: baseline;
height: auto;
line-height: 1.45;
text-align: left;
}
}
}
// 全局:列表表格内容居中展示(表头 + 单元格)
// 列上设置 align / header-align 时,Element Plus 会加 is-left、is-right,须高于默认居中
.el-table {
@@ -44,7 +44,12 @@
@click="file.fileUrl ? handleAttachmentClick(file) : undefined"
>
<template v-if="isImageFile(file) && file.fileUrl">
<img :src="resolveFileUrl(file.fileUrl)" :alt="file.fileName" />
<img
:src="resolveFileUrl(file.fileUrl)"
:alt="file.fileName"
loading="lazy"
decoding="async"
/>
</template>
<template v-else-if="isImageFile(file) && !file.fileUrl">
<el-icon :size="previewIconSize" color="#94a3b8"><Loading /></el-icon>
@@ -6,12 +6,29 @@
class="pl-carrier-list-attachment-cell__item"
:title="item.fullLabel"
>
<AttachmentUploadField
v-if="item.url"
:model-value="item.url"
disabled
:category-labels="item.categoryLabels"
/>
<div v-if="item.url" class="pl-carrier-list-attachment-cell__thumb">
<el-image
v-if="item.isImage"
class="pl-carrier-list-attachment-cell__image"
fit="cover"
lazy
:src="displaySrc(item.url)"
:preview-src-list="mediaActive ? [resolvePhotoDisplayUrl(item.url)] : []"
preview-teleported
hide-on-click-modal
>
<template #error>
<div class="pl-carrier-list-attachment-cell__placeholder">
<el-icon :size="20" color="#94a3b8"><Document /></el-icon>
</div>
</template>
</el-image>
<div v-else class="pl-carrier-list-attachment-cell__placeholder">
<el-icon :size="20" color="#94a3b8"><Document /></el-icon>
<span v-if="item.ext" class="pl-carrier-list-attachment-cell__ext">{{ item.ext }}</span>
</div>
<span class="pl-carrier-list-attachment-cell__caption">{{ item.label }}</span>
</div>
<div v-else class="pl-carrier-list-attachment-cell__empty">
<span class="pl-carrier-list-attachment-cell__empty-text">未上传</span>
<span class="pl-carrier-list-attachment-cell__caption">{{ item.label }}</span>
@@ -21,152 +38,194 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import type { Carrier } from '@/api/pl'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import { normalizeAttachmentUrls } from '@/utils/download-attachment'
import { computed } from 'vue'
import { Document } from '@element-plus/icons-vue'
import type { Carrier } from '@/api/pl'
import { normalizeAttachmentUrls } from '@/utils/download-attachment'
import { resolvePhotoDisplayUrl } from '@/utils/pl-photo'
const props = defineProps<{
carrier?: Pick<
Carrier,
'businessLicenseUrls' | 'roadTransportLicenseUrls' | 'transportAgreementUrls'
> | null
}>()
type ItemDef = {
key: string
label: string
fullLabel: string
url: string
categoryLabels: Record<string, string>
}
function parseUrls(raw?: string | null): string[] {
const normalized = normalizeAttachmentUrls(raw)
if (!normalized) return []
return normalized
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
const items = computed<ItemDef[]>(() => {
const defs = [
const props = withDefaults(
defineProps<{
carrier?: Pick<
Carrier,
'businessLicenseUrls' | 'roadTransportLicenseUrls' | 'transportAgreementUrls'
> | null
/** KeepAlive 离开页时置 false,暂停缩略图请求 */
mediaActive?: boolean
}>(),
{
key: 'businessLicense',
label: '营业执照',
fullLabel: '营业执照',
raw: props.carrier?.businessLicenseUrls
},
{
key: 'roadTransportLicense',
label: '道路许可',
fullLabel: '道路经营许可证',
raw: props.carrier?.roadTransportLicenseUrls
},
{
key: 'transportAgreement',
label: '运输协议',
fullLabel: '运输协议',
raw: props.carrier?.transportAgreementUrls
carrier: null,
mediaActive: true
}
]
)
const result: ItemDef[] = []
for (const def of defs) {
const urls = parseUrls(def.raw)
if (!urls.length) {
result.push({
key: def.key,
label: def.label,
fullLabel: def.fullLabel,
url: '',
categoryLabels: {}
})
continue
}
urls.forEach((url, index) => {
result.push({
key: `${def.key}-${index}`,
label: def.label,
fullLabel: def.fullLabel,
url,
categoryLabels: { [url]: def.label }
})
})
type ItemDef = {
key: string
label: string
fullLabel: string
url: string
isImage: boolean
ext: string
}
return result
})
function parseUrls(raw?: string | null): string[] {
const normalized = normalizeAttachmentUrls(raw)
if (!normalized) return []
return normalized
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
function isImageUrl(url: string) {
const path = String(url || '')
.split('?')[0]
.toLowerCase()
return /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(path)
}
function getFileExt(url: string) {
const name =
String(url || '')
.split('?')[0]
.split('/')
.pop() || ''
const lastDot = name.lastIndexOf('.')
if (lastDot === -1) return ''
return name.slice(lastDot + 1).toUpperCase()
}
function displaySrc(url: string) {
if (!props.mediaActive) return ''
return resolvePhotoDisplayUrl(url)
}
const items = computed<ItemDef[]>(() => {
const defs = [
{
key: 'businessLicense',
label: '营业执照',
fullLabel: '营业执照',
raw: props.carrier?.businessLicenseUrls
},
{
key: 'roadTransportLicense',
label: '道路许可',
fullLabel: '道路经营许可证',
raw: props.carrier?.roadTransportLicenseUrls
},
{
key: 'transportAgreement',
label: '运输协议',
fullLabel: '运输协议',
raw: props.carrier?.transportAgreementUrls
}
]
const result: ItemDef[] = []
for (const def of defs) {
const urls = parseUrls(def.raw)
if (!urls.length) {
result.push({
key: def.key,
label: def.label,
fullLabel: def.fullLabel,
url: '',
isImage: false,
ext: ''
})
continue
}
urls.forEach((url, index) => {
result.push({
key: `${def.key}-${index}`,
label: def.label,
fullLabel: def.fullLabel,
url,
isImage: isImageUrl(url),
ext: getFileExt(url)
})
})
}
return result
})
</script>
<style scoped lang="scss">
.pl-carrier-list-attachment-cell {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
}
.pl-carrier-list-attachment-cell {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
}
.pl-carrier-list-attachment-cell__item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-carrier-list-attachment-cell__item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-carrier-list-attachment-cell__empty {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px dashed var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 12px;
}
.pl-carrier-list-attachment-cell__thumb,
.pl-carrier-list-attachment-cell__empty {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px solid var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
}
.pl-carrier-list-attachment-cell__empty-text {
margin-bottom: 14px;
font-size: 11px;
line-height: 1.3;
}
.pl-carrier-list-attachment-cell__empty {
border-style: dashed;
color: var(--mint-text);
font-size: 12px;
}
.pl-carrier-list-attachment-cell__caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-carrier-list-attachment-cell__image {
width: 100%;
height: 100%;
cursor: pointer;
}
:deep(.attachment-upload) {
width: 100%;
}
.pl-carrier-list-attachment-cell__placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
width: 100%;
height: 100%;
margin-bottom: 14px;
}
:deep(.attachment-list) {
flex-wrap: nowrap;
}
.pl-carrier-list-attachment-cell__ext {
font-size: 10px;
line-height: 1.2;
color: #64748b;
}
:deep(.attachment-item) {
width: 96px;
margin-bottom: 0;
}
.pl-carrier-list-attachment-cell__empty-text {
margin-bottom: 14px;
font-size: 11px;
line-height: 1.3;
}
:deep(.attachment-preview) {
height: 56px;
}
:deep(.attachment-footer) {
display: none;
}
.pl-carrier-list-attachment-cell__caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
</style>
@@ -6,12 +6,29 @@
class="pl-cert-list-attachment-cell__item"
:title="item.fullLabel"
>
<AttachmentUploadField
v-if="item.url"
:model-value="item.url"
disabled
:category-labels="item.categoryLabels"
/>
<div v-if="item.url" class="pl-cert-list-attachment-cell__thumb">
<el-image
v-if="item.isImage"
class="pl-cert-list-attachment-cell__image"
fit="cover"
lazy
:src="displaySrc(item.url)"
:preview-src-list="mediaActive ? [resolvePhotoDisplayUrl(item.url)] : []"
preview-teleported
hide-on-click-modal
>
<template #error>
<div class="pl-cert-list-attachment-cell__placeholder">
<el-icon :size="20" color="#94a3b8"><Document /></el-icon>
</div>
</template>
</el-image>
<div v-else class="pl-cert-list-attachment-cell__placeholder">
<el-icon :size="20" color="#94a3b8"><Document /></el-icon>
<span v-if="item.ext" class="pl-cert-list-attachment-cell__ext">{{ item.ext }}</span>
</div>
<span class="pl-cert-list-attachment-cell__caption">{{ item.label }}</span>
</div>
<div v-else class="pl-cert-list-attachment-cell__empty">
<span class="pl-cert-list-attachment-cell__empty-text">未上传</span>
<span class="pl-cert-list-attachment-cell__caption">{{ item.label }}</span>
@@ -22,162 +39,200 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import type { CertRead } from '@/api/pl'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import { normalizeAttachmentUrls } from '@/utils/download-attachment'
import {
PL_VEHICLE_CERT_PART_TRAILER,
normalizeVehicleCertPart
} from '@/utils/pl-vehicle-cert'
import { computed } from 'vue'
import { Document } from '@element-plus/icons-vue'
import type { CertRead } from '@/api/pl'
import { normalizeAttachmentUrls } from '@/utils/download-attachment'
import { resolvePhotoDisplayUrl } from '@/utils/pl-photo'
import { PL_VEHICLE_CERT_PART_TRAILER, normalizeVehicleCertPart } from '@/utils/pl-vehicle-cert'
const props = withDefaults(
defineProps<{
certList?: CertRead[] | null
/** 车辆证书:按主车/挂车加前缀 */
showVehiclePart?: boolean
}>(),
{
certList: () => [],
showVehiclePart: false
}
)
type ItemDef = {
key: string
label: string
fullLabel: string
url: string
categoryLabels: Record<string, string>
}
function parseUrls(raw?: string | null): string[] {
const normalized = normalizeAttachmentUrls(raw)
if (!normalized) return []
return normalized
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
function partPrefix(cert: CertRead, enablePart: boolean): string {
if (!enablePart) return ''
return normalizeVehicleCertPart(cert.vehiclePart) === PL_VEHICLE_CERT_PART_TRAILER ? '挂·' : '主·'
}
const items = computed<ItemDef[]>(() => {
const certs = props.certList || []
if (!certs.length) return []
const enablePart =
props.showVehiclePart &&
certs.some((cert) => normalizeVehicleCertPart(cert.vehiclePart) === PL_VEHICLE_CERT_PART_TRAILER)
const result: ItemDef[] = []
certs.forEach((cert, certIndex) => {
const certName = String(cert.certName || '').trim() || '证书'
const prefix = partPrefix(cert, enablePart)
const fullLabel = `${prefix}${certName}`
const label = fullLabel.length > 6 ? `${fullLabel.slice(0, 5)}…` : fullLabel
const urls = parseUrls(cert.attachmentUrls)
if (!urls.length) {
result.push({
key: `${cert.id || cert.certId || certIndex}-empty`,
label,
fullLabel,
url: '',
categoryLabels: {}
})
return
const props = withDefaults(
defineProps<{
certList?: CertRead[] | null
/** 车辆证书:按主车/挂车加前缀 */
showVehiclePart?: boolean
/** KeepAlive 离开页时置 false,暂停缩略图请求 */
mediaActive?: boolean
}>(),
{
certList: () => [],
showVehiclePart: false,
mediaActive: true
}
)
urls.forEach((url, urlIndex) => {
result.push({
key: `${cert.id || cert.certId || certIndex}-${urlIndex}`,
label,
fullLabel,
url,
categoryLabels: { [url]: label }
type ItemDef = {
key: string
label: string
fullLabel: string
url: string
isImage: boolean
ext: string
}
function parseUrls(raw?: string | null): string[] {
const normalized = normalizeAttachmentUrls(raw)
if (!normalized) return []
return normalized
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
function partPrefix(cert: CertRead, enablePart: boolean): string {
if (!enablePart) return ''
return normalizeVehicleCertPart(cert.vehiclePart) === PL_VEHICLE_CERT_PART_TRAILER
? '挂·'
: '主·'
}
function isImageUrl(url: string) {
const path = String(url || '')
.split('?')[0]
.toLowerCase()
return /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(path)
}
function getFileExt(url: string) {
const name =
String(url || '')
.split('?')[0]
.split('/')
.pop() || ''
const lastDot = name.lastIndexOf('.')
if (lastDot === -1) return ''
return name.slice(lastDot + 1).toUpperCase()
}
function displaySrc(url: string) {
if (!props.mediaActive) return ''
return resolvePhotoDisplayUrl(url)
}
const items = computed<ItemDef[]>(() => {
const certs = props.certList || []
if (!certs.length) return []
const enablePart =
props.showVehiclePart &&
certs.some(
(cert) => normalizeVehicleCertPart(cert.vehiclePart) === PL_VEHICLE_CERT_PART_TRAILER
)
const result: ItemDef[] = []
certs.forEach((cert, certIndex) => {
const certName = String(cert.certName || '').trim() || '证书'
const prefix = partPrefix(cert, enablePart)
const fullLabel = `${prefix}${certName}`
const label = fullLabel.length > 6 ? `${fullLabel.slice(0, 5)}…` : fullLabel
const urls = parseUrls(cert.attachmentUrls)
if (!urls.length) {
result.push({
key: `${cert.id || cert.certId || certIndex}-empty`,
label,
fullLabel,
url: '',
isImage: false,
ext: ''
})
return
}
urls.forEach((url, urlIndex) => {
result.push({
key: `${cert.id || cert.certId || certIndex}-${urlIndex}`,
label,
fullLabel,
url,
isImage: isImageUrl(url),
ext: getFileExt(url)
})
})
})
return result
})
return result
})
</script>
<style scoped lang="scss">
.pl-cert-list-attachment-cell {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
}
.pl-cert-list-attachment-cell {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
}
.pl-cert-list-attachment-cell__item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-cert-list-attachment-cell__item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-cert-list-attachment-cell__empty {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px dashed var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 12px;
}
.pl-cert-list-attachment-cell__thumb,
.pl-cert-list-attachment-cell__empty {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px solid var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
}
.pl-cert-list-attachment-cell__empty-text {
margin-bottom: 14px;
font-size: 11px;
line-height: 1.3;
}
.pl-cert-list-attachment-cell__empty {
border-style: dashed;
color: var(--mint-text);
font-size: 12px;
}
.pl-cert-list-attachment-cell__caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-cert-list-attachment-cell__image {
width: 100%;
height: 100%;
cursor: pointer;
}
.pl-cert-list-attachment-cell__none {
color: var(--mint-text);
}
.pl-cert-list-attachment-cell__placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
width: 100%;
height: 100%;
margin-bottom: 14px;
}
:deep(.attachment-upload) {
width: 100%;
}
.pl-cert-list-attachment-cell__ext {
font-size: 10px;
line-height: 1.2;
color: #64748b;
}
:deep(.attachment-list) {
flex-wrap: nowrap;
}
.pl-cert-list-attachment-cell__empty-text {
margin-bottom: 14px;
font-size: 11px;
line-height: 1.3;
}
:deep(.attachment-item) {
width: 96px;
margin-bottom: 0;
}
.pl-cert-list-attachment-cell__caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
:deep(.attachment-preview) {
height: 56px;
}
:deep(.attachment-footer) {
display: none;
}
.pl-cert-list-attachment-cell__none {
color: var(--mint-text);
}
</style>
@@ -61,12 +61,6 @@
{{ row.model || row.productModel || '—' }}
</template>
</el-table-column>
<el-table-column prop="categoryName" label="产品分类" min-width="110" show-overflow-tooltip />
<el-table-column label="税率(%)" min-width="90" align="center">
<template #default="{ row }">
{{ row.taxRate != null ? `${row.taxRate}%` : '—' }}
</template>
</el-table-column>
<el-table-column label="单位" min-width="80" align="center">
<template #default="{ row }">
<DictTag dict-type="crm_product_unit" :value="row.unit" />
@@ -51,7 +51,7 @@
<section class="pl-plan-form-section">
<h3 class="pl-plan-form-section-title">基础信息</h3>
<el-form ref="basicFormRef" :model="formData" :rules="basicRules" label-position="right" label-width="100px" class="pl-dialog-form">
<div class="form-grid-4">
<div class="form-grid-5">
<el-form-item label="创建日期" prop="createDate">
<el-date-picker
v-model="formData.createDate"
@@ -28,8 +28,14 @@
class="pl-plan-list-cert-cell__cert-text"
>
{{ slot.label }}(<span
:class="{ 'pl-plan-list-cert-cell__cert-status--missing': !isProductCertSlotFilled(product, slot.key) }"
>{{ isProductCertSlotFilled(product, slot.key) ? '有' : '无' }}</span>)
:class="{
'pl-plan-list-cert-cell__cert-status--missing': !isProductCertSlotFilled(
product,
slot.key
)
}"
>{{ isProductCertSlotFilled(product, slot.key) ? '有' : '无' }}</span
>)
</span>
</div>
<div
@@ -56,8 +62,10 @@
<template v-if="getProductCertUrl(product, slot.key)">
<img
v-if="isCertImageUrl(getProductCertUrl(product, slot.key))"
:src="resolveCertFileUrl(getProductCertUrl(product, slot.key))"
:src="displayCertSrc(getProductCertUrl(product, slot.key))"
:alt="slot.label"
loading="lazy"
decoding="async"
/>
<div
v-else
@@ -85,11 +93,40 @@
:key="slot.key"
class="pl-plan-list-cert-cell__cert-item"
>
<AttachmentUploadField
<div
v-if="getProductCertUrl(product, slot.key)"
:model-value="getProductCertUrl(product, slot.key)"
disabled
/>
class="pl-plan-list-cert-cell__thumb pl-plan-list-cert-cell__thumb--filled"
>
<el-image
v-if="isCertImageUrl(getProductCertUrl(product, slot.key))"
class="pl-plan-list-cert-cell__image"
fit="cover"
lazy
:src="displayCertSrc(getProductCertUrl(product, slot.key))"
:preview-src-list="
mediaActive ? [resolveCertFileUrl(getProductCertUrl(product, slot.key))] : []
"
preview-teleported
hide-on-click-modal
>
<template #error>
<div class="pl-plan-list-cert-cell__thumb-icon">
<el-icon :size="20"><Document /></el-icon>
</div>
</template>
</el-image>
<div
v-else
class="pl-plan-list-cert-cell__thumb-icon"
:class="
isCertPdfUrl(getProductCertUrl(product, slot.key))
? 'pl-plan-list-cert-cell__thumb-icon--pdf'
: 'pl-plan-list-cert-cell__thumb-icon--doc'
"
>
<el-icon :size="20"><Document /></el-icon>
</div>
</div>
<span v-else class="pl-plan-list-cert-cell__missing">未上传</span>
<span class="pl-plan-list-cert-cell__cert-label">{{ slot.label }}</span>
</div>
@@ -100,277 +137,276 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { Document, Upload } from '@element-plus/icons-vue'
import type { PlanProduct } from '@/api/pl'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import {
getProductCertUrl,
getRequiredCertSlots,
isHazardProduct,
isProductCertSlotFilled
} from '@/composables/usePlToxicProductCertCheck'
import { computed } from 'vue'
import { Document, Upload } from '@element-plus/icons-vue'
import type { PlanProduct } from '@/api/pl'
import {
getProductCertUrl,
getRequiredCertSlots,
isHazardProduct,
isProductCertSlotFilled
} from '@/composables/usePlToxicProductCertCheck'
const props = withDefaults(
defineProps<{
products?: PlanProduct[]
/** 列表紧凑模式:文字展示证书有无,不显示缩略图 */
compact?: boolean
/** 隐藏产品名称行(产品信息由独立列展示时使用) */
hideProduct?: boolean
/** 缩略图模式,点击触发上传 */
clickable?: boolean
/** 禁止点击上传(仍展示缩略图) */
clickableDisabled?: boolean
/** 危化标签短文案:毒 / 爆 */
shortHazardTag?: boolean
}>(),
{
products: () => [],
compact: false,
hideProduct: false,
clickable: false,
clickableDisabled: false,
shortHazardTag: false
const props = withDefaults(
defineProps<{
products?: PlanProduct[]
/** 列表紧凑模式:文字展示证书有无,不显示缩略图 */
compact?: boolean
/** 隐藏产品名称行(产品信息由独立列展示时使用) */
hideProduct?: boolean
/** 缩略图模式,点击触发上传 */
clickable?: boolean
/** 禁止点击上传(仍展示缩略图) */
clickableDisabled?: boolean
/** 危化标签短文案:毒 / 爆 */
shortHazardTag?: boolean
/** KeepAlive 离开页时置 false,暂停缩略图请求 */
mediaActive?: boolean
}>(),
{
products: () => [],
compact: false,
hideProduct: false,
clickable: false,
clickableDisabled: false,
shortHazardTag: false,
mediaActive: true
}
)
const emit = defineEmits<{
click: []
}>()
const useShortHazardTag = computed(() => props.compact || props.shortHazardTag)
const hazardProducts = computed(() =>
(props.products || []).filter((product) => isHazardProduct(product))
)
function resolveCertFileUrl(url: string) {
const trimmed = String(url || '').trim()
if (!trimmed) return ''
if (/^https?:\/\//i.test(trimmed)) return trimmed
const base = String(import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
return base ? `${base}/${trimmed.replace(/^\//, '')}` : trimmed
}
)
const emit = defineEmits<{
click: []
}>()
function displayCertSrc(url: string) {
if (!props.mediaActive) return ''
return resolveCertFileUrl(url)
}
const useShortHazardTag = computed(() => props.compact || props.shortHazardTag)
function getCertFileName(url: string) {
return (
String(url || '')
.trim()
.split('/')
.pop() || ''
)
}
const hazardProducts = computed(() => (props.products || []).filter(product => isHazardProduct(product)))
function isCertImageUrl(url: string) {
const name = getCertFileName(url).toLowerCase()
return /\.(png|jpe?g|gif|webp|bmp|svg)(\?|$)/i.test(name)
}
function resolveCertFileUrl(url: string) {
const trimmed = String(url || '').trim()
if (!trimmed) return ''
if (/^https?:\/\//i.test(trimmed)) return trimmed
const base = String(import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
return base ? `${base}/${trimmed.replace(/^\//, '')}` : trimmed
}
function isCertPdfUrl(url: string) {
const name = getCertFileName(url).toLowerCase()
const normalized = String(url || '').toLowerCase()
return /\.pdf(\?|$)/i.test(name) || /\.pdf(\?|$)/i.test(normalized)
}
function getCertFileName(url: string) {
return String(url || '').trim().split('/').pop() || ''
}
function isCertImageUrl(url: string) {
const name = getCertFileName(url).toLowerCase()
return /\.(png|jpe?g|gif|webp|bmp|svg)(\?|$)/i.test(name)
}
function isCertPdfUrl(url: string) {
const name = getCertFileName(url).toLowerCase()
const normalized = String(url || '').toLowerCase()
return /\.pdf(\?|$)/i.test(name) || /\.pdf(\?|$)/i.test(normalized)
}
function handleCertClick() {
if (props.clickableDisabled) return
emit('click')
}
function handleCertClick() {
if (props.clickableDisabled) return
emit('click')
}
</script>
<style scoped lang="scss">
.pl-plan-list-cert-cell {
display: flex;
flex-direction: column;
gap: 10px;
}
.pl-plan-list-cert-cell__group {
display: flex;
flex-direction: column;
gap: 6px;
}
.pl-plan-list-cert-cell__product {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.pl-plan-list-cert-cell__name {
font-size: 13px;
font-weight: 600;
color: var(--text, #1e293b);
}
.pl-plan-list-cert-cell__certs {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
}
.pl-plan-list-cert-cell__cert-item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-plan-list-cert-cell__cert-label {
color: var(--mint-text);
font-size: 12px;
line-height: 1.4;
text-align: center;
}
.pl-plan-list-cert-cell__missing {
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
border: 1px dashed var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 12px;
}
.pl-plan-list-cert-cell__certs--clickable {
.pl-plan-list-cert-cell__cert-item {
cursor: pointer;
&:hover:not(.is-disabled) .pl-plan-list-cert-cell__thumb {
border-color: var(--primary, #10b981);
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}
&.is-disabled {
cursor: not-allowed;
opacity: 0.72;
}
.pl-plan-list-cert-cell {
display: flex;
flex-direction: column;
gap: 10px;
}
}
.pl-plan-list-cert-cell__thumb {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px solid var(--border, #d9e8e2);
border-radius: 8px;
background: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.pl-plan-list-cert-cell__thumb--filled {
align-items: stretch;
}
.pl-plan-list-cert-cell__cert-caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-plan-list-cert-cell__thumb--empty {
flex-direction: column;
gap: 2px;
border-style: dashed;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 11px;
}
.pl-plan-list-cert-cell__upload-hint {
max-width: 88px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-plan-list-cert-cell__thumb-icon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: #64748b;
}
.pl-plan-list-cert-cell__thumb-icon--pdf {
color: #dc2626;
}
.pl-plan-list-cert-cell__thumb-icon--doc {
color: #2563eb;
}
.pl-plan-list-cert-cell__empty {
color: var(--mint-text);
}
:deep(.attachment-upload) {
width: 100%;
}
:deep(.attachment-list) {
flex-wrap: nowrap;
}
:deep(.attachment-item) {
width: 96px;
margin-bottom: 0;
}
:deep(.attachment-preview) {
height: 56px;
}
:deep(.attachment-footer) {
display: none;
}
.pl-plan-list-cert-cell--compact {
gap: 6px;
.pl-plan-list-cert-cell__group {
display: flex;
flex-direction: column;
gap: 6px;
}
.pl-plan-list-cert-cell__product {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.pl-plan-list-cert-cell__name {
font-size: 12px;
font-size: 13px;
font-weight: 600;
color: var(--text, #1e293b);
}
.pl-plan-list-cert-cell__certs--text {
flex-direction: row;
.pl-plan-list-cert-cell__certs {
display: flex;
align-items: flex-start;
gap: 12px;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.pl-plan-list-cert-cell__cert-text {
.pl-plan-list-cert-cell__cert-item {
display: flex;
flex-direction: column;
align-items: center;
width: 96px;
}
.pl-plan-list-cert-cell__cert-label {
color: var(--mint-text);
font-size: 12px;
line-height: 1.4;
white-space: nowrap;
text-align: center;
}
.pl-plan-list-cert-cell__cert-status--missing {
color: var(--danger, #dc2626);
font-weight: 500;
.pl-plan-list-cert-cell__missing {
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
border: 1px dashed var(--border, #d9e8e2);
border-radius: 8px;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 12px;
}
.pl-plan-list-cert-cell__certs--clickable {
.pl-plan-list-cert-cell__cert-item {
cursor: pointer;
&:hover:not(.is-disabled) .pl-plan-list-cert-cell__thumb {
border-color: var(--primary, #10b981);
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}
&.is-disabled {
cursor: not-allowed;
opacity: 0.72;
}
}
}
.pl-plan-list-cert-cell__thumb {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 56px;
overflow: hidden;
border: 1px solid var(--border, #d9e8e2);
border-radius: 8px;
background: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.pl-plan-list-cert-cell__thumb--filled {
align-items: stretch;
}
.pl-plan-list-cert-cell__cert-caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 2px 4px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 11px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-plan-list-cert-cell__thumb--empty {
flex-direction: column;
gap: 2px;
border-style: dashed;
background: var(--table-head, #f8fafc);
color: var(--mint-text);
font-size: 11px;
}
.pl-plan-list-cert-cell__upload-hint {
max-width: 88px;
line-height: 1.3;
text-align: center;
word-break: keep-all;
}
.pl-plan-list-cert-cell__thumb-icon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: #64748b;
}
.pl-plan-list-cert-cell__thumb-icon--pdf {
color: #dc2626;
}
.pl-plan-list-cert-cell__thumb-icon--doc {
color: #2563eb;
}
.pl-plan-list-cert-cell__empty {
color: var(--mint-text);
}
.pl-plan-list-cert-cell__image {
width: 100%;
height: 100%;
cursor: pointer;
}
.pl-plan-list-cert-cell--compact {
gap: 6px;
.pl-plan-list-cert-cell__group {
gap: 4px;
}
.pl-plan-list-cert-cell__name {
font-size: 12px;
}
.pl-plan-list-cert-cell__certs--text {
flex-direction: row;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.pl-plan-list-cert-cell__cert-text {
color: var(--mint-text);
font-size: 12px;
line-height: 1.4;
white-space: nowrap;
}
.pl-plan-list-cert-cell__cert-status--missing {
color: var(--danger, #dc2626);
font-weight: 500;
}
}
}
</style>
@@ -181,6 +181,9 @@ function getHazardFlags(product: PlanProduct) {
.pl-plan-list-product-cell__text {
min-width: 0;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.pl-plan-list-product-cell__mark {
@@ -128,6 +128,12 @@
</script>
<style scoped lang="scss">
/* 避免 Element Plus 默认灰底(--el-text-color-disabled)透过 SVG 镂空形成「蒙层」 */
:deep(.el-avatar) {
--el-avatar-bg-color: #e2e8f0;
background: #e2e8f0;
}
.user-avatar-wrapper {
display: inline-flex;
flex-shrink: 0;
@@ -0,0 +1,20 @@
import { onActivated, onBeforeUnmount, onDeactivated, ref } from 'vue'
/**
* KeepAlive 列表页缩略图加载开关:离开页暂停请求,避免阻塞菜单切换。
*/
export function useListMediaActive() {
const mediaActive = ref(true)
onActivated(() => {
mediaActive.value = true
})
onDeactivated(() => {
mediaActive.value = false
})
onBeforeUnmount(() => {
mediaActive.value = false
})
return { mediaActive }
}
+2 -2
View File
@@ -1,5 +1,5 @@
/** 未设置头像时使用 `public/favicon.svg`(根路径 `/favicon.svg`) */
export const DEFAULT_USER_AVATAR_URL = '/favicon.svg'
/** 未设置头像时使用 `public/avatar.svg`(根路径 `/avatar.svg`) */
export const DEFAULT_USER_AVATAR_URL = '/avatar.svg'
/** @deprecated 各角色默认已统一为默认头像图,保留参数仅为兼容旧调用 */
export function defaultAvatarPathByRole(_role: string | undefined): string {
+10 -7
View File
@@ -223,9 +223,11 @@
<el-table-column
prop="clueName"
label="线索姓名"
min-width="120"
align="center"
header-align="center"
min-width="140"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
fixed="left"
>
<template #default="{ row }">
@@ -236,10 +238,11 @@
v-if="isColumnVisible('company')"
prop="company"
label="公司名称"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('customerType')"
@@ -131,10 +131,11 @@
v-if="isColumnVisible('contractName')"
prop="contractName"
label="合同名称"
min-width="200"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="审批级别" v-if="isColumnVisible('step')" min-width="100" align="center" header-align="center">
<template #default="{ row }">第{{ row.step }}级</template>
@@ -180,10 +180,11 @@
v-if="isColumnVisible('contractName')"
prop="contractName"
label="合同名称"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="变更类型" v-if="isColumnVisible('changeType')" min-width="120" align="center" header-align="center">
<template #default="{ row }">
@@ -70,7 +70,15 @@
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column type="index" label="序号" min-width="60" align="center" header-align="center" />
<el-table-column label="产品编号" prop="productNo" min-width="140" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column label="产品名称" prop="productName" min-width="180" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column
label="产品名称"
prop="productName"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="产品分类" prop="categoryName" min-width="120" align="center" header-align="center" />
<el-table-column label="规格型号" prop="model" min-width="120" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" prop="unit" min-width="100" align="center" header-align="center">
+23 -5
View File
@@ -193,7 +193,15 @@
<div class="contract-product-expand" v-loading="expandLoadingMap[String(scope.row.id)]">
<el-table :data="scope.row.products || []" stripe class="list-table">
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="产品名称" prop="productName" min-width="120" :show-overflow-tooltip="true" />
<el-table-column
label="产品名称"
prop="productName"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="型号/规格" prop="model" min-width="130" :show-overflow-tooltip="true">
<template #default="productScope">
<span>{{ productScope.row.model || productScope.row.productModel || '-' }}</span>
@@ -247,7 +255,15 @@
</el-table-column>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="合同编号" align="center" prop="contractNo" min-width="170" show-overflow-tooltip />
<el-table-column label="合同名称" prop="contractName" show-overflow-tooltip min-width="280">
<el-table-column
label="合同名称"
prop="contractName"
min-width="280"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="scope">
<el-link type="primary" @click="handleView(scope.row)">{{ scope.row.contractName }}</el-link>
</template>
@@ -255,10 +271,12 @@
<el-table-column
v-if="isColumnVisible('customerName')"
label="客户名称"
align="center"
align="left"
header-align="left"
prop="customerName"
min-width="180"
show-overflow-tooltip
min-width="240"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column v-if="isColumnVisible('contactName')" label="联系人" align="center" prop="contactName" min-width="100" show-overflow-tooltip />
<el-table-column v-if="isColumnVisible('contactMobile')" label="联系人手机" align="center" prop="contactMobile" min-width="120" />
@@ -224,10 +224,11 @@
<el-table-column
label="商机名称"
prop="opportunityName"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click="handleViewOpportunity(row.id)">
@@ -292,10 +293,11 @@
<el-table-column
label="合同名称"
prop="contractName"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click="handleViewContract(row.id)">
+10 -8
View File
@@ -208,10 +208,11 @@
<el-table-column
prop="customerName"
label="客户名称"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click="handleView(row)">{{ row.customerName }}</el-link>
@@ -221,10 +222,11 @@
v-if="isColumnVisible('shortName')"
prop="shortName"
label="客户简称"
min-width="150"
align="center"
header-align="center"
show-overflow-tooltip
min-width="180"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('customerType')"
@@ -118,10 +118,11 @@
<el-table-column
prop="customerName"
label="客户名称"
min-width="180"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click="handleView(row)">{{ row.customerName }}</el-link>
@@ -131,10 +132,11 @@
v-if="isColumnVisible('shortName')"
prop="shortName"
label="客户简称"
min-width="150"
align="center"
header-align="center"
show-overflow-tooltip
min-width="180"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('customerType')"
+10 -7
View File
@@ -181,11 +181,12 @@
/>
<el-table-column
label="商机名称"
align="center"
header-align="center"
align="left"
header-align="left"
prop="opportunityName"
min-width="200"
show-overflow-tooltip
min-width="240"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click="handleDetail(row)">{{ row.opportunityName }}</el-link>
@@ -194,10 +195,12 @@
<el-table-column
v-if="isColumnVisible('customerName')"
label="客户名称"
align="center"
align="left"
header-align="left"
prop="customerName"
min-width="150"
show-overflow-tooltip
min-width="240"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('contactName')"
@@ -103,8 +103,24 @@
<div class="list-body list-wrap">
<el-table class="list-table" :data="topAmountList" stripe max-height="400">
<el-table-column type="index" label="排名" min-width="70" align="center" />
<el-table-column prop="opportunityName" label="商机名称" min-width="160" show-overflow-tooltip align="center" />
<el-table-column prop="customerName" label="客户名称" min-width="120" show-overflow-tooltip align="center" />
<el-table-column
prop="opportunityName"
label="商机名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
prop="customerName"
label="客户名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column prop="amount" label="预估金额" min-width="120" align="right" class-name="col-money">
<template #default="scope">¥{{ formatMoney(scope.row.amount) }}</template>
</el-table-column>
@@ -119,8 +135,24 @@
<div class="list-body list-wrap">
<el-table class="list-table" :data="topFollowList" stripe max-height="400">
<el-table-column type="index" label="排名" min-width="70" align="center" />
<el-table-column prop="opportunityName" label="商机名称" min-width="160" show-overflow-tooltip align="center" />
<el-table-column prop="customerName" label="客户名称" min-width="120" show-overflow-tooltip align="center" />
<el-table-column
prop="opportunityName"
label="商机名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
prop="customerName"
label="客户名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column prop="followCount" label="跟进次数" min-width="100" align="center">
<template #default="scope">
<el-tag type="warning" size="small">{{ scope.row.followCount }}次</el-tag>
@@ -159,10 +159,11 @@
v-if="isColumnVisible('customerName')"
prop="customerName"
label="供应商/客户"
min-width="160"
min-width="240"
align="left"
header-align="center"
show-overflow-tooltip
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<el-link type="primary" @click.stop="handleView(row)">{{ row.customerName || '-' }}</el-link>
@@ -172,10 +173,11 @@
v-if="isColumnVisible('productName')"
prop="productName"
label="产品名称"
min-width="140"
min-width="240"
align="left"
header-align="center"
show-overflow-tooltip
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('letterType')"
+11 -9
View File
@@ -154,9 +154,11 @@
<el-table-column
prop="productName"
label="产品名称"
min-width="200"
align="center"
header-align="center"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<div class="product-name-cell">
@@ -664,7 +666,7 @@ const pagination = reactive({ page: 1, pageSize: 20, total: 0 })
const searchForm = reactive({
keyword: '',
categoryId: '',
status: '',
status: 'on',
})
const quickSearchKeyword = ref('')
@@ -819,7 +821,7 @@ function handlePageChange() {
function handleReset() {
searchForm.keyword = ''
searchForm.categoryId = ''
searchForm.status = ''
searchForm.status = 'on'
quickSearchKeyword.value = ''
pagination.page = 1
getList()
@@ -1146,7 +1148,7 @@ onMounted(() => {
.product-name-cell {
display: inline-flex;
align-items: center;
justify-content: center;
justify-content: flex-start;
flex-wrap: wrap;
gap: 6px;
max-width: 100%;
@@ -1154,9 +1156,9 @@ onMounted(() => {
.product-name-cell .el-link {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.product-hazard-tag {
@@ -70,7 +70,15 @@
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column type="index" label="序号" min-width="60" align="center" header-align="center" />
<el-table-column label="产品编号" prop="productNo" min-width="140" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column label="产品名称" prop="productName" min-width="180" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column
label="产品名称"
prop="productName"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="产品分类" prop="categoryName" min-width="120" align="center" header-align="center" />
<el-table-column label="规格型号" prop="model" min-width="120" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" prop="unit" min-width="100" align="center" header-align="center">
+28 -9
View File
@@ -163,7 +163,15 @@
<div class="quote-product-expand" v-loading="expandLoadingMap[String(scope.row.id)]">
<el-table :data="scope.row.productList || []" stripe class="list-table">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="产品名称" prop="productName" min-width="120" align="center" header-align="center" :show-overflow-tooltip="true" />
<el-table-column
label="产品名称"
prop="productName"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="型号/规格" prop="model" min-width="130" align="center" header-align="center" :show-overflow-tooltip="true">
<template #default="productScope">
<span>{{ productScope.row.model || '-' }}</span>
@@ -219,7 +227,15 @@
</el-table-column>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="报价单号" align="center" prop="quoteNo" min-width="150" show-overflow-tooltip />
<el-table-column label="报价主题" prop="quoteTitle" show-overflow-tooltip min-width="260" align="center" header-align="center">
<el-table-column
label="报价主题"
prop="quoteTitle"
min-width="260"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="scope">
<el-link type="primary" @click="handleView(scope.row)">{{ scope.row.quoteTitle }}</el-link>
</template>
@@ -234,19 +250,22 @@
<el-table-column
v-if="isColumnVisible('customerName')"
label="客户名称"
align="center"
header-align="center"
align="left"
header-align="left"
prop="customerName"
min-width="180"
show-overflow-tooltip
min-width="240"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('opportunityName')"
label="商机名称"
align="center"
align="left"
header-align="left"
prop="opportunityName"
min-width="180"
show-overflow-tooltip
min-width="240"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column v-if="isColumnVisible('contactName')" label="联系人" align="center" prop="contactName" min-width="100" show-overflow-tooltip />
<el-table-column v-if="isColumnVisible('contactMobile')" label="联系人手机" align="center" prop="contactMobile" min-width="120" />
+10 -4
View File
@@ -196,8 +196,11 @@
v-if="isColumnVisible('partnerCompany')"
prop="partnerCompany"
label="往来单位"
min-width="150"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
sortable="custom"
:sort-order="getSortOrder('partnerCompany')"
/>
@@ -233,8 +236,11 @@
v-if="isColumnVisible('product')"
prop="product"
label="产品"
min-width="120"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
sortable="custom"
:sort-order="getSortOrder('product')"
/>
+5 -4
View File
@@ -177,10 +177,11 @@
v-if="isColumnVisible('customerName')"
prop="customerName"
label="往来单位"
min-width="150"
align="center"
header-align="center"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('startDate')"
+4 -1
View File
@@ -131,8 +131,9 @@
<template #default="{ row }">
<el-image
v-if="row.imageUrl"
:src="row.imageUrl"
:src="mediaActive ? row.imageUrl : ''"
fit="cover"
lazy
style="width: 40px; height: 40px; border-radius: 6px"
/>
<span v-else>-</span>
@@ -528,6 +529,7 @@
<script setup lang="ts">
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import { useListMediaActive } from '@/composables/useListMediaActive'
/* eslint-disable vue/no-v-model-argument */
import { ref, reactive, onMounted, nextTick, watch, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -568,6 +570,7 @@ import ListToolbarEndActions from '@/components/business/list-toolbar-end-action
const tableData = ref<any[]>([])
const selectedRows = ref<any[]>([])
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const pagination = reactive({ page: 1, pageSize: 100, total: 0 })
const categoryList = ref<any[]>([])
const parentCategoryList = ref<any[]>([])
+13 -2
View File
@@ -135,8 +135,9 @@
<div class="expand-product-thumb-wrap">
<el-image
v-if="line.imageUrl"
:src="line.imageUrl"
:src="mediaActive ? line.imageUrl : ''"
fit="cover"
lazy
class="expand-product-thumb"
/>
<span v-else class="expand-product-thumb placeholder">无图</span>
@@ -200,7 +201,15 @@
<el-link type="primary" @click="handleView(row)">{{ row.orderNo }}</el-link>
</template>
</el-table-column>
<el-table-column prop="clientName" label="客户名称" min-width="150" />
<el-table-column
prop="clientName"
label="客户名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column prop="regionName" label="区域" min-width="100" />
<el-table-column prop="supplierTotalAmount" label="供货总金额(元)" min-width="140">
<template #default="{ row }">
@@ -1688,6 +1697,7 @@
import { useRoute, useRouter } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
import { useListMediaActive } from '@/composables/useListMediaActive'
import {
Check,
Close,
@@ -1774,6 +1784,7 @@
const expandedRowLoadingMap = ref<Record<string, boolean>>({})
const tableData = ref<any[]>([])
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const selectedRows = ref<any[]>([])
const pagination = reactive({ page: 1, pageSize: 20, total: 0 })
const regionList = ref<any[]>([])
+3 -1
View File
@@ -112,7 +112,7 @@
<div class="product-cell-thumb">
<el-image
v-if="row.imageUrl"
:src="row.imageUrl"
:src="mediaActive ? row.imageUrl : ''"
fit="cover"
lazy
class="product-cell-img"
@@ -908,6 +908,7 @@
<script setup lang="ts">
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import { useListMediaActive } from '@/composables/useListMediaActive'
import { ref, reactive, onMounted, computed, watch, nextTick } from 'vue'
import {
ElMessage,
@@ -1061,6 +1062,7 @@ import ListToolbarEndActions from '@/components/business/list-toolbar-end-action
}
}
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const productFormContainerRef = ref<HTMLElement | null>(null)
// 分页
@@ -101,7 +101,15 @@
</template>
</el-table-column>
<el-table-column prop="planNo" label="计划号" min-width="140" show-overflow-tooltip />
<el-table-column prop="partnerCompany" label="往来单位" min-width="160" show-overflow-tooltip />
<el-table-column
prop="partnerCompany"
label="往来单位"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column prop="vehicleNo" label="车牌" min-width="110" align="center" />
<el-table-column
prop="pickupAddress"
@@ -114,7 +122,14 @@
{{ row.destinationAddress || row.destinationName || '—' }}
</template>
</el-table-column>
<el-table-column label="产品名称" min-width="140" show-overflow-tooltip>
<el-table-column
label="产品名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<div v-if="row.items?.length" class="io-order-multi-cell">
<div v-for="item in row.items" :key="`${item.id}-name`" class="io-order-multi-cell__line">
@@ -307,7 +322,15 @@
header-align="center"
/>
<el-table-column prop="productNo" label="产品编号" min-width="110" show-overflow-tooltip />
<el-table-column prop="productName" label="产品名称" min-width="120" show-overflow-tooltip />
<el-table-column
prop="productName"
label="产品名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column label="品牌" min-width="120" show-overflow-tooltip>
<template #default="{ row }">
{{ brandConstraintLabel(row) }}
+3 -1
View File
@@ -134,7 +134,7 @@
header-align="left"
>
<template #default="{ row }">
<PlCarrierListAttachmentCell :carrier="row" />
<PlCarrierListAttachmentCell :carrier="row" :media-active="mediaActive" />
</template>
</el-table-column>
<el-table-column
@@ -327,10 +327,12 @@ import ListToolbarEndActions from '@/components/business/list-toolbar-end-action
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListMediaActive } from '@/composables/useListMediaActive'
import { pickBxPageResult } from '@/utils/http/bx'
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
import { canDeleteByCreator, filterDeletableByCreator, allRowsDeletableByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const quickSearchKeyword = ref('')
const listColumnDefs = [
+9 -1
View File
@@ -70,7 +70,15 @@
header-align="center"
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
/>
<el-table-column prop="productName" label="产品名称" min-width="180" show-overflow-tooltip />
<el-table-column
prop="productName"
label="产品名称"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('brandName')"
label="品牌"
+6 -2
View File
@@ -116,8 +116,10 @@
<img
v-if="firstPhotoUrl(row.photoUrls)"
class="pl-photo-thumb"
:src="resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls))"
:src="mediaActive ? resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls)) : ''"
alt="人员照片"
loading="lazy"
decoding="async"
/>
<span v-else class="pl-photo-thumb pl-photo-thumb--empty">未上传</span>
</template>
@@ -147,7 +149,7 @@
header-align="left"
>
<template #default="{ row }">
<PlCertListAttachmentCell :cert-list="row.certList" />
<PlCertListAttachmentCell :cert-list="row.certList" :media-active="mediaActive" />
</template>
</el-table-column>
<el-table-column
@@ -418,6 +420,7 @@ import ListToolbarEndActions from '@/components/business/list-toolbar-end-action
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListMediaActive } from '@/composables/useListMediaActive'
import { pickBxPageResult } from '@/utils/http/bx'
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
import { formatDateTime } from '@/utils/format'
@@ -449,6 +452,7 @@ const affiliationMode = computed(() =>
const isCarrierPersonnel = computed(() => affiliationMode.value === 'carrier')
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const listColumnDefs = [
{ prop: 'photoUrls', label: '照片' },
@@ -186,15 +186,20 @@
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="180"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
min-width="200"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="name" />
+11 -3
View File
@@ -182,9 +182,11 @@
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
min-width="200"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="name" />
@@ -231,6 +233,7 @@
hide-product
clickable
:clickable-disabled="!canUploadCert(row)"
:media-active="mediaActive"
@click="handleUploadCert(row)"
/>
</template>
@@ -239,8 +242,11 @@
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="180"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('planType')"
@@ -397,6 +403,7 @@ import PlPlanTypeTabs from '@/components/business/pl-plan-type-tabs/index.vue'
import ListToolbarDateShortcuts from '@/components/core/list-toolbar-date-shortcuts/index.vue'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListDateShortcut } from '@/composables/useListDateShortcut'
import { useListMediaActive } from '@/composables/useListMediaActive'
import {
formatPlVehiclePlateDisplay,
getPlPlanFollowStatusLabel,
@@ -412,6 +419,7 @@ import { useMenuStore } from '@/store/modules/menu'
const menuStore = useMenuStore()
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const certReadyLoading = ref(false)
const viewDialogRef = ref<InstanceType<typeof PlPlanViewDialog>>()
const viewVisible = ref(false)
+8 -47
View File
@@ -81,13 +81,6 @@
<el-button class="btn-main" type="primary" @click="handleAdd">
<el-icon><Plus /></el-icon>新增计划
</el-button>
<el-button
class="btn-ghost"
:disabled="!selectedPlan || !canEditPlan(selectedPlan)"
@click="handleToolbarEdit"
>
<el-icon><Edit /></el-icon>编辑
</el-button>
<el-button
class="btn-ghost"
:disabled="!selectedPlan || !canArrangeTransport(selectedPlan)"
@@ -104,14 +97,6 @@
>
<el-icon><Bell /></el-icon>等客户通知
</el-button>
<el-button
class="btn-ghost"
:disabled="!selectedPlan || !canCancelWaitNotice(selectedPlan)"
:loading="waitNoticeLoading"
@click="handleToolbarCancelWaitNotice"
>
<el-icon><RefreshLeft /></el-icon>取消等通知
</el-button>
<el-dropdown
trigger="click"
:disabled="selectedRows.length < 1"
@@ -153,20 +138,6 @@
>
<el-icon><CircleClose /></el-icon>作废
</el-button>
<el-button
class="btn-ghost"
type="danger"
:disabled="
!selectedPlan ||
!canDeletePlan(selectedPlan) ||
!canDeleteByCreator(selectedPlan)
"
:title="selectedPlan ? getDeletePlanDisabledTitle(selectedPlan) : ''"
:loading="deleteLoading"
@click="handleToolbarDelete"
>
<el-icon><Delete /></el-icon>删除
</el-button>
<ListToolbarEndActions
:loading="loading"
@@ -242,15 +213,20 @@
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="180"
show-overflow-tooltip
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
/>
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
min-width="200"
min-width="240"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="name" />
@@ -821,11 +797,6 @@ function handleToolbarWaitNotice() {
handleWaitNotice(selectedPlan.value)
}
function handleToolbarCancelWaitNotice() {
if (!selectedPlan.value) return
handleCancelWaitNotice(selectedPlan.value)
}
async function handleDelete(row: Plan) {
if (!canDeletePlan(row)) {
ElMessage.warning('只能删除待安排或等通知且未安排运输的计划')
@@ -921,11 +892,6 @@ function handleToolbarPrintSlip(command: string) {
subpackSlipPrintRef.value?.open(ids)
}
function handleToolbarEdit() {
if (selectedRows.value.length !== 1) return
handleEdit(selectedRows.value[0])
}
async function handleToolbarArrange() {
if (selectedRows.value.length !== 1) return
await handleArrange(selectedRows.value[0])
@@ -936,11 +902,6 @@ function handleToolbarVoid() {
handleVoid(selectedRows.value[0])
}
function handleToolbarDelete() {
if (selectedRows.value.length !== 1) return
handleDelete(selectedRows.value[0])
}
useDbInstantSearch(
() => ({
planNo: searchForm.planNo,
+11 -2
View File
@@ -118,8 +118,10 @@
<img
v-if="firstPhotoUrl(row.photoUrls)"
class="pl-photo-thumb"
:src="resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls))"
:src="mediaActive ? resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls)) : ''"
alt="车辆照片"
loading="lazy"
decoding="async"
/>
<span v-else class="pl-photo-thumb pl-photo-thumb--empty">未上传</span>
</template>
@@ -152,7 +154,11 @@
header-align="left"
>
<template #default="{ row }">
<PlCertListAttachmentCell :cert-list="row.certList" show-vehicle-part />
<PlCertListAttachmentCell
:cert-list="row.certList"
show-vehicle-part
:media-active="mediaActive"
/>
</template>
</el-table-column>
<el-table-column label="车辆类型" min-width="90" align="center" header-align="center" v-if="isColumnVisible('vehicleType')">
@@ -455,6 +461,7 @@ import SystemViewDialog, {
} from '@/components/business/system-view-dialog/index.vue'
import { loadPersonnelWithCerts } from '@/composables/usePlVehicleViewDetail'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListMediaActive } from '@/composables/useListMediaActive'
import { pickBxData, pickBxList, pickBxPageResult } from '@/utils/http/bx'
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
import { formatDateTime } from '@/utils/format'
@@ -487,6 +494,8 @@ type CertListItem = CertRow & { _key?: string }
type CertFormListRef = InstanceType<typeof PlVehicleCertPartTabs>
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const quickSearchKeyword = ref('')
const submitLoading = ref(false)
const dialogLoading = ref(false)
+11 -2
View File
@@ -123,8 +123,10 @@
<img
v-if="firstPhotoUrl(row.photoUrls)"
class="pl-photo-thumb"
:src="resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls))"
:src="mediaActive ? resolvePhotoDisplayUrl(firstPhotoUrl(row.photoUrls)) : ''"
alt="车辆照片"
loading="lazy"
decoding="async"
/>
<span v-else class="pl-photo-thumb pl-photo-thumb--empty">未上传</span>
</template>
@@ -157,7 +159,11 @@
header-align="left"
>
<template #default="{ row }">
<PlCertListAttachmentCell :cert-list="row.certList" show-vehicle-part />
<PlCertListAttachmentCell
:cert-list="row.certList"
show-vehicle-part
:media-active="mediaActive"
/>
</template>
</el-table-column>
<el-table-column label="车辆类型" min-width="100" align="center" header-align="center" v-if="isColumnVisible('vehicleType')">
@@ -473,6 +479,7 @@ import SystemViewDialog, {
type ViewSection
} from '@/components/business/system-view-dialog/index.vue'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListMediaActive } from '@/composables/useListMediaActive'
import { pickBxData, pickBxList, pickBxPageResult } from '@/utils/http/bx'
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
import { formatDateTime } from '@/utils/format'
@@ -496,6 +503,8 @@ type CertFormListRef = InstanceType<typeof PlVehicleCertPartTabs>
const VEHICLE_TYPE_LOCK = 'carrier' as const
const loading = ref(false)
const { mediaActive } = useListMediaActive()
const quickSearchKeyword = ref('')
const submitLoading = ref(false)
const dialogLoading = ref(false)