feat(pl): 装送货段增加同市标记,并同步额度证件与计划表单。

同市易制毒段只校验购买证;同步 Web/H5 表单、额度统计展示与相关回归测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-12 16:34:58 +08:00
1 parent d58f6ea5bd
commit 522b4be705
40 files changed
+576 -107

No files matched your search

@@ -34,6 +34,28 @@ export function certFaceFields(row: CertListFace) {
]
}
export function certKindLabel(certType?: string | null) {
return certType === 'transport' ? '运输证' : '购买证'
}
export function certKindTagType(certType?: string | null) {
return certType === 'transport' ? 'warning' : 'success'
}
export function certKindMobileTone(certType?: string | null) {
return certType === 'transport' ? 'warning' : 'primary'
}
export function compareCertUploadTime<T extends { createTime?: string | null; id?: string | null }>(
a: T,
b: T
) {
return (
String(b.createTime || '').localeCompare(String(a.createTime || '')) ||
String(b.id || '').localeCompare(String(a.id || ''))
)
}
export function expiryWarning(validTo?: string | null, today = new Date()) {
const target = calendarDate(validTo)
if (!target) return null
+11 -8
View File
@@ -66,8 +66,8 @@
><el-tag
v-else-if="column.prop === 'certType'"
size="small"
:type="row.certType === 'transport' ? 'warning' : 'success'"
>{{ row.certType === 'transport' ? '运输证' : '购买证' }}</el-tag
:type="certKindTagType(row.certType)"
>{{ certKindLabel(row.certType) }}</el-tag
><el-tag
v-else-if="column.prop === 'status'"
size="small"
@@ -629,7 +629,14 @@
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import CertContractBinder from './CertContractBinder.vue'
import { bindingsFromPurchaseCerts, matchPurchaseCert } from './contract-binder-rules'
import { buyPartyName, expiryWarning, salePartyName } from './cert-list-face'
import {
buyPartyName,
certKindLabel,
certKindTagType,
compareCertUploadTime,
expiryWarning,
salePartyName
} from './cert-list-face'
import ContractScopeDialog from './ContractScopeDialog.vue'
import SystemViewDialog, {
type ViewField,
@@ -1089,11 +1096,7 @@
rows.value = [
...purchases.map((row) => presentCert(row, 'purchase')),
...transports.map((row) => presentCert(row, 'transport'))
].sort(
(a, b) =>
String(b.createTime || '').localeCompare(String(a.createTime || '')) ||
String(b.id).localeCompare(String(a.id))
)
].sort(compareCertUploadTime)
} finally {
if (current === listEpoch && !disposed) loading.value = false
}
@@ -42,7 +42,10 @@
</el-select>
</el-form-item>
</el-form>
<p v-else class="quota-contract-cert-dialog__current">{{ currentCertLabel }}</p>
<p v-else class="quota-contract-cert-dialog__current">
<el-tag size="small" :type="certKindTagType(certType)">{{ certKindLabel(certType) }}</el-tag>
<span v-if="certNo">{{ certNo }}</span>
</p>
<CertContractBinder
v-if="ready && certId && contractId"
:key="binderKey"
@@ -68,6 +71,7 @@
type ScopeProduct
} from '@/api/pl/quota-cert'
import CertContractBinder from '../quota-cert/CertContractBinder.vue'
import { certKindLabel, certKindTagType } from '../quota-cert/cert-list-face'
import { bindingPayload, replaceCertProducts } from '../quota-cert/model'
const emit = defineEmits<{ saved: [] }>()
@@ -91,10 +95,6 @@
() =>
`${mode.value}|${certType.value}|${certId.value}|${savedProducts.value.map((row) => row.contractProductId).join(',')}`
)
const currentCertLabel = computed(() =>
[certType.value === 'purchase' ? '购买证' : '运输证', certNo.value].filter(Boolean).join(' ')
)
function certOptionLabel(item: QuotaCert) {
const name = [item.certNo, item.productNameOnCert].filter(Boolean).join(' · ')
if (item.status === 'void') return `${name}(已作废)`
@@ -209,6 +209,10 @@
<style scoped>
.quota-contract-cert-dialog__current {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 8px;
margin: 0 0 12px;
color: #1e293b;
font-weight: 600;
@@ -6,8 +6,15 @@
v-for="cert in contract?.certificates || []"
:key="certKey(cert)"
:name="certKey(cert)"
:label="certTabLabel(cert)"
>
<template #label>
<span class="quota-cert-tab-label">
<el-tag size="small" :type="certKindTagType(cert.certType)">{{
certKindLabel(cert.certType)
}}</el-tag>
<span>{{ cert.certNo }}</span>
</span>
</template>
<section class="quota-cert-summary">
<header class="quota-cert-summary__head">
<strong>{{ cert.certNo }}</strong>
@@ -16,8 +23,8 @@
有效期:{{ cert.validFrom || '—' }} 至 {{ cert.validTo || '—' }}
</span>
<div class="quota-cert-summary__tags">
<el-tag size="small">{{
cert.certType === 'purchase' ? '购买证' : '运输证'
<el-tag size="small" :type="certKindTagType(cert.certType)">{{
certKindLabel(cert.certType)
}}</el-tag>
<el-tag size="small" :type="cert.linkStatus === 'active' ? 'success' : 'info'">{{
linkLabel(cert.linkStatus)
@@ -90,7 +97,13 @@
<el-table-column prop="productName" label="产品" min-width="160" />
<el-table-column prop="model" label="规格" min-width="120" />
<el-table-column prop="unit" label="产品单位" min-width="100" />
<el-table-column prop="certKind" label="证件类型" min-width="100" />
<el-table-column label="证件类型" min-width="110">
<template #default="{ row }">
<el-tag size="small" :type="certKindTagType(row.certType)">{{
row.certKind
}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="certNo" label="证件编号" min-width="160" />
<el-table-column prop="certUnit" label="证面单位" min-width="100" />
<el-table-column label="产品预占" min-width="120"
@@ -230,7 +243,12 @@
import { useDictStore } from '@/store/modules/dict'
import { getProductUnitLabel } from '@/utils/crm-product-display'
import { formatCertQty } from '../quota-cert/model'
import { certFaceFields, expiryWarning } from '../quota-cert/cert-list-face'
import {
certFaceFields,
certKindLabel,
certKindTagType,
expiryWarning
} from '../quota-cert/cert-list-face'
import StatisticsProducts from './StatisticsProducts.vue'
import { statusLabel } from './labels'
const props = withDefaults(
@@ -252,10 +270,6 @@
function certKey(cert: { certType: string; certId: string }) {
return `${cert.certType}:${cert.certId}`
}
function certTabLabel(cert: ContractStatistics['certificates'][number]) {
const kind = cert.certType === 'purchase' ? '购买证' : '运输证'
return `${kind} ${cert.certNo || ''}`.trim()
}
watch(
() =>
props.mode === 'contract'
@@ -282,7 +296,8 @@
productName: product.productName || '—',
model: product.model || '—',
unit: unitLabel(product.unit) || '—',
certKind: cert.certType === 'purchase' ? '购买证' : '运输证',
certType: cert.certType,
certKind: certKindLabel(cert.certType),
certNo: cert.certNo || '—',
certUnit: unitLabel(cert.quantityUnit) || '—',
reservedQty: product.reservedQty,
@@ -475,4 +490,10 @@
}
}
}
.quota-cert-tab-label {
display: inline-flex;
gap: 6px;
align-items: center;
}
</style>
@@ -144,9 +144,11 @@
/> </div
></template>
<template #default="{ row }"
><span v-if="column.prop === 'certType'">{{
row.certType === 'transport' ? '运输证' : '购买证'
}}</span
><el-tag
v-if="column.prop === 'certType'"
size="small"
:type="certKindTagType(row.certType)"
>{{ certKindLabel(row.certType) }}</el-tag
><el-tag
v-else-if="column.prop === 'status'"
size="small"
@@ -205,7 +207,7 @@
import StatisticsDetail from './StatisticsDetail.vue'
import { createStatisticsLoader } from './loader'
import { statusLabel, contractTypeLabel } from './labels'
import { expiryWarning } from '../quota-cert/cert-list-face'
import { certKindLabel, certKindTagType, expiryWarning } from '../quota-cert/cert-list-face'
const props = withDefaults(
defineProps<{
mode: 'contract' | 'certificate'