This commit is contained in:
yin 2026-10-22 18:00:49 +08:00
parent 0d57e2d04a
commit 7a8a087b17
14 changed files with 3894 additions and 1007 deletions

View File

@ -1,157 +1,205 @@
<template>
<el-dialog
:model-value="visible"
title="配送订单批量转退回拆包单"
width="800px"
class="transfer-by-orders-dialog"
width="min(760px, 94vw)"
align-center
append-to-body
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="!submitting"
@update:model-value="handleVisibleChange"
@closed="resetState"
>
<!-- 确认态:入参 ids 取自勾选配送订单的 id(wms_order_delivery*.id) -->
<template v-if="!result">
<el-alert class="transfer-alert" type="info" :closable="false" show-icon>
<template #title>
仅「库内拦截」订单会被转换;已有有效拆包单、无运单号、无明细可复制的订单会静默跳过(不报错、不影响其它订单);单条失败不阻断整体提交。
</template>
</el-alert>
<div class="transfer-count">
<span>
已勾选 <b>{{ rows.length }}</b> 条,去重后待处理订单 <b>{{ submitIds.length }}</b> 条
</span>
<span class="transfer-count__limit">单次上限 {{ MAX_COUNT }} 条</span>
</div>
<el-alert
v-if="!submitIds.length"
class="transfer-alert"
type="warning"
:closable="false"
show-icon
>
<template #title>
所选行均缺少订单ID(配送订单表主键 id),无可用订单可提交;请重新勾选列表中的配送订单。
</template>
</el-alert>
<template v-else>
<div v-if="blockedRows.length" class="transfer-note">
其中 {{ blockedRows.length }} 条缺少订单ID(id),不会提交
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>配送订单批量转退回拆包单</h2>
<p>将勾选的库内拦截配送订单转换为退回拆包单</p>
</div>
<div v-if="advisorySkipRows.length" class="transfer-note">
其中 {{ advisorySkipRows.length }} 条按当前列表状态预计会被跳过(非库内拦截),仍会提交并由服务端最终判定
</div>
<div v-if="overLimit" class="transfer-error">
去重后 {{ submitIds.length }} 条已超过单次上限 {{ MAX_COUNT }} 条,请减少勾选后重试
</div>
</template>
<el-table :data="previewRows" size="small" border max-height="320" class="transfer-preview">
<el-table-column label="订单ID" width="100" align="center">
<template #default="{ row }">{{ row.order_id ?? '-' }}</template>
</el-table-column>
<el-table-column label="发货单号" min-width="170" show-overflow-tooltip>
<template #default="{ row }">{{ row.delivery_order_code || '-' }}</template>
</el-table-column>
<el-table-column label="运单号" min-width="170" show-overflow-tooltip>
<template #default="{ row }">{{ row.waybill_codes || '-' }}</template>
</el-table-column>
<el-table-column label="拦截状态" width="130" align="center">
<template #default="{ row }">{{ row.intercept_status_label }}</template>
</el-table-column>
<el-table-column label="能否转换" width="150" align="center">
<template #default="{ row }">
<el-tag size="small" :type="row.tagType">{{ row.tagText }}</el-tag>
</template>
</el-table-column>
</el-table>
<div class="transfer-note">
入参为配送订单表主键ID(id,去重后上限 200 条);归属仓库由服务端按当前登录仓库自动判定,无需选择仓库。
</div>
</template>
<!-- 结果态:接口逐单返回 success[] / skipped[] / failed[],HTTP 整体仍成功 -->
<template v-else>
<div class="transfer-summary">
<div class="transfer-summary__item">
<span class="transfer-summary__label">待处理订单</span>
<span class="transfer-summary__value">{{ result.total }}</span>
</div>
<div class="transfer-summary__item is-success">
<span class="transfer-summary__label">成功创建拆包单</span>
<span class="transfer-summary__value">{{ result.success_count }}</span>
</div>
<div class="transfer-summary__item" :class="{ 'is-warning': skippedList.length > 0 }">
<span class="transfer-summary__label">跳过</span>
<span class="transfer-summary__value">{{ result.skipped_count }}</span>
</div>
<div class="transfer-summary__item" :class="{ 'is-danger': failedList.length > 0 }">
<span class="transfer-summary__label">失败</span>
<span class="transfer-summary__value">{{ result.failed_count }}</span>
</div>
</div>
<div v-if="successList.length" class="transfer-section">
<div class="transfer-section__title">成功明细({{ successList.length }})</div>
<el-table :data="successList" size="small" border max-height="240">
<el-table-column prop="order_id" label="订单ID" width="100" align="center" />
<el-table-column prop="waybill_code" label="运单号" min-width="170" show-overflow-tooltip />
<el-table-column prop="unpack_id" label="拆包单ID" width="100" align="center" />
<el-table-column prop="unpack_no" label="拆包单号" min-width="170" show-overflow-tooltip />
<el-table-column prop="detail_count" label="明细行数" width="95" align="center" />
<el-table-column prop="total_quantity" label="数量合计" width="95" align="center" />
</el-table>
</div>
<div v-if="skippedList.length" class="transfer-section">
<div class="transfer-section__title">
<span>跳过明细({{ skippedList.length }})</span>
<span class="transfer-section__actions">
<el-button link type="primary" size="small" @click="copyIds(skippedList, '跳过')">复制跳过订单ID</el-button>
</span>
</div>
<el-table :data="skippedList" size="small" border max-height="200">
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
<el-table-column prop="reason" label="跳过原因" min-width="320" show-overflow-tooltip />
</el-table>
</div>
<div v-if="failedList.length" class="transfer-section">
<div class="transfer-section__title">
<span>失败明细({{ failedList.length }})</span>
<span class="transfer-section__actions">
<el-button link type="primary" size="small" @click="copyIds(failedList, '失败')">复制失败订单ID</el-button>
</span>
</div>
<el-table :data="failedList" size="small" border max-height="200">
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
<el-table-column prop="reason" label="失败原因" min-width="320" show-overflow-tooltip />
</el-table>
</div>
<div v-if="!successList.length && !skippedList.length && !failedList.length" class="transfer-empty">
<el-empty description="本次提交没有可处理的订单" :image-size="60" />
</div>
</template>
<template #footer>
<template v-if="!result">
<el-button size="small" :disabled="submitting" @click="handleVisibleChange(false)">取消</el-button>
<el-button
size="small"
type="primary"
:loading="submitting"
:disabled="!canSubmit"
@click="submit"
<button
class="task-panel__close"
type="button"
aria-label="关闭"
:disabled="submitting"
@click="handleVisibleChange(false)"
>
确认转换
</el-button>
</template>
<template v-else>
<el-button size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button>
</template>
</template>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<!-- 确认态:入参 ids 取自勾选配送订单的 id(wms_order_delivery*.id) -->
<template v-if="!result">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已勾选</span>
<strong class="task-panel__field-value">{{ rows.length }} 条</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">去重后可提交</span>
<strong class="task-panel__field-value">{{ submitIds.length }} 条 / 上限 {{ MAX_COUNT }} 条</strong>
</div>
<div class="task-panel__section">
<span class="task-panel__section-title">订单预览</span>
<div class="task-panel__table-wrap">
<el-table :data="previewRows" size="small" border max-height="240" empty-text="无">
<el-table-column label="订单ID" width="100" align="center">
<template #default="{ row }">{{ row.order_id ?? '-' }}</template>
</el-table-column>
<el-table-column label="发货单号" min-width="170" show-overflow-tooltip>
<template #default="{ row }">{{ row.delivery_order_code || '-' }}</template>
</el-table-column>
<el-table-column label="运单号" min-width="170" show-overflow-tooltip>
<template #default="{ row }">{{ row.waybill_codes || '-' }}</template>
</el-table-column>
<el-table-column label="拦截状态" width="130" align="center">
<template #default="{ row }">{{ row.intercept_status_label }}</template>
</el-table-column>
<el-table-column label="能否转换" width="150" align="center">
<template #default="{ row }">
<el-tag size="small" :type="row.tagType">{{ row.tagText }}</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<p class="task-panel__form-tip">
仅「库内拦截」订单会被转换;已有有效拆包单、无运单号、无明细可复制的订单会静默跳过(不报错、不影响其它订单);单条失败不阻断整体提交。
</p>
<p v-if="!submitIds.length" class="task-panel__form-tip task-panel__form-tip--warning">
所选行均缺少订单ID(配送订单表主键 id),无可用订单可提交;请重新勾选列表中的配送订单。
</p>
<template v-else>
<p v-if="blockedRows.length" class="task-panel__form-tip">
其中 {{ blockedRows.length }} 条缺少订单ID(id),不会提交
</p>
<p v-if="advisorySkipRows.length" class="task-panel__form-tip">
其中 {{ advisorySkipRows.length }} 条按当前列表状态预计会被跳过(非库内拦截),仍会提交并由服务端最终判定
</p>
<p v-if="overLimit" class="task-panel__form-tip task-panel__form-tip--error">
去重后 {{ submitIds.length }} 条已超过单次上限 {{ MAX_COUNT }} 条,请减少勾选后重试
</p>
</template>
<!-- <p class="task-panel__form-tip">
入参为配送订单表主键ID(id,去重后上限 {{ MAX_COUNT }} 条);归属仓库由服务端按当前登录仓库自动判定,无需选择仓库。
</p> -->
</template>
<!-- 结果态:接口逐单返回 success[] / skipped[] / failed[],HTTP 整体仍成功 -->
<template v-else>
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">待处理订单</span>
<strong class="task-panel__field-value">{{ result.total }} 条</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">成功创建拆包单</span>
<strong class="task-panel__field-value task-panel__field-value--success">
{{ result.success_count }} 条
</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">跳过</span>
<strong
class="task-panel__field-value"
:class="{ 'task-panel__field-value--warning': skippedList.length > 0 }"
>
{{ result.skipped_count }} 条
</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">失败</span>
<strong
class="task-panel__field-value"
:class="{ 'task-panel__field-value--danger': failedList.length > 0 }"
>
{{ result.failed_count }} 条
</strong>
</div>
<div v-if="successList.length" class="task-panel__section">
<span class="task-panel__section-title">成功明细({{ successList.length }})</span>
<div class="task-panel__table-wrap">
<el-table :data="successList" size="small" border max-height="200" empty-text="无">
<el-table-column prop="order_id" label="订单ID" width="100" align="center" />
<el-table-column prop="waybill_code" label="运单号" min-width="170" show-overflow-tooltip />
<el-table-column prop="unpack_id" label="拆包单ID" width="100" align="center" />
<el-table-column prop="unpack_no" label="拆包单号" min-width="170" show-overflow-tooltip />
<el-table-column prop="detail_count" label="明细行数" width="95" align="center" />
<el-table-column prop="total_quantity" label="数量合计" width="95" align="center" />
</el-table>
</div>
</div>
<div v-if="skippedList.length" class="task-panel__section">
<div class="task-panel__section-head">
<span class="task-panel__section-title">跳过明细({{ skippedList.length }})</span>
<el-button link type="primary" size="small" @click="copyIds(skippedList, '跳过')">
复制跳过订单ID
</el-button>
</div>
<div class="task-panel__table-wrap">
<el-table :data="skippedList" size="small" border max-height="200" empty-text="无">
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
<el-table-column prop="reason" label="跳过原因" min-width="320" show-overflow-tooltip />
</el-table>
</div>
</div>
<div v-if="failedList.length" class="task-panel__section">
<div class="task-panel__section-head">
<span class="task-panel__section-title">失败明细({{ failedList.length }})</span>
<el-button link type="primary" size="small" @click="copyIds(failedList, '失败')">
复制失败订单ID
</el-button>
</div>
<div class="task-panel__table-wrap">
<el-table :data="failedList" size="small" border max-height="200" empty-text="无">
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
<el-table-column prop="reason" label="失败原因" min-width="320" show-overflow-tooltip />
</el-table>
</div>
</div>
<div
v-if="!successList.length && !skippedList.length && !failedList.length"
class="transfer-empty"
>
<el-empty description="本次提交没有可处理的订单" :image-size="60" />
</div>
</div>
</template>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">
{{ result ? '关闭后可查看列表最新状态' : '提交后由服务端逐单判定' }}
</span>
<div class="task-panel__actions">
<template v-if="!result">
<el-button size="small" :disabled="submitting" @click="handleVisibleChange(false)">取消</el-button>
<el-button
size="small"
type="primary"
:loading="submitting"
:disabled="!canSubmit"
@click="submit"
>
确认转换
</el-button>
</template>
<el-button v-else size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -365,97 +413,198 @@ async function copyIds(list: Array<{ order_id?: number | string }>, label: strin
</script>
<style scoped lang="scss">
.transfer-alert {
margin-bottom: 12px;
:deep(.el-alert__title) {
line-height: 1.5;
}
}
.transfer-preview {
margin-top: 8px;
margin-bottom: 8px;
}
.transfer-count {
/* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
.task-panel {
display: flex;
align-items: center;
gap: 12px;
margin-top: 6px;
font-size: 12px;
color: #606266;
flex-direction: column;
max-height: calc(100vh - 96px);
background: #fff;
color: #303133;
.transfer-count__limit {
color: #909399;
}
b {
color: #409eff;
}
}
.transfer-error {
margin-top: 4px;
font-size: 12px;
color: #f56c6c;
}
.transfer-note {
margin-top: 4px;
font-size: 12px;
color: #909399;
}
.transfer-summary {
display: flex;
gap: 24px;
margin-bottom: 12px;
padding: 10px 14px;
border-radius: 4px;
background: #f5f7fa;
.transfer-summary__item {
&__head {
display: flex;
align-items: baseline;
align-items: flex-start;
gap: 12px;
padding: 16px;
flex-shrink: 0;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:not(:disabled):hover {
color: #409eff;
}
&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
&__body {
padding: 12px 16px 0;
min-height: 0;
overflow-y: auto;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
&--success {
color: #67c23a;
}
&--warning {
color: #e6a23c;
}
&--danger {
color: #f56c6c;
}
}
&__section {
display: flex;
flex-direction: column;
gap: 6px;
}
.transfer-summary__label {
&__section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
&__section-title {
font-size: 12px;
line-height: 20px;
color: #606266;
padding-left: 2px;
}
&__table-wrap {
border-radius: 4px;
overflow: hidden;
/* 勾选列(表头 + 数据单元格)复选框居中显示 */
:deep(.el-table-column--selection .cell) {
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
&--warning {
background: #fdf6ec;
color: #e6a23c;
}
&--error {
background: #fef0f0;
color: #f56c6c;
}
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
font-size: 12px;
color: #909399;
}
.transfer-summary__value {
font-size: 18px;
font-weight: 600;
color: #303133;
}
.transfer-summary__item.is-success .transfer-summary__value {
color: #67c23a;
}
.transfer-summary__item.is-warning .transfer-summary__value {
color: #e6a23c;
}
.transfer-summary__item.is-danger .transfer-summary__value {
color: #f56c6c;
}
}
.transfer-section {
margin-top: 12px;
.transfer-section__title {
&__actions {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
font-size: 13px;
font-weight: 600;
color: #303133;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
@ -463,3 +612,19 @@ async function copyIds(list: Array<{ order_id?: number | string }>, label: strin
padding: 12px 0;
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.transfer-by-orders-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -221,47 +221,87 @@
<!-- 子单号打印:选择运单号 -->
<el-dialog
v-model="subWaybillSelectDialogVisible"
title="选择运单号打印"
width="680px"
class="select-waybill-dialog"
width="min(680px, 92vw)"
align-center
append-to-body
:show-close="false"
:close-on-click-modal="false"
>
<el-alert
v-if="subWaybillSelectErrorMessage"
:title="subWaybillSelectErrorMessage"
type="error"
:closable="false"
show-icon
style="margin-bottom: 12px"
/>
<el-table
:data="subWaybillOptions"
:loading="subWaybillSelectLoading"
max-height="420"
size="small"
@selection-change="onSubWaybillSelectChange"
>
<el-table-column type="selection" width="48" />
<el-table-column prop="waybill_code" label="运单号" min-width="190" show-overflow-tooltip />
<el-table-column label="类型" width="80" align="center">
<template #default="{ row }">
<el-tag :type="row.is_main ? 'info' : 'success'" size="small">
{{ row.is_main ? '主单' : '子单' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="logistics_name" label="物流公司" min-width="130" show-overflow-tooltip />
</el-table>
<template #footer>
<el-button size="small" @click="closeSubWaybillSelectDialog">取消</el-button>
<el-button
size="small"
type="primary"
:loading="subWaybillPrintLoading"
@click="confirmSubWaybillPrint"
>
打印所选运单
</el-button>
</template>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>选择运单号打印</h2>
<p>勾选需要打印的运单号</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="closeSubWaybillSelectDialog">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<p
v-if="subWaybillSelectErrorMessage"
class="task-panel__form-tip task-panel__form-tip--error"
>
{{ subWaybillSelectErrorMessage }}
</p>
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选运单</span>
<strong class="task-panel__field-value">{{ subWaybillSelectedWaybills.length }} 个</strong>
</div>
<div class="task-panel__section">
<span class="task-panel__section-title">运单号列表</span>
<div class="task-panel__table-wrap">
<el-table
v-loading="subWaybillSelectLoading"
:data="subWaybillOptions"
border
size="small"
max-height="240"
empty-text="无"
@selection-change="onSubWaybillSelectChange"
>
<el-table-column type="selection" width="48" />
<el-table-column prop="waybill_code" label="运单号" min-width="190" show-overflow-tooltip />
<el-table-column label="类型" width="80" align="center">
<template #default="{ row }">
<el-tag :type="row.is_main ? 'info' : 'success'" size="small">
{{ row.is_main ? '主单' : '子单' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="logistics_name" label="物流公司" min-width="130" show-overflow-tooltip />
</el-table>
</div>
</div>
</div>
<p class="task-panel__form-tip">
仅打印已勾选的运单号,主单与子单可分别选择。
</p>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">未勾选运单号时无法打印</span>
<div class="task-panel__actions">
<el-button size="small" @click="closeSubWaybillSelectDialog">取消</el-button>
<el-button
size="small"
type="primary"
:loading="subWaybillPrintLoading"
@click="confirmSubWaybillPrint"
>
打印所选运单
</el-button>
</div>
</footer>
</div>
</el-dialog>
<allocate-sub-order-number-form
@ -432,6 +472,7 @@ const {
selectDialogVisible: subWaybillSelectDialogVisible,
selectLoading: subWaybillSelectLoading,
waybillOptions: subWaybillOptions,
selectedWaybills: subWaybillSelectedWaybills,
selectErrorMessage: subWaybillSelectErrorMessage,
onSelectChange: onSubWaybillSelectChange,
confirmPrintWaybills: confirmSubWaybillPrint,
@ -777,5 +818,183 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
.order-log-wrapper {
height: 100%;
}
/* 选择运单号面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
min-height: 0;
overflow-y: auto;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__section {
display: flex;
flex-direction: column;
gap: 6px;
}
&__section-title {
font-size: 12px;
line-height: 20px;
color: #606266;
padding-left: 2px;
}
&__table-wrap {
border-radius: 4px;
overflow: hidden;
/* 勾选列(表头 + 数据单元格)复选框居中显示 */
:deep(.el-table-column--selection .cell) {
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
&--error {
background: #fef0f0;
color: #f56c6c;
}
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.select-waybill-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -317,32 +317,59 @@
<el-dialog
v-model="resolveExceptionDialogVisible"
title="异常订单处理"
width="520px"
class="resolve-exception-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="resetResolveExceptionDialog"
>
<el-alert
type="warning"
:closable="false"
show-icon
title="该操作会将异常订单恢复为正常待处理状态(step: 3 -> 2)。"
/>
<el-form label-width="120px" class="resolve-exception-form">
<el-form-item label="已选订单数">
<span>{{ resolveExceptionOrderIds.length }} 条</span>
</el-form-item>
<el-form-item label="订单ID">
<div class="resolve-exception-ids">{{ resolveExceptionOrderIds.join(', ') }}</div>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException">
确认处理
</el-button>
</template>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>异常订单处理</h2>
<p>将异常订单恢复为正常待处理状态</p>
</div>
<button
class="task-panel__close"
type="button"
aria-label="关闭"
@click="resolveExceptionDialogVisible = false"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单数</span>
<strong class="task-panel__field-value">{{ resolveExceptionOrderIds.length }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--stack">
<span class="task-panel__field-label">订单 ID</span>
<div class="task-panel__ids">{{ resolveExceptionOrderIds.join(', ') || '—' }}</div>
</div>
</div>
<p class="task-panel__form-tip">
该操作会将异常订单恢复为正常待处理状态(step: 3 → 2)。
</p>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认已选订单</span>
<div class="task-panel__actions">
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException">
确认处理
</el-button>
</div>
</footer>
</div>
</el-dialog>
<allocate-sub-order-number-form
@ -1148,16 +1175,147 @@ function onBatchPrintSuccess() {
margin-top: 12px;
}
.resolve-exception-form {
margin-top: 12px;
}
/* 异常订单处理面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
.resolve-exception-ids {
max-height: 96px;
overflow-y: auto;
color: #606266;
line-height: 1.6;
word-break: break-all;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
&--stack {
flex-direction: column;
align-items: stretch;
gap: 4px;
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__ids {
max-height: 96px;
overflow-y: auto;
color: #606266;
font-size: 12px;
line-height: 1.6;
word-break: break-all;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
.clone-order-meta {
@ -1189,3 +1347,19 @@ function onBatchPrintSuccess() {
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.resolve-exception-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,41 +1,76 @@
<template>
<el-dialog
v-model="visible"
title="分配子单号"
width="520px"
class="allocate-sub-order-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="handleClosed"
>
<el-form
ref="formRef"
:model="formModel"
:rules="rules"
label-width="120px"
class="allocate-sub-order-form"
@submit.prevent
>
<el-form-item label="订单 ID">
<span class="readonly-value">{{ orderId ?? '-' }}</span>
</el-form-item>
<el-form-item label="订单号">
<span class="readonly-value">{{ orderCode || '-' }}</span>
</el-form-item>
<el-form-item label="子单号数量" prop="sub_order_count">
<el-input-number
v-model="formModel.sub_order_count"
:min="1"
:max="999"
:step="1"
placeholder="请输入子单号数量"
controls-position="right"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认分配</el-button>
</template>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>分配子单号</h2>
<p>为指定订单批量分配子单号</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">订单 ID</span>
<strong class="task-panel__field-value">{{ orderId ?? '—' }}</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">订单号</span>
<strong class="task-panel__field-value">{{ orderCode || '—' }}</strong>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">子单号数量</span>
<el-form
ref="formRef"
:model="formModel"
:rules="rules"
class="task-panel__field-form"
@submit.prevent
>
<el-form-item prop="sub_order_count">
<el-input-number
v-model="formModel.sub_order_count"
size="default"
:min="1"
:max="999"
:step="1"
placeholder="请输入子单号数量"
controls-position="right"
@keyup.enter="handleSubmit"
/>
</el-form-item>
</el-form>
</div>
</div>
<!-- <p class="task-panel__form-tip">
子单号数量需为不小于 1 的整数,提交后按填写的数量为该订单分配子单号。
</p> -->
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认子单号数量</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认分配</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -109,12 +144,182 @@ function handleClosed() {
}
</script>
<style scoped>
.allocate-sub-order-form {
margin-top: 4px;
}
<style scoped lang="scss">
/* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
.task-panel {
background: #fff;
color: #303133;
.readonly-value {
color: #606266;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 数量输入行:不需要灰色容器,与上方静态信息行拉开层次 */
&--input {
align-items: flex-start;
min-height: 0;
/* 左 12px 与上方标签对齐;右 0 让输入框右边顶到灰色容器右边缘 */
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
word-break: break-all;
}
&__field-form {
flex: 1;
min-width: 0;
max-width: none;
:deep(.el-form-item) {
margin-bottom: 0;
}
:deep(.el-form-item__content) {
margin-left: 0 !important;
width: 100%;
}
:deep(.el-input-number) {
width: 100%;
}
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.allocate-sub-order-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,97 +1,105 @@
<template>
<el-dialog
v-model="visible"
title="批量发货"
width="720px"
class="batch-recheck-dialog"
width="min(720px, 94vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="!submitting"
:close-on-press-escape="!submitting"
@closed="emit('closed')"
>
<!-- <el-alert
type="info"
:closable="false"
show-icon
class="batch-recheck-alert"
title="批量发货说明"
description="对每个订单执行前置检查(已分配储位、已分配快递、已同步且未被拦截),必要时自动完成拣货后标记发货。各订单独立事务,支持部分失败。"
/> -->
<el-form ref="formRef" :model="form" :rules="rules" label-width="96px" class="batch-recheck-form">
<el-form-item label="已选订单">
<span>{{ selectedRows.length }} 条</span>
</el-form-item>
<el-form-item v-if="selectedRows.length" label="订单预览">
<el-table :data="selectedRows" border size="small" max-height="160" empty-text="无">
<el-table-column prop="id" label="订单 ID" width="96" />
<el-table-column prop="delivery_order_code" label="发货单号" min-width="150" show-overflow-tooltip />
<el-table-column label="复核状态" width="96">
<template #default="{ row }">
{{ translateRecheckStatus(row) }}
</template>
</el-table-column>
<el-table-column label="拣货状态" width="96">
<template #default="{ row }">
{{ translatePickStatus(row) }}
</template>
</el-table-column>
</el-table>
</el-form-item>
<!-- <el-form-item label="订单 ID" prop="idsText" required>
<el-input
v-model="form.idsText"
type="textarea"
:rows="4"
placeholder="必填。支持多个订单 ID,逗号、空格或换行分隔;接口参数 ids 支持数组或逗号分隔字符串"
/>
<div class="form-hint">
已解析 <strong>{{ parsedIds.length }}</strong> 个有效 ID
<el-button
v-if="suggestedIds.length"
link
type="primary"
size="small"
style="margin-left: 8px"
@click="fillSuggestedIds"
>
恢复为当前勾选({{ suggestedIds.length }})
</el-button>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>批量发货</h2>
<p>对已选订单执行快捷复核并标记发货</p>
</div>
</el-form-item> -->
</el-form>
<button
class="task-panel__close"
type="button"
aria-label="关闭"
:disabled="submitting"
@click="!submitting && (visible = false)"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div v-if="result" class="recheck-result">
<!-- <el-divider content-position="left">执行结果</el-divider> -->
<div class="result-summary">
<el-tag type="success" size="small">成功 {{ result.success_count }}</el-tag>
<el-tag type="danger" size="small">失败 {{ result.failed_count }}</el-tag>
</div>
<el-tabs v-model="resultTab" class="result-tabs">
<el-tab-pane :label="`成功 (${result.success.length})`" name="success">
<el-table :data="normalizeResultRows(result.success)" border size="small" max-height="220" empty-text="无">
<el-table-column prop="order_id" label="订单 ID" width="100" />
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip />
</el-table>
</el-tab-pane>
<el-tab-pane :label="`失败 (${result.failed.length})`" name="failed">
<el-table :data="normalizeResultRows(result.failed)" border size="small" max-height="220" empty-text="无">
<el-table-column prop="order_id" label="订单 ID" width="100" />
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="reason" label="原因" min-width="180" show-overflow-tooltip />
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip />
</el-table>
</el-tab-pane>
</el-tabs>
<el-form
ref="formRef"
:model="form"
:rules="rules"
class="task-panel__body batch-recheck-form"
>
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单</span>
<strong class="task-panel__field-value">{{ selectedRows.length }} 条</strong>
</div>
<div v-if="selectedRows.length" class="task-panel__section">
<span class="task-panel__section-title">订单预览</span>
<div class="task-panel__table-wrap">
<el-table :data="selectedRows" border size="small" max-height="160" empty-text="无">
<el-table-column prop="id" label="订单 ID" width="96" />
<el-table-column prop="delivery_order_code" label="发货单号" min-width="150" show-overflow-tooltip />
<el-table-column label="复核状态" width="96">
<template #default="{ row }">
{{ translateRecheckStatus(row) }}
</template>
</el-table-column>
<el-table-column label="拣货状态" width="96">
<template #default="{ row }">
{{ translatePickStatus(row) }}
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<!-- <p class="task-panel__form-tip">
对每个订单执行前置检查(已分配储位、已分配快递、已同步且未被拦截),必要时自动完成拣货后标记发货;各订单独立事务,支持部分失败。
</p> -->
<div v-if="result" class="recheck-result">
<div class="result-summary">
<el-tag type="success" size="small">成功 {{ result.success_count }}</el-tag>
<el-tag type="danger" size="small">失败 {{ result.failed_count }}</el-tag>
</div>
<el-tabs v-model="resultTab" class="result-tabs">
<el-tab-pane :label="`成功 (${result.success.length})`" name="success">
<el-table :data="normalizeResultRows(result.success)" border size="small" max-height="220" empty-text="无">
<el-table-column prop="order_id" label="订单 ID" width="100" />
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip />
</el-table>
</el-tab-pane>
<el-tab-pane :label="`失败 (${result.failed.length})`" name="failed">
<el-table :data="normalizeResultRows(result.failed)" border size="small" max-height="220" empty-text="无">
<el-table-column prop="order_id" label="订单 ID" width="100" />
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="reason" label="原因" min-width="180" show-overflow-tooltip />
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip />
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</el-form>
<footer class="task-panel__foot">
<span class="task-panel__hint">各订单独立事务,支持部分失败</span>
<div class="task-panel__actions">
<el-button size="small" :disabled="submitting" @click="visible = false">关闭</el-button>
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">执行发货</el-button>
</div>
</footer>
</div>
<template #footer>
<el-button size="small" :disabled="submitting" @click="visible = false">关闭</el-button>
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">执行发货</el-button>
</template>
</el-dialog>
</template>
@ -274,23 +282,170 @@ async function handleSubmit() {
</script>
<style scoped lang="scss">
.batch-recheck-alert {
margin-bottom: 12px;
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
display: flex;
flex-direction: column;
max-height: 82vh;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
flex-shrink: 0;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:not(:disabled):hover {
color: #409eff;
}
&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
&__body {
padding: 12px 16px 0;
min-height: 0;
overflow-y: auto;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__section {
display: flex;
flex-direction: column;
gap: 6px;
}
&__section-title {
font-size: 12px;
line-height: 20px;
color: #606266;
padding-left: 2px;
}
&__table-wrap {
border-radius: 4px;
overflow: hidden;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
.batch-recheck-form {
margin-top: 4px;
}
.form-hint {
margin-top: 6px;
font-size: 12px;
color: #909399;
line-height: 1.5;
margin: 0;
}
.recheck-result {
margin-top: 4px;
margin: 10px 0 8px;
}
.result-summary {
@ -303,3 +458,19 @@ async function handleSubmit() {
margin-bottom: 8px;
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.batch-recheck-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,26 +1,52 @@
<template>
<el-dialog
v-model="visible"
title="克隆待处理订单"
width="480px"
class="clone-order-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')"
>
<el-alert
type="warning"
:closable="false"
show-icon
title="克隆会取消原订单并创建新订单,请确认后执行。"
/>
<div class="clone-order-meta">
<p>原订单ID:{{ sourceOrderId || '-' }}</p>
<p>订单号:{{ sourceOrderCode || '-' }}</p>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>克隆待处理订单</h2>
<p>克隆会取消原订单并创建一个新订单</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">原订单 ID</span>
<strong class="task-panel__field-value">{{ sourceOrderId || '—' }}</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">订单号</span>
<strong class="task-panel__field-value">{{ sourceOrderCode || '—' }}</strong>
</div>
</div>
<p class="task-panel__form-tip">
克隆会取消原订单并创建新订单,操作不可撤销,请确认后执行。
</p>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认原订单信息</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认克隆</el-button>
</div>
</footer>
</div>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认克隆</el-button>
</template>
</el-dialog>
</template>
@ -39,13 +65,149 @@ const emit = defineEmits<{
}>()
</script>
<style scoped>
.clone-order-meta {
margin-top: 12px;
color: #606266;
}
<style scoped lang="scss">
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
.clone-order-meta p {
margin: 4px 0;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
word-break: break-all;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.clone-order-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,48 +1,75 @@
<template>
<el-dialog
v-model="visible"
title="手工录入运单号"
width="520px"
class="manual-waybill-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="handleClosed"
>
<!-- <el-alert
type="info"
:closable="false"
show-icon
title="为指定待处理订单创建运单记录(wms_order_express),仅允许步骤为 1~3 且数据归档状态非归档中的订单。"
class="manual-waybill-alert"
/> -->
<el-form
ref="formRef"
:model="formModel"
:rules="rules"
label-width="100px"
class="manual-waybill-form"
@submit.prevent
>
<el-form-item label="订单 ID">
<span class="readonly-value">{{ orderId ?? '-' }}</span>
</el-form-item>
<el-form-item label="订单号">
<span class="readonly-value">{{ orderCode || '-' }}</span>
</el-form-item>
<el-form-item label="运单号" prop="waybill_code">
<el-input
v-model="formModel.waybill_code"
placeholder="请输入运单号"
clearable
maxlength="64"
show-word-limit
@keyup.enter="handleSubmit"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认录入</el-button>
</template>
<!-- 面板结构对齐「按订单批量分配储位」(UnifiedTaskProgressDialog / TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>手工录入运单号</h2>
<p>为指定待处理订单创建运单记录</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">订单 ID</span>
<strong class="task-panel__field-value">{{ orderId ?? '—' }}</strong>
</div>
<div class="task-panel__field">
<span class="task-panel__field-label">订单号</span>
<strong class="task-panel__field-value">{{ orderCode || '—' }}</strong>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">运单号</span>
<el-form
ref="formRef"
:model="formModel"
:rules="rules"
class="task-panel__field-form"
@submit.prevent
>
<el-form-item prop="waybill_code">
<el-input
v-model="formModel.waybill_code"
size="default"
placeholder="请输入运单号"
clearable
maxlength="64"
show-word-limit
@keyup.enter="handleSubmit"
/>
</el-form-item>
</el-form>
</div>
</div>
<p class="task-panel__form-tip">
仅允许步骤 1~3 且未归档中的订单录入;运单号必填,重复录入会覆盖原运单记录。
</p>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认运单号无误</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认录入</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -115,16 +142,182 @@ function handleClosed() {
}
</script>
<style scoped>
.manual-waybill-alert {
margin-bottom: 16px;
}
<style scoped lang="scss">
/* 面板结构 / 尺寸对齐 TaskProgressPanel(按订单批量分配储位) */
.task-panel {
background: #fff;
color: #303133;
.manual-waybill-form {
margin-top: 4px;
}
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
.readonly-value {
color: #606266;
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 运单号输入行:不需要灰色容器,与上方静态信息行拉开层次 */
&--input {
align-items: flex-start;
min-height: 0;
/* 左 12px 与上方标签对齐;右 0 让输入框右边顶到灰色容器右边缘 */
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
word-break: break-all;
}
&__field-form {
flex: 1;
min-width: 0;
max-width: none;
:deep(.el-form-item) {
margin-bottom: 0;
}
:deep(.el-form-item__content) {
margin-left: 0 !important;
width: 100%;
}
:deep(.el-input) {
width: 100%;
}
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同 UnifiedTaskProgressDialog) */
.el-dialog.manual-waybill-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,121 +1,158 @@
<template>
<el-dialog
v-model="visible"
title="批量修改收件地址"
width="640px"
class="update-address-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')"
>
<el-alert
type="warning"
:closable="false"
show-icon
class="update-address-alert"
title="修改限制"
description="地址字段仅允许修改 post_status='none'(未分配快递)的订单;留言不受此限制。至少填写一项地址字段或留言,空白字段不会更新到订单。"
/>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>批量修改收件地址</h2>
<p>提交后按已选订单批量更新收件地址</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<el-form label-width="96px" class="update-address-form">
<el-form-item label="已选订单数">
<span>{{ orderCount }} 条</span>
</el-form-item>
<el-form-item label="收件人">
<el-input v-model="form.name" clearable placeholder="留空则不修改" />
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="form.mobile" clearable placeholder="留空则不修改" />
</el-form-item>
<el-form-item label="电话">
<el-input v-model="form.tel" clearable placeholder="留空则不修改" />
</el-form-item>
<el-form-item label="邮编">
<el-input v-model="form.zip_code" clearable placeholder="留空则不修改" />
</el-form-item>
<el-form-item label="省份">
<el-select
v-model="form.province_code"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
@change="handleProvinceChange"
>
<el-option
v-for="item in provinceOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="城市">
<el-select
v-model="form.city_code"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
:disabled="!form.province_code"
@change="handleCityChange"
>
<el-option
v-for="item in cityOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="区/县">
<el-select
v-model="form.area_code"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
:disabled="!form.city_code"
@change="handleAreaChange"
>
<el-option
v-for="item in areaOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="镇/街道">
<el-input v-model="form.town" clearable placeholder="留空则不修改" />
</el-form-item>
<el-form-item label="详细地址">
<el-input
v-model="form.detail_address"
type="textarea"
:rows="3"
resize="none"
clearable
placeholder="留空则不修改"
/>
</el-form-item>
<!-- <el-form-item label="留言">
<el-input
v-model="form.remark"
type="textarea"
:rows="3"
resize="none"
clearable
maxlength="500"
show-word-limit
placeholder="留空则不修改;填写后将批量覆盖所选订单的留言"
/>
</el-form-item> -->
</el-form>
<div class="task-panel__body">
<p class="task-panel__form-tip">
仅允许修改 post_status='none'(未分配快递)的订单;至少填写一项地址字段,空白字段不会更新到订单。
</p>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</template>
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单数</span>
<strong class="task-panel__field-value">{{ orderCount }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">收件人</span>
<div class="task-panel__field-control">
<el-input v-model="form.name" size="default" clearable placeholder="留空则不修改" />
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">手机号</span>
<div class="task-panel__field-control">
<el-input v-model="form.mobile" size="default" clearable placeholder="留空则不修改" />
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">电话</span>
<div class="task-panel__field-control">
<el-input v-model="form.tel" size="default" clearable placeholder="留空则不修改" />
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">邮编</span>
<div class="task-panel__field-control">
<el-input v-model="form.zip_code" size="default" clearable placeholder="留空则不修改" />
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">省份</span>
<div class="task-panel__field-control">
<el-select
v-model="form.province_code"
size="default"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
@change="handleProvinceChange"
>
<el-option
v-for="item in provinceOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">城市</span>
<div class="task-panel__field-control">
<el-select
v-model="form.city_code"
size="default"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
:disabled="!form.province_code"
@change="handleCityChange"
>
<el-option
v-for="item in cityOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">区/县</span>
<div class="task-panel__field-control">
<el-select
v-model="form.area_code"
size="default"
filterable
clearable
placeholder="留空则不修改"
style="width: 100%"
:disabled="!form.city_code"
@change="handleAreaChange"
>
<el-option
v-for="item in areaOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">镇/街道</span>
<div class="task-panel__field-control">
<el-input v-model="form.town" size="default" clearable placeholder="留空则不修改" />
</div>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">详细地址</span>
<div class="task-panel__field-control">
<el-input
v-model="form.detail_address"
type="textarea"
:rows="3"
resize="none"
clearable
placeholder="留空则不修改"
/>
</div>
</div>
</div>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认地址信息无误</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -207,13 +244,175 @@ function handleAreaChange(code: string) {
</script>
<style scoped lang="scss">
.update-address-alert {
margin-bottom: 12px;
}
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
display: flex;
flex-direction: column;
max-height: 80vh;
.update-address-form {
max-height: 58vh;
overflow-y: auto;
padding-right: 4px;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
flex-shrink: 0;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
min-height: 0;
overflow-y: auto;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
padding-bottom: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 输入行:去掉灰色容器,与静态信息行区分 */
&--input {
align-items: flex-start;
min-height: 0;
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
width: 72px;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__field-control {
flex: 1;
min-width: 0;
}
&__form-tip {
margin: 0 0 8px;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.update-address-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,40 +1,73 @@
<template>
<el-dialog
v-model="visible"
:title="mode === 'express' ? '批量修改快递信息' : '批量修改平台信息'"
width="560px"
class="update-order-meta-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')"
>
<el-form label-width="110px" class="storage-allocate-form">
<el-form-item label="已选订单数">
<span>{{ orderCount }} 条</span>
</el-form-item>
<el-form-item :label="mode === 'express' ? '快递编码' : '平台编码'" required>
<el-select
v-model="codeProxy"
filterable
allow-create
default-first-option
:reserve-keyword="false"
clearable
placeholder="请选择或输入编码"
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</template>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>{{ mode === 'express' ? '批量修改快递信息' : '批量修改平台信息' }}</h2>
<p>提交后按已选订单批量更新{{ mode === 'express' ? '快递' : '平台' }}信息</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单数</span>
<strong class="task-panel__field-value">{{ orderCount }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label is-required">
{{ mode === 'express' ? '快递编码' : '平台编码' }}
</span>
<div class="task-panel__field-control">
<el-select
v-model="codeProxy"
size="default"
filterable
allow-create
default-first-option
:reserve-keyword="false"
clearable
placeholder="请选择或输入编码"
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
</div>
<!-- <p class="task-panel__form-tip">
支持下拉选择或直接输入{{ mode === 'express' ? '快递编码' : '平台编码' }},提交后仅更新已选订单。
</p> -->
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认编码无误</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -63,3 +96,173 @@ const codeProxy = computed({
}
})
</script>
<style scoped lang="scss">
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 编码输入行:去掉灰色容器,与静态信息行区分 */
&--input {
align-items: flex-start;
min-height: 0;
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
&.is-required::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__field-control {
flex: 1;
min-width: 0;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.update-order-meta-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,42 +1,62 @@
<template>
<el-dialog
v-model="visible"
title="批量修改留言"
width="520px"
class="update-remark-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')"
>
<el-alert
type="info"
:closable="false"
show-icon
class="update-remark-alert"
title="修改说明"
description="批量覆盖所选订单的备注/留言,不受 post_status 限制。更新成功后写入操作日志。"
/>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>批量修改留言</h2>
<p>提交后按已选订单批量覆盖备注/留言</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<el-form label-width="96px" class="update-remark-form">
<el-form-item label="已选订单数">
<span>{{ orderCount }} 条</span>
</el-form-item>
<el-form-item label="留言" required>
<el-input
v-model="form.remark"
type="textarea"
:rows="4"
resize="none"
maxlength="500"
show-word-limit
placeholder="请输入订单备注/留言"
/>
</el-form-item>
</el-form>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单数</span>
<strong class="task-panel__field-value">{{ orderCount }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label is-required">留言</span>
<div class="task-panel__field-control">
<el-input
v-model="form.remark"
type="textarea"
:rows="4"
resize="none"
maxlength="500"
show-word-limit
placeholder="请输入订单备注/留言"
/>
</div>
</div>
</div>
<!-- <p class="task-panel__form-tip">
批量覆盖所选订单的备注/留言,不受 post_status 限制;更新成功后写入操作日志。
</p> -->
</div>
<template #footer>
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</template>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认留言内容无误</span>
<div class="task-panel__actions">
<el-button size="small" @click="visible = false">取消</el-button>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
</div>
</footer>
</div>
</el-dialog>
</template>
@ -64,7 +84,173 @@ const emit = defineEmits<{
</script>
<style scoped lang="scss">
.update-remark-alert {
margin-bottom: 12px;
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 留言输入行:去掉灰色容器,与静态信息行区分 */
&--input {
align-items: flex-start;
min-height: 0;
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
width: 72px;
white-space: nowrap;
&.is-required::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__field-control {
flex: 1;
min-width: 0;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.update-remark-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -313,32 +313,59 @@
<el-dialog
v-model="resolveExceptionDialogVisible"
title="异常订单处理"
width="520px"
class="resolve-exception-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="resetResolveExceptionDialog"
>
<el-alert
type="warning"
:closable="false"
show-icon
title="该操作会将异常订单恢复为正常待处理状态(step: 3 -> 2)。"
/>
<el-form label-width="120px" class="resolve-exception-form">
<el-form-item label="已选订单数">
<span>{{ resolveExceptionOrderIds.length }} 条</span>
</el-form-item>
<el-form-item label="订单ID">
<div class="resolve-exception-ids">{{ resolveExceptionOrderIds.join(', ') }}</div>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException">
确认处理
</el-button>
</template>
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>异常订单处理</h2>
<p>将异常订单恢复为正常待处理状态</p>
</div>
<button
class="task-panel__close"
type="button"
aria-label="关闭"
@click="resolveExceptionDialogVisible = false"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选订单数</span>
<strong class="task-panel__field-value">{{ resolveExceptionOrderIds.length }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--stack">
<span class="task-panel__field-label">订单 ID</span>
<div class="task-panel__ids">{{ resolveExceptionOrderIds.join(', ') || '—' }}</div>
</div>
</div>
<p class="task-panel__form-tip">
该操作会将异常订单恢复为正常待处理状态
</p>
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认已选订单</span>
<div class="task-panel__actions">
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException">
确认处理
</el-button>
</div>
</footer>
</div>
</el-dialog>
<allocate-sub-order-number-form
@ -1145,16 +1172,163 @@ async function handleConfirmInterceptBatch() {
height: 100%;
}
.resolve-exception-form {
margin-top: 12px;
}
/* 异常订单处理面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
background: #fff;
color: #303133;
.resolve-exception-ids {
max-height: 96px;
overflow-y: auto;
color: #606266;
line-height: 1.6;
word-break: break-all;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
&--stack {
flex-direction: column;
align-items: stretch;
gap: 4px;
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__ids {
max-height: 96px;
overflow-y: auto;
color: #606266;
font-size: 12px;
line-height: 1.6;
word-break: break-all;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
.el-dialog.resolve-exception-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -1,55 +1,78 @@
<template>
<el-dialog
v-model="visibleProxy"
title="确认打印(扫面单号)"
width="520px"
class="confirm-wave-print-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@opened="handleOpened"
>
<div class="confirm-wave-print">
<el-alert type="info" :closable="false" show-icon class="confirm-wave-print__tip">
<template #title>
扫描波次内任一订单的面单号,把该波次下「已打印且非拦截」的订单全部标记为已确认打印
</template>
<div class="confirm-wave-print__tip-detail">
面单号会自行定位所属波次,无需先选中;波次内仍有未打印订单时会被阻断;已全部确认时重复扫描不会重复写日志。
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>确认打印(扫面单号)</h2>
<p>扫描波次内任一订单的面单号完成确认</p>
</div>
</el-alert>
<div class="confirm-wave-print__field">
<span class="field-label">面单号/运单号</span>
<el-input
ref="inputRef"
v-model="waybillNo"
placeholder="扫描或输入面单号后回车"
clearable
<button
class="task-panel__close"
type="button"
aria-label="关闭"
:disabled="submitting"
@keyup.enter="handleSubmit"
/>
@click="visibleProxy = false"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field task-panel__field--input">
<span class="task-panel__field-label">面单号</span>
<el-input
ref="inputRef"
v-model="waybillNo"
size="default"
placeholder="扫描或输入面单号后回车"
clearable
:disabled="submitting"
@keyup.enter="handleSubmit"
/>
</div>
<div v-if="lastResult" class="task-panel__field">
<span class="task-panel__field-label">波次</span>
<strong class="task-panel__field-value">{{ lastResult.waveLabel }}</strong>
</div>
<div v-if="lastResult" class="task-panel__field task-panel__field--stack">
<span class="task-panel__field-label">结果</span>
<div class="task-panel__result" :class="{ 'is-repeat': lastResult.repeated }">
{{ lastResult.text }}
</div>
</div>
</div>
<p class="task-panel__form-tip">
面单号会自行定位所属波次,无需先选中;波次内仍有未打印订单时会被阻断;已全部确认时重复扫描不会重复写日志。
</p>
<p class="task-panel__form-tip">
本页支持直接扫面单号(长度超过 8 位)自动确认打印;此处弹窗用于手工输入或复核最近一次确认结果。
</p>
</div>
<div v-if="lastResult" class="confirm-wave-print__result" :class="{ 'is-repeat': lastResult.repeated }">
<div class="result-row">
<span class="result-label">波次</span>
<span class="result-value">{{ lastResult.waveLabel }}</span>
<footer class="task-panel__foot">
<span class="task-panel__hint">确认成功后自动清空输入框,可连续扫码</span>
<div class="task-panel__actions">
<el-button size="small" @click="visibleProxy = false">关闭</el-button>
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">确认打印</el-button>
</div>
<div class="result-row">
<span class="result-label">结果</span>
<span class="result-value">{{ lastResult.text }}</span>
</div>
</div>
<p class="confirm-wave-print__hint">
提示:本页支持直接扫面单号(长度超过 8 位)自动确认打印;此处弹窗用于手工输入或复核最近一次确认结果。
</p>
</footer>
</div>
<template #footer>
<el-button size="small" @click="visibleProxy = false">关闭</el-button>
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">确认打印</el-button>
</template>
</el-dialog>
</template>
@ -148,67 +171,186 @@ async function handleSubmit() {
</script>
<style scoped lang="scss">
.confirm-wave-print {
display: flex;
flex-direction: column;
gap: 12px;
/* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
.task-panel {
background: #fff;
color: #303133;
&__tip {
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
&__tip-detail {
margin-top: 4px;
line-height: 1.6;
color: var(--el-text-color-secondary);
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:not(:disabled):hover {
color: #409eff;
}
&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
&__body {
padding: 12px 16px 0;
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
gap: 10px;
}
.field-label {
flex: 0 0 96px;
text-align: right;
color: var(--el-text-color-regular);
}
&__result {
padding: 10px 12px;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: var(--el-color-success-light-9);
border: 1px solid var(--el-color-success-light-7);
background: #fafafa;
&.is-repeat {
background: var(--el-color-info-light-9);
border-color: var(--el-color-info-light-7);
/* 面单号输入行:不需要灰色容器,与上方静态信息行拉开层次 */
&--input {
align-items: center;
min-height: 0;
/* 左 12px 与上方标签对齐;右 0 让输入框右边顶到灰色容器右边缘 */
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.el-input {
flex: 1;
min-width: 0;
}
}
&--stack {
flex-direction: column;
align-items: stretch;
gap: 4px;
}
}
.result-row {
display: flex;
gap: 10px;
line-height: 1.8;
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
.result-label {
flex: 0 0 40px;
color: var(--el-text-color-secondary);
}
.result-value {
flex: 1;
color: var(--el-text-color-primary);
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
word-break: break-all;
}
&__hint {
margin: 0;
&__result {
font-size: 12px;
line-height: 1.6;
color: var(--el-text-color-secondary);
color: #67c23a;
word-break: break-all;
&.is-repeat {
color: #909399;
}
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
<style lang="scss">
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.confirm-wave-print-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -309,43 +309,109 @@
</template>
</el-dialog>
<el-dialog v-model="systemProductPickerVisible" title="查询系统商品" align-center width="980px" append-to-body destroy-on-close>
<div class="system-product-picker">
<div class="picker-toolbar">
<el-input v-model="systemProductKeyword" placeholder="输入商品名称或条码" clearable style="width: 320px" @keyup.enter="querySystemProducts(1)">
<template #append>
<el-button size="small" :icon="Search" :loading="systemProductLoading" @click="querySystemProducts(1)">查询</el-button>
</template>
</el-input>
<span v-if="boundStoreId" class="picker-hint">已按收货单货主过滤:{{ boundStoreName || ('ID ' + boundStoreId) }}</span>
<span v-else class="picker-hint">当前收货单未绑定货主,查询不过滤货主</span>
<el-dialog
v-model="systemProductPickerVisible"
class="system-product-dialog"
width="min(1000px, 96vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>查询系统商品</h2>
<!-- <p>按商品名称或条码检索,选择需要绑定的系统商品</p> -->
</div>
<button
class="task-panel__close"
type="button"
aria-label="关闭"
@click="systemProductPickerVisible = false"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__toolbar">
<div class="task-panel__toolbar-main">
<el-input
v-model="systemProductKeyword"
placeholder="输入商品名称或条码"
clearable
style="width: 320px"
@keyup.enter="querySystemProducts(1)"
/>
<el-button size="small" type="primary" :loading="systemProductLoading" @click="querySystemProducts(1)">
查询
</el-button>
</div>
<span class="system-product-filter-hint">
<template v-if="boundStoreId">已按收货单货主过滤:{{ boundStoreName || ('ID ' + boundStoreId) }}</template>
<template v-else>当前收货单未绑定货主,查询不过滤货主</template>
</span>
</div>
<div class="task-panel__section">
<!-- <div class="task-panel__section-head">
<span class="task-panel__section-title">商品列表</span>
<span class="task-panel__section-meta">已选 {{ systemProductSelection.length }} 条</span>
</div> -->
<div class="task-panel__table-wrap system-product-dialog-table">
<UpperTable
:data="systemProductResults"
:loading="systemProductLoading"
:show-selection="true"
:show-pagination="false"
default-align="center"
:multiple-selection="systemProductSelection"
:pagination="{ currentPage: systemProductPagination.page, pageSize: systemProductPagination.pageSize, total: systemProductPagination.total }"
:columns="[
{ prop: 'id', label: '系统商品ID', width: '120' },
{ prop: 'item_name', label: '商品名称', minWidth: '220' },
{
prop: 'barcodes',
label: '条码',
width: '220',
copyAction: 'copy',
copyValue: getSystemProductBarcodes
},
{ prop: 'store_name', label: '货主', width: '180' },
{ prop: 'weight', label: '重量(g)', width: '110' }
]"
@selection-change="handleSystemProductSelectionChange"
@row-click="handleSystemProductRowClick"
/>
</div>
</div>
</div>
<div class="picker-table-wrap">
<UpperTable
:data="systemProductResults"
:loading="systemProductLoading"
:show-selection="true"
:multiple-selection="systemProductSelection"
:pagination="{ currentPage: systemProductPagination.page, pageSize: systemProductPagination.pageSize, total: systemProductPagination.total }"
:columns="[
{ prop: 'id', label: '系统商品ID', width: '120' },
{ prop: 'item_name', label: '商品名称', minWidth: '220' },
{ prop: 'barcodes', label: '条码', width: '180' },
{ prop: 'store_name', label: '货主', width: '180' },
{ prop: 'weight', label: '重量(g)', width: '110', align: 'right' }
]"
@selection-change="handleSystemProductSelectionChange"
@row-click="handleSystemProductRowClick"
@page-change="onSystemProductPageChange"
@page-size-change="onSystemProductPageSizeChange"
/>
</div>
<footer class="task-panel__foot">
<!-- <span class="task-panel__hint">多条码商品只显示首个条码,点 +N 展开全部</span> -->
<div class="task-panel__actions">
<el-pagination
:current-page="systemProductPagination.page"
:page-size="systemProductPagination.pageSize"
:page-sizes="[10, 20, 50, 100]"
:total="systemProductPagination.total"
layout="total, sizes, prev, pager, next"
background
size="small"
class="system-product-pagination"
@current-change="onSystemProductPageChange"
@size-change="onSystemProductPageSizeChange"
/>
<el-button size="small" @click="systemProductPickerVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="applySelectedSystemProduct">使用选中商品</el-button>
</div>
</footer>
</div>
<template #footer>
<el-button size="small" @click="systemProductPickerVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="applySelectedSystemProduct">使用选中商品</el-button>
</template>
</el-dialog>
<el-dialog v-model="spacePickerVisible" title="选择系统库位" align-center width="900px" append-to-body destroy-on-close>
@ -384,75 +450,148 @@
</template>
</el-dialog>
<el-dialog v-model="batchImportDialogVisible" title="批量导入商品" align-center width="1020px" append-to-body destroy-on-close>
<div class="batch-import-toolbar">
<input
ref="batchImportInputRef"
type="file"
accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
style="display:none"
@change="onBatchImportFileChange"
/>
<el-button size="small" @click="triggerBatchImportSelect">选择Excel</el-button>
<el-button size="small" @click="downloadBatchImportTemplate">下载模板</el-button>
<el-button size="small" @click="clearBatchImportData">清除数据</el-button>
<el-button size="small" :loading="batchRetryFailedLoading" @click="retryFailedBatchRows">只重试失败</el-button>
<el-button size="small" type="primary" :loading="batchImportLoading" @click="submitBatchImportCreate">导入</el-button>
<span class="picker-hint">已选文件:{{ batchImportFileName || '未选择' }}</span>
</div>
<el-dialog
v-model="batchImportDialogVisible"
class="batch-import-dialog"
width="min(1080px, 96vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>批量导入商品</h2>
<!-- <p>选择 Excel 文件批量生成收货商品明细</p> -->
</div>
<button
class="task-panel__close"
type="button"
aria-label="关闭"
@click="batchImportDialogVisible = false"
>
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="picker-table-wrap">
<UpperTable
:data="batchImportPreviewRows"
:show-selection="false"
:pagination="{ currentPage: 1, pageSize: 200, total: batchImportPreviewRows.length }"
:columns="[
{ prop: 'row_no', label: '行号', width: '80' },
{ prop: 'system_product_id', label: 'SKU', width: '120' },
{ prop: 'barcode', label: '条码', width: '160' },
{ prop: 'product_name', label: '商品名称', minWidth: '180' },
{ prop: 'actual_quantity', label: '实际收货数量', width: '120' },
{ prop: 'box_quantity', label: '箱数', width: '90' },
{ prop: 'boxes_per_pallet', label: '箱规', width: '90' },
{ prop: 'box_remainder', label: '剩余不满一箱', width: '130' },
{ prop: 'space_keyword', label: '库位条码或名称', width: '160' },
{ prop: 'import_status', label: '状态', width: '100' },
{ prop: 'import_message', label: '结果说明', minWidth: '200' },
{ prop: 'retry_action', label: '操作', width: '140' },
{ prop: 'remark', label: '备注', minWidth: '180' }
]"
>
<template #column-system_product_id="{ row }">
<div class="batch-cell-action">
<span>{{ row.system_product_id || '--' }}</span>
<el-button type="primary" link size="small" @click="openBatchRowSkuPicker(row)">选择商品</el-button>
<div class="task-panel__body">
<input
ref="batchImportInputRef"
type="file"
accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
style="display: none"
@change="onBatchImportFileChange"
/>
<div class="task-panel__toolbar">
<div class="task-panel__toolbar-main">
<el-button size="small" @click="triggerBatchImportSelect">选择Excel</el-button>
<el-button size="small" @click="downloadBatchImportTemplate">下载模板</el-button>
<el-button size="small" type="danger" plain @click="clearBatchImportData">清除数据</el-button>
<el-button size="small" type="primary" plain :loading="batchRetryFailedLoading" @click="retryFailedBatchRows">
只重试失败
</el-button>
<el-button size="small" type="primary" :loading="batchImportLoading" @click="submitBatchImportCreate">
导入
</el-button>
</div>
</template>
<template #column-space_keyword="{ row }">
<div class="batch-cell-action">
<span>{{ row.space_keyword || '--' }}</span>
<el-button type="primary" link size="small" @click="openBatchRowSpacePicker(row)">选择库位</el-button>
</div>
</template>
<template #column-import_status="{ row }">
<span :class="getStatusTextClass(row.import_status === '成功' ? 'success' : row.import_status === '失败' ? 'danger' : 'info')">
{{ row.import_status || '--' }}
<span class="task-panel__file-hint" :title="batchImportFileName">
已选文件:{{ batchImportFileName || '未选择' }}
</span>
</template>
<template #column-retry_action="{ row }">
<el-button v-if="row.import_status === '失败'" type="primary" link size="small" @click="retryBatchImportRow(row)">重试</el-button>
<span v-else>--</span>
</template>
</UpperTable>
</div>
</div>
<div class="batch-import-summary">
已生成基础新增数组:{{ batchImportAddItems.length }} 条
</div>
<div class="task-panel__section">
<!-- <div class="task-panel__section-head">
<span class="task-panel__section-title">导入预览</span>
<span class="task-panel__section-meta">
共 {{ batchImportPreviewRows.length }} 行 · 已生成 {{ batchImportAddItems.length }} 条
</span>
</div> -->
<div class="batch-import-table">
<UpperTable
:data="batchImportPagedRows"
:show-selection="false"
:show-pagination="false"
default-align="center"
:pagination="{ currentPage: batchImportPage, pageSize: batchImportPageSize, total: batchImportPreviewRows.length }"
:columns="[
{ prop: 'row_no', label: '行号', width: '80' },
{ prop: 'system_product_id', label: 'SKU', width: '120' },
{
prop: 'barcode',
label: '条码',
width: '180',
copyAction: 'copy',
copyValue: getBatchImportBarcodes
},
{ prop: 'product_name', label: '商品名称', minWidth: '180' },
{ prop: 'actual_quantity', label: '实际收货数量', width: '120' },
{ prop: 'box_quantity', label: '箱数', width: '90' },
{ prop: 'boxes_per_pallet', label: '箱规', width: '90' },
{ prop: 'box_remainder', label: '剩余不满一箱', width: '130' },
{ prop: 'space_keyword', label: '库位条码或名称', width: '160' },
{ prop: 'import_status', label: '状态', width: '100' },
{ prop: 'import_message', label: '结果说明', minWidth: '200' },
{ prop: 'retry_action', label: '操作', width: '140' },
{ prop: 'remark', label: '备注', minWidth: '180' }
]"
>
<template #column-system_product_id="{ row }">
<div class="batch-cell-action">
<span>{{ row.system_product_id || '--' }}</span>
<el-button type="primary" link size="small" @click="openBatchRowSkuPicker(row)">选择商品</el-button>
</div>
</template>
<template #column-space_keyword="{ row }">
<div class="batch-cell-action">
<span>{{ row.space_keyword || '--' }}</span>
<el-button type="primary" link size="small" @click="openBatchRowSpacePicker(row)">选择库位</el-button>
</div>
</template>
<template #column-import_status="{ row }">
<span
:class="getStatusTextClass(row.import_status === '成功' ? 'success' : row.import_status === '失败' ? 'danger' : 'info')"
>
{{ row.import_status || '--' }}
</span>
</template>
<template #column-retry_action="{ row }">
<el-button
v-if="row.import_status === '失败'"
type="primary"
link
size="small"
@click="retryBatchImportRow(row)"
>
重试
</el-button>
<span v-else>--</span>
</template>
</UpperTable>
</div>
</div>
</div>
<template #footer>
<el-button size="small" @click="batchImportDialogVisible = false">关闭</el-button>
</template>
<footer class="task-panel__foot">
<div class="task-panel__actions">
<el-pagination
v-model:current-page="batchImportPage"
v-model:page-size="batchImportPageSize"
:page-sizes="[10, 20, 50, 100, 200]"
:total="batchImportPreviewRows.length"
layout="total, sizes, prev, pager, next"
background
size="small"
class="batch-import-pagination"
/>
<el-button size="small" @click="batchImportDialogVisible = false">关闭</el-button>
</div>
</footer>
</div>
</el-dialog>
<!-- 右键菜单 -->
@ -972,6 +1111,24 @@ const systemProductAllResults = ref<any[]>([])
const systemProductSelection = ref<any[]>([])
const systemProductPagination = reactive({ page: 1, pageSize: 10, total: 0 })
/** 条码列多值折叠取值:只显示首个条码 + `+N` 展开全部(UpperTable copyAction 内置能力) */
const getSystemProductBarcodes = (row: any): unknown[] =>
Array.isArray(row?.barcodes) ? row.barcodes : []
/** 批量导入条码列多值折叠取值:支持数组 / 逗号、竖线、分号分隔的多个条码 */
const getBatchImportBarcodes = (row: any): string[] => {
const raw = row?.barcode
if (Array.isArray(raw)) {
return raw.map((item) => String(item ?? '').trim()).filter(Boolean)
}
const text = String(raw ?? '').trim()
if (!text) return []
return text
.split(/[|,,;;]/)
.map((item) => item.trim())
.filter(Boolean)
}
const spacePickerVisible = ref(false)
const spaceLoading = ref(false)
const spaceKeyword = ref('')
@ -986,6 +1143,20 @@ const batchImportSourceFile = ref<File | null>(null)
const batchImportFileName = ref('')
const batchImportPreviewRows = ref<any[]>([])
const batchImportAddItems = ref<any[]>([])
const batchImportPage = ref(1)
const batchImportPageSize = ref(200)
const batchImportPagedRows = computed(() => {
const start = (batchImportPage.value - 1) * batchImportPageSize.value
return batchImportPreviewRows.value.slice(start, start + batchImportPageSize.value)
})
/** 每页条数或数据变化后,把当前页收敛到有效范围,避免出现空白页 */
watch([batchImportPageSize, () => batchImportPreviewRows.value.length], () => {
const maxPage = Math.max(1, Math.ceil(batchImportPreviewRows.value.length / batchImportPageSize.value))
if (batchImportPage.value > maxPage) {
batchImportPage.value = maxPage
}
})
const batchImportEditingRow = ref<any>(null)
const batchImportPickerMode = ref<'space' | 'sku' | ''>('')
const batchRetryFailedLoading = ref(false)
@ -1735,6 +1906,7 @@ const generateBatchImportList = async () => {
})
batchImportPreviewRows.value = previewRows
batchImportPage.value = 1
addItems.push(...previewRows.map((r) => ({ item: { ...(r.item_payload || {}) } })))
batchImportAddItems.value = addItems
ElMessage.success(`已生成 ${addItems.length} 条基础新增数据`)
@ -1749,6 +1921,7 @@ const generateBatchImportList = async () => {
const clearBatchImportData = () => {
batchImportPreviewRows.value = []
batchImportAddItems.value = []
batchImportPage.value = 1
batchImportSourceFile.value = null
batchImportFileName.value = ''
}
@ -2759,23 +2932,266 @@ onUnmounted(() => {
flex-wrap: wrap;
}
.batch-import-toolbar {
/* 批量导入商品面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 10px;
flex-direction: column;
max-height: calc(100vh - 96px);
background: #fff;
color: #303133;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px 16px 8px;
flex-shrink: 0;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
flex: 1;
min-height: 0;
padding: 6px 16px 0;
display: flex;
flex-direction: column;
overflow-y: auto;
}
/* 工具栏:按钮间距 6px,与 OrderToolbarButtonGroup 一致 */
&__toolbar {
display: flex;
align-items: center;
gap: 12px;
flex-shrink: 0;
}
&__toolbar-main {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
min-width: 0;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
/* 禁用态:保持字体颜色可读,与 toolbar 按钮一致 */
:deep(.el-button.is-disabled),
:deep(.el-button.is-disabled:hover),
:deep(.el-button.is-disabled:focus),
:deep(.el-button.is-disabled:active) {
color: #606266;
background-color: #fafbfc;
border-color: #ebeef5;
}
:deep(.el-button--primary.is-disabled),
:deep(.el-button--primary.is-disabled:hover),
:deep(.el-button--primary.is-disabled:focus),
:deep(.el-button--primary.is-disabled:active) {
color: #409eff;
background-color: #f5faff;
border-color: #e4efff;
}
:deep(.el-button--primary.is-plain.is-disabled),
:deep(.el-button--primary.is-plain.is-disabled:hover),
:deep(.el-button--primary.is-plain.is-disabled:focus),
:deep(.el-button--primary.is-plain.is-disabled:active) {
color: #409eff;
background-color: #fff;
border-color: #409eff;
}
:deep(.el-button--danger.is-disabled),
:deep(.el-button--danger.is-disabled:hover),
:deep(.el-button--danger.is-disabled:focus),
:deep(.el-button--danger.is-disabled:active) {
color: #f56c6c;
background-color: #fff;
border-color: #f56c6c;
}
}
&__file-hint {
margin-left: auto;
min-width: 0;
max-width: 40%;
font-size: 12px;
line-height: 20px;
color: #909399;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__section {
display: flex;
flex-direction: column;
gap: 6px;
margin-top: 10px;
flex-shrink: 0;
}
&__section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
&__section-title {
font-size: 12px;
line-height: 20px;
color: #606266;
padding-left: 2px;
flex-shrink: 0;
}
&__section-meta {
font-size: 12px;
line-height: 20px;
color: #909399;
}
&__table-wrap {
border-radius: 4px;
overflow: hidden;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
margin-right: auto;
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
.batch-import-summary {
margin-top: 10px;
color: #606266;
/* 分页位于页脚「关闭」按钮左侧,始终展示;尺寸 / 选择器宽度对齐 UpperTable 默认分页 */
.batch-import-pagination,
.system-product-pagination {
flex: none;
margin-right: 4px;
:deep(.el-pagination) {
flex-wrap: wrap;
justify-content: flex-end;
--el-pagination-button-width: 28px;
--el-pagination-button-height: 28px;
}
:deep(.el-pagination__total),
:deep(.el-pagination__sizes) {
display: inline-flex !important;
margin-right: 8px;
}
:deep(.el-select--small) {
width: 80px;
}
:deep(.el-input__wrapper) {
padding: 0 4px;
}
}
/* 收货单货主过滤说明:与查询行同行、靠右,纯文字无容器背景 */
.system-product-filter-hint {
margin-left: auto;
min-width: 0;
max-width: 45%;
font-size: 12px;
line-height: 20px;
color: #909399;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 查询系统商品:表格需要确定高度才能内部滚动 */
.system-product-dialog-table {
height: 400px;
}
.batch-cell-action {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
@ -2788,6 +3204,13 @@ onUnmounted(() => {
height: 440px;
}
/* 表格固定高度:数据少也保持同样大小,超出容器时表格内部滚动(短屏自适应) */
.batch-import-table {
height: min(450px, calc(100vh - 280px));
border-radius: 4px;
overflow: hidden;
}
.product-window {
position: fixed;
z-index: 2000;
@ -3134,4 +3557,19 @@ onUnmounted(() => {
.ut-status-text--warning { color: var(--el-color-warning); }
.ut-status-text--info { color: var(--el-color-info); }
.ut-status-text--danger { color: var(--el-color-danger); }
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.batch-import-dialog,
.el-dialog.system-product-dialog {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>

View File

@ -196,111 +196,181 @@
</el-dialog>
<!-- 驳回收货单对话框 -->
<el-dialog v-model="rejectDialogVisible" title="批量驳回收货单" width="480px" align-center>
<el-form label-width="80px" size="small">
<el-form-item label="驳回理由">
<el-input
v-model="rejectRemark"
type="textarea"
:rows="3"
placeholder="请输入驳回理由(选填,将覆盖原备注)"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="rejectDialogVisible = false">取消</el-button>
<el-button size="small" type="warning" :loading="rejectLoading" @click="submitRejectReceiving">确认驳回</el-button>
</template>
</el-dialog>
<!-- 匹配入库:左右结构,左选收货单,右对比明细 -->
<el-dialog
v-model="matchPutawayDialogVisible"
title="匹配入库"
width="92vw"
v-model="rejectDialogVisible"
class="reject-receiving-dialog"
width="min(560px, 92vw)"
align-center
append-to-body
:show-close="false"
:close-on-click-modal="false"
>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>批量驳回收货单</h2>
<p>驳回已勾选的收货单并记录理由</p>
</div>
<button class="task-panel__close" type="button" aria-label="关闭" @click="rejectDialogVisible = false">
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="task-panel__form">
<div class="task-panel__field">
<span class="task-panel__field-label">已选收货单</span>
<strong class="task-panel__field-value">{{ selectionRows.length }} 条</strong>
</div>
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
<span class="task-panel__field-label">驳回理由</span>
<el-input
v-model="rejectRemark"
type="textarea"
:rows="3"
placeholder="请输入驳回理由(选填,将覆盖原备注)"
/>
</div>
</div>
<!-- <p class="task-panel__form-tip">
驳回理由为选填项,填写后会覆盖收货单原备注;驳回后不可撤销。
</p> -->
</div>
<footer class="task-panel__foot">
<span class="task-panel__hint">提交前请确认已选收货单</span>
<div class="task-panel__actions">
<el-button size="small" @click="rejectDialogVisible = false">取消</el-button>
<el-button size="small" type="warning" :loading="rejectLoading" @click="submitRejectReceiving">
确认驳回
</el-button>
</div>
</footer>
</div>
</el-dialog>
<!-- 匹配入库:左右结构,左选入库单,右对比明细 -->
<el-dialog
v-model="matchPutawayDialogVisible"
class="match-putaway-dialog-shell"
width="min(1200px, 96vw)"
align-center
append-to-body
:show-close="false"
destroy-on-close
:close-on-click-modal="false"
@closed="resetMatchPutawayDialog"
>
<div class="match-putaway-dialog">
<div class="match-left-panel">
<div class="match-panel-title">入库单列表</div>
<el-table
ref="matchEntryTableRef"
:data="matchEntryList"
v-loading="matchEntryListLoading"
highlight-current-row
border
size="small"
height="100%"
@current-change="onMatchEntrySelect"
>
<el-table-column prop="entry_order_code" label="入库单号" min-width="160" show-overflow-tooltip />
<el-table-column label="来源" width="80" align="center">
<template #default="{ row: e }">{{ entrySourceLabel(e.source_type) }}</template>
</el-table-column>
<el-table-column label="入库状态" width="90" align="center">
<template #default="{ row: e }">
<span :class="getStatusTextClass(entryOrderStatusTag(e.order_status))">
{{ entryOrderStatusLabel(e.order_status) }}
</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="match-right-panel">
<div class="match-panel-title">
明细对比
<span style="font-weight:400;color:#909399;margin-left:8px;font-size:12px">
收货单 {{ matchPutawayReceivingRow?.receiving_number || '—' }}
<template v-if="matchSelectedEntryOrder"> ← → 入库单 {{ matchSelectedEntryOrder.entry_order_code }}</template>
</span>
<span
v-if="matchSelectedEntryOrder && matchComparisonRows.length"
:class="getStatusTextClass(matchComparisonSummary.type)"
style="margin-left:10px"
>
{{ matchComparisonSummary.text }}
</span>
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="task-panel">
<header class="task-panel__head">
<div class="task-panel__titles">
<h2>匹配入库</h2>
<p>选择入库单与收货单明细比对后确认匹配</p>
</div>
<el-table
:data="matchComparisonRows"
v-loading="matchReceivingDetailsLoading || matchEntryDetailsLoading"
border
size="small"
height="100%"
row-key="stockId"
<button
class="task-panel__close"
type="button"
aria-label="关闭"
@click="matchPutawayDialogVisible = false"
>
<el-table-column prop="productName" label="商品名称" min-width="150" show-overflow-tooltip />
<el-table-column prop="barcode" label="条码" width="130" show-overflow-tooltip />
<el-table-column prop="itemCode" label="商品编码" width="130" show-overflow-tooltip />
<el-table-column label="收货数量" width="90" align="center">
<template #default="{ row: r }">{{ r.receivingQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="收货箱数" width="80" align="center">
<template #default="{ row: r }">{{ r.receivingBoxes ?? '--' }}</template>
</el-table-column>
<el-table-column label="入库应收" width="90" align="center">
<template #default="{ row: r }">{{ r.entryPlanQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="入库实收" width="90" align="center">
<template #default="{ row: r }">{{ r.entryReceivedQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="匹配" width="70" align="center">
<template #default="{ row: r }">
<span :class="getStatusTextClass(r.matched ? 'success' : 'info')">
{{ r.matched ? '已匹配' : '未匹配' }}
<svg viewBox="0 0 12 12" fill="none">
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</svg>
</button>
</header>
<div class="task-panel__body">
<div class="match-putaway-dialog">
<div class="match-left-panel">
<span class="task-panel__section-title">入库单列表</span>
<div class="task-panel__table-wrap">
<el-table
ref="matchEntryTableRef"
:data="matchEntryList"
v-loading="matchEntryListLoading"
highlight-current-row
border
size="small"
height="100%"
@current-change="onMatchEntrySelect"
>
<el-table-column prop="entry_order_code" label="入库单号" min-width="160" show-overflow-tooltip />
<el-table-column label="来源" width="80" align="center">
<template #default="{ row: e }">{{ entrySourceLabel(e.source_type) }}</template>
</el-table-column>
<el-table-column label="入库状态" width="90" align="center">
<template #default="{ row: e }">
<span :class="getStatusTextClass(entryOrderStatusTag(e.order_status))">
{{ entryOrderStatusLabel(e.order_status) }}
</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="match-right-panel">
<div class="match-panel-head">
<span class="task-panel__section-title">明细对比</span>
<span class="match-panel-meta">
收货单 {{ matchPutawayReceivingRow?.receiving_number || '—' }}
<template v-if="matchSelectedEntryOrder">
← → 入库单 {{ matchSelectedEntryOrder.entry_order_code }}
</template>
</span>
</template>
</el-table-column>
</el-table>
<span
v-if="matchSelectedEntryOrder && matchComparisonRows.length"
:class="getStatusTextClass(matchComparisonSummary.type)"
class="match-panel-summary"
>
{{ matchComparisonSummary.text }}
</span>
</div>
<div class="task-panel__table-wrap">
<el-table
:data="matchComparisonRows"
v-loading="matchReceivingDetailsLoading || matchEntryDetailsLoading"
border
size="small"
height="100%"
row-key="stockId"
>
<el-table-column prop="productName" label="商品名称" min-width="150" show-overflow-tooltip />
<el-table-column prop="barcode" label="条码" width="130" show-overflow-tooltip />
<el-table-column prop="itemCode" label="商品编码" width="130" show-overflow-tooltip />
<el-table-column label="收货数量" width="90" align="center">
<template #default="{ row: r }">{{ r.receivingQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="收货箱数" width="80" align="center">
<template #default="{ row: r }">{{ r.receivingBoxes ?? '--' }}</template>
</el-table-column>
<el-table-column label="入库应收" width="90" align="center">
<template #default="{ row: r }">{{ r.entryPlanQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="入库实收" width="90" align="center">
<template #default="{ row: r }">{{ r.entryReceivedQty ?? '--' }}</template>
</el-table-column>
<el-table-column label="匹配" width="70" align="center">
<template #default="{ row: r }">
<span :class="getStatusTextClass(r.matched ? 'success' : 'info')">
{{ r.matched ? '已匹配' : '未匹配' }}
</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</div>
<template #footer>
<div class="match-putaway-footer">
<span class="match-selection-tip">{{ matchSelectedEntryOrder ? '已选:' + matchSelectedEntryOrder.entry_order_code : '未选择入库单' }}</span>
<div>
<footer class="task-panel__foot">
<span class="task-panel__hint">
{{ matchSelectedEntryOrder ? '已选:' + matchSelectedEntryOrder.entry_order_code : '未选择入库单' }}
</span>
<div class="task-panel__actions">
<el-button size="small" @click="matchPutawayDialogVisible = false">取消</el-button>
<el-button
size="small"
@ -312,8 +382,8 @@
确认匹配入库
</el-button>
</div>
</div>
</template>
</footer>
</div>
</el-dialog>
</div>
</template>
@ -1739,46 +1809,217 @@ async function handleExportAll() {
flex-shrink: 0;
display: flex;
flex-direction: column;
gap: 6px;
min-height: 0;
:deep(.el-table) { height: 100%; }
}
.match-right-panel {
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
min-height: 0;
}
.match-right-panel > .el-table {
flex: 1;
}
.match-panel-title {
font-size: 13px;
font-weight: 600;
color: #303133;
margin-bottom: 6px;
.match-panel-head {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
flex-shrink: 0;
}
.match-putaway-dialog .match-hint {
margin: 0 0 8px;
font-size: 13px;
color: #606266;
}
.match-putaway-footer {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.match-selection-tip {
.match-panel-meta {
font-size: 12px;
line-height: 20px;
color: #909399;
min-width: 0;
}
.match-panel-summary {
margin-left: auto;
}
/* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel):驳回 / 匹配入库共用 */
.task-panel {
display: flex;
flex-direction: column;
max-height: calc(100vh - 96px);
background: #fff;
color: #303133;
&__head {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 16px;
flex-shrink: 0;
}
&__titles {
flex: 1;
min-width: 0;
h2 {
margin: 0;
font-size: 18px;
line-height: 24px;
font-weight: 400;
color: #303133;
}
p {
margin: 4px 0 0;
font-size: 12px;
line-height: 18px;
color: #909399;
}
}
&__close {
width: 24px;
height: 24px;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 4px;
background: transparent;
color: #909399;
cursor: pointer;
transition: color 0.2s;
svg {
width: 12px;
height: 12px;
}
&:hover {
color: #409eff;
}
}
&__body {
flex: 1;
min-height: 0;
padding: 12px 16px 0;
display: flex;
flex-direction: column;
}
&__section-title {
font-size: 12px;
line-height: 20px;
color: #606266;
padding-left: 2px;
flex-shrink: 0;
}
&__table-wrap {
flex: 1;
min-height: 0;
border-radius: 4px;
overflow: hidden;
:deep(.el-table) {
height: 100%;
}
}
&__form {
display: flex;
flex-direction: column;
gap: 8px;
}
&__field {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
min-height: 40px;
padding: 8px 12px;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
/* 驳回理由输入行:不需要灰色容器,与上方静态信息行拉开层次 */
&--input {
align-items: center;
min-height: 0;
/* 左 12px 与上方标签对齐;右 0 让输入框右边顶到灰色容器右边缘 */
padding: 4px 0 0 12px;
border: none;
border-radius: 0;
background: transparent;
.el-input,
.el-textarea {
flex: 1;
min-width: 0;
}
}
&--textarea {
align-items: flex-start;
.task-panel__field-label {
padding-top: 7px;
}
}
}
&__field-label {
font-size: 12px;
line-height: 20px;
color: #606266;
flex-shrink: 0;
white-space: nowrap;
}
&__field-value {
font-size: 13px;
font-weight: 500;
color: #303133;
text-align: right;
}
&__form-tip {
margin: 8px 0 0;
padding: 8px 12px;
border-radius: 4px;
background: #f4f4f5;
font-size: 12px;
line-height: 18px;
color: #909399;
}
&__foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px 16px;
flex-shrink: 0;
}
&__hint {
font-size: 12px;
color: #909399;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
:deep(.el-button) {
margin-left: 0;
margin-right: 0;
}
}
}
</style>
@ -1794,4 +2035,19 @@ async function handleExportAll() {
.ut-status-text--warning { color: var(--el-color-warning); }
.ut-status-text--info { color: var(--el-color-info); }
.ut-status-text--danger { color: var(--el-color-danger); }
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
.el-dialog.reject-receiving-dialog,
.el-dialog.match-putaway-dialog-shell {
padding: 0;
overflow: hidden;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0;
}
}
</style>