This commit is contained in:
zlwu committed 2026-08-23 18:42:27 +08:00
1 parent b74d483682
commit dd1acdc787
50 files changed
+636156 -7218

No files matched your search

+3 -3
View File
@@ -1453,15 +1453,15 @@
}
.day-num {
margin-bottom: 4px;
font-size: 14px;
font-size: 18px;
font-weight: 600;
}
.duty-cal td.today .day-num {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
width: 28px;
height: 28px;
color: #fff;
background: var(--el-color-primary, #10b981);
border-radius: 50%;
+121 -10
View File
@@ -100,7 +100,6 @@
:get-filter-params="getPlanArchiveExportFilterParams"
:has-selection="true"
:selected-ids="selectedRows.map((r) => r.id)"
:visible-columns="planArchiveExportColumns"
filename="计划归档.xlsx"
/>
@@ -209,10 +208,39 @@
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('documentAttachments')"
label="单据附件"
min-width="220"
align="left"
header-align="left"
>
<template #default="{ row }">
<PlPlanDocumentAttachmentCell :attachments="row.documentAttachments" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('erpEntered')"
label="ERP"
min-width="72"
align="center"
header-align="center"
>
<template #default="{ row }">
<div class="pl-plan-archive-erp-cell" @click.stop @mousedown.stop>
<el-checkbox
:model-value="Number(row.erpEntered) === 1"
:disabled="row.followStatus === 'cancelled' || erpUpdatingId === row.id"
@click.stop
@change="(checked) => handleErpEnteredChange(row, Boolean(checked))"
/>
</div>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
min-width="240"
min-width="160"
align="left"
header-align="left"
class-name="col-name-wrap"
@@ -225,7 +253,7 @@
<el-table-column
v-if="isColumnVisible('productSpec')"
label="型号/规格"
min-width="120"
min-width="96"
align="center"
header-align="center"
show-overflow-tooltip
@@ -237,7 +265,7 @@
<el-table-column
v-if="isColumnVisible('productUnit')"
label="单位"
min-width="80"
min-width="64"
align="center"
header-align="center"
>
@@ -267,6 +295,28 @@
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productInboundQty')"
label="入库数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="inboundQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productOutboundQty')"
label="出库数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="outboundQty" />
</template>
</el-table-column>
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="200">
<template #default="{ row }">
<PlPlanListCertCell :products="row.products" compact hide-product />
@@ -284,6 +334,21 @@
{{ formatPlVehiclePlateDisplay(row.licensePlate, row.trailerNo) }}
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('carrierName')"
prop="carrierName"
label="承运商"
min-width="140"
show-overflow-tooltip
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
{{ row.resourceSnapshot?.carrierName || '' }}
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('personnelSummary')"
prop="personnelSummary"
@@ -336,6 +401,7 @@
ref="viewDialogRef"
v-model:visible="viewVisible"
:plan-id="viewPlanId"
show-archive-io-fields
>
<template v-if="viewingPlan" #hero-actions>
<el-button
@@ -376,6 +442,7 @@ import {
} from '@/composables/usePlToxicProductCertCheck'
import { pickBxData } from '@/utils/http/bx'
import PlPlanArchiveDialog from '@/components/business/pl-plan-archive-dialog/index.vue'
import PlPlanDocumentAttachmentCell from '@/components/business/pl-plan-document-attachment-cell/index.vue'
import PlPlanListCertCell from '@/components/business/pl-plan-list-cert-cell/index.vue'
import PlPlanListProductCell from '@/components/business/pl-plan-list-product-cell/index.vue'
import PlPlanViewDialog from '@/components/business/pl-plan-view-dialog/index.vue'
@@ -405,6 +472,7 @@ const viewPlanId = ref('')
const viewDialogRef = ref<InstanceType<typeof PlPlanViewDialog>>()
const archiveDialogVisible = ref(false)
const archivePlanId = ref('')
const erpUpdatingId = ref('')
const planList = ref<Plan[]>([])
const listColumnDefs = [
@@ -414,13 +482,18 @@ const listColumnDefs = [
{ prop: 'planType', label: '单据类型' },
{ prop: 'supplierName', label: '供方' },
{ prop: 'customerName', label: '需方' },
{ prop: 'documentAttachments', label: '单据附件' },
{ prop: 'erpEntered', label: 'ERP' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'productSpec', label: '型号/规格' },
{ prop: 'productUnit', label: '单位' },
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'productInboundQty', label: '入库数量' },
{ prop: 'productOutboundQty', label: '出库数量' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'carrierName', label: '承运商' },
{ prop: 'personnelSummary', label: '人员' },
{ prop: 'followUserName', label: '跟进人', defaultVisible: false }
]
@@ -463,6 +536,12 @@ function getArchiveStatCellValue(row: Plan, prop: string): unknown {
if (prop === 'productActualQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.actualQty) || 0), 0)
}
if (prop === 'productInboundQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.inboundQty) || 0), 0)
}
if (prop === 'productOutboundQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.outboundQty) || 0), 0)
}
if (prop === 'productName') {
return (row.products || []).map((p) => p.productName || '').filter(Boolean).join('\n')
}
@@ -478,9 +557,18 @@ function getArchiveStatCellValue(row: Plan, prop: string): unknown {
if (prop === 'planAttachments') {
return ''
}
if (prop === 'documentAttachments') {
return ''
}
if (prop === 'erpEntered') {
return Number(row.erpEntered) === 1 ? '是' : '否'
}
if (prop === 'licensePlate') {
return formatPlVehiclePlateDisplay(row.licensePlate, row.trailerNo)
}
if (prop === 'carrierName') {
return row.resourceSnapshot?.carrierName || ''
}
if (prop === 'personnelSummary') {
return normalizePlPersonnelSummaryDisplay(row.personnelSummary)
}
@@ -491,6 +579,7 @@ const selectedRows = ref<Plan[]>([])
function getPlanArchiveExportFilterParams() {
const keyword = quickSearch.value.trim()
return {
exportFormat: 'archive',
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: searchForm.planType || undefined,
@@ -504,12 +593,6 @@ function getPlanArchiveExportFilterParams() {
}
}
const planArchiveExportColumns = computed(() => {
const cols = [...visibleColumns.value]
if (!cols.includes('planNo')) cols.unshift('planNo')
return cols
})
const viewingPlan = ref<Plan | null>(null)
function syncViewingPlanFromList() {
@@ -682,6 +765,28 @@ function handleToolbarArchive() {
handleArchive(selectedRows.value[0])
}
async function handleErpEnteredChange(row: Plan, entered: boolean) {
if (row.followStatus === 'cancelled') return
const previous = Number(row.erpEntered) === 1
if (previous === entered) return
erpUpdatingId.value = row.id
row.erpEntered = entered ? 1 : 0
try {
const res = await planApi.setErpEntered(row.id, entered)
const data = pickBxData<Plan>(res)
if (data?.id) {
row.erpEntered = data.erpEntered ?? (entered ? 1 : 0)
}
} catch (error) {
row.erpEntered = previous ? 1 : 0
const message = error instanceof Error ? error.message : '更新 ERP 状态失败'
ElMessage.error(message.includes('失败') ? message : `更新 ERP 状态失败:${message}`)
} finally {
erpUpdatingId.value = ''
}
}
useDbInstantSearch(
() => ({
planNo: searchForm.planNo,
@@ -711,4 +816,10 @@ onMounted(() => {
.pl-plan-list-toolbar-row {
flex-wrap: wrap;
}
.pl-plan-archive-erp-cell {
display: inline-flex;
align-items: center;
justify-content: center;
}
</style>
@@ -304,6 +304,28 @@
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productInboundQty')"
label="入库数量"
min-width="88"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="inboundQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productOutboundQty')"
label="出库数量"
min-width="88"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="outboundQty" />
</template>
</el-table-column>
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="280">
<template #default="{ row }">
<PlPlanListCertCell
@@ -371,6 +393,7 @@
ref="viewDialogRef"
v-model:visible="viewVisible"
:plan-id="viewPlanId"
show-inbound-outbound-qty
>
<template v-if="viewingPlan" #hero-actions>
<el-button
@@ -472,6 +495,8 @@ const listColumnDefs = [
{ prop: 'productUnit', label: '单位' },
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'productInboundQty', label: '入库数量' },
{ prop: 'productOutboundQty', label: '出库数量' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'personnelSummary', label: '人员' },
@@ -319,6 +319,16 @@
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column label="入库数量" min-width="100" align="right" header-align="right">
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="inboundQty" />
</template>
</el-table-column>
<el-table-column label="出库数量" min-width="100" align="right" header-align="right">
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="outboundQty" />
</template>
</el-table-column>
</el-table>
<div class="pagination list-pager-bar">
@@ -340,6 +350,7 @@
ref="viewDialogRef"
v-model:visible="viewVisible"
:plan-id="viewPlanId"
show-inbound-outbound-qty
/>
</div>
</template>
+34 -23
View File
@@ -365,6 +365,28 @@
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productInboundQty')"
label="入库数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="inboundQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productOutboundQty')"
label="出库数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="outboundQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('arrangeCopy')"
label="复制"
@@ -499,6 +521,7 @@
ref="viewDialogRef"
v-model:visible="viewVisible"
:plan-id="viewPlanId"
show-inbound-outbound-qty
>
<template v-if="viewingPlan" #hero-actions>
<el-button
@@ -542,24 +565,9 @@
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
command="inbound"
:disabled="!canPrintSlipCommand(viewingPlan?.planType, 'inbound')"
>
入库单
</el-dropdown-item>
<el-dropdown-item
command="delivery"
:disabled="!canPrintSlipCommand(viewingPlan?.planType, 'delivery')"
>
送(提)货单
</el-dropdown-item>
<el-dropdown-item
command="subpack"
:disabled="!canPrintSlipCommand(viewingPlan?.planType, 'subpack')"
>
分装单
</el-dropdown-item>
<el-dropdown-item command="inbound">入库单</el-dropdown-item>
<el-dropdown-item command="delivery">送(提)货单</el-dropdown-item>
<el-dropdown-item command="subpack">分装单</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@@ -697,7 +705,6 @@ import { useListDateShortcut } from '@/composables/useListDateShortcut'
import { canBatchPrintSlip } from '@/utils/pl-batch-print'
import { planContractLines } from '@/utils/pl-plan-contract-display'
import {
canPrintSlipCommand,
formatPlVehiclePlateDisplay,
getPlPlanFollowStatusLabel,
getPlPlanFollowStatusTagType,
@@ -746,6 +753,8 @@ const listColumnDefs = [
{ prop: 'productUnit', label: '单位' },
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'productInboundQty', label: '入库数量' },
{ prop: 'productOutboundQty', label: '出库数量' },
{ prop: 'arrangeCopy', label: '复制' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'personnelSummary', label: '人员' },
@@ -844,6 +853,12 @@ function getPlanStatCellValue(row: Plan, prop: string): unknown {
if (prop === 'productActualQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.actualQty) || 0), 0)
}
if (prop === 'productInboundQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.inboundQty) || 0), 0)
}
if (prop === 'productOutboundQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.outboundQty) || 0), 0)
}
if (prop === 'productName') {
return (row.products || []).map((p) => p.productName || '').filter(Boolean).join('\n')
}
@@ -1209,10 +1224,6 @@ async function handleArrange(row: Plan) {
}
function handlePrintSlip(command: PlPrintSlipCommand, row: Plan) {
if (!canPrintSlipCommand(row.planType, command)) {
ElMessage.warning('当前单据类型不支持打印该单据')
return
}
if (command === 'inbound') {
inboundSlipPrintRef.value?.open(row.id)
return