提交
This commit is contained in:
1 parent
ca6aca2b14
commit
f70dc26206
63 files changed
+589912
-9127
No files matched your search
@@ -179,14 +179,26 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="客户名称"
|
||||
min-width="240"
|
||||
v-if="isColumnVisible('supplierName')"
|
||||
prop="supplierName"
|
||||
label="供方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="需方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productName')"
|
||||
@@ -213,17 +225,6 @@
|
||||
<PlPlanListProductCell :products="row.products" field="spec" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productQty')"
|
||||
label="数量"
|
||||
min-width="90"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="qty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productUnit')"
|
||||
label="单位"
|
||||
@@ -235,6 +236,28 @@
|
||||
<PlPlanListProductCell :products="row.products" field="unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productPlanQty')"
|
||||
label="计划数量"
|
||||
min-width="100"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="planQty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productActualQty')"
|
||||
label="实际数量"
|
||||
min-width="100"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="actualQty" />
|
||||
</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 />
|
||||
@@ -368,11 +391,13 @@ const listColumnDefs = [
|
||||
{ prop: 'archiveStatus', label: '归档状态' },
|
||||
{ prop: 'followStatus', label: '跟进状态' },
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'supplierName', label: '供方' },
|
||||
{ prop: 'customerName', label: '需方' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'productSpec', label: '型号/规格' },
|
||||
{ prop: 'productQty', label: '数量' },
|
||||
{ prop: 'productUnit', label: '单位' },
|
||||
{ prop: 'productPlanQty', label: '计划数量' },
|
||||
{ prop: 'productActualQty', label: '实际数量' },
|
||||
{ prop: 'planAttachments', label: '计划附件' },
|
||||
{ prop: 'licensePlate', label: '车牌号' },
|
||||
{ prop: 'personnelSummary', label: '人员' },
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column prop="planNo" label="计划编号" min-width="180" show-overflow-tooltip>
|
||||
<el-table-column prop="planNo" label="计划编号" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="handleView(row)">{{ row.planNo }}</el-link>
|
||||
</template>
|
||||
@@ -180,14 +180,26 @@
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="客户名称"
|
||||
min-width="240"
|
||||
v-if="isColumnVisible('supplierName')"
|
||||
prop="supplierName"
|
||||
label="供方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="需方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('planType')"
|
||||
@@ -202,6 +214,19 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('followStatus')"
|
||||
prop="followStatus"
|
||||
label="跟进状态"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlPlanFollowStatusTagType(row.followStatus)" size="small">
|
||||
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('hazardCertReady')"
|
||||
label="证书齐备"
|
||||
@@ -217,7 +242,7 @@
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productName')"
|
||||
label="产品名称"
|
||||
min-width="240"
|
||||
min-width="160"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
@@ -230,7 +255,7 @@
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productSpec')"
|
||||
label="型号/规格"
|
||||
min-width="120"
|
||||
min-width="96"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
@@ -239,21 +264,10 @@
|
||||
<PlPlanListProductCell :products="row.products" field="spec" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productQty')"
|
||||
label="数量"
|
||||
min-width="90"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="qty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productUnit')"
|
||||
label="单位"
|
||||
min-width="80"
|
||||
min-width="64"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
@@ -261,6 +275,28 @@
|
||||
<PlPlanListProductCell :products="row.products" field="unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productPlanQty')"
|
||||
label="计划数量"
|
||||
min-width="88"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="planQty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productActualQty')"
|
||||
label="实际数量"
|
||||
min-width="88"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="actualQty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="280">
|
||||
<template #default="{ row }">
|
||||
<PlPlanListCertCell
|
||||
@@ -273,19 +309,6 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('followStatus')"
|
||||
prop="followStatus"
|
||||
label="跟进状态"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlPlanFollowStatusTagType(row.followStatus)" size="small">
|
||||
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('licensePlate')"
|
||||
prop="licensePlate"
|
||||
@@ -431,15 +454,17 @@ const planList = ref<Plan[]>([])
|
||||
|
||||
const listColumnDefs = [
|
||||
{ prop: 'planDate', label: '计划日期' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'supplierName', label: '供方' },
|
||||
{ prop: 'customerName', label: '需方' },
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'followStatus', label: '跟进状态' },
|
||||
{ prop: 'hazardCertReady', label: '证书齐备' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'productSpec', label: '型号/规格' },
|
||||
{ prop: 'productQty', label: '数量' },
|
||||
{ prop: 'productUnit', label: '单位' },
|
||||
{ prop: 'productPlanQty', label: '计划数量' },
|
||||
{ prop: 'productActualQty', label: '实际数量' },
|
||||
{ prop: 'planAttachments', label: '计划附件' },
|
||||
{ prop: 'followStatus', label: '跟进状态' },
|
||||
{ prop: 'licensePlate', label: '车牌号' },
|
||||
{ prop: 'personnelSummary', label: '人员' },
|
||||
{ prop: 'followUserName', label: '跟进人', defaultVisible: false }
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称">
|
||||
<el-form-item label="需方">
|
||||
<el-input
|
||||
v-model="searchForm.customerName"
|
||||
placeholder="搜索客户名称"
|
||||
placeholder="搜索需方客户名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
@@ -230,15 +230,53 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="客户名称"
|
||||
min-width="240"
|
||||
v-if="isColumnVisible('supplierName')"
|
||||
prop="supplierName"
|
||||
label="供方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="需方"
|
||||
min-width="200"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('contractSummary')"
|
||||
label="合同"
|
||||
min-width="220"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div
|
||||
v-if="planContractLines(row).length"
|
||||
class="pl-plan-contract-cell"
|
||||
>
|
||||
<div
|
||||
v-for="(line, index) in planContractLines(row)"
|
||||
:key="`${line.side}-${line.no}-${index}`"
|
||||
class="pl-plan-contract-cell__row"
|
||||
>
|
||||
<span class="pl-plan-contract-cell__side">{{ line.side }}</span>
|
||||
<span class="pl-plan-contract-cell__no">{{ line.no }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<span v-else class="pl-plan-contract-cell__empty">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productName')"
|
||||
label="产品名称"
|
||||
@@ -454,17 +492,6 @@
|
||||
>
|
||||
<el-icon><CircleClose /></el-icon>作废
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canDeletePlan(viewingPlan)"
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="!canDeleteByCreator(viewingPlan)"
|
||||
:title="getDeletePlanDisabledTitle(viewingPlan)"
|
||||
:loading="deleteLoading"
|
||||
@click="handleDelete(viewingPlan)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</PlPlanViewDialog>
|
||||
|
||||
@@ -486,7 +513,6 @@ import {
|
||||
Bell,
|
||||
CircleClose,
|
||||
CopyDocument,
|
||||
Delete,
|
||||
Edit,
|
||||
Plus,
|
||||
Printer,
|
||||
@@ -510,7 +536,6 @@ 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 { canDeleteByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
|
||||
import { canBatchPrintSlip } from '@/utils/pl-batch-print'
|
||||
import {
|
||||
canPrintSlipCommand,
|
||||
@@ -529,7 +554,6 @@ const router = useRouter()
|
||||
|
||||
const loading = ref(false)
|
||||
const voidLoading = ref(false)
|
||||
const deleteLoading = ref(false)
|
||||
const waitNoticeLoading = ref(false)
|
||||
const formDialogVisible = ref(false)
|
||||
const editingPlanId = ref('')
|
||||
@@ -548,7 +572,9 @@ const listColumnDefs = [
|
||||
{ prop: 'followStatus', label: '跟进状态' },
|
||||
{ prop: 'planDate', label: '计划日期' },
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'supplierName', label: '供方' },
|
||||
{ prop: 'customerName', label: '需方' },
|
||||
{ prop: 'contractSummary', label: '合同' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'productSpec', label: '型号/规格' },
|
||||
{ prop: 'productPackageSpec', label: '包装规格' },
|
||||
@@ -582,10 +608,7 @@ async function refreshViewIfOpen() {
|
||||
await viewDialogRef.value?.reload()
|
||||
}
|
||||
|
||||
function getPlanArrangePrerequisiteGaps(plan: Pick<
|
||||
Plan,
|
||||
'createDate' | 'planDate' | 'belongsCompany' | 'planType' | 'followUserId' | 'followUserName'
|
||||
>): string[] {
|
||||
function getPlanArrangePrerequisiteGaps(plan: Plan): string[] {
|
||||
const missing: string[] = []
|
||||
if (!String(plan.createDate || '').trim()) missing.push('创建日期')
|
||||
if (!String(plan.planDate || '').trim()) missing.push('计划日期')
|
||||
@@ -594,6 +617,12 @@ function getPlanArrangePrerequisiteGaps(plan: Pick<
|
||||
if (!String(plan.followUserId || '').trim() && !String(plan.followUserName || '').trim()) {
|
||||
missing.push('跟进人')
|
||||
}
|
||||
if (!String(plan.supplierId || '').trim() || !String(plan.supplierName || '').trim()) {
|
||||
missing.push('供方客户')
|
||||
}
|
||||
if (!String(plan.customerId || '').trim() || !String(plan.customerName || '').trim()) {
|
||||
missing.push('需方客户')
|
||||
}
|
||||
return missing
|
||||
}
|
||||
|
||||
@@ -670,6 +699,20 @@ function getPlanTypeLabel(type?: string | null) {
|
||||
return map[type] || type
|
||||
}
|
||||
|
||||
/** 合同列:供/需合同各占一行展示 */
|
||||
function planContractLines(plan: Plan): Array<{ side: string; no: string }> {
|
||||
const lines: Array<{ side: string; no: string }> = []
|
||||
for (const item of plan.supplierContracts || []) {
|
||||
const no = item.contractNo || item.contractId
|
||||
if (no) lines.push({ side: '供', no: String(no) })
|
||||
}
|
||||
for (const item of plan.demanderContracts || []) {
|
||||
const no = item.contractNo || item.contractId
|
||||
if (no) lines.push({ side: '需', no: String(no) })
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -801,14 +844,6 @@ function canVoidPlan(row: Plan) {
|
||||
return row.archiveStatus !== 'archived' && row.followStatus !== 'cancelled'
|
||||
}
|
||||
|
||||
function canDeletePlan(row: Plan) {
|
||||
return (
|
||||
(row.followStatus === 'pending_arrange' || row.followStatus === 'wait_notice') &&
|
||||
row.transportStatus === 'pending' &&
|
||||
row.archiveStatus !== 'archived'
|
||||
)
|
||||
}
|
||||
|
||||
function canWaitNotice(row: Plan) {
|
||||
return (
|
||||
row.followStatus === 'pending_arrange' &&
|
||||
@@ -820,12 +855,6 @@ function canCancelWaitNotice(row: Plan) {
|
||||
return row.followStatus === 'wait_notice' && row.archiveStatus !== 'archived'
|
||||
}
|
||||
|
||||
function getDeletePlanDisabledTitle(row: Plan) {
|
||||
if (!canDeletePlan(row)) return '只能删除待安排或等通知且未安排运输的计划'
|
||||
if (!canDeleteByCreator(row)) return CREATOR_DELETE_TIP
|
||||
return ''
|
||||
}
|
||||
|
||||
function syncViewingPlan(updated: Plan) {
|
||||
if (viewingPlan.value?.id === updated.id) {
|
||||
viewingPlan.value = { ...viewingPlan.value, ...updated }
|
||||
@@ -869,35 +898,6 @@ function handleToolbarWaitNotice() {
|
||||
handleWaitNotice(selectedPlan.value)
|
||||
}
|
||||
|
||||
async function handleDelete(row: Plan) {
|
||||
if (!canDeletePlan(row)) {
|
||||
ElMessage.warning('只能删除待安排或等通知且未安排运输的计划')
|
||||
return
|
||||
}
|
||||
if (!canDeleteByCreator(row)) {
|
||||
ElMessage.warning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
await ElMessageBox.confirm('确定删除该运输计划吗?删除后不可恢复。', '删除运输计划', {
|
||||
type: 'warning'
|
||||
})
|
||||
deleteLoading.value = true
|
||||
try {
|
||||
await planApi.delete(row.id)
|
||||
ElMessage.success('删除成功')
|
||||
if (viewingPlan.value?.id === row.id) {
|
||||
viewVisible.value = false
|
||||
viewingPlan.value = null
|
||||
}
|
||||
fetchData()
|
||||
} catch (e) {
|
||||
const message = e instanceof Error ? e.message : '删除失败'
|
||||
ElMessage.error(message)
|
||||
} finally {
|
||||
deleteLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleVoid(row: Plan) {
|
||||
const hint =
|
||||
row.transportStatus === 'arranged'
|
||||
@@ -1044,4 +1044,41 @@ async function openArrangeFromQuery() {
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.pl-plan-contract-cell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pl-plan-contract-cell__row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--text, #1e293b);
|
||||
}
|
||||
|
||||
.pl-plan-contract-cell__side {
|
||||
flex-shrink: 0;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.pl-plan-contract-cell__no {
|
||||
min-width: 0;
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.pl-plan-contract-cell__empty {
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user