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> <template>
<el-dialog <el-dialog
:model-value="visible" :model-value="visible"
title="配送订单批量转退回拆包单" class="transfer-by-orders-dialog"
width="800px" width="min(760px, 94vw)"
align-center align-center
append-to-body
:show-close="false"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="!submitting"
@update:model-value="handleVisibleChange" @update:model-value="handleVisibleChange"
@closed="resetState" @closed="resetState"
> >
<!-- 确认态:入参 ids 取自勾选配送订单的 id(wms_order_delivery*.id) --> <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<template v-if="!result"> <div class="task-panel">
<el-alert class="transfer-alert" type="info" :closable="false" show-icon> <header class="task-panel__head">
<template #title> <div class="task-panel__titles">
仅「库内拦截」订单会被转换;已有有效拆包单、无运单号、无明细可复制的订单会静默跳过(不报错、不影响其它订单);单条失败不阻断整体提交。 <h2>配送订单批量转退回拆包单</h2>
</template> <p>将勾选的库内拦截配送订单转换为退回拆包单</p>
</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),不会提交
</div> </div>
<div v-if="advisorySkipRows.length" class="transfer-note"> <button
其中 {{ advisorySkipRows.length }} 条按当前列表状态预计会被跳过(非库内拦截),仍会提交并由服务端最终判定 class="task-panel__close"
</div> type="button"
<div v-if="overLimit" class="transfer-error"> aria-label="关闭"
去重后 {{ submitIds.length }} 条已超过单次上限 {{ MAX_COUNT }} 条,请减少勾选后重试 :disabled="submitting"
</div> @click="handleVisibleChange(false)"
</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"
> >
确认转换 <svg viewBox="0 0 12 12" fill="none">
</el-button> <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</template> </svg>
<template v-else> </button>
<el-button size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button> </header>
</template>
</template> <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> </el-dialog>
</template> </template>
@ -365,97 +413,198 @@ async function copyIds(list: Array<{ order_id?: number | string }>, label: strin
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.transfer-alert { /* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
margin-bottom: 12px; .task-panel {
:deep(.el-alert__title) {
line-height: 1.5;
}
}
.transfer-preview {
margin-top: 8px;
margin-bottom: 8px;
}
.transfer-count {
display: flex; display: flex;
align-items: center; flex-direction: column;
gap: 12px; max-height: calc(100vh - 96px);
margin-top: 6px; background: #fff;
font-size: 12px; color: #303133;
color: #606266;
.transfer-count__limit { &__head {
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 {
display: flex; 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; 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; font-size: 12px;
color: #909399; color: #909399;
} }
.transfer-summary__value { &__actions {
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 {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; gap: 8px;
margin-bottom: 6px;
font-size: 13px; :deep(.el-button) {
font-weight: 600; margin-left: 0;
color: #303133; margin-right: 0;
}
} }
} }
@ -463,3 +612,19 @@ async function copyIds(list: Array<{ order_id?: number | string }>, label: strin
padding: 12px 0; padding: 12px 0;
} }
</style> </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 <el-dialog
v-model="subWaybillSelectDialogVisible" v-model="subWaybillSelectDialogVisible"
title="选择运单号打印" class="select-waybill-dialog"
width="680px" width="min(680px, 92vw)"
align-center
append-to-body
:show-close="false"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-alert <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
v-if="subWaybillSelectErrorMessage" <div class="task-panel">
:title="subWaybillSelectErrorMessage" <header class="task-panel__head">
type="error" <div class="task-panel__titles">
:closable="false" <h2>选择运单号打印</h2>
show-icon <p>勾选需要打印的运单号</p>
style="margin-bottom: 12px" </div>
/> <button class="task-panel__close" type="button" aria-label="关闭" @click="closeSubWaybillSelectDialog">
<el-table <svg viewBox="0 0 12 12" fill="none">
:data="subWaybillOptions" <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
:loading="subWaybillSelectLoading" </svg>
max-height="420" </button>
size="small" </header>
@selection-change="onSubWaybillSelectChange"
> <div class="task-panel__body">
<el-table-column type="selection" width="48" /> <p
<el-table-column prop="waybill_code" label="运单号" min-width="190" show-overflow-tooltip /> v-if="subWaybillSelectErrorMessage"
<el-table-column label="类型" width="80" align="center"> class="task-panel__form-tip task-panel__form-tip--error"
<template #default="{ row }"> >
<el-tag :type="row.is_main ? 'info' : 'success'" size="small"> {{ subWaybillSelectErrorMessage }}
{{ row.is_main ? '主单' : '子单' }} </p>
</el-tag> <div class="task-panel__form">
</template> <div class="task-panel__field">
</el-table-column> <span class="task-panel__field-label">已选运单</span>
<el-table-column prop="logistics_name" label="物流公司" min-width="130" show-overflow-tooltip /> <strong class="task-panel__field-value">{{ subWaybillSelectedWaybills.length }} 个</strong>
</el-table> </div>
<template #footer>
<el-button size="small" @click="closeSubWaybillSelectDialog">取消</el-button> <div class="task-panel__section">
<el-button <span class="task-panel__section-title">运单号列表</span>
size="small" <div class="task-panel__table-wrap">
type="primary" <el-table
:loading="subWaybillPrintLoading" v-loading="subWaybillSelectLoading"
@click="confirmSubWaybillPrint" :data="subWaybillOptions"
> border
打印所选运单 size="small"
</el-button> max-height="240"
</template> 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> </el-dialog>
<allocate-sub-order-number-form <allocate-sub-order-number-form
@ -432,6 +472,7 @@ const {
selectDialogVisible: subWaybillSelectDialogVisible, selectDialogVisible: subWaybillSelectDialogVisible,
selectLoading: subWaybillSelectLoading, selectLoading: subWaybillSelectLoading,
waybillOptions: subWaybillOptions, waybillOptions: subWaybillOptions,
selectedWaybills: subWaybillSelectedWaybills,
selectErrorMessage: subWaybillSelectErrorMessage, selectErrorMessage: subWaybillSelectErrorMessage,
onSelectChange: onSubWaybillSelectChange, onSelectChange: onSubWaybillSelectChange,
confirmPrintWaybills: confirmSubWaybillPrint, confirmPrintWaybills: confirmSubWaybillPrint,
@ -777,5 +818,183 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
.order-log-wrapper { .order-log-wrapper {
height: 100%; 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> </style>

View File

@ -317,32 +317,59 @@
<el-dialog <el-dialog
v-model="resolveExceptionDialogVisible" v-model="resolveExceptionDialogVisible"
title="异常订单处理" class="resolve-exception-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="resetResolveExceptionDialog" @closed="resetResolveExceptionDialog"
> >
<el-alert <div class="task-panel">
type="warning" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>异常订单处理</h2>
title="该操作会将异常订单恢复为正常待处理状态(step: 3 -> 2)。" <p>将异常订单恢复为正常待处理状态</p>
/> </div>
<el-form label-width="120px" class="resolve-exception-form"> <button
<el-form-item label="已选订单数"> class="task-panel__close"
<span>{{ resolveExceptionOrderIds.length }} 条</span> type="button"
</el-form-item> aria-label="关闭"
<el-form-item label="订单ID"> @click="resolveExceptionDialogVisible = false"
<div class="resolve-exception-ids">{{ resolveExceptionOrderIds.join(', ') }}</div> >
</el-form-item> <svg viewBox="0 0 12 12" fill="none">
</el-form> <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
<template #footer> </svg>
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button> </button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException"> </header>
确认处理
</el-button> <div class="task-panel__body">
</template> <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> </el-dialog>
<allocate-sub-order-number-form <allocate-sub-order-number-form
@ -1148,16 +1175,147 @@ function onBatchPrintSuccess() {
margin-top: 12px; margin-top: 12px;
} }
.resolve-exception-form { /* 异常订单处理面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-top: 12px; .task-panel {
} background: #fff;
color: #303133;
.resolve-exception-ids { &__head {
max-height: 96px; display: flex;
overflow-y: auto; align-items: flex-start;
color: #606266; gap: 12px;
line-height: 1.6; padding: 16px;
word-break: break-all; }
&__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 { .clone-order-meta {
@ -1189,3 +1347,19 @@ function onBatchPrintSuccess() {
} }
</style> </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> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="分配子单号" class="allocate-sub-order-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="handleClosed" @closed="handleClosed"
> >
<el-form <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
ref="formRef" <div class="task-panel">
:model="formModel" <header class="task-panel__head">
:rules="rules" <div class="task-panel__titles">
label-width="120px" <h2>分配子单号</h2>
class="allocate-sub-order-form" <p>为指定订单批量分配子单号</p>
@submit.prevent </div>
> <button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<el-form-item label="订单 ID"> <svg viewBox="0 0 12 12" fill="none">
<span class="readonly-value">{{ orderId ?? '-' }}</span> <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
</el-form-item> </svg>
<el-form-item label="订单号"> </button>
<span class="readonly-value">{{ orderCode || '-' }}</span> </header>
</el-form-item>
<el-form-item label="子单号数量" prop="sub_order_count"> <div class="task-panel__body">
<el-input-number <div class="task-panel__form">
v-model="formModel.sub_order_count" <div class="task-panel__field">
:min="1" <span class="task-panel__field-label">订单 ID</span>
:max="999" <strong class="task-panel__field-value">{{ orderId ?? '—' }}</strong>
:step="1" </div>
placeholder="请输入子单号数量" <div class="task-panel__field">
controls-position="right" <span class="task-panel__field-label">订单号</span>
/> <strong class="task-panel__field-value">{{ orderCode || '—' }}</strong>
</el-form-item> </div>
</el-form> <div class="task-panel__field task-panel__field--input">
<template #footer> <span class="task-panel__field-label">子单号数量</span>
<el-button size="small" @click="visible = false">取消</el-button> <el-form
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认分配</el-button> ref="formRef"
</template> :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> </el-dialog>
</template> </template>
@ -109,12 +144,182 @@ function handleClosed() {
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.allocate-sub-order-form { /* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
margin-top: 4px; .task-panel {
} background: #fff;
color: #303133;
.readonly-value { &__head {
color: #606266; 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> </style>

View File

@ -1,97 +1,105 @@
<template> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="批量发货" class="batch-recheck-dialog"
width="720px" width="min(720px, 94vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="!submitting" :close-on-click-modal="!submitting"
:close-on-press-escape="!submitting" :close-on-press-escape="!submitting"
@closed="emit('closed')" @closed="emit('closed')"
> >
<!-- <el-alert <div class="task-panel">
type="info" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>批量发货</h2>
class="batch-recheck-alert" <p>对已选订单执行快捷复核并标记发货</p>
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> </div>
</el-form-item> --> <button
</el-form> 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-form
<!-- <el-divider content-position="left">执行结果</el-divider> --> ref="formRef"
<div class="result-summary"> :model="form"
<el-tag type="success" size="small">成功 {{ result.success_count }}</el-tag> :rules="rules"
<el-tag type="danger" size="small">失败 {{ result.failed_count }}</el-tag> class="task-panel__body batch-recheck-form"
</div> >
<el-tabs v-model="resultTab" class="result-tabs"> <div class="task-panel__form">
<el-tab-pane :label="`成功 (${result.success.length})`" name="success"> <div class="task-panel__field">
<el-table :data="normalizeResultRows(result.success)" border size="small" max-height="220" empty-text="无"> <span class="task-panel__field-label">已选订单</span>
<el-table-column prop="order_id" label="订单 ID" width="100" /> <strong class="task-panel__field-value">{{ selectedRows.length }} 条</strong>
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip /> </div>
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip />
</el-table> <div v-if="selectedRows.length" class="task-panel__section">
</el-tab-pane> <span class="task-panel__section-title">订单预览</span>
<el-tab-pane :label="`失败 (${result.failed.length})`" name="failed"> <div class="task-panel__table-wrap">
<el-table :data="normalizeResultRows(result.failed)" border size="small" max-height="220" empty-text="无"> <el-table :data="selectedRows" border size="small" max-height="160" empty-text="无">
<el-table-column prop="order_id" label="订单 ID" width="100" /> <el-table-column prop="id" label="订单 ID" width="96" />
<el-table-column prop="waybill_no" label="运单号" min-width="140" show-overflow-tooltip /> <el-table-column prop="delivery_order_code" label="发货单号" min-width="150" show-overflow-tooltip />
<el-table-column prop="reason" label="原因" min-width="180" show-overflow-tooltip /> <el-table-column label="复核状态" width="96">
<el-table-column prop="message" label="说明" min-width="160" show-overflow-tooltip /> <template #default="{ row }">
</el-table> {{ translateRecheckStatus(row) }}
</el-tab-pane> </template>
</el-tabs> </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> </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> </el-dialog>
</template> </template>
@ -274,23 +282,170 @@ async function handleSubmit() {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.batch-recheck-alert { /* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-bottom: 12px; .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 { .batch-recheck-form {
margin-top: 4px; margin: 0;
}
.form-hint {
margin-top: 6px;
font-size: 12px;
color: #909399;
line-height: 1.5;
} }
.recheck-result { .recheck-result {
margin-top: 4px; margin: 10px 0 8px;
} }
.result-summary { .result-summary {
@ -303,3 +458,19 @@ async function handleSubmit() {
margin-bottom: 8px; margin-bottom: 8px;
} }
</style> </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> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="克隆待处理订单" class="clone-order-dialog"
width="480px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')" @closed="emit('closed')"
> >
<el-alert <div class="task-panel">
type="warning" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>克隆待处理订单</h2>
title="克隆会取消原订单并创建新订单,请确认后执行。" <p>克隆会取消原订单并创建一个新订单</p>
/> </div>
<div class="clone-order-meta"> <button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
<p>原订单ID:{{ sourceOrderId || '-' }}</p> <svg viewBox="0 0 12 12" fill="none">
<p>订单号:{{ sourceOrderCode || '-' }}</p> <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> </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> </el-dialog>
</template> </template>
@ -39,13 +65,149 @@ const emit = defineEmits<{
}>() }>()
</script> </script>
<style scoped> <style scoped lang="scss">
.clone-order-meta { /* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-top: 12px; .task-panel {
color: #606266; background: #fff;
} color: #303133;
.clone-order-meta p { &__head {
margin: 4px 0; 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> </style>

View File

@ -1,48 +1,75 @@
<template> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="手工录入运单号" class="manual-waybill-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="handleClosed" @closed="handleClosed"
> >
<!-- <el-alert <!-- 面板结构对齐「按订单批量分配储位」(UnifiedTaskProgressDialog / TaskProgressPanel) -->
type="info" <div class="task-panel">
:closable="false" <header class="task-panel__head">
show-icon <div class="task-panel__titles">
title="为指定待处理订单创建运单记录(wms_order_express),仅允许步骤为 1~3 且数据归档状态非归档中的订单。" <h2>手工录入运单号</h2>
class="manual-waybill-alert" <p>为指定待处理订单创建运单记录</p>
/> --> </div>
<el-form <button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
ref="formRef" <svg viewBox="0 0 12 12" fill="none">
:model="formModel" <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
:rules="rules" </svg>
label-width="100px" </button>
class="manual-waybill-form" </header>
@submit.prevent
> <div class="task-panel__body">
<el-form-item label="订单 ID"> <div class="task-panel__form">
<span class="readonly-value">{{ orderId ?? '-' }}</span> <div class="task-panel__field">
</el-form-item> <span class="task-panel__field-label">订单 ID</span>
<el-form-item label="订单号"> <strong class="task-panel__field-value">{{ orderId ?? '—' }}</strong>
<span class="readonly-value">{{ orderCode || '-' }}</span> </div>
</el-form-item> <div class="task-panel__field">
<el-form-item label="运单号" prop="waybill_code"> <span class="task-panel__field-label">订单号</span>
<el-input <strong class="task-panel__field-value">{{ orderCode || '—' }}</strong>
v-model="formModel.waybill_code" </div>
placeholder="请输入运单号" <div class="task-panel__field task-panel__field--input">
clearable <span class="task-panel__field-label">运单号</span>
maxlength="64" <el-form
show-word-limit ref="formRef"
@keyup.enter="handleSubmit" :model="formModel"
/> :rules="rules"
</el-form-item> class="task-panel__field-form"
</el-form> @submit.prevent
<template #footer> >
<el-button size="small" @click="visible = false">取消</el-button> <el-form-item prop="waybill_code">
<el-button size="small" type="primary" :loading="loading" @click="handleSubmit">确认录入</el-button> <el-input
</template> 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> </el-dialog>
</template> </template>
@ -115,16 +142,182 @@ function handleClosed() {
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.manual-waybill-alert { /* 面板结构 / 尺寸对齐 TaskProgressPanel(按订单批量分配储位) */
margin-bottom: 16px; .task-panel {
} background: #fff;
color: #303133;
.manual-waybill-form { &__head {
margin-top: 4px; display: flex;
} align-items: flex-start;
gap: 12px;
padding: 16px;
}
.readonly-value { &__titles {
color: #606266; 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> </style>

View File

@ -1,121 +1,158 @@
<template> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="批量修改收件地址" class="update-address-dialog"
width="640px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')" @closed="emit('closed')"
> >
<el-alert <div class="task-panel">
type="warning" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>批量修改收件地址</h2>
class="update-address-alert" <p>提交后按已选订单批量更新收件地址</p>
title="修改限制" </div>
description="地址字段仅允许修改 post_status='none'(未分配快递)的订单;留言不受此限制。至少填写一项地址字段或留言,空白字段不会更新到订单。" <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"> <div class="task-panel__body">
<el-form-item label="已选订单数"> <p class="task-panel__form-tip">
<span>{{ orderCount }} 条</span> 仅允许修改 post_status='none'(未分配快递)的订单;至少填写一项地址字段,空白字段不会更新到订单。
</el-form-item> </p>
<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>
<template #footer> <div class="task-panel__form">
<el-button size="small" @click="visible = false">取消</el-button> <div class="task-panel__field">
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button> <span class="task-panel__field-label">已选订单数</span>
</template> <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> </el-dialog>
</template> </template>
@ -207,13 +244,175 @@ function handleAreaChange(code: string) {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.update-address-alert { /* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-bottom: 12px; .task-panel {
} background: #fff;
color: #303133;
display: flex;
flex-direction: column;
max-height: 80vh;
.update-address-form { &__head {
max-height: 58vh; display: flex;
overflow-y: auto; align-items: flex-start;
padding-right: 4px; 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> </style>

View File

@ -1,40 +1,73 @@
<template> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
:title="mode === 'express' ? '批量修改快递信息' : '批量修改平台信息'" class="update-order-meta-dialog"
width="560px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')" @closed="emit('closed')"
> >
<el-form label-width="110px" class="storage-allocate-form"> <div class="task-panel">
<el-form-item label="已选订单数"> <header class="task-panel__head">
<span>{{ orderCount }} 条</span> <div class="task-panel__titles">
</el-form-item> <h2>{{ mode === 'express' ? '批量修改快递信息' : '批量修改平台信息' }}</h2>
<el-form-item :label="mode === 'express' ? '快递编码' : '平台编码'" required> <p>提交后按已选订单批量更新{{ mode === 'express' ? '快递' : '平台' }}信息</p>
<el-select </div>
v-model="codeProxy" <button class="task-panel__close" type="button" aria-label="关闭" @click="visible = false">
filterable <svg viewBox="0 0 12 12" fill="none">
allow-create <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
default-first-option </svg>
:reserve-keyword="false" </button>
clearable </header>
placeholder="请选择或输入编码"
style="width: 100%" <div class="task-panel__body">
> <div class="task-panel__form">
<el-option <div class="task-panel__field">
v-for="item in options" <span class="task-panel__field-label">已选订单数</span>
:key="item.value" <strong class="task-panel__field-value">{{ orderCount }} 条</strong>
:label="item.label" </div>
:value="item.value" <div class="task-panel__field task-panel__field--input">
/> <span class="task-panel__field-label is-required">
</el-select> {{ mode === 'express' ? '快递编码' : '平台编码' }}
</el-form-item> </span>
</el-form> <div class="task-panel__field-control">
<template #footer> <el-select
<el-button size="small" @click="visible = false">取消</el-button> v-model="codeProxy"
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button> size="default"
</template> 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> </el-dialog>
</template> </template>
@ -63,3 +96,173 @@ const codeProxy = computed({
} }
}) })
</script> </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> <template>
<el-dialog <el-dialog
v-model="visible" v-model="visible"
title="批量修改留言" class="update-remark-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="emit('closed')" @closed="emit('closed')"
> >
<el-alert <div class="task-panel">
type="info" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>批量修改留言</h2>
class="update-remark-alert" <p>提交后按已选订单批量覆盖备注/留言</p>
title="修改说明" </div>
description="批量覆盖所选订单的备注/留言,不受 post_status 限制。更新成功后写入操作日志。" <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"> <div class="task-panel__body">
<el-form-item label="已选订单数"> <div class="task-panel__form">
<span>{{ orderCount }} 条</span> <div class="task-panel__field">
</el-form-item> <span class="task-panel__field-label">已选订单数</span>
<el-form-item label="留言" required> <strong class="task-panel__field-value">{{ orderCount }} 条</strong>
<el-input </div>
v-model="form.remark" <div class="task-panel__field task-panel__field--input">
type="textarea" <span class="task-panel__field-label is-required">留言</span>
:rows="4" <div class="task-panel__field-control">
resize="none" <el-input
maxlength="500" v-model="form.remark"
show-word-limit type="textarea"
placeholder="请输入订单备注/留言" :rows="4"
/> resize="none"
</el-form-item> maxlength="500"
</el-form> show-word-limit
placeholder="请输入订单备注/留言"
/>
</div>
</div>
</div>
<!-- <p class="task-panel__form-tip">
批量覆盖所选订单的备注/留言,不受 post_status 限制;更新成功后写入操作日志。
</p> -->
</div>
<template #footer> <footer class="task-panel__foot">
<el-button size="small" @click="visible = false">取消</el-button> <span class="task-panel__hint">提交前请确认留言内容无误</span>
<el-button size="small" type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button> <div class="task-panel__actions">
</template> <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> </el-dialog>
</template> </template>
@ -64,7 +84,173 @@ const emit = defineEmits<{
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.update-remark-alert { /* 面板结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-bottom: 12px; .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> </style>

View File

@ -313,32 +313,59 @@
<el-dialog <el-dialog
v-model="resolveExceptionDialogVisible" v-model="resolveExceptionDialogVisible"
title="异常订单处理" class="resolve-exception-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="resetResolveExceptionDialog" @closed="resetResolveExceptionDialog"
> >
<el-alert <div class="task-panel">
type="warning" <header class="task-panel__head">
:closable="false" <div class="task-panel__titles">
show-icon <h2>异常订单处理</h2>
title="该操作会将异常订单恢复为正常待处理状态(step: 3 -> 2)。" <p>将异常订单恢复为正常待处理状态</p>
/> </div>
<el-form label-width="120px" class="resolve-exception-form"> <button
<el-form-item label="已选订单数"> class="task-panel__close"
<span>{{ resolveExceptionOrderIds.length }} 条</span> type="button"
</el-form-item> aria-label="关闭"
<el-form-item label="订单ID"> @click="resolveExceptionDialogVisible = false"
<div class="resolve-exception-ids">{{ resolveExceptionOrderIds.join(', ') }}</div> >
</el-form-item> <svg viewBox="0 0 12 12" fill="none">
</el-form> <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
<template #footer> </svg>
<el-button size="small" @click="resolveExceptionDialogVisible = false">取消</el-button> </button>
<el-button size="small" type="primary" :loading="resolveExceptionLoading" @click="submitResolveException"> </header>
确认处理
</el-button> <div class="task-panel__body">
</template> <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> </el-dialog>
<allocate-sub-order-number-form <allocate-sub-order-number-form
@ -1145,16 +1172,163 @@ async function handleConfirmInterceptBatch() {
height: 100%; height: 100%;
} }
.resolve-exception-form { /* 异常订单处理面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
margin-top: 12px; .task-panel {
} background: #fff;
color: #303133;
.resolve-exception-ids { &__head {
max-height: 96px; display: flex;
overflow-y: auto; align-items: flex-start;
color: #606266; gap: 12px;
line-height: 1.6; padding: 16px;
word-break: break-all; }
&__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> </style>

View File

@ -1,55 +1,78 @@
<template> <template>
<el-dialog <el-dialog
v-model="visibleProxy" v-model="visibleProxy"
title="确认打印(扫面单号)" class="confirm-wave-print-dialog"
width="520px" width="min(560px, 92vw)"
align-center align-center
append-to-body append-to-body
:show-close="false"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@opened="handleOpened" @opened="handleOpened"
> >
<div class="confirm-wave-print"> <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<el-alert type="info" :closable="false" show-icon class="confirm-wave-print__tip"> <div class="task-panel">
<template #title> <header class="task-panel__head">
扫描波次内任一订单的面单号,把该波次下「已打印且非拦截」的订单全部标记为已确认打印 <div class="task-panel__titles">
</template> <h2>确认打印(扫面单号)</h2>
<div class="confirm-wave-print__tip-detail"> <p>扫描波次内任一订单的面单号完成确认</p>
面单号会自行定位所属波次,无需先选中;波次内仍有未打印订单时会被阻断;已全部确认时重复扫描不会重复写日志。
</div> </div>
</el-alert> <button
class="task-panel__close"
<div class="confirm-wave-print__field"> type="button"
<span class="field-label">面单号/运单号</span> aria-label="关闭"
<el-input
ref="inputRef"
v-model="waybillNo"
placeholder="扫描或输入面单号后回车"
clearable
:disabled="submitting" :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>
<div v-if="lastResult" class="confirm-wave-print__result" :class="{ 'is-repeat': lastResult.repeated }"> <footer class="task-panel__foot">
<div class="result-row"> <span class="task-panel__hint">确认成功后自动清空输入框,可连续扫码</span>
<span class="result-label">波次</span> <div class="task-panel__actions">
<span class="result-value">{{ lastResult.waveLabel }}</span> <el-button size="small" @click="visibleProxy = false">关闭</el-button>
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">确认打印</el-button>
</div> </div>
<div class="result-row"> </footer>
<span class="result-label">结果</span>
<span class="result-value">{{ lastResult.text }}</span>
</div>
</div>
<p class="confirm-wave-print__hint">
提示:本页支持直接扫面单号(长度超过 8 位)自动确认打印;此处弹窗用于手工输入或复核最近一次确认结果。
</p>
</div> </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> </el-dialog>
</template> </template>
@ -148,67 +171,186 @@ async function handleSubmit() {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.confirm-wave-print { /* 面板结构 / 尺寸对齐 TaskProgressPanel(手工录入运单号) */
display: flex; .task-panel {
flex-direction: column; background: #fff;
gap: 12px; color: #303133;
&__tip { &__head {
display: flex;
align-items: flex-start; align-items: flex-start;
gap: 12px;
padding: 16px;
} }
&__tip-detail { &__titles {
margin-top: 4px; flex: 1;
line-height: 1.6; min-width: 0;
color: var(--el-text-color-secondary);
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 { &__field {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; justify-content: space-between;
} gap: 16px;
min-height: 40px;
.field-label { padding: 8px 12px;
flex: 0 0 96px; border: 1px solid #ebeef5;
text-align: right;
color: var(--el-text-color-regular);
}
&__result {
padding: 10px 12px;
border-radius: 4px; border-radius: 4px;
background: var(--el-color-success-light-9); background: #fafafa;
border: 1px solid var(--el-color-success-light-7);
&.is-repeat { /* 面单号输入行:不需要灰色容器,与上方静态信息行拉开层次 */
background: var(--el-color-info-light-9); &--input {
border-color: var(--el-color-info-light-7); 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 { &__field-label {
display: flex; font-size: 12px;
gap: 10px; line-height: 20px;
line-height: 1.8; color: #606266;
flex-shrink: 0;
white-space: nowrap;
} }
.result-label { &__field-value {
flex: 0 0 40px; font-size: 13px;
color: var(--el-text-color-secondary); font-weight: 500;
} color: #303133;
text-align: right;
.result-value {
flex: 1;
color: var(--el-text-color-primary);
word-break: break-all; word-break: break-all;
} }
&__hint { &__result {
margin: 0;
font-size: 12px; font-size: 12px;
line-height: 1.6; 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> </style>

View File

@ -309,43 +309,109 @@
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="systemProductPickerVisible" title="查询系统商品" align-center width="980px" append-to-body destroy-on-close> <el-dialog
<div class="system-product-picker"> v-model="systemProductPickerVisible"
<div class="picker-toolbar"> class="system-product-dialog"
<el-input v-model="systemProductKeyword" placeholder="输入商品名称或条码" clearable style="width: 320px" @keyup.enter="querySystemProducts(1)"> width="min(1000px, 96vw)"
<template #append> align-center
<el-button size="small" :icon="Search" :loading="systemProductLoading" @click="querySystemProducts(1)">查询</el-button> append-to-body
</template> :show-close="false"
</el-input> destroy-on-close
<span v-if="boundStoreId" class="picker-hint">已按收货单货主过滤:{{ boundStoreName || ('ID ' + boundStoreId) }}</span> :close-on-click-modal="false"
<span v-else class="picker-hint">当前收货单未绑定货主,查询不过滤货主</span> >
<!-- 面板结构对齐「手工录入运单号」(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>
<div class="picker-table-wrap"> <footer class="task-panel__foot">
<UpperTable <!-- <span class="task-panel__hint">多条码商品只显示首个条码,点 +N 展开全部</span> -->
:data="systemProductResults" <div class="task-panel__actions">
:loading="systemProductLoading" <el-pagination
:show-selection="true" :current-page="systemProductPagination.page"
:multiple-selection="systemProductSelection" :page-size="systemProductPagination.pageSize"
:pagination="{ currentPage: systemProductPagination.page, pageSize: systemProductPagination.pageSize, total: systemProductPagination.total }" :page-sizes="[10, 20, 50, 100]"
:columns="[ :total="systemProductPagination.total"
{ prop: 'id', label: '系统商品ID', width: '120' }, layout="total, sizes, prev, pager, next"
{ prop: 'item_name', label: '商品名称', minWidth: '220' }, background
{ prop: 'barcodes', label: '条码', width: '180' }, size="small"
{ prop: 'store_name', label: '货主', width: '180' }, class="system-product-pagination"
{ prop: 'weight', label: '重量(g)', width: '110', align: 'right' } @current-change="onSystemProductPageChange"
]" @size-change="onSystemProductPageSizeChange"
@selection-change="handleSystemProductSelectionChange" />
@row-click="handleSystemProductRowClick" <el-button size="small" @click="systemProductPickerVisible = false">取消</el-button>
@page-change="onSystemProductPageChange" <el-button size="small" type="primary" @click="applySelectedSystemProduct">使用选中商品</el-button>
@page-size-change="onSystemProductPageSizeChange" </div>
/> </footer>
</div>
</div> </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>
<el-dialog v-model="spacePickerVisible" title="选择系统库位" align-center width="900px" append-to-body destroy-on-close> <el-dialog v-model="spacePickerVisible" title="选择系统库位" align-center width="900px" append-to-body destroy-on-close>
@ -384,75 +450,148 @@
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="batchImportDialogVisible" title="批量导入商品" align-center width="1020px" append-to-body destroy-on-close> <el-dialog
<div class="batch-import-toolbar"> v-model="batchImportDialogVisible"
<input class="batch-import-dialog"
ref="batchImportInputRef" width="min(1080px, 96vw)"
type="file" align-center
accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" append-to-body
style="display:none" :show-close="false"
@change="onBatchImportFileChange" destroy-on-close
/> :close-on-click-modal="false"
<el-button size="small" @click="triggerBatchImportSelect">选择Excel</el-button> >
<el-button size="small" @click="downloadBatchImportTemplate">下载模板</el-button> <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<el-button size="small" @click="clearBatchImportData">清除数据</el-button> <div class="task-panel">
<el-button size="small" :loading="batchRetryFailedLoading" @click="retryFailedBatchRows">只重试失败</el-button> <header class="task-panel__head">
<el-button size="small" type="primary" :loading="batchImportLoading" @click="submitBatchImportCreate">导入</el-button> <div class="task-panel__titles">
<span class="picker-hint">已选文件:{{ batchImportFileName || '未选择' }}</span> <h2>批量导入商品</h2>
</div> <!-- <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"> <div class="task-panel__body">
<UpperTable <input
:data="batchImportPreviewRows" ref="batchImportInputRef"
:show-selection="false" type="file"
:pagination="{ currentPage: 1, pageSize: 200, total: batchImportPreviewRows.length }" accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
:columns="[ style="display: none"
{ prop: 'row_no', label: '行号', width: '80' }, @change="onBatchImportFileChange"
{ prop: 'system_product_id', label: 'SKU', width: '120' }, />
{ prop: 'barcode', label: '条码', width: '160' }, <div class="task-panel__toolbar">
{ prop: 'product_name', label: '商品名称', minWidth: '180' }, <div class="task-panel__toolbar-main">
{ prop: 'actual_quantity', label: '实际收货数量', width: '120' }, <el-button size="small" @click="triggerBatchImportSelect">选择Excel</el-button>
{ prop: 'box_quantity', label: '箱数', width: '90' }, <el-button size="small" @click="downloadBatchImportTemplate">下载模板</el-button>
{ prop: 'boxes_per_pallet', label: '箱规', width: '90' }, <el-button size="small" type="danger" plain @click="clearBatchImportData">清除数据</el-button>
{ prop: 'box_remainder', label: '剩余不满一箱', width: '130' }, <el-button size="small" type="primary" plain :loading="batchRetryFailedLoading" @click="retryFailedBatchRows">
{ prop: 'space_keyword', label: '库位条码或名称', width: '160' }, 只重试失败
{ prop: 'import_status', label: '状态', width: '100' }, </el-button>
{ prop: 'import_message', label: '结果说明', minWidth: '200' }, <el-button size="small" type="primary" :loading="batchImportLoading" @click="submitBatchImportCreate">
{ prop: 'retry_action', label: '操作', width: '140' }, 导入
{ prop: 'remark', label: '备注', minWidth: '180' } </el-button>
]"
>
<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> </div>
</template> <span class="task-panel__file-hint" :title="batchImportFileName">
<template #column-space_keyword="{ row }"> 已选文件:{{ batchImportFileName || '未选择' }}
<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> </span>
</template> </div>
<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 class="batch-import-summary"> <div class="task-panel__section">
已生成基础新增数组:{{ batchImportAddItems.length }} 条 <!-- <div class="task-panel__section-head">
</div> <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> <footer class="task-panel__foot">
<el-button size="small" @click="batchImportDialogVisible = false">关闭</el-button> <div class="task-panel__actions">
</template> <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> </el-dialog>
<!-- 右键菜单 --> <!-- 右键菜单 -->
@ -972,6 +1111,24 @@ const systemProductAllResults = ref<any[]>([])
const systemProductSelection = ref<any[]>([]) const systemProductSelection = ref<any[]>([])
const systemProductPagination = reactive({ page: 1, pageSize: 10, total: 0 }) 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 spacePickerVisible = ref(false)
const spaceLoading = ref(false) const spaceLoading = ref(false)
const spaceKeyword = ref('') const spaceKeyword = ref('')
@ -986,6 +1143,20 @@ const batchImportSourceFile = ref<File | null>(null)
const batchImportFileName = ref('') const batchImportFileName = ref('')
const batchImportPreviewRows = ref<any[]>([]) const batchImportPreviewRows = ref<any[]>([])
const batchImportAddItems = 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 batchImportEditingRow = ref<any>(null)
const batchImportPickerMode = ref<'space' | 'sku' | ''>('') const batchImportPickerMode = ref<'space' | 'sku' | ''>('')
const batchRetryFailedLoading = ref(false) const batchRetryFailedLoading = ref(false)
@ -1735,6 +1906,7 @@ const generateBatchImportList = async () => {
}) })
batchImportPreviewRows.value = previewRows batchImportPreviewRows.value = previewRows
batchImportPage.value = 1
addItems.push(...previewRows.map((r) => ({ item: { ...(r.item_payload || {}) } }))) addItems.push(...previewRows.map((r) => ({ item: { ...(r.item_payload || {}) } })))
batchImportAddItems.value = addItems batchImportAddItems.value = addItems
ElMessage.success(`已生成 ${addItems.length} 条基础新增数据`) ElMessage.success(`已生成 ${addItems.length} 条基础新增数据`)
@ -1749,6 +1921,7 @@ const generateBatchImportList = async () => {
const clearBatchImportData = () => { const clearBatchImportData = () => {
batchImportPreviewRows.value = [] batchImportPreviewRows.value = []
batchImportAddItems.value = [] batchImportAddItems.value = []
batchImportPage.value = 1
batchImportSourceFile.value = null batchImportSourceFile.value = null
batchImportFileName.value = '' batchImportFileName.value = ''
} }
@ -2759,23 +2932,266 @@ onUnmounted(() => {
flex-wrap: wrap; flex-wrap: wrap;
} }
.batch-import-toolbar { /* 批量导入商品面板:结构 / 尺寸对齐手工录入运单号(TaskProgressPanel) */
.task-panel {
display: flex; display: flex;
align-items: center; flex-direction: column;
gap: 10px; max-height: calc(100vh - 96px);
flex-wrap: wrap; background: #fff;
margin-bottom: 10px; 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 { /* 分页位于页脚「关闭」按钮左侧,始终展示;尺寸 / 选择器宽度对齐 UpperTable 默认分页 */
margin-top: 10px; .batch-import-pagination,
color: #606266; .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; 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 { .batch-cell-action {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
gap: 6px; gap: 6px;
} }
@ -2788,6 +3204,13 @@ onUnmounted(() => {
height: 440px; height: 440px;
} }
/* 表格固定高度:数据少也保持同样大小,超出容器时表格内部滚动(短屏自适应) */
.batch-import-table {
height: min(450px, calc(100vh - 280px));
border-radius: 4px;
overflow: hidden;
}
.product-window { .product-window {
position: fixed; position: fixed;
z-index: 2000; z-index: 2000;
@ -3134,4 +3557,19 @@ onUnmounted(() => {
.ut-status-text--warning { color: var(--el-color-warning); } .ut-status-text--warning { color: var(--el-color-warning); }
.ut-status-text--info { color: var(--el-color-info); } .ut-status-text--info { color: var(--el-color-info); }
.ut-status-text--danger { color: var(--el-color-danger); } .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> </style>

View File

@ -196,111 +196,181 @@
</el-dialog> </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 <el-dialog
v-model="matchPutawayDialogVisible" v-model="rejectDialogVisible"
title="匹配入库" class="reject-receiving-dialog"
width="92vw" width="min(560px, 92vw)"
align-center align-center
append-to-body 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 destroy-on-close
:close-on-click-modal="false"
@closed="resetMatchPutawayDialog" @closed="resetMatchPutawayDialog"
> >
<div class="match-putaway-dialog"> <!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
<div class="match-left-panel"> <div class="task-panel">
<div class="match-panel-title">入库单列表</div> <header class="task-panel__head">
<el-table <div class="task-panel__titles">
ref="matchEntryTableRef" <h2>匹配入库</h2>
:data="matchEntryList" <p>选择入库单与收货单明细比对后确认匹配</p>
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>
</div> </div>
<el-table <button
:data="matchComparisonRows" class="task-panel__close"
v-loading="matchReceivingDetailsLoading || matchEntryDetailsLoading" type="button"
border aria-label="关闭"
size="small" @click="matchPutawayDialogVisible = false"
height="100%"
row-key="stockId"
> >
<el-table-column prop="productName" label="商品名称" min-width="150" show-overflow-tooltip /> <svg viewBox="0 0 12 12" fill="none">
<el-table-column prop="barcode" label="条码" width="130" show-overflow-tooltip /> <path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
<el-table-column prop="itemCode" label="商品编码" width="130" show-overflow-tooltip /> </svg>
<el-table-column label="收货数量" width="90" align="center"> </button>
<template #default="{ row: r }">{{ r.receivingQty ?? '--' }}</template> </header>
</el-table-column>
<el-table-column label="收货箱数" width="80" align="center"> <div class="task-panel__body">
<template #default="{ row: r }">{{ r.receivingBoxes ?? '--' }}</template> <div class="match-putaway-dialog">
</el-table-column> <div class="match-left-panel">
<el-table-column label="入库应收" width="90" align="center"> <span class="task-panel__section-title">入库单列表</span>
<template #default="{ row: r }">{{ r.entryPlanQty ?? '--' }}</template> <div class="task-panel__table-wrap">
</el-table-column> <el-table
<el-table-column label="入库实收" width="90" align="center"> ref="matchEntryTableRef"
<template #default="{ row: r }">{{ r.entryReceivedQty ?? '--' }}</template> :data="matchEntryList"
</el-table-column> v-loading="matchEntryListLoading"
<el-table-column label="匹配" width="70" align="center"> highlight-current-row
<template #default="{ row: r }"> border
<span :class="getStatusTextClass(r.matched ? 'success' : 'info')"> size="small"
{{ r.matched ? '已匹配' : '未匹配' }} 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> </span>
</template> <span
</el-table-column> v-if="matchSelectedEntryOrder && matchComparisonRows.length"
</el-table> :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>
</div>
<template #footer> <footer class="task-panel__foot">
<div class="match-putaway-footer"> <span class="task-panel__hint">
<span class="match-selection-tip">{{ matchSelectedEntryOrder ? '已选:' + matchSelectedEntryOrder.entry_order_code : '未选择入库单' }}</span> {{ matchSelectedEntryOrder ? '已选:' + matchSelectedEntryOrder.entry_order_code : '未选择入库单' }}
<div> </span>
<div class="task-panel__actions">
<el-button size="small" @click="matchPutawayDialogVisible = false">取消</el-button> <el-button size="small" @click="matchPutawayDialogVisible = false">取消</el-button>
<el-button <el-button
size="small" size="small"
@ -312,8 +382,8 @@
确认匹配入库 确认匹配入库
</el-button> </el-button>
</div> </div>
</div> </footer>
</template> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -1739,46 +1809,217 @@ async function handleExportAll() {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px;
min-height: 0; min-height: 0;
:deep(.el-table) { height: 100%; }
} }
.match-right-panel { .match-right-panel {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px;
min-width: 0; min-width: 0;
min-height: 0;
} }
.match-right-panel > .el-table { .match-panel-head {
flex: 1; display: flex;
} align-items: center;
flex-wrap: wrap;
.match-panel-title { gap: 8px;
font-size: 13px;
font-weight: 600;
color: #303133;
margin-bottom: 6px;
flex-shrink: 0; flex-shrink: 0;
} }
.match-putaway-dialog .match-hint { .match-panel-meta {
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 {
font-size: 12px; font-size: 12px;
line-height: 20px;
color: #909399; 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> </style>
@ -1794,4 +2035,19 @@ async function handleExportAll() {
.ut-status-text--warning { color: var(--el-color-warning); } .ut-status-text--warning { color: var(--el-color-warning); }
.ut-status-text--info { color: var(--el-color-info); } .ut-status-text--info { color: var(--el-color-info); }
.ut-status-text--danger { color: var(--el-color-danger); } .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> </style>