feat(pl): 按单据类型限制打印项并调整送(提)货单布局

按入库/出库/直销限制可打印单据;送(提)货单信息区改为一行布局,物料表增加单据编号列,并修正条款列宽与类型多选不换行。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-26 21:05:11 +08:00
1 parent 1e2e8ab0fc
commit 70bdd820ce
4 files changed
+367 -191

No files matched your search

@@ -273,24 +273,38 @@
>
<el-icon><CopyDocument /></el-icon>复制磅单二维码
</el-button>
<el-button
v-if="showInboundSlipPrint"
@click="handlePrintInboundSlip"
<el-dropdown
v-if="showSlipPrint"
trigger="click"
@command="handlePrintSlip"
>
<el-icon><Printer /></el-icon>入库单
</el-button>
<el-button
v-if="showDeliverySlipPrint"
@click="handlePrintDeliverySlip"
>
<el-icon><Printer /></el-icon>送(提)货单
</el-button>
<el-button
v-if="showSubpackSlipPrint"
@click="handlePrintSubpackSlip"
>
<el-icon><Printer /></el-icon>分装单
</el-button>
<el-button>
<el-icon><Printer /></el-icon>打印单据
<el-icon class="el-icon--right"><ArrowDown /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
command="inbound"
:disabled="!canPrintSlipCommand(plan.planType, 'inbound')"
>
入库单
</el-dropdown-item>
<el-dropdown-item
command="delivery"
:disabled="!canPrintSlipCommand(plan.planType, 'delivery')"
>
送(提)货单
</el-dropdown-item>
<el-dropdown-item
command="subpack"
:disabled="!canPrintSlipCommand(plan.planType, 'subpack')"
>
分装单
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<template v-else>
<el-button @click="innerVisible = false">
@@ -306,7 +320,7 @@
</template>
<script setup lang="ts">
import { Check, Close, CopyDocument, Printer, View } from '@element-plus/icons-vue'
import { ArrowDown, Check, Close, CopyDocument, Printer, View } from '@element-plus/icons-vue'
import {
carrierApi,
planApi,
@@ -336,7 +350,7 @@ import { useDictStore } from '@/store/modules/dict'
import { isTonProductUnit } from '@/utils/crm-product-display'
import { formatDate } from '@/utils/format'
import { pickBxData, pickBxList } from '@/utils/http/bx'
import { formatPlVehiclePlateDisplay } from '@/utils/pl-display'
import { canPrintSlipCommand, formatPlVehiclePlateDisplay, type PlPrintSlipCommand } from '@/utils/pl-display'
const dictStore = useDictStore()
@@ -427,9 +441,7 @@ const dialogTitle = computed(() => {
const isRearrange = computed(() => plan.value.transportStatus === 'arranged')
/** 安排成功后始终展示打印入口,与运输计划列表工具栏一致,便于现场立即开单 */
const showInboundSlipPrint = computed(() => arrangeSuccess.value)
const showDeliverySlipPrint = computed(() => arrangeSuccess.value)
const showSubpackSlipPrint = computed(() => arrangeSuccess.value)
const showSlipPrint = computed(() => arrangeSuccess.value)
function getUnitLabel(unit: string) {
return dictStore.getLabel('crm_product_unit', unit) || unit
@@ -787,31 +799,28 @@ async function handleSubmit() {
}
}
function handlePrintInboundSlip() {
function handlePrintSlip(command: string) {
const planId = plan.value.id
if (!planId) {
ElMessage.warning('计划信息无效')
return
}
inboundSlipPrintRef.value?.open(planId)
}
function handlePrintDeliverySlip() {
const planId = plan.value.id
if (!planId) {
ElMessage.warning('计划信息无效')
const slipCommand = command as PlPrintSlipCommand
if (!canPrintSlipCommand(plan.value.planType, slipCommand)) {
ElMessage.warning('当前单据类型不支持打印该单据')
return
}
deliverySlipPrintRef.value?.open(planId)
}
function handlePrintSubpackSlip() {
const planId = plan.value.id
if (!planId) {
ElMessage.warning('计划信息无效')
if (slipCommand === 'inbound') {
inboundSlipPrintRef.value?.open(planId)
return
}
subpackSlipPrintRef.value?.open(planId)
if (slipCommand === 'delivery') {
deliverySlipPrintRef.value?.open(planId)
return
}
if (slipCommand === 'subpack') {
subpackSlipPrintRef.value?.open(planId)
}
}
</script>