1
This commit is contained in:
parent
b12420e5a9
commit
60e7b4d132
@ -27,14 +27,18 @@ export type StockCheckEnvelope<T> = {
|
||||
/**
|
||||
* 库存盘点(module folder = stock.check)接口封装。
|
||||
*
|
||||
* 响应封装(2026-10-02 起全部接口统一,本模块现 24 个方法):
|
||||
* 响应封装(2026-10-02 起全部接口统一,本模块现 26 个方法):
|
||||
* `{ flag, code, message, data, timestamp }` —— 业务数据**整体在 `data` 内**(见 StockCheckEnvelope)。
|
||||
* 调用侧统一 `const data = res.data ?? res`;`code=1` 为成功(request.ts 已含在 SUCCESS_CODES 内)。
|
||||
*
|
||||
* 静态盘点锁定(2026-10-28 文档新增 staticLockList):
|
||||
* is_static=1 的任务在 approved/checking 期间锁定其商品范围内的 stock_id,
|
||||
* 完成/取消后解除 —— 库存操作(移库 / 分配储位等)前置判断可调 stockCheckStaticLockList。
|
||||
*
|
||||
* 作业数据(workData 家族,2026-10-07 文档更新):
|
||||
* · workData —— 三视图(location/goods/space),服务端分页,新增 keyword / only_abnormal 入参,
|
||||
* **不再返回 check**(任务信息请调 detail)
|
||||
* · workDataDetail —— 单条明细的作业数据(单行对象,按 scope_type 分流)
|
||||
* · workDataDetail —— 单条明细的作业数据(detail_id,或 id+stock_id 商品钻取)
|
||||
* · workDataSpaceDetails —— space 视图服务端分页版(可只取某个库位)
|
||||
*
|
||||
* 状态机(主表 status):
|
||||
@ -386,10 +390,14 @@ export type StockCheckCreateParams = {
|
||||
/**
|
||||
* 是否静态盘点:0=关闭(缺省)/ 1=开启
|
||||
*
|
||||
* 仅商品盘点(type=store / goods)有效;库位盘点(type=location)不显示选项、不传。
|
||||
* 仅商品盘点(type=store / goods)有效;库位盘点(type=location)**恒为 0**,传入 1 也被忽略。
|
||||
* 兼容布尔 `true` 与 `isStatic` 驼峰写法,`'true'` / `'1'` 亦视为开启,其他值视为普通盘点;
|
||||
* 静态盘点定式(patternCreate)创建的任务由**服务端自动置 1**。
|
||||
* 开启后审核通过会锁定移库 / 分配储位操作(拣货不受影响),盘点完成后自动解锁。
|
||||
*/
|
||||
isStatic?: 0 | 1
|
||||
is_static?: 0 | 1 | boolean
|
||||
/** 同 `is_static`(驼峰别名,兼容写法;前端当前使用本字段) */
|
||||
isStatic?: 0 | 1 | boolean
|
||||
remark?: string
|
||||
}
|
||||
|
||||
@ -1233,27 +1241,153 @@ export function stockCheckWorkData<
|
||||
// ============ stock.check.workDataDetail ============
|
||||
|
||||
/**
|
||||
* workDataDetail 返回的单行作业数据(**按明细范围类型分流**):
|
||||
* - `scope_type=location`(库位明细) → `StockCheckWorkLocationRow`
|
||||
* - `scope_type=goods`(商品明细) → `StockCheckWorkGoodsRow`
|
||||
* workDataDetail 商品钻取的**库位分行**(data.rows 元素,一行一个库位)
|
||||
*
|
||||
* ⚠️ 数量字段仅**明盘**返回;盲盘(mode=blind)不含任何数量字段。
|
||||
*/
|
||||
export type StockCheckWorkDataDetailRow = StockCheckWorkLocationRow | StockCheckWorkGoodsRow
|
||||
|
||||
/** stock.check.workDataDetail 请求参数(2026-10-07 新增) */
|
||||
export type StockCheckWorkDataDetailParams = {
|
||||
/** 盘点明细ID(wms_stock_check_detail.id) */
|
||||
detail_id: number
|
||||
/** 盘点明细ID(驼峰别名,兼容写法;detail_id 优先) */
|
||||
detailId?: number
|
||||
export type StockCheckWorkDetailGoodsRow = {
|
||||
/** 该库位盘点明细ID(无明细快照的库位为 null) */
|
||||
detail_id: number | null
|
||||
/** 库位ID(wms_location_space.id) */
|
||||
location_id?: number | null
|
||||
/** `location_id` 同义字段(可直接回传 `stock.check.report` 的 space_id) */
|
||||
space_id?: number | null
|
||||
/** 库位编码 */
|
||||
location_code?: string | null
|
||||
/** 该库位最近上报时间(无记录为 null) */
|
||||
checked_at?: string | null
|
||||
/** 盘点人 */
|
||||
checker_name?: string | null
|
||||
/** 该库位作业记录ID(按记录 id 升序) */
|
||||
record_ids?: number[]
|
||||
/** 作业记录照片 */
|
||||
images?: StockCheckWorkImage[]
|
||||
/**
|
||||
* 该库位**当前**账面(wms_storage 可用+锁定;仅明盘)
|
||||
*
|
||||
* ⚠️ 静态盘点(is_static=1)时**不参与差异计算**,参与计算的是 `snapshot_quantity`。
|
||||
*/
|
||||
system_quantity?: number | null
|
||||
/** 该库位当前 storage 账面(与静态/普通口径无关,恒为当前库存;仅明盘) */
|
||||
storage_quantity?: number | null
|
||||
/** 该库位锁定数量(仅明盘) */
|
||||
locked_quantity?: number | null
|
||||
/** 该库位账面**快照**(盘点开始时的账面;仅明盘) */
|
||||
snapshot_quantity?: number | null
|
||||
/** 该库位实盘合计(仅明盘) */
|
||||
checked_quantity?: number | null
|
||||
/** 该库位差异 = 实盘 - 参与计算的账面(仅明盘) */
|
||||
diff_quantity?: number | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
/** workDataDetail 商品钻取的商品级汇总(仅明盘返回) */
|
||||
export type StockCheckWorkDetailGoodsSummary = {
|
||||
/** 参与差异计算的账面(is_static=1 取快照、=0 取当前 storage 合计) */
|
||||
system_quantity?: number | null
|
||||
/** 当前 storage 账面合计(供对照) */
|
||||
storage_quantity?: number | null
|
||||
/** 明细账面快照合计(供对照) */
|
||||
snapshot_quantity?: number | null
|
||||
/** 实盘合计 */
|
||||
checked_quantity?: number | null
|
||||
/** 差异 = 实盘 - 参与计算的账面 */
|
||||
diff_quantity?: number | null
|
||||
/** 是否差异:0|1 */
|
||||
is_diff?: boolean | number | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
/**
|
||||
* workDataDetail 商品钻取结构(入参 ② `id + stock_id`,或 `detail_id` 指向商品范围行)
|
||||
*
|
||||
* 账面口径随任务静态标记(is_static)变化:
|
||||
* · is_static=1(静态盘点)→ `system_quantity` 取**明细账面快照**(盘点基准冻结,不受盘点期间出入库影响)
|
||||
* · is_static=0(普通盘点)→ `system_quantity` 取**当前** wms_storage 账面 SUM(available_quantity+locked_quantity)
|
||||
* 两种口径都会额外输出 `storage_quantity`(当前 storage 账面)与 `snapshot_quantity`(明细快照)供对照,
|
||||
* `system_quantity` 始终是参与差异计算的那个账面;`book_source` 标识来源(snapshot|storage)。
|
||||
*/
|
||||
export type StockCheckWorkDetailGoods = {
|
||||
/** 盘点任务ID */
|
||||
check_id: number
|
||||
/** 商品库存ID(wms_stock_warehouse.id) */
|
||||
stock_id: number
|
||||
item_code?: string | null
|
||||
item_name?: string | null
|
||||
spec?: string | null
|
||||
store_id?: number | null
|
||||
store_name?: string | null
|
||||
barcode?: string | null
|
||||
/** 商品图片(URL 数组) */
|
||||
images?: string[]
|
||||
/** 任务是否静态盘点(0/1 或布尔) */
|
||||
is_static?: boolean | number | null
|
||||
/** 账面来源:snapshot=取明细快照 / storage=取当前 storage 账面 */
|
||||
book_source?: 'snapshot' | 'storage' | string
|
||||
/** 商品级汇总(**仅明盘**;盲盘不返回 summary 与任何数量字段) */
|
||||
summary?: StockCheckWorkDetailGoodsSummary
|
||||
/** 按库位分行(顺序与 workData goods 视图 locations 一致) */
|
||||
rows: StockCheckWorkDetailGoodsRow[]
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
/**
|
||||
* workDataDetail 返回的作业数据(**按入参分流**):
|
||||
* - `detail_id` 指向 `scope_type=location`(库位明细) → `StockCheckWorkLocationRow`
|
||||
* - `detail_id` 指向 `scope_type=goods`(商品明细)或商品钻取 → 商品钻取结构 `StockCheckWorkDetailGoods`
|
||||
* - 兼容旧描述:`scope_type=goods` 单行结构 `StockCheckWorkGoodsRow`
|
||||
*/
|
||||
export type StockCheckWorkDataDetailRow =
|
||||
| StockCheckWorkLocationRow
|
||||
| StockCheckWorkGoodsRow
|
||||
| StockCheckWorkDetailGoods
|
||||
|
||||
/**
|
||||
* stock.check.workDataDetail 请求参数(2026-10-07 新增;2026-10-28 文档放开商品钻取)
|
||||
*
|
||||
* **入参二选一**:
|
||||
* ① `detail_id`(盘点明细ID,兼容 `detailId`):库位明细**必传**;
|
||||
* 商品范围明细也可只传本参数(服务端按该明细的商品走商品钻取)
|
||||
* ② `id`(盘点任务ID)+ `stock_id`(商品库存ID,兼容 `stockId`):商品钻取用,
|
||||
* goods 汇总视图行(stock.check.workData)不返回明细ID 时按此获取明细
|
||||
*
|
||||
* warehouse_id 由服务端注入,前端不传。
|
||||
*/
|
||||
export type StockCheckWorkDataDetailParams =
|
||||
| {
|
||||
/** ① 盘点明细ID(wms_stock_check_detail.id) */
|
||||
detail_id: number
|
||||
/** 盘点明细ID(驼峰别名,兼容写法;detail_id 优先) */
|
||||
detailId?: number
|
||||
/** 盘点任务ID(商品钻取的搭配参数,可省略) */
|
||||
id?: number
|
||||
/** 商品库存ID(商品钻取的搭配参数,可省略) */
|
||||
stock_id?: number
|
||||
/** 商品库存ID(驼峰别名) */
|
||||
stockId?: number
|
||||
}
|
||||
| {
|
||||
/** ② 商品钻取:盘点任务ID */
|
||||
id: number
|
||||
/** ② 商品钻取:商品库存ID(wms_stock_warehouse.id) */
|
||||
stock_id: number
|
||||
/** 盘点明细ID(可选;同时传时以服务端明细为准) */
|
||||
detail_id?: number
|
||||
/** 盘点明细ID(驼峰别名) */
|
||||
detailId?: number
|
||||
/** 商品库存ID(驼峰别名) */
|
||||
stockId?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* stock.check.workDataDetail:拉取**单条盘点明细**的作业数据(workData 单行版,2026-10-07 新增)
|
||||
*
|
||||
* - 入参只有 `detail_id`(盘点明细ID),warehouse_id 由服务端注入(前端不传)
|
||||
* - 统一 success 包装,`data` 为**单行作业数据**(不是数组),行结构按明细范围类型分流:
|
||||
* - 入参二选一(2026-10-28 文档):`detail_id`(库位明细必传)/ `id + stock_id`(商品钻取),
|
||||
* warehouse_id 由服务端注入(前端不传)
|
||||
* - 统一 success 包装,`data` 为**单行对象**(不是数组),结构按入参分流:
|
||||
* · 库位明细(scope_type=location)→ 结构同 workData 的 location 视图单行
|
||||
* · 商品明细(scope_type=goods) → 结构同 workData 的 goods 视图行
|
||||
* · 商品钻取(id + stock_id,或 detail_id 指向商品范围行)→ `StockCheckWorkDetailGoods`
|
||||
* (商品级汇总 summary + 按库位分行 rows;账面口径随任务 is_static 区分,见该类型注释)
|
||||
* - 仅任务 `approved`(待盘点)/ `checking`(盘点中)可拉取(与 workData 同口径)
|
||||
*/
|
||||
export function stockCheckWorkDataDetail(
|
||||
@ -1341,8 +1475,16 @@ export function stockCheckWorkDataSpaceDetails(
|
||||
export type StockCheckReportParams = {
|
||||
/** 盘点任务ID */
|
||||
id: number
|
||||
/** 盘点明细ID */
|
||||
detail_id: number
|
||||
/**
|
||||
* 盘点明细ID(**2026-10-28 文档改为可选**)
|
||||
*
|
||||
* - 库位明细行(scope_type=location):**必传**
|
||||
* - 商品行:可选 —— 不传时服务端按 `id + stock_id + space_id` 反查该商品的库位明细
|
||||
* (先按 location_id=space_id 命中,未命中取该商品任一明细);
|
||||
* 反查不到报 400「盘点明细不存在(该商品不在本任务盘点范围内,或库位盘点任务需传 detail_id)」
|
||||
* (goods 汇总视图行不再返回明细ID,此时只能走反查)
|
||||
*/
|
||||
detail_id?: number
|
||||
/**
|
||||
* **库位ID(wms_location_space.id)—— 必传**(2026-10-26 文档)
|
||||
*
|
||||
@ -1695,6 +1837,13 @@ export type StockCheckFinishResponse = {
|
||||
profit_total: number
|
||||
/** 盘亏合计(商品行:实盘小于账面快照的差异绝对值,含未盘明细的账面快照数;库位行:按商品实盘小于 wms_storage 账面的差异绝对值) */
|
||||
loss_total: number
|
||||
/**
|
||||
* 本次完成**释放的静态锁定商品ID数组**(2026-10-28 文档新增)
|
||||
*
|
||||
* 静态盘点(is_static=1)任务完成后解除锁定,返回被释放的 stock_id 列表;
|
||||
* 非静态任务 / 无锁定商品时为空数组。
|
||||
*/
|
||||
released_stock_ids?: number[]
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1999,3 +2148,64 @@ export function stockCheckBatchDelete(
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// ============ stock.check.staticLockList ============
|
||||
|
||||
/** staticLockList 的锁定商品行(每个 stock_id 一条) */
|
||||
export type StockCheckStaticLockRow = {
|
||||
/** 商品库存ID(wms_stock_warehouse.id) */
|
||||
stock_id: number
|
||||
item_code?: string | null
|
||||
item_name?: string | null
|
||||
/** 来源盘点任务ID数组 */
|
||||
check_ids?: number[]
|
||||
/** 来源盘点单号数组 */
|
||||
check_nos?: string[]
|
||||
/** 该商品在盘子任务中的库位编码数组 */
|
||||
location_codes?: string[]
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
/** stock.check.staticLockList 响应(无入参,warehouse_id 服务端注入) */
|
||||
export type StockCheckStaticLockListResponse = {
|
||||
warehouse_id: number
|
||||
/** 锁定商品ID数组(**升序**) */
|
||||
stock_ids: number[]
|
||||
/** 每个 stock_id 一条明细(来源盘点任务 / 单号 / 库位) */
|
||||
rows: StockCheckStaticLockRow[]
|
||||
/** = rows.length */
|
||||
total: number
|
||||
/** true = 本次命中服务端缓存(`stock_check:static_lock:{warehouseId}`,TTL 300 秒) */
|
||||
cached: boolean
|
||||
/** 缓存生成时间(ISO 8601;命中缓存时为上次回源时间) */
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
/**
|
||||
* stock.check.staticLockList:拉取「静态盘点锁定中」的库存商品列表(2026-10-28 文档新增)
|
||||
*
|
||||
* 公共查询,供**出入库 / 移库等库存操作前置判断**该商品当前是否可动:
|
||||
* - 口径:`is_static=1` 且状态为 `approved`(审核完成)/ `checking`(盘点作业中)的盘点任务,
|
||||
* 取其商品范围明细(scope_type=goods)的 stock_id 去重集合 —— **审核完成即开始锁定**,
|
||||
* 任务完成 / 取消后解除;提交审核前(created/submitted/rejected)与已完成/已取消均不锁定;
|
||||
* 库位盘点任务 `is_static` 恒为 0,天然不参与。
|
||||
* - **前端无需传参**:warehouse_id 由服务端从当前上下文注入。
|
||||
* - 服务端按仓库缓存(默认 TTL 300 秒,Redis 优先、不可用时降级进程内缓存),
|
||||
* 审核 / 完成 / 取消 / 批量删除等状态流转时主动失效;`cached` 标识本次是否命中缓存。
|
||||
*
|
||||
* ⚠️ 本仓库(web 后台)目前**尚无调用方**:接入侧需自行决定命中锁定时的拦截文案与是否强制阻断。
|
||||
*/
|
||||
export function stockCheckStaticLockList(): Promise<
|
||||
StockCheckEnvelope<StockCheckStaticLockListResponse>
|
||||
> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'stock.check.staticLockList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
@ -88,16 +88,20 @@ const summaryItems = computed<ProgressSummaryItem[]>(() => {
|
||||
})
|
||||
|
||||
const tipText = computed(() => {
|
||||
if (progressState.value === 'success') return props.message || '导出完成,可关闭窗口'
|
||||
if (progressState.value === 'success') {
|
||||
return `${props.message || '导出完成'},窗口将在 1.5 秒后自动关闭`
|
||||
}
|
||||
if (progressState.value === 'running') {
|
||||
return '导出任务在后台执行中,关闭本窗口可停止自动刷新;重新进入本页面或再次点击导出可恢复查看结果。'
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
const footerHint = computed(() =>
|
||||
progressState.value === 'running' ? '导出任务在后台执行' : '任务已结束,可关闭窗口'
|
||||
)
|
||||
const footerHint = computed(() => {
|
||||
if (progressState.value === 'running') return '导出任务在后台执行'
|
||||
if (progressState.value === 'success') return '任务已完成,窗口将自动关闭'
|
||||
return '任务已结束,可关闭窗口'
|
||||
})
|
||||
|
||||
function formatDateTime(value: string | number | null | undefined) {
|
||||
if (!value) return '—'
|
||||
|
||||
@ -39,6 +39,8 @@ export function useAsyncExportTask(options: {
|
||||
})
|
||||
|
||||
let exportPollingTimer: number | null = null
|
||||
/** 导出完成后自动关闭进度弹窗的定时器 */
|
||||
let autoCloseTimer: number | null = null
|
||||
|
||||
/** 连续轮询失败次数(网络异常/接口非成功),达到上限后放弃,避免无限请求 */
|
||||
let pollFailCount = 0
|
||||
@ -57,6 +59,24 @@ export function useAsyncExportTask(options: {
|
||||
const MAX_TOTAL_POLLS = 600
|
||||
/** 失败重试间隔 */
|
||||
const FAILURE_RETRY_DELAY = 2000
|
||||
/** 导出完成后自动关闭进度弹窗的延迟(毫秒) */
|
||||
const AUTO_CLOSE_DELAY = 1500
|
||||
|
||||
function clearAutoCloseTimer() {
|
||||
if (autoCloseTimer) {
|
||||
window.clearTimeout(autoCloseTimer)
|
||||
autoCloseTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
/** 导出完成后延迟关闭进度弹窗(留出时间让用户看到「已完成」状态) */
|
||||
function scheduleAutoClose() {
|
||||
clearAutoCloseTimer()
|
||||
autoCloseTimer = window.setTimeout(() => {
|
||||
autoCloseTimer = null
|
||||
exportDialogVisible.value = false
|
||||
}, AUTO_CLOSE_DELAY)
|
||||
}
|
||||
|
||||
function resetPollGuards() {
|
||||
pollFailCount = 0
|
||||
@ -66,6 +86,7 @@ export function useAsyncExportTask(options: {
|
||||
}
|
||||
|
||||
function resetExportProgress() {
|
||||
clearAutoCloseTimer()
|
||||
resetPollGuards()
|
||||
exportTaskProgress.taskId = ''
|
||||
exportTaskProgress.status = 'submitted'
|
||||
@ -160,7 +181,8 @@ export function useAsyncExportTask(options: {
|
||||
} else {
|
||||
ElMessage.warning(exportTaskProgress.message || '导出完成,但未返回下载地址')
|
||||
}
|
||||
// 完成后保留弹窗,展示完成状态,由用户手动关闭
|
||||
// 完成后先展示「已完成」状态,1.5 秒后自动关闭进度弹窗
|
||||
scheduleAutoClose()
|
||||
return
|
||||
}
|
||||
|
||||
@ -293,6 +315,7 @@ export function useAsyncExportTask(options: {
|
||||
function resumeExportTaskFromStorage() {
|
||||
const savedTaskId = getSavedExportTaskId()
|
||||
if (!savedTaskId || exportLoading.value) return
|
||||
clearAutoCloseTimer()
|
||||
resetPollGuards()
|
||||
exportTaskProgress.taskId = savedTaskId
|
||||
exportTaskProgress.status = 'submitted'
|
||||
@ -317,6 +340,9 @@ export function useAsyncExportTask(options: {
|
||||
// 用户在等待轮询期间主动关闭进度框:停止轮询并解除 loading,
|
||||
// 保留已保存的 taskId,便于之后再次进入页面时恢复查询/下载
|
||||
watch(exportDialogVisible, (visible) => {
|
||||
if (!visible) {
|
||||
clearAutoCloseTimer()
|
||||
}
|
||||
if (!visible && exportLoading.value && exportTaskProgress.taskId) {
|
||||
stopExportPolling()
|
||||
exportLoading.value = false
|
||||
@ -326,6 +352,7 @@ export function useAsyncExportTask(options: {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
stopExportPolling()
|
||||
clearAutoCloseTimer()
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@ -49,8 +49,30 @@ export function useOrderAsyncExport(storageKey?: string) {
|
||||
})
|
||||
|
||||
let exportPollingTimer: number | null = null
|
||||
/** 导出完成后自动关闭进度弹窗的定时器 */
|
||||
let autoCloseTimer: number | null = null
|
||||
|
||||
/** 导出完成后自动关闭进度弹窗的延迟(毫秒) */
|
||||
const AUTO_CLOSE_DELAY = 1500
|
||||
|
||||
function clearAutoCloseTimer() {
|
||||
if (autoCloseTimer) {
|
||||
window.clearTimeout(autoCloseTimer)
|
||||
autoCloseTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
/** 导出完成后延迟关闭进度弹窗(留出时间让用户看到「已完成」状态) */
|
||||
function scheduleAutoClose() {
|
||||
clearAutoCloseTimer()
|
||||
autoCloseTimer = window.setTimeout(() => {
|
||||
autoCloseTimer = null
|
||||
exportDialogVisible.value = false
|
||||
}, AUTO_CLOSE_DELAY)
|
||||
}
|
||||
|
||||
function resetExportProgress() {
|
||||
clearAutoCloseTimer()
|
||||
exportTaskProgress.taskId = ''
|
||||
exportTaskProgress.status = 'submitted'
|
||||
exportTaskProgress.progress = 0
|
||||
@ -147,7 +169,8 @@ export function useOrderAsyncExport(storageKey?: string) {
|
||||
} else {
|
||||
ElMessage.warning(exportTaskProgress.message || '导出完成,但未返回下载地址')
|
||||
}
|
||||
// 完成后保留弹窗,展示完成状态,由用户手动关闭
|
||||
// 完成后先展示「已完成」状态,1.5 秒后自动关闭进度弹窗
|
||||
scheduleAutoClose()
|
||||
return
|
||||
}
|
||||
|
||||
@ -233,6 +256,7 @@ export function useOrderAsyncExport(storageKey?: string) {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
stopExportPolling()
|
||||
clearAutoCloseTimer()
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@ -285,7 +285,7 @@
|
||||
:video="playingVideo"
|
||||
/>
|
||||
|
||||
<!-- 设置结束时间弹窗:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) -->
|
||||
<!-- 设置结束时间弹窗:面板结构 / 尺寸对齐「手工录入运单号」 -->
|
||||
<el-dialog
|
||||
v-model="setEndTimeVisible"
|
||||
class="set-end-time-dialog"
|
||||
@ -322,9 +322,9 @@
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">当前状态</span>
|
||||
<strong class="task-panel__field-value">
|
||||
<el-tag :type="statusTagType(operatingRow?.status)" size="small">
|
||||
<span :class="getStatusTextClass(statusTagType(operatingRow?.status))">
|
||||
{{ statusLabel(operatingRow?.status) }}
|
||||
</el-tag>
|
||||
</span>
|
||||
</strong>
|
||||
</div>
|
||||
<div v-if="operatingRow?.start_time" class="task-panel__field">
|
||||
@ -1017,7 +1017,7 @@ onMounted(() => {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
/* 设置结束时间:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) */
|
||||
/* 设置结束时间:面板结构 / 尺寸对齐「手工录入运单号」(TaskProgressPanel) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
@ -1105,20 +1105,34 @@ onMounted(() => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1158,7 +1172,8 @@ onMounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -1,106 +1,109 @@
|
||||
<template>
|
||||
<div class="receive-register">
|
||||
<!-- 左:操作表单 + 参数(任务已锁定,不可切换) -->
|
||||
<div class="receive-left">
|
||||
<div class="panel-title">收件登记</div>
|
||||
|
||||
<el-descriptions :column="1" size="small" border class="task-params">
|
||||
<el-descriptions-item label="任务">{{ taskLabel || '—' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-form :model="form" label-width="0" class="register-form" @submit.prevent>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
ref="waybillInputRef"
|
||||
v-model="form.waybillCode"
|
||||
placeholder="退回运单号(扫码/输入)"
|
||||
clearable
|
||||
@keyup.enter="handleRegister"
|
||||
<div class="order-sub-container">
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<order-toolbar-button-group
|
||||
:buttons="toolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="form.remark"
|
||||
class="full-width"
|
||||
clearable
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="备注(可选,可复用)"
|
||||
@change="handleRemarkChange"
|
||||
>
|
||||
<el-option v-for="opt in remarkOptions" :key="opt" :label="opt" :value="opt">
|
||||
<span class="remark-option-content">
|
||||
<span class="remark-option-label" :title="opt">{{ opt }}</span>
|
||||
<el-button
|
||||
class="remark-option-delete"
|
||||
type="danger"
|
||||
link
|
||||
size="small"
|
||||
@mousedown.stop.prevent
|
||||
@click.stop.prevent="removeRemarkOption(opt)"
|
||||
>删除</el-button>
|
||||
</span>
|
||||
</el-option>
|
||||
<el-option :value="REMARK_ADD_OPTION_VALUE" label="+ 添加备注选项" class="remark-add-option" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="registerLoading" @click="handleRegister">扫码登记</el-button>
|
||||
<el-button @click="clearWaybill">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 右:当前任务的登记列表 -->
|
||||
<div class="receive-right">
|
||||
<div class="panel-head">
|
||||
<span class="panel-title">任务登记列表</span>
|
||||
<el-button size="small" :loading="listLoading" @click="handleRefresh">刷新</el-button>
|
||||
<el-divider direction="vertical" />
|
||||
<!-- 扫码登记区:运单号 + 备注(可复用/可新增)+ 登记/重置 -->
|
||||
<div class="scan-register">
|
||||
<el-input
|
||||
ref="waybillInputRef"
|
||||
v-model="form.waybillCode"
|
||||
size="small"
|
||||
class="register-input"
|
||||
placeholder="退回运单号(扫码/输入)"
|
||||
clearable
|
||||
@keyup.enter="handleRegister"
|
||||
/>
|
||||
<el-select
|
||||
v-model="form.remark"
|
||||
size="small"
|
||||
class="register-remark"
|
||||
clearable
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="备注(可选,可复用)"
|
||||
@change="handleRemarkChange"
|
||||
>
|
||||
<el-option v-for="opt in remarkOptions" :key="opt" :label="opt" :value="opt">
|
||||
<span class="remark-option-content">
|
||||
<span class="remark-option-label" :title="opt">{{ opt }}</span>
|
||||
<el-button
|
||||
class="remark-option-delete"
|
||||
type="danger"
|
||||
link
|
||||
size="small"
|
||||
@mousedown.stop.prevent
|
||||
@click.stop.prevent="removeRemarkOption(opt)"
|
||||
>删除</el-button>
|
||||
</span>
|
||||
</el-option>
|
||||
<el-option :value="REMARK_ADD_OPTION_VALUE" label="+ 添加备注选项" class="remark-add-option" />
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" :loading="registerLoading" @click="handleRegister">
|
||||
扫码登记
|
||||
</el-button>
|
||||
<el-button size="small" @click="clearWaybill">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<span class="task-locked" :title="taskLabel || '—'">任务:{{ taskLabel || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-wrap">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
table-id="data-returnrecord-receive-register-list"
|
||||
default-align="center"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:enable-column-config="true"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:loading="listLoading"
|
||||
:query-time="queryTime"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
>
|
||||
<template #column-is_notified="{ row }">
|
||||
<span :class="getStatusTextClass(row.is_notified ? 'success' : 'info')">
|
||||
{{ row.is_notified ? '已通知' : '未通知' }}
|
||||
</span>
|
||||
</template>
|
||||
<div class="split-stack">
|
||||
<div class="upper-wrapper upper-wrapper--full">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
table-id="data-returnrecord-receive-register-list"
|
||||
default-align="center"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:enable-column-config="true"
|
||||
:pagination="pagination"
|
||||
:loading="listLoading"
|
||||
:query-time="queryTime"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #column-is_notified="{ row }">
|
||||
<span :class="getStatusTextClass(row.is_notified ? 'success' : 'info')">
|
||||
{{ row.is_notified ? '已通知' : '未通知' }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #column-is_original_return="{ row }">
|
||||
<span :class="getStatusTextClass(row.is_original_return ? 'success' : 'info')">
|
||||
{{ row.is_original_return ? '是' : '否' }}
|
||||
</span>
|
||||
</template>
|
||||
<template #column-is_original_return="{ row }">
|
||||
<span :class="getStatusTextClass(row.is_original_return ? 'success' : 'info')">
|
||||
{{ row.is_original_return ? '是' : '否' }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #column-order_express_id="{ row }">
|
||||
<span v-if="row.order_express_id != null">{{ row.order_express_id }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #column-order_express_id="{ row }">
|
||||
<span v-if="row.order_express_id != null">{{ row.order_express_id }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<template #column-order_id="{ row }">
|
||||
<span v-if="row.order_id != null">{{ row.order_id }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #column-order_id="{ row }">
|
||||
<span v-if="row.order_id != null">{{ row.order_id }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">该任务暂无登记记录</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
<template #empty>
|
||||
<div class="empty-tip">该任务暂无登记记录</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -132,8 +135,11 @@ import { ElMessage } from 'element-plus'
|
||||
import { returnReceivedCreate, returnReceivedList } from '@/api/returnreceived'
|
||||
import { returnReceivedColumns } from '@/views/express/returnReceived/returnReceived-config'
|
||||
import { getStatusTextClass } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { useBarcodeScan } from '@/composables/useBarcodeScan'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
|
||||
const props = defineProps<{
|
||||
/** 锁定的退回收件任务ID(仅能从任务列表「登记收件」进入) */
|
||||
@ -159,6 +165,47 @@ const queryTime = ref(0)
|
||||
const list = ref<any[]>([])
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
|
||||
// ==================== 工具栏(对齐「退回收件任务」页) ====================
|
||||
|
||||
const toolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'listLoading', action: 'loadList' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
]
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
listLoading: listLoading.value,
|
||||
}))
|
||||
const buttonDisabledMap = ref<Record<string, boolean>>({})
|
||||
const buttonLabelMap = ref<Record<string, string>>({})
|
||||
const toolbarLayoutKey = ref('')
|
||||
|
||||
function resolveButtonLoading(loadingKey?: string) {
|
||||
if (!loadingKey) return false
|
||||
return Boolean(buttonLoadingMap.value[loadingKey])
|
||||
}
|
||||
function resolveButtonDisabled(disabledKey?: string) {
|
||||
if (!disabledKey) return false
|
||||
return Boolean(buttonDisabledMap.value[disabledKey])
|
||||
}
|
||||
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
|
||||
return dynamicLabelKey ? (buttonLabelMap.value[dynamicLabelKey] || defaultLabel) : defaultLabel
|
||||
}
|
||||
|
||||
const toolbarActionMap: Record<string, () => void> = {
|
||||
loadList: () => {
|
||||
void loadList()
|
||||
},
|
||||
openColumnConfigPanel: () => {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
},
|
||||
}
|
||||
|
||||
function handleToolbarButtonClick(action: string) {
|
||||
const handler = toolbarActionMap[action]
|
||||
if (!handler) return
|
||||
safeInvoke(() => handler())
|
||||
}
|
||||
|
||||
function normalizeTaskId(raw: unknown): number | null {
|
||||
if (raw === undefined || raw === null || raw === '') return null
|
||||
const n = Number(raw)
|
||||
@ -395,94 +442,54 @@ watch(
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.receive-register {
|
||||
@use "../../../order/orderManagement/styles/order-sub.scss";
|
||||
|
||||
/* 窄屏时允许工具栏换行,避免登记控件溢出(覆盖共享 order-sub.scss 的不换行) */
|
||||
.toolbar-left {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* 扫码登记区(对齐「未退登记」页 toolbar 内的登记行) */
|
||||
.scan-register {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
background-color: #f0f2f5;
|
||||
align-items: center;
|
||||
/* 与 OrderToolbarButtonGroup 的按钮间距一致(6px) */
|
||||
gap: 6px;
|
||||
flex: 0 0 auto;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.receive-left {
|
||||
flex: 0 0 340px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 6px;
|
||||
overflow: auto;
|
||||
/* 清除 Element Plus 相邻按钮默认的 12px 左边距,按钮间距只由 gap 控制(与「退回收件任务」工具栏一致) */
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.receive-right {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
.register-input {
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
.register-remark {
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
/* 右上角锁定的任务信息:与工具栏 small 控件竖向居中对齐 */
|
||||
.task-locked {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 24px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
max-width: 320px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.task-params {
|
||||
:deep(.el-descriptions__label) {
|
||||
width: 70px;
|
||||
background: #fafbfc;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.register-form {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-wrap {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
:deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
:deep(.table-container) {
|
||||
height: auto !important;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
padding: 16px;
|
||||
}
|
||||
.empty-tip {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
/* 备注下拉选项:el-select 下拉被 teleport 到 body,样式必须放顶层(不能嵌套在 .receive-register 内) */
|
||||
|
||||
@ -66,9 +66,12 @@
|
||||
</template>
|
||||
|
||||
<template #column-register_count="{ row }">
|
||||
<el-tag size="small" :type="Number(row.register_count) > 0 ? 'primary' : 'info'">
|
||||
<span
|
||||
class="register-count"
|
||||
:class="Number(row.register_count) > 0 ? 'is-positive' : 'is-zero'"
|
||||
>
|
||||
{{ Number(row.register_count) || 0 }}
|
||||
</el-tag>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #column-actions="{ row }">
|
||||
@ -99,7 +102,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ========== 新建任务弹窗:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) ========== -->
|
||||
<!-- ========== 新建任务弹窗:面板结构 / 尺寸对齐「手工录入运单号」 ========== -->
|
||||
<el-dialog
|
||||
v-model="createVisible"
|
||||
class="create-task-dialog"
|
||||
@ -608,6 +611,19 @@ onMounted(() => {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 登记数:纯文字着色(不带宽色背景),>0 用主色、 0 用次要灰 */
|
||||
.register-count {
|
||||
font-weight: 500;
|
||||
|
||||
&.is-positive {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
&.is-zero {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.wave-operation-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -622,7 +638,7 @@ onMounted(() => {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
/* 新建退回收件任务:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) */
|
||||
/* 新建退回收件任务:面板结构 / 尺寸对齐「手工录入运单号」(TaskProgressPanel) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
@ -710,20 +726,34 @@ onMounted(() => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -763,7 +793,8 @@ onMounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -230,6 +230,8 @@ async function confirmLeave(message: string): Promise<boolean> {
|
||||
confirmButtonText: '离开',
|
||||
cancelButtonText: '取消',
|
||||
distinguishCancelAndClose: true,
|
||||
// 按钮尺寸对齐「新建退回收件任务」表单(Element Plus small)
|
||||
buttonSize: 'small',
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- ========== 编辑弹窗:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) ========== -->
|
||||
<!-- ========== 编辑弹窗:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) ========== -->
|
||||
<el-dialog
|
||||
v-model="editVisible"
|
||||
class="edit-return-waybill-dialog"
|
||||
@ -203,55 +203,86 @@
|
||||
|
||||
<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 is-required">运单号</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-input v-model="editForm.waybillCode" size="default" placeholder="请输入运单号" clearable />
|
||||
<p class="task-panel__field-tip">运单号不能为空,用于匹配对应的退回运单</p>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">登记 ID</span>
|
||||
<strong class="task-panel__field-value">{{ editForm.id ?? '—' }}</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-select
|
||||
v-model="editForm.storeId"
|
||||
size="default"
|
||||
placeholder="请选择货主"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeOptions"
|
||||
:key="String(item.value)"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">登记时间</span>
|
||||
<strong class="task-panel__field-value">
|
||||
{{ editForm.createdAt ? formatTime(editForm.createdAt) : '—' }}
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<el-form
|
||||
ref="editFormRef"
|
||||
:model="editForm"
|
||||
:rules="editRules"
|
||||
class="task-panel__form-fields"
|
||||
@submit.prevent
|
||||
>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">运单号</span>
|
||||
<el-form-item prop="waybillCode">
|
||||
<el-input
|
||||
v-model="editForm.waybillCode"
|
||||
size="default"
|
||||
placeholder="请输入运单号"
|
||||
clearable
|
||||
maxlength="64"
|
||||
show-word-limit
|
||||
@keyup.enter="handleEditSubmit"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-input
|
||||
v-model="editForm.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
resize="none"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
placeholder="备注(可选)"
|
||||
/>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">货主</span>
|
||||
<el-form-item prop="storeId">
|
||||
<el-select
|
||||
v-model="editForm.storeId"
|
||||
size="default"
|
||||
placeholder="请选择货主"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeOptions"
|
||||
:key="String(item.value)"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<el-form-item prop="remark">
|
||||
<el-input
|
||||
v-model="editForm.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
resize="none"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
placeholder="备注(可选)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</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="editVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="editLoading" @click="handleEditSubmit">确定</el-button>
|
||||
<el-button size="small" type="primary" :loading="editLoading" @click="handleEditSubmit">
|
||||
保存修改
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
@ -262,6 +293,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import {
|
||||
returnWaybillList,
|
||||
returnWaybillCreate,
|
||||
@ -606,18 +638,37 @@ async function handleViewDetail(row: any) {
|
||||
|
||||
const editVisible = ref(false)
|
||||
const editLoading = ref(false)
|
||||
const editFormRef = ref<FormInstance>()
|
||||
const editForm = reactive({
|
||||
id: null as number | null,
|
||||
waybillCode: '',
|
||||
storeId: null as number | string | null,
|
||||
remark: '',
|
||||
createdAt: '',
|
||||
})
|
||||
|
||||
const editRules: FormRules = {
|
||||
waybillCode: [
|
||||
{ required: true, message: '请输入运单号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_rule, value, callback) => {
|
||||
if (!String(value ?? '').trim()) {
|
||||
callback(new Error('运单号不能为空'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function openEdit(row: any) {
|
||||
editForm.id = row.id
|
||||
editForm.waybillCode = row.waybill_code ?? ''
|
||||
editForm.storeId = row.store_id != null ? row.store_id : null
|
||||
editForm.remark = row.remark ?? ''
|
||||
editForm.createdAt = row.created_at ?? ''
|
||||
editVisible.value = true
|
||||
}
|
||||
|
||||
@ -626,11 +677,9 @@ async function handleEditSubmit() {
|
||||
ElMessage.warning('缺少登记ID')
|
||||
return
|
||||
}
|
||||
const valid = await editFormRef.value?.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
const code = editForm.waybillCode.trim()
|
||||
if (!code) {
|
||||
ElMessage.warning('运单号不能为空')
|
||||
return
|
||||
}
|
||||
editLoading.value = true
|
||||
try {
|
||||
const res: any = await returnWaybillUpdate({
|
||||
@ -733,7 +782,7 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 编辑未退登记:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) */
|
||||
/* 编辑未退登记:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
@ -814,6 +863,7 @@ onMounted(() => {
|
||||
&--input {
|
||||
align-items: flex-start;
|
||||
min-height: 0;
|
||||
/* 右 0 让输入框右边顶到容器右边缘 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
@ -823,24 +873,19 @@ onMounted(() => {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
&--textarea {
|
||||
padding-top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):输入框左边缘与上方静态信息行的标签列对齐 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
@ -851,13 +896,42 @@ onMounted(() => {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__field-control {
|
||||
flex: 1;
|
||||
/* 可编辑字段组:结构与「手工录入运单号」的 task-panel__field-form 一致 */
|
||||
&__form-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.el-form-item) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0 !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-input),
|
||||
:deep(.el-select),
|
||||
:deep(.el-textarea) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 校验提示改为占位显示,避免绝对定位覆盖下一条字段 */
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
&__form-tip {
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background: #f4f4f5;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
@ -879,7 +953,8 @@ onMounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -1,152 +1,158 @@
|
||||
<template>
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
title="运单批量转入退件登记"
|
||||
width="760px"
|
||||
class="transfer-waybills-dialog"
|
||||
width="min(760px, 94vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@update:model-value="handleVisibleChange"
|
||||
@closed="resetState"
|
||||
>
|
||||
<!-- 确认态:入参 ids 取自勾选运单的 id(wms_order_express.id) -->
|
||||
<template v-if="!result">
|
||||
<el-alert class="transfer-alert" type="info" :closable="false" show-icon>
|
||||
<template #title>
|
||||
一个运单只允许一条有效拆包单:已存在未作废拆包单时会直接复用(不重复创建),已作废的会重新创建;子单(业务键 > 1)会自动跳过;单条失败不影响其它运单。
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<div class="transfer-count">
|
||||
<span>
|
||||
已勾选 <b>{{ rows.length }}</b> 条,去重后待处理运单 <b>{{ submitIds.length }}</b> 条
|
||||
</span>
|
||||
<span class="transfer-count__limit">单次上限 {{ MAX_COUNT }} 条</span>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="!submitIds.length"
|
||||
class="transfer-alert"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
>
|
||||
<template #title>
|
||||
所选行均缺少运单ID(运单表主键 id),无可用运单可提交;请重新勾选列表中的运单。
|
||||
</template>
|
||||
</el-alert>
|
||||
<template v-else>
|
||||
<div v-if="subRows.length" class="transfer-note">
|
||||
其中 {{ subRows.length }} 条为子单(业务键 > 1),将随 ids 一并提交,由服务端跳过并记入失败明细
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>运单批量转入退件登记</h2>
|
||||
<p>按勾选的运单批量创建退回拆包单,逐单返回处理结果</p>
|
||||
</div>
|
||||
<div v-if="blockedRows.length" class="transfer-note">
|
||||
其中 {{ blockedRows.length }} 条缺少运单ID(id),不会提交
|
||||
</div>
|
||||
<div v-if="overLimit" class="transfer-error">
|
||||
去重后 {{ submitIds.length }} 条已超过单次上限 {{ MAX_COUNT }} 条,请减少勾选后重试
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="previewRows" size="small" border max-height="320" class="transfer-preview">
|
||||
<el-table-column label="运单ID" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.waybill_id ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运单号" min-width="170" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主单号" min-width="170" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.main_waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务键" width="90" align="center">
|
||||
<template #default="{ row }">{{ row.business_key ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="能否转入" width="120" 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[] / 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-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="waybill_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-column label="处理结果" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="row.reused ? 'info' : 'success'">
|
||||
{{ row.reused ? '已存在·复用' : '新转入' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</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="copyFailedCodes">复制失败运单号</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table :data="failedList" size="small" border max-height="200">
|
||||
<el-table-column label="运单ID" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.waybill_id ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退回运单号" min-width="170" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reason" label="失败原因" min-width="300" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="!successList.length && !failedList.length" class="transfer-empty">
|
||||
<el-empty description="本次提交没有可处理的运单" :image-size="60" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<template v-if="!result">
|
||||
<el-button size="small" :disabled="submitting" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
<button
|
||||
class="task-panel__close"
|
||||
type="button"
|
||||
aria-label="关闭"
|
||||
@click="handleVisibleChange(false)"
|
||||
>
|
||||
确认转入
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button>
|
||||
</template>
|
||||
</template>
|
||||
<svg viewBox="0 0 12 12" fill="none">
|
||||
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="task-panel__body">
|
||||
<div class="task-panel__form">
|
||||
<!-- 汇总静态行(入参 ids 取自勾选运单的 id,即 wms_order_express.id) -->
|
||||
<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 }} 条</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">单次上限</span>
|
||||
<strong class="task-panel__field-value">{{ MAX_COUNT }} 条</strong>
|
||||
</div>
|
||||
<div v-if="subRows.length" class="task-panel__field">
|
||||
<span class="task-panel__field-label">子单跳过</span>
|
||||
<strong class="task-panel__field-value">{{ subRows.length }} 条</strong>
|
||||
</div>
|
||||
<div v-if="blockedRows.length" class="task-panel__field">
|
||||
<span class="task-panel__field-label">缺少运单 ID</span>
|
||||
<strong class="task-panel__field-value">{{ blockedRows.length }} 条</strong>
|
||||
</div>
|
||||
|
||||
<div v-if="!result && previewRows.length" 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="220" empty-text="无">
|
||||
<el-table-column label="运单ID" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.waybill_id ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运单号" min-width="170" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主单号" min-width="170" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.main_waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务键" width="90" align="center">
|
||||
<template #default="{ row }">{{ row.business_key ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="能否转入" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="statusTextClass(row.tagType)">{{ row.tagText }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提示条:对齐「批量发货」表单的 .task-panel__form-tip -->
|
||||
<p
|
||||
v-if="!result"
|
||||
class="task-panel__form-tip"
|
||||
:class="{ 'task-panel__form-tip--warning': !submitIds.length || overLimit }"
|
||||
>
|
||||
{{ confirmTip }}
|
||||
</p>
|
||||
|
||||
<!-- 结果区:接口逐单返回 success[] / failed[],HTTP 整体仍成功 -->
|
||||
<div v-if="result" class="transfer-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>
|
||||
<span class="result-summary__total">总计 {{ result.total }} 条</span>
|
||||
</div>
|
||||
<el-tabs v-model="resultTab" class="result-tabs">
|
||||
<el-tab-pane :label="`成功 (${successList.length})`" name="success">
|
||||
<el-table :data="successList" size="small" border max-height="220" empty-text="无">
|
||||
<el-table-column prop="waybill_id" label="运单ID" width="100" align="center" />
|
||||
<el-table-column prop="waybill_code" label="退回运单号" min-width="170" align="center" 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" align="center" 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-column label="处理结果" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="statusTextClass(row.reused ? 'info' : 'success')">
|
||||
{{ row.reused ? '已存在·复用' : '新转入' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="`失败 (${failedList.length})`" name="failed">
|
||||
<div class="result-tools">
|
||||
<el-button link type="primary" size="small" @click="copyFailedCodes">复制失败运单号</el-button>
|
||||
</div>
|
||||
<el-table :data="failedList" size="small" border max-height="200" empty-text="无">
|
||||
<el-table-column label="运单ID" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.waybill_id ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退回运单号" min-width="170" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.waybill_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reason" label="失败原因" min-width="260" align="center" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<p v-if="!successList.length && !failedList.length" class="result-empty">
|
||||
本次提交没有可处理的运单
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
<span class="task-panel__hint">{{ footerHint }}</span>
|
||||
<div class="task-panel__actions">
|
||||
<template v-if="!result">
|
||||
<el-button size="small" :disabled="submitting" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
>
|
||||
确认转入
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button v-else size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -259,6 +265,39 @@ const canSubmit = computed(() => submitIds.value.length > 0 && !overLimit.value
|
||||
const successList = computed<ReturnUnpackTransferSuccessItem[]>(() => result.value?.success ?? [])
|
||||
const failedList = computed<ReturnUnpackTransferFailedItem[]>(() => result.value?.failed ?? [])
|
||||
|
||||
const resultTab = ref<'success' | 'failed'>('success')
|
||||
|
||||
/** 状态类型 → 彩色文字(统一用 ut-status-text,不用彩色 tag 块) */
|
||||
const STATUS_TEXT_CLASS_MAP: Record<string, string> = {
|
||||
success: 'ut-status-text ut-status-text--success',
|
||||
warning: 'ut-status-text ut-status-text--warning',
|
||||
info: 'ut-status-text ut-status-text--info',
|
||||
danger: 'ut-status-text ut-status-text--danger'
|
||||
}
|
||||
|
||||
function statusTextClass(type?: string) {
|
||||
return STATUS_TEXT_CLASS_MAP[String(type || 'info')] || 'ut-status-text ut-status-text--info'
|
||||
}
|
||||
|
||||
/** 确认态提示条:把原有说明 + 告警合并为一条 */
|
||||
const confirmTip = computed(() => {
|
||||
if (!submitIds.value.length) {
|
||||
return '所选行均缺少运单 ID(运单表主键 id),无可用运单可提交;请重新勾选列表中的运单。'
|
||||
}
|
||||
if (overLimit.value) {
|
||||
return `去重后 ${submitIds.value.length} 条已超过单次上限 ${MAX_COUNT} 条,请减少勾选后重试。`
|
||||
}
|
||||
return `入参为运单表主键 ID(去重后上限 ${MAX_COUNT} 条),归属仓库由服务端按当前登录仓库自动判定;一个运单只允许一条有效拆包单:已存在未作废拆包单会直接复用,已作废的重新创建,子单(业务键 > 1)提交后由服务端跳过。`
|
||||
})
|
||||
|
||||
/** 页脚提示 */
|
||||
const footerHint = computed(() => {
|
||||
if (result.value) return '各运单独立处理,支持部分失败'
|
||||
if (!submitIds.value.length) return '当前勾选无可用运单'
|
||||
if (overLimit.value) return `已超出单次上限 ${MAX_COUNT} 条`
|
||||
return '提交前请确认勾选的运单无误'
|
||||
})
|
||||
|
||||
function handleVisibleChange(next: boolean) {
|
||||
emit('update:visible', next)
|
||||
}
|
||||
@ -266,6 +305,7 @@ function handleVisibleChange(next: boolean) {
|
||||
function resetState() {
|
||||
result.value = null
|
||||
submitting.value = false
|
||||
resultTab.value = 'success'
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
@ -335,98 +375,219 @@ async function copyFailedCodes() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.transfer-alert {
|
||||
margin-bottom: 12px;
|
||||
@use "../../../order/orderManagement/styles/order-sub.scss";
|
||||
|
||||
:deep(.el-alert__title) {
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-preview {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.transfer-count {
|
||||
/* 面板结构 / 尺寸对齐「批量发货」(BatchQuickRecheckForm) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
flex-direction: column;
|
||||
max-height: 82vh;
|
||||
|
||||
.transfer-count__limit {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
b {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-error {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.transfer-note {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.transfer-summary {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
margin-bottom: 12px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 4px;
|
||||
background: #f5f7fa;
|
||||
|
||||
.transfer-summary__item {
|
||||
&__head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__titles {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
&__close {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: #909399;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
|
||||
svg {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
&: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 {
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&__section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.transfer-summary__label {
|
||||
&__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;
|
||||
|
||||
/* 无法提交 / 超出上限时的告警样式 */
|
||||
&--warning {
|
||||
background: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
&__foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 12px 16px 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__hint {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.transfer-summary__value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.is-success .transfer-summary__value {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
.is-danger .transfer-summary__value {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-section {
|
||||
& + .transfer-section {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.transfer-section__title {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 6px;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-empty {
|
||||
padding: 8px 0;
|
||||
.transfer-result {
|
||||
margin: 10px 0 8px;
|
||||
}
|
||||
|
||||
.result-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.result-summary__total {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.result-tabs :deep(.el-tabs__header) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.result-tools {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.result-empty {
|
||||
margin: 8px 0 0;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
|
||||
.el-dialog.transfer-waybills-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -73,42 +73,104 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增 / 编辑包装供应商(面板结构对齐「手工录入运单号」) -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogMode === 'create' ? '新增包装供应商' : '编辑包装供应商'"
|
||||
width="560px"
|
||||
class="package-supplier-dialog"
|
||||
width="min(560px, 92vw)"
|
||||
align-center
|
||||
@close="resetForm"
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
@closed="resetForm"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="110px" size="small">
|
||||
<el-form-item label="供应商编码" prop="supplier_code">
|
||||
<el-input
|
||||
v-model="formData.supplier_code"
|
||||
placeholder="大写字母/数字,仓库内唯一"
|
||||
:disabled="dialogMode === 'edit'"
|
||||
@blur="normalizeSupplierCode"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supplier_name">
|
||||
<el-input v-model="formData.supplier_name" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contact_name">
|
||||
<el-input v-model="formData.contact_name" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contact_phone">
|
||||
<el-input v-model="formData.contact_phone" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="1">启用</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</template>
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>{{ dialogMode === 'create' ? '新增包装供应商' : '编辑包装供应商' }}</h2>
|
||||
<p>维护包装供应商的基础信息与启停状态</p>
|
||||
</div>
|
||||
<button
|
||||
class="task-panel__close"
|
||||
type="button"
|
||||
aria-label="关闭"
|
||||
@click="dialogVisible = 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">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" class="task-panel__form">
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">供应商编码</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="supplier_code">
|
||||
<el-input
|
||||
v-model="formData.supplier_code"
|
||||
placeholder="大写字母/数字,仓库内唯一"
|
||||
:disabled="dialogMode === 'edit'"
|
||||
@blur="normalizeSupplierCode"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">供应商名称</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="supplier_name">
|
||||
<el-input v-model="formData.supplier_name" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
</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-form-item prop="contact_name">
|
||||
<el-input v-model="formData.contact_name" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
</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-form-item prop="contact_phone">
|
||||
<el-input v-model="formData.contact_phone" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
</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-form-item prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="1">启用</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<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="dialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -495,4 +557,200 @@ onMounted(() => {
|
||||
color: #909399;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
包装供应商弹窗面板(结构 / 尺寸对齐「手工录入运单号」)
|
||||
================================================================ */
|
||||
.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;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 面板内嵌 el-form-item:去掉默认间距,错误提示改回文档流内展示 */
|
||||
.task-panel__form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头 / 内边距,统一交给面板 */
|
||||
.el-dialog.package-supplier-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -110,12 +110,16 @@ const metricItems = computed<ProgressMetricItem[]>(() => {
|
||||
})
|
||||
|
||||
const tipText = computed(() => {
|
||||
if (progressState.value === 'success') return props.message || '导出完成,可关闭窗口'
|
||||
if (progressState.value === 'success') {
|
||||
return `${props.message || '导出完成'},窗口将在 1.5 秒后自动关闭`
|
||||
}
|
||||
if (progressState.value === 'running') return '导出任务在后台执行中,关闭窗口不会中断。'
|
||||
return ''
|
||||
})
|
||||
|
||||
const footerHint = computed(() =>
|
||||
progressState.value === 'running' ? '导出任务在后台执行' : '任务已结束,可关闭窗口'
|
||||
)
|
||||
const footerHint = computed(() => {
|
||||
if (progressState.value === 'running') return '导出任务在后台执行'
|
||||
if (progressState.value === 'success') return '任务已完成,窗口将自动关闭'
|
||||
return '任务已结束,可关闭窗口'
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -1,96 +1,160 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:class="{ 'direct-inbound-batch-dialog': isBatchMode }"
|
||||
:title="isBatchMode ? undefined : '导入入库'"
|
||||
:width="isBatchMode ? 'min(1080px, 96vw)' : '520px'"
|
||||
:show-close="!isBatchMode"
|
||||
:class="{ 'direct-inbound-batch-dialog': isBatchMode, 'direct-inbound-single-dialog': !isBatchMode }"
|
||||
:width="isBatchMode ? 'min(1080px, 96vw)' : 'min(560px, 92vw)'"
|
||||
:show-close="false"
|
||||
align-center
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
:close-on-click-modal="!submitting"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<template v-if="!isBatchMode && singleTarget">
|
||||
<div class="item-summary">
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">商品编码</span>
|
||||
<span class="summary-value">{{ singleTarget.warehouse_item_code || '—' }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">商品名称</span>
|
||||
<span class="summary-value">{{ singleTarget.warehouse_item_name || '—' }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">计划数量</span>
|
||||
<span class="summary-value">{{ singleTarget.count ?? '—' }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">剩余可入</span>
|
||||
<span class="summary-value">{{ singleTarget.remaining_quantity ?? 0 }}</span>
|
||||
<!-- 单条导入:面板结构对齐「手工录入运单号」 -->
|
||||
<div v-if="!isBatchMode && singleTarget" class="task-panel task-panel--single">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>导入入库</h2>
|
||||
<p>按入库明细录入直入数量与库位</p>
|
||||
</div>
|
||||
<button
|
||||
class="task-panel__close"
|
||||
type="button"
|
||||
aria-label="关闭"
|
||||
:disabled="submitting"
|
||||
@click="visible = false"
|
||||
>
|
||||
<svg viewBox="0 0 12 12" fill="none">
|
||||
<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="task-panel__body">
|
||||
<el-form
|
||||
ref="singleFormRef"
|
||||
:model="singleForm"
|
||||
:rules="singleFormRules"
|
||||
class="task-panel__form"
|
||||
>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">商品编码</span>
|
||||
<strong class="task-panel__field-value">{{ singleTarget.warehouse_item_code || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">商品名称</span>
|
||||
<strong class="task-panel__field-value">{{ singleTarget.warehouse_item_name || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">计划数量</span>
|
||||
<strong class="task-panel__field-value">{{ singleTarget.count ?? '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">剩余可入</span>
|
||||
<strong class="task-panel__field-value">{{ singleTarget.remaining_quantity ?? 0 }}</strong>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">SKU</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-input :model-value="String(singleTarget.stock_id ?? '')" disabled />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!showContainerPicker" class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">入库数量</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="quantity">
|
||||
<el-input-number
|
||||
v-model="singleForm.quantity"
|
||||
:min="1"
|
||||
:max="singleMaxQuantity"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">入库方式</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="inbound_type">
|
||||
<el-radio-group v-model="singleForm.inbound_type">
|
||||
<el-radio
|
||||
v-for="opt in directInboundInboundTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.value"
|
||||
>
|
||||
{{ opt.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="showContainerPicker" class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">收货容器</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="receiving_detail_id">
|
||||
<el-select
|
||||
v-model="singleForm.receiving_detail_id"
|
||||
placeholder="请选择收货容器"
|
||||
filterable
|
||||
clearable
|
||||
:loading="containerLoading"
|
||||
style="width: 100%"
|
||||
@visible-change="(open: boolean) => open && loadContainers()"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in containerOptions"
|
||||
:key="item.detail_id"
|
||||
:label="formatContainerLabel(item)"
|
||||
:value="Number(item.detail_id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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 :model-value="singleSpaceDisplay" readonly>
|
||||
<template #append>
|
||||
<el-button @click="openSpacePicker('single')">选择系统库位</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="remark">
|
||||
<el-input
|
||||
v-model="singleForm.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="如:导入文件名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-form ref="singleFormRef" :model="singleForm" :rules="singleFormRules" label-width="100px" size="small">
|
||||
<el-form-item label="SKU">
|
||||
<el-input :model-value="String(singleTarget.stock_id ?? '')" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!showContainerPicker" label="入库数量" prop="quantity">
|
||||
<el-input-number
|
||||
v-model="singleForm.quantity"
|
||||
:min="1"
|
||||
:max="singleMaxQuantity"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库方式" prop="inbound_type">
|
||||
<el-radio-group v-model="singleForm.inbound_type">
|
||||
<el-radio
|
||||
v-for="opt in directInboundInboundTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.value"
|
||||
>
|
||||
{{ opt.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showContainerPicker" label="收货容器" prop="receiving_detail_id">
|
||||
<el-select
|
||||
v-model="singleForm.receiving_detail_id"
|
||||
placeholder="请选择收货容器"
|
||||
filterable
|
||||
clearable
|
||||
:loading="containerLoading"
|
||||
style="width: 100%"
|
||||
@visible-change="(open: boolean) => open && loadContainers()"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in containerOptions"
|
||||
:key="item.detail_id"
|
||||
:label="formatContainerLabel(item)"
|
||||
:value="Number(item.detail_id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input :model-value="singleSpaceDisplay" readonly>
|
||||
<template #append>
|
||||
<el-button @click="openSpacePicker('single')">选择系统库位</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="singleForm.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="如:导入文件名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<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>
|
||||
|
||||
<!-- 批量导入:面板结构 / 尺寸对齐 storage/receiving「批量导入商品」 -->
|
||||
<div v-else-if="isBatchMode" class="task-panel">
|
||||
@ -219,15 +283,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<template v-if="!isBatchMode">
|
||||
<el-button size="small" :disabled="submitting" @click="visible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
确认导入
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
@ -969,13 +1024,135 @@ async function handleSubmit() {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__hint {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
/* ---------- 单条导入(对齐「手工录入运单号」) ---------- */
|
||||
&__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;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
&--textarea {
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__field-control {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 单条导入面板:头部 / 内容 / 页脚尺寸对齐「手工录入运单号」 */
|
||||
.task-panel--single {
|
||||
.task-panel__head {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.task-panel__body {
|
||||
flex: none;
|
||||
display: block;
|
||||
padding: 12px 16px 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.task-panel__foot {
|
||||
justify-content: space-between;
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 面板内嵌 el-form-item:去掉默认间距,错误提示改回文档流内展示 */
|
||||
.task-panel__form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格固定高度:数据少也保持同样大小,超出容器时表格内部滚动(短屏自适应) */
|
||||
@ -1074,4 +1251,19 @@ async function handleSubmit() {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 单条导入:面板自带页头 / 页脚,去掉默认头 / 内边距 */
|
||||
.el-dialog.direct-inbound-single-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
:data="tableData"
|
||||
:columns="detailColumns"
|
||||
:show-selection="true"
|
||||
default-align="center"
|
||||
:pagination="pagination"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:loading="loading"
|
||||
@ -141,11 +142,12 @@ const canDirectInbound = computed(() => {
|
||||
})
|
||||
|
||||
const detailColumns = computed(() => {
|
||||
const columns = [...entrydetail]
|
||||
// 入库明细表格统一居中(覆盖配置里数量列的 align: 'right')
|
||||
const columns: any[] = entrydetail.map((col) => ({ ...col, align: 'center' }))
|
||||
const countIndex = columns.findIndex((col) => col.prop === 'count')
|
||||
const insertAt = countIndex >= 0 ? countIndex + 1 : columns.length
|
||||
columns.splice(insertAt, 0,
|
||||
{ prop: 'remaining_quantity', label: '剩余可入', width: '90', align: 'right' },
|
||||
{ prop: 'remaining_quantity', label: '剩余可入', width: '90', align: 'center' },
|
||||
)
|
||||
if (canBatchImport.value) {
|
||||
columns.push({
|
||||
@ -154,7 +156,7 @@ const detailColumns = computed(() => {
|
||||
width: '90',
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
} as unknown as (typeof entrydetail)[number])
|
||||
})
|
||||
}
|
||||
return columns
|
||||
})
|
||||
|
||||
@ -257,72 +257,114 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 开始入库确认对话框 -->
|
||||
<!-- 开始入库确认(面板结构参考「批量发货」) -->
|
||||
<el-dialog
|
||||
v-model="reviewDialogVisible"
|
||||
title="开始入库确认"
|
||||
width="800px"
|
||||
class="entry-review-dialog"
|
||||
width="min(800px, 94vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
@closed="handleReviewDialogClosed"
|
||||
>
|
||||
<div v-if="reviewTargetRow" class="review-dialog-content">
|
||||
<div class="review-summary">
|
||||
<el-descriptions :column="2" size="small" border>
|
||||
<el-descriptions-item label="入库单号">{{ reviewTargetRow.entry_order_code || '--' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="货主">{{ reviewTargetRow.store_name || '--' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单状态">
|
||||
<el-tag size="small" :type="getEntryOrderStatusTagType(reviewTargetRow.order_status)">
|
||||
{{ formatEntryOrderStatus(reviewTargetRow.order_status) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入库类型">{{ translateEntryField('order_type', reviewTargetRow.order_type) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div class="review-binding-section">
|
||||
<div class="review-section-title">收货对照预览</div>
|
||||
<el-table
|
||||
v-loading="reviewCompareLoading"
|
||||
:data="reviewCompareRows"
|
||||
border
|
||||
stripe
|
||||
size="small"
|
||||
row-key="rowKey"
|
||||
empty-text="暂无对照数据"
|
||||
max-height="360"
|
||||
<div v-if="reviewTargetRow" 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="关闭"
|
||||
:disabled="reviewSubmitting"
|
||||
@click="reviewDialogVisible = false"
|
||||
>
|
||||
<el-table-column label="匹配" width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="row.matchTagType">{{ row.matchStatusLabel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库商品" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.entryName }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货商品" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.receivingName }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划数量" width="100" align="right">
|
||||
<template #default="{ row }">{{ row.entryQty }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货可用" width="100" align="right">
|
||||
<template #default="{ row }">{{ row.receivingAvailable }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<template #footer>
|
||||
<el-button size="small" :disabled="reviewSubmitting" @click="reviewDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="warning"
|
||||
:loading="reviewSubmitting"
|
||||
@click="handleReviewConfirm"
|
||||
>
|
||||
确定开始入库
|
||||
</el-button>
|
||||
</template>
|
||||
<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">{{ reviewTargetRow.entry_order_code || '--' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">货主</span>
|
||||
<strong class="task-panel__field-value">{{ reviewTargetRow.store_name || '--' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">订单状态</span>
|
||||
<strong class="task-panel__field-value">
|
||||
<span :class="getStatusTextClass(getEntryOrderStatusTagType(reviewTargetRow.order_status))">
|
||||
{{ formatEntryOrderStatus(reviewTargetRow.order_status) }}
|
||||
</span>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">入库类型</span>
|
||||
<strong class="task-panel__field-value">{{ translateEntryField('order_type', reviewTargetRow.order_type) }}</strong>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__section">
|
||||
<span class="task-panel__section-title">收货对照预览</span>
|
||||
<div class="task-panel__table-wrap">
|
||||
<el-table
|
||||
v-loading="reviewCompareLoading"
|
||||
:data="reviewCompareRows"
|
||||
border
|
||||
stripe
|
||||
size="small"
|
||||
row-key="rowKey"
|
||||
empty-text="暂无对照数据"
|
||||
max-height="360"
|
||||
>
|
||||
<el-table-column label="匹配" width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="getStatusTextClass(row.matchTagType)">{{ row.matchStatusLabel }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库商品" min-width="150" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.entryName }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货商品" min-width="150" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.receivingName }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划数量" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.entryQty }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货可用" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.receivingAvailable }}</template>
|
||||
</el-table-column>
|
||||
</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" :disabled="reviewSubmitting" @click="reviewDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="warning"
|
||||
:loading="reviewSubmitting"
|
||||
@click="handleReviewConfirm"
|
||||
>
|
||||
确定开始入库
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 打印对话框 -->
|
||||
@ -1332,4 +1374,186 @@ function handleImport() {
|
||||
text-decoration: underline;
|
||||
color: var(--el-color-primary-light-3);
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
开始入库确认面板(结构 / 尺寸参考「批量发货」)
|
||||
================================================================ */
|
||||
.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 {
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头 / 内边距,统一交给面板(同批量发货) */
|
||||
.el-dialog.entry-review-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header,
|
||||
.el-dialog__footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
content="请先在下方明细列表勾选一条库存记录(含库存记录 ID)"
|
||||
:content="expiryTooltipText"
|
||||
:disabled="canEditExpiry"
|
||||
>
|
||||
<span class="transfer-btn-wrap">
|
||||
@ -57,7 +57,7 @@
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="!canEditExpiry"
|
||||
@click="openExpiryDialog"
|
||||
@click="openExpiryDialog()"
|
||||
>
|
||||
维护生产/到期日期
|
||||
</el-button>
|
||||
@ -97,7 +97,7 @@
|
||||
:close-on-click-modal="false"
|
||||
@closed="resetTransferDialog"
|
||||
>
|
||||
<!-- 面板结构对齐 storage/receiving「批量驳回收货单」 -->
|
||||
<!-- 面板结构对齐「手工录入运单号」 -->
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
@ -177,7 +177,7 @@
|
||||
@opened="handleExpiryDialogOpened"
|
||||
@closed="resetExpiryForm"
|
||||
>
|
||||
<!-- 面板结构对齐 storage/receiving「批量驳回收货单」 -->
|
||||
<!-- 面板结构对齐「手工录入运单号」 -->
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
@ -587,6 +587,15 @@ function normalizeRow(r: any) {
|
||||
row.stock.is_batch_mgmt_enabled = false
|
||||
}
|
||||
row.batch_count = Number(row.batch_count || 0)
|
||||
// 兜底:部分接口行只返回 wms_storage 主键 id(listByStockId 明细行为 id);
|
||||
// 批次模式主列表的 id 是 'batch-<id>' 字符串,不会被误取
|
||||
const storageId = Number(row.storage_id)
|
||||
if (!Number.isFinite(storageId) || storageId <= 0) {
|
||||
const rawId = Number(r.id)
|
||||
if (Number.isInteger(rawId) && rawId > 0 && String(r.id).trim() === String(rawId)) {
|
||||
row.storage_id = rawId
|
||||
}
|
||||
}
|
||||
return row
|
||||
}
|
||||
|
||||
@ -849,6 +858,14 @@ function getRowStorageId(row: any): number | null {
|
||||
/** 是否可维护日期:需要有一条含库存记录 ID 的库存明细行 */
|
||||
const canEditExpiry = computed(() => getRowStorageId(activeRow.value) !== null)
|
||||
|
||||
/** 维护日期入口提示:按库位汇总是聚合行,天然没有库存记录 ID(接口不支持按汇总行维护) */
|
||||
const expiryTooltipText = computed(() => {
|
||||
if (isSpaceView.value) {
|
||||
return '「按库位汇总」为聚合行,不含库存记录 ID;请切换到「按明细」或开启批次模式后再维护日期'
|
||||
}
|
||||
return '请先在下方明细列表勾选一条库存记录(含库存记录 ID)'
|
||||
})
|
||||
|
||||
const expiryItemLabel = computed(() => {
|
||||
const row = expiryRow.value || {}
|
||||
const code = String(row.item_code || '').trim()
|
||||
@ -900,16 +917,27 @@ function buildExpiryChangeText(data: any): string {
|
||||
.join(';')
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的是否为库存行对象:
|
||||
* `@click` 直接绑定函数时会把 MouseEvent 当第一个参数传入,用行字段探测排除掉
|
||||
*/
|
||||
function isStockRowLike(value: unknown): value is Record<string, unknown> {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value)) return false
|
||||
const probeKeys = ['storage_id', 'stock_id', 'production_date', 'expiry_date', 'batch_no', 'space_code']
|
||||
return probeKeys.some((key) => key in (value as Record<string, unknown>))
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开日期维护弹窗(两个入口共用):
|
||||
* 1. 工具栏「维护生产/到期日期」按钮:不传参,取当前勾选行;
|
||||
* 2. 明细表「生产日期 / 到期日期」单元格:传入该行与目标字段,弹窗打开后自动展开对应日历
|
||||
*/
|
||||
function openExpiryDialog(row?: any, target?: 'production' | 'expiry') {
|
||||
const targetRow = normalizeRow(row) || normalizeRow(activeRow.value) || {}
|
||||
const passedRow = isStockRowLike(row) ? row : null
|
||||
const targetRow = normalizeRow(passedRow) || normalizeRow(activeRow.value) || {}
|
||||
if (!getRowStorageId(targetRow)) {
|
||||
ElMessage.warning(
|
||||
row ? '该行缺少库存记录 ID,无法维护日期' : '请先在下方明细列表勾选一条库存记录'
|
||||
passedRow ? '该行缺少库存记录 ID,无法维护日期' : '请先在下方明细列表勾选一条库存记录'
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -1140,9 +1168,11 @@ watch(targetSpace, (val) => {
|
||||
|
||||
.expiry-clear-btn {
|
||||
flex-shrink: 0;
|
||||
/* 输入行改为 align-items: flex-start 后,按钮需自行与日期选择器垂直居中 */
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
/* 移库弹窗:面板结构 / 尺寸对齐 storage/receiving「批量驳回收货单」 */
|
||||
/* 移库弹窗:面板结构 / 尺寸对齐「手工录入运单号」(TaskProgressPanel) */
|
||||
.task-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -1154,7 +1184,7 @@ watch(targetSpace, (val) => {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
padding: 16px 16px 8px;
|
||||
padding: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@ -1205,7 +1235,7 @@ watch(targetSpace, (val) => {
|
||||
&__body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 6px 16px 0;
|
||||
padding: 12px 16px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
@ -1230,13 +1260,17 @@ watch(targetSpace, (val) => {
|
||||
|
||||
/* 输入行:不需要灰色容器,与上方静态信息行拉开层次 */
|
||||
&--input {
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
min-height: 0;
|
||||
padding: 4px 12px 0;
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
|
||||
:deep(.el-input),
|
||||
:deep(.el-input-number),
|
||||
:deep(.el-date-editor) {
|
||||
@ -1248,18 +1282,24 @@ watch(targetSpace, (val) => {
|
||||
/* 纯展示行(如识别到的库位名称):无容器,紧贴输入框 */
|
||||
&--plain {
|
||||
min-height: 0;
|
||||
padding: 0 12px;
|
||||
padding: 0 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@ -1282,7 +1322,7 @@ watch(targetSpace, (val) => {
|
||||
}
|
||||
|
||||
&__form-tip {
|
||||
margin: 8px 0 12px;
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background: #f4f4f5;
|
||||
@ -1294,9 +1334,9 @@ watch(targetSpace, (val) => {
|
||||
&__foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 12px 16px 16px;
|
||||
padding: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@ -1313,7 +1353,8 @@ watch(targetSpace, (val) => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -284,8 +284,8 @@
|
||||
:close-on-click-modal="false"
|
||||
@closed="resetBindForm"
|
||||
>
|
||||
<!-- 面板结构对齐「批量驳回收货单」 -->
|
||||
<div class="task-panel">
|
||||
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
|
||||
<div class="task-panel task-panel--bind">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>明细绑定</h2>
|
||||
@ -304,7 +304,6 @@
|
||||
<div
|
||||
v-if="field.type === 'display'"
|
||||
class="task-panel__field"
|
||||
:class="{ 'task-panel__field--stack': field.prop === 'barcode' && bindBarcodeHiddenCount > 0 }"
|
||||
>
|
||||
<span class="task-panel__field-label">{{ field.label }}</span>
|
||||
<div v-if="field.prop === 'barcode'" class="task-panel__barcode">
|
||||
@ -330,8 +329,8 @@
|
||||
<strong v-else class="task-panel__field-value">{{ formatBindDisplayValue(field.prop) }}</strong>
|
||||
</div>
|
||||
<div v-else class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">
|
||||
{{ field.label }}<span v-if="field.required" class="required-mark">*</span>
|
||||
<span class="task-panel__field-label" :class="{ 'is-required': field.required }">
|
||||
{{ field.label }}
|
||||
</span>
|
||||
<el-input :model-value="bindSelectedProductDisplay" readonly placeholder="请选择系统商品">
|
||||
<template #append>
|
||||
@ -3312,7 +3311,8 @@ onUnmounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
@ -3321,6 +3321,46 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 明细绑定:字段样式对齐「手工录入运单号」表单(不影响同页其他弹窗) */
|
||||
.task-panel--bind {
|
||||
.task-panel__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
|
||||
/* 必填星号:绝对定位占位,保证标签文字起点一致(同手工录入运单号系表单) */
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
.task-panel__field--input {
|
||||
align-items: flex-start;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 收货条码:与其它字段值一样靠右对齐(多值折叠后再换行,仍贴右边缘) */
|
||||
.task-panel__barcode {
|
||||
flex: 1 1 auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
/* 分页位于页脚「关闭」按钮左侧,始终展示;尺寸 / 选择器宽度对齐 UpperTable 默认分页 */
|
||||
.batch-import-pagination,
|
||||
.system-product-pagination {
|
||||
|
||||
@ -540,16 +540,14 @@ onMounted(() => {
|
||||
.order-sub-container .main-content .lower-level .detail-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
/* 详情区外壳不留上/下间距,由 .detail-panel 自身控制(对齐 stock/external_stock) */
|
||||
/* 详情区外壳不留上/下间距(明细组件自带 padding: 6px 10px 8px),只留左右 10px(同波次明细) */
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__body) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions-item__cell) {
|
||||
padding: 8px 12px;
|
||||
}
|
||||
/* 与波次明细的详情页签头部保持一致 */
|
||||
.order-sub-container .main-content .lower-level .detail-header {
|
||||
padding: 0 12px;
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
/* 工具栏按钮间距对齐 storage/receiving 商品明细:gap 6px,去掉 EP 默认 12px 左边距 */
|
||||
@ -568,9 +566,9 @@ onMounted(() => {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* 库存明细面板:分区标题 + 带边框描述列表(对齐 stock/external_stock「基本信息」) */
|
||||
/* 库存明细面板:分区标题 + 带边框描述列表(对齐 order/waveOrder 波次明细组件) */
|
||||
.detail-page.detail-panel {
|
||||
padding: 8px 0;
|
||||
padding: 6px 10px 8px;
|
||||
|
||||
.section {
|
||||
margin-bottom: 12px;
|
||||
@ -590,10 +588,17 @@ onMounted(() => {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.detail-descriptions :deep(.el-descriptions__label) {
|
||||
width: 120px;
|
||||
background: #fafbfc;
|
||||
font-weight: 500;
|
||||
.detail-descriptions {
|
||||
:deep(.el-descriptions__label) {
|
||||
width: 110px;
|
||||
min-width: 110px;
|
||||
background: #fafbfc;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__content) {
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -929,8 +929,12 @@ async function finishCheck() {
|
||||
const profit = Number(data.profit_total ?? 0)
|
||||
const loss = Number(data.loss_total ?? 0)
|
||||
const unchecked = Number(data.unchecked_items ?? 0)
|
||||
// 静态盘点(is_static=1)完成后后端会释放静态锁定(2026-10-28 文档新增字段)
|
||||
const released = Array.isArray(data.released_stock_ids) ? data.released_stock_ids.length : 0
|
||||
ElMessage.success(
|
||||
`盘点已完成(盘盈 ${profit} / 盘亏 ${loss}${unchecked > 0 ? `;未盘 ${unchecked} 项按 0 处理` : ''})`
|
||||
`盘点已完成(盘盈 ${profit} / 盘亏 ${loss}${
|
||||
unchecked > 0 ? `;未盘 ${unchecked} 项按 0 处理` : ''
|
||||
}${released > 0 ? `;已释放 ${released} 个静态锁定商品` : ''})`
|
||||
)
|
||||
await loadItems()
|
||||
emit('changed')
|
||||
|
||||
@ -62,9 +62,7 @@
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">
|
||||
实盘数量<span class="required-mark">*</span>
|
||||
</span>
|
||||
<span class="task-panel__field-label is-required">实盘数量</span>
|
||||
<el-input-number
|
||||
v-model="form.quantity"
|
||||
:min="0"
|
||||
@ -348,13 +346,21 @@ async function handleSubmit() {
|
||||
|
||||
/* 输入行:不需要灰色容器,与上方静态信息行拉开层次 */
|
||||
&--input {
|
||||
align-items: center;
|
||||
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;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@ -366,12 +372,27 @@ async function handleSubmit() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):对齐「手工录入运单号」表单 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
@ -413,7 +434,8 @@ async function handleSubmit() {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -1249,19 +1249,8 @@ const OPERATION_BUTTONS: OperationButtonConfig[] = [
|
||||
label: '审核通过',
|
||||
actionType: 'action',
|
||||
type: 'primary',
|
||||
confirmMessage: '审核通过后即可开始盘点作业。确定通过?',
|
||||
// 开启静态盘点:审核通过后锁定移库 / 分配储位(拣货不受影响),盘点完成后自动解锁
|
||||
confirmMessageWhen: (row) =>
|
||||
isStaticCheckRow(row)
|
||||
? '<div>该盘点单已开启<b>静态盘点</b>,审核通过后:</div>' +
|
||||
'<ul style="margin: 6px 0 8px; padding-left: 18px; line-height: 1.7;">' +
|
||||
'<li>锁定<b>移库</b>、<b>分配储位</b>操作</li>' +
|
||||
'<li><b>拣货不受影响</b></li>' +
|
||||
'<li>需等盘点完成后自动解锁</li>' +
|
||||
'</ul>' +
|
||||
'<div>确定通过?</div>'
|
||||
: '',
|
||||
confirmUseHtml: true,
|
||||
// 确认交互改用页面内的面板式弹窗(对齐「手工录入运单号」新表单设计),
|
||||
// 不再使用 ElMessageBox:此处不配置 confirmMessage / confirmMessageWhen。
|
||||
confirmTitle: '审核通过',
|
||||
confirmType: 'info',
|
||||
confirmButtonText: '确定通过',
|
||||
|
||||
@ -332,6 +332,74 @@
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- ===== 审核通过(面板结构对齐手工录入运单号) ===== -->
|
||||
<el-dialog
|
||||
v-model="auditDialogVisible"
|
||||
class="audit-pass-dialog"
|
||||
width="min(560px, 92vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
@closed="resetAuditDialog"
|
||||
>
|
||||
<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="auditDialogVisible = 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">{{ auditRow?.check_no || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">盘点名称</span>
|
||||
<strong class="task-panel__field-value">{{ auditRow?.title || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">盘点范围</span>
|
||||
<strong class="task-panel__field-value">{{ translate('type', auditRow?.type) }}</strong>
|
||||
</div>
|
||||
<div v-if="auditStatic" class="task-panel__field">
|
||||
<span class="task-panel__field-label">静态盘点</span>
|
||||
<strong class="task-panel__field-value">开启</strong>
|
||||
</div>
|
||||
</div>
|
||||
<p class="task-panel__form-tip">
|
||||
审核通过后即可开始盘点作业
|
||||
</p>
|
||||
<p v-if="auditStatic" class="task-panel__form-tip task-panel__form-tip--warning">
|
||||
已开启静态盘点:审核通过后将锁定移库 / 分配储位(拣货不受影响),需等盘点完成后自动解锁。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
<span class="task-panel__hint">提交前请确认盘点单状态</span>
|
||||
<div class="task-panel__actions">
|
||||
<el-button size="small" @click="auditDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="auditLoading" @click="submitAuditPass">
|
||||
确定通过
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -362,6 +430,7 @@ import {
|
||||
isCheckApiSuccess,
|
||||
isLocationScopeType,
|
||||
isStaticCheckRow,
|
||||
translate,
|
||||
loadStoreOptions,
|
||||
storeOptions,
|
||||
buildWhereConditions,
|
||||
@ -568,20 +637,18 @@ async function handleOperationAction(key: string, row: Record<string, any>) {
|
||||
await runCheckAction(() => stockCheckSubmit({ id }), '已提交审核')
|
||||
break
|
||||
case 'auditPass': {
|
||||
const staticTip = isStaticCheckRow(row)
|
||||
? ',已锁定移库/分配储位,盘点完成后自动解锁'
|
||||
: ''
|
||||
await runCheckAction(
|
||||
() => stockCheckAudit({ id, action: 'approve' }),
|
||||
`审核已通过${staticTip}`
|
||||
)
|
||||
handleAuditPass(row)
|
||||
break
|
||||
}
|
||||
case 'auditReject':
|
||||
await handleAuditReject(row)
|
||||
break
|
||||
case 'finishCheck':
|
||||
await runCheckAction(() => stockCheckFinish({ id }), '盘点已完成')
|
||||
// 静态盘点(is_static=1)完成后后端会释放静态锁定,响应带 released_stock_ids
|
||||
await runCheckAction(() => stockCheckFinish({ id }), '盘点已完成', (res) => {
|
||||
const released = Number((res?.data ?? res)?.released_stock_ids?.length ?? 0)
|
||||
return released > 0 ? `,已释放 ${released} 个静态锁定商品` : ''
|
||||
})
|
||||
break
|
||||
case 'cancelCheck':
|
||||
await runCheckAction(() => stockCheckCancel({ id }), '盘点单已取消')
|
||||
@ -600,6 +667,52 @@ const rejectLoading = ref(false)
|
||||
const rejectReason = ref('')
|
||||
const rejectRow = ref<Record<string, any> | null>(null)
|
||||
|
||||
/** 审核通过:面板弹窗二次确认(对齐「手工录入运单号」新表单设计) */
|
||||
const auditDialogVisible = ref(false)
|
||||
const auditLoading = ref(false)
|
||||
const auditRow = ref<Record<string, any> | null>(null)
|
||||
const auditStatic = computed(() => isStaticCheckRow(auditRow.value))
|
||||
|
||||
function handleAuditPass(row: Record<string, any>) {
|
||||
const id = Number(row?.id)
|
||||
if (!Number.isFinite(id) || id <= 0) {
|
||||
ElMessage.warning('缺少有效的盘点单ID')
|
||||
return
|
||||
}
|
||||
auditRow.value = row
|
||||
auditDialogVisible.value = true
|
||||
}
|
||||
|
||||
function resetAuditDialog() {
|
||||
auditRow.value = null
|
||||
auditLoading.value = false
|
||||
}
|
||||
|
||||
/** 提交审核通过:调用 stock.check.audit(action=approve) */
|
||||
async function submitAuditPass() {
|
||||
const id = Number(auditRow.value?.id)
|
||||
if (!Number.isFinite(id) || id <= 0) {
|
||||
ElMessage.warning('缺少有效的盘点单ID')
|
||||
return
|
||||
}
|
||||
const wasStatic = auditStatic.value
|
||||
auditLoading.value = true
|
||||
try {
|
||||
const res: any = await stockCheckAudit({ id, action: 'approve' })
|
||||
if (!isCheckApiSuccess(res)) {
|
||||
throw new Error(res?.message || '审核通过失败')
|
||||
}
|
||||
ElMessage.success(wasStatic ? '审核已通过,已锁定移库/分配储位,盘点完成后自动解锁' : '审核已通过')
|
||||
auditDialogVisible.value = false
|
||||
await reloadAndResyncDetail()
|
||||
} catch (e: any) {
|
||||
console.error('[stockcheck] 审核通过失败', e)
|
||||
ElMessage.error(e?.message || '审核通过失败')
|
||||
} finally {
|
||||
auditLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleAuditReject(row: Record<string, any>) {
|
||||
const id = Number(row?.id)
|
||||
if (!Number.isFinite(id) || id <= 0) {
|
||||
@ -637,13 +750,17 @@ async function submitAuditReject() {
|
||||
}
|
||||
|
||||
/** 统一执行状态类操作:校验结果 → 提示 → 刷新列表并同步详情 */
|
||||
async function runCheckAction(action: () => Promise<any>, successText: string) {
|
||||
async function runCheckAction(
|
||||
action: () => Promise<any>,
|
||||
successText: string,
|
||||
buildSuffix?: (res: any) => string
|
||||
) {
|
||||
try {
|
||||
const res: any = await action()
|
||||
if (!isCheckApiSuccess(res)) {
|
||||
throw new Error(res?.message || '操作失败')
|
||||
}
|
||||
ElMessage.success(successText)
|
||||
ElMessage.success(`${successText}${buildSuffix?.(res) || ''}`)
|
||||
await reloadAndResyncDetail()
|
||||
} catch (e: any) {
|
||||
console.error('[stockcheck] 盘点单操作失败', e)
|
||||
@ -1312,11 +1429,16 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):对齐「手工录入运单号」表单 */
|
||||
&__field-label {
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@ -1336,6 +1458,11 @@ onMounted(() => {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
|
||||
&--warning {
|
||||
background: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
&__foot {
|
||||
@ -1354,7 +1481,8 @@ onMounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
@ -1366,7 +1494,8 @@ onMounted(() => {
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同批量驳回收货单) */
|
||||
.el-dialog.reject-stockcheck-dialog {
|
||||
.el-dialog.reject-stockcheck-dialog,
|
||||
.el-dialog.audit-pass-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
@ -21,94 +21,149 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
title="新建盘点单"
|
||||
width="min(560px, 94vw)"
|
||||
class="check-form-dialog"
|
||||
width="min(560px, 92vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@update:model-value="handleVisibleChange"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="90px"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="盘点名称" prop="title">
|
||||
<el-input v-model="form.title" maxlength="50" show-word-limit placeholder="如:9月底全盘(可留空)" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="盘点范围" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio value="location">按库位</el-radio>
|
||||
<el-radio value="store">按货主按商品</el-radio>
|
||||
<el-radio value="goods">按商品</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="type-tip">
|
||||
{{ isLocationType
|
||||
? '库位盘点:明细行为「库位」(一行一个库位,行内按商品聚合),创建后添加盘点库位;不选库位时由后端自动拉取全仓库启用库位。'
|
||||
: '商品盘点:明细行为「商品」(一行一个库存商品),创建后从库存中挑选商品。' }}
|
||||
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>新建盘点单</h2>
|
||||
<p>创建后为「空盘点单」,需再添加盘点明细并提交审核</p>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="form.type === 'store'" label="货主" prop="store_id">
|
||||
<el-select
|
||||
v-model="form.store_id"
|
||||
placeholder="请选择货主"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
<button
|
||||
class="task-panel__close"
|
||||
type="button"
|
||||
aria-label="关闭"
|
||||
@click="handleVisibleChange(false)"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in storeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-item label="盘点方式" prop="mode">
|
||||
<el-radio-group v-model="form.mode" :disabled="isLocationType">
|
||||
<el-radio value="open">明盘</el-radio>
|
||||
<el-radio value="blind">盲盘</el-radio>
|
||||
</el-radio-group>
|
||||
<span v-if="isLocationType" class="form-tip form-tip--lock">
|
||||
库位盘点固定为盲盘(不可更改):盘点作业时前端不显示账面数量
|
||||
</span>
|
||||
<span v-else-if="form.mode === 'blind'" class="form-tip">盲盘:盘点作业时前端不显示账面数量</span>
|
||||
</el-form-item>
|
||||
<div class="task-panel__body">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
class="task-panel__form"
|
||||
>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">盘点名称</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="title">
|
||||
<el-input v-model="form.title" maxlength="50" show-word-limit placeholder="如:9月底全盘(可留空)" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form-item v-if="!isLocationType" label="静态盘点" prop="isStatic">
|
||||
<el-radio-group v-model="form.isStatic">
|
||||
<el-radio :value="0">关闭</el-radio>
|
||||
<el-radio :value="1">开启</el-radio>
|
||||
</el-radio-group>
|
||||
<span v-if="form.isStatic === 1" class="form-tip form-tip--block">
|
||||
开启后:审核通过将锁定移库、分配储位操作(拣货不受影响),盘点完成后自动解锁
|
||||
</span>
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">盘点范围</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio value="location">按库位</el-radio>
|
||||
<el-radio value="store">按货主按商品</el-radio>
|
||||
<el-radio value="goods">按商品</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">
|
||||
{{ isLocationType
|
||||
? '库位盘点:明细行为「库位」(一行一个库位,行内按商品聚合),创建后添加盘点库位;不选库位时由后端自动拉取全仓库启用库位。'
|
||||
: '商品盘点:明细行为「商品」(一行一个库存商品),创建后从库存中挑选商品。' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="200" show-word-limit placeholder="可留空" />
|
||||
</el-form-item>
|
||||
<div v-if="form.type === 'store'" class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">货主</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="store_id">
|
||||
<el-select
|
||||
v-model="form.store_id"
|
||||
placeholder="请选择货主"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in storeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
:title="createAlertText"
|
||||
/>
|
||||
</el-form>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">盘点方式</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="mode">
|
||||
<el-radio-group v-model="form.mode" :disabled="isLocationType">
|
||||
<el-radio value="open">明盘</el-radio>
|
||||
<el-radio value="blind">盲盘</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<p v-if="isLocationType" class="task-panel__field-tip">
|
||||
库位盘点固定为盲盘(不可更改):盘点作业时前端不显示账面数量
|
||||
</p>
|
||||
<p v-else-if="form.mode === 'blind'" class="task-panel__field-tip">
|
||||
盲盘:盘点作业时前端不显示账面数量
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
确认创建
|
||||
</el-button>
|
||||
</template>
|
||||
<div v-if="!isLocationType" class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">静态盘点</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="isStatic">
|
||||
<el-radio-group v-model="form.isStatic">
|
||||
<el-radio :value="0">关闭</el-radio>
|
||||
<el-radio :value="1">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<p v-if="form.isStatic === 1" class="task-panel__field-tip is-warning">
|
||||
开启后:审核通过将锁定移库、分配储位操作(拣货不受影响),盘点完成后自动解锁
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="200" show-word-limit placeholder="可留空" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<p class="task-panel__form-tip">
|
||||
{{ createAlertText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
<span class="task-panel__hint">提交前请确认盘点范围与盘点方式</span>
|
||||
<div class="task-panel__actions">
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
确认创建
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -288,33 +343,214 @@ async function handleSubmit() {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-tip {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
color: #e6a23c;
|
||||
/* 面板结构 / 尺寸对齐手工录入运单号(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;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
&--textarea {
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-control {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
|
||||
&.is-warning {
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-tip--lock {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
line-height: 1.5;
|
||||
color: #909399;
|
||||
}
|
||||
/* 面板内嵌 el-form-item:去掉默认间距,错误提示改回文档流内展示 */
|
||||
.task-panel__form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 独立成行的提示(宽占满、无左间距),沿用 warning 色 */
|
||||
.form-tip--block {
|
||||
display: block;
|
||||
margin-left: 0;
|
||||
margin-top: 2px;
|
||||
width: 100%;
|
||||
line-height: 1.5;
|
||||
}
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.type-tip {
|
||||
width: 100%;
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #909399;
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
|
||||
.el-dialog.check-form-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -15,78 +15,123 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
title="快速创建盘点单"
|
||||
width="min(560px, 94vw)"
|
||||
class="check-pattern-dialog"
|
||||
width="min(560px, 92vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@update:model-value="handleVisibleChange"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="90px"
|
||||
size="small"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="盘点定式" prop="pattern_id">
|
||||
<el-select
|
||||
v-model="form.pattern_id"
|
||||
:loading="patternLoading"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="输入定式名称筛选,如:临期盘点"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in patternOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="type-tip">
|
||||
{{ selectedPattern
|
||||
? (selectedPattern.description || '按该定式自动收集盘点对象,创建后进入待审核。')
|
||||
: '选择定式后由后端自动收集盘点对象(无需手动添加明细)。' }}
|
||||
<!-- 面板结构对齐「手工录入运单号」(TaskProgressPanel) -->
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>快速创建盘点单</h2>
|
||||
<p>选择盘点定式后,由后端自动收集盘点对象并进入待审核</p>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<button
|
||||
class="task-panel__close"
|
||||
type="button"
|
||||
aria-label="关闭"
|
||||
@click="handleVisibleChange(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-item label="盘点名称" prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
maxlength="50"
|
||||
show-word-limit
|
||||
:placeholder="titlePlaceholder"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="task-panel__body">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
class="task-panel__form"
|
||||
@submit.prevent
|
||||
>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">盘点定式</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="pattern_id">
|
||||
<el-select
|
||||
v-model="form.pattern_id"
|
||||
:loading="patternLoading"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="输入定式名称筛选,如:临期盘点"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in patternOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">
|
||||
{{ selectedPattern
|
||||
? (selectedPattern.description || '按该定式自动收集盘点对象,创建后进入待审核。')
|
||||
: '选择定式后由后端自动收集盘点对象(无需手动添加明细)。' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="200" show-word-limit placeholder="可留空" />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">盘点名称</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
maxlength="50"
|
||||
show-word-limit
|
||||
:placeholder="titlePlaceholder"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
:title="createAlertText"
|
||||
/>
|
||||
</el-form>
|
||||
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-form-item prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
placeholder="可留空"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!form.pattern_id"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确认创建
|
||||
</el-button>
|
||||
</template>
|
||||
<p class="task-panel__form-tip">
|
||||
{{ createAlertText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
<span class="task-panel__hint">提交前请确认盘点定式与名称</span>
|
||||
<div class="task-panel__actions">
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!form.pattern_id"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确认创建
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -260,17 +305,210 @@ async function handleSubmit() {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-tip {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
color: #e6a23c;
|
||||
/* 面板结构 / 尺寸对齐手工录入运单号(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;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
&--textarea {
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-control {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.type-tip {
|
||||
width: 100%;
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #909399;
|
||||
/* 面板内嵌 el-form-item:去掉默认间距,错误提示改回文档流内展示 */
|
||||
.task-panel__form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板(同手工录入运单号) */
|
||||
.el-dialog.check-pattern-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -109,13 +109,13 @@
|
||||
:height="tableHeight"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="45" :reserve-selection="true" />
|
||||
<el-table-column prop="item_code" label="商品编码" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="item_name" label="商品名称" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="spec" label="规格" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="store_name" label="货主" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="space_code" label="库位" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="batch_no" label="批次号" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column type="selection" width="45" align="center" :reserve-selection="true" />
|
||||
<el-table-column prop="item_code" label="商品编码" min-width="130" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="item_name" label="商品名称" min-width="160" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="spec" label="规格" min-width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="store_name" label="货主" min-width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="space_code" label="库位" min-width="120" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="batch_no" label="批次号" min-width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="quantity" label="库存数量" width="100" align="center" />
|
||||
<el-table-column prop="available_quantity" label="可用数量" width="100" align="center" />
|
||||
|
||||
|
||||
@ -401,7 +401,7 @@
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<!-- 面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) -->
|
||||
<!-- 面板结构 / 尺寸对齐「手工录入运单号」 -->
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
@ -1466,7 +1466,7 @@ function handleImport() {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 更新快递公司与运单号:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) */
|
||||
/* 更新快递公司与运单号:面板结构 / 尺寸对齐「手工录入运单号」(TaskProgressPanel) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
@ -1557,17 +1557,26 @@ function handleImport() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
/* 多行文本行:标签与文本域首行对齐 */
|
||||
&--textarea {
|
||||
padding-top: 8px;
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度(含必填星号占位):保证各输入框左边缘对齐、长度一致 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
@ -1606,7 +1615,8 @@ function handleImport() {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -209,6 +209,77 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 修改备注弹窗(面板结构 / 尺寸对齐「手工录入运单号」ManualWaybillForm) -->
|
||||
<el-dialog
|
||||
v-model="renameDialogVisible"
|
||||
class="rename-sign-row-dialog"
|
||||
width="min(560px, 92vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<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="renameDialogVisible = 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">{{ renameRow?.counterparty_name || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">当前备注</span>
|
||||
<strong class="task-panel__field-value">{{ renameRow?.remask || '—' }}</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="renameForm.remask"
|
||||
size="default"
|
||||
placeholder="留空则使用货主全称"
|
||||
clearable
|
||||
@keyup.enter="handleRenameSubmit"
|
||||
/>
|
||||
</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="renameDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="renameLoading" @click="handleRenameSubmit">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -475,6 +546,46 @@ function getAuthStatusLabel(status: number): string {
|
||||
return map[status] || '未知'
|
||||
}
|
||||
|
||||
// ─── 修改备注(弹窗表单,对齐「手工录入运单号」) ─────────────────────────────
|
||||
const renameDialogVisible = ref(false)
|
||||
const renameLoading = ref(false)
|
||||
const renameRow = ref<any>(null)
|
||||
const renameForm = reactive({ remask: '' })
|
||||
|
||||
function handleRename(row: any) {
|
||||
renameRow.value = row
|
||||
/* 与改造前一致:默认填当前备注,没有备注时填货主全称 */
|
||||
renameForm.remask = String(row?.remask ?? row?.counterparty_name ?? '')
|
||||
renameDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function handleRenameSubmit() {
|
||||
const row = renameRow.value
|
||||
if (!row?.id) {
|
||||
ElMessage.warning('缺少签约关系 ID,无法修改备注')
|
||||
return
|
||||
}
|
||||
const remask = renameForm.remask.trim()
|
||||
renameLoading.value = true
|
||||
try {
|
||||
const res = await storeWarehouseRename({ id: row.id, remask }) as any
|
||||
if (res?.flag === 'success' || res?.code === 200) {
|
||||
ElMessage.success('修改备注成功')
|
||||
renameDialogVisible.value = false
|
||||
loadList()
|
||||
if (selectedRow.value && selectedRow.value.id === row.id) {
|
||||
selectedRow.value.remask = remask
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(res?.message || '修改备注失败')
|
||||
}
|
||||
} catch {
|
||||
/* 请求层已提示错误 */
|
||||
} finally {
|
||||
renameLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// ─── 操作 ────────────────────────────────────────────────────────────────────
|
||||
async function handleConfirmSign(row: any) {
|
||||
try {
|
||||
@ -495,24 +606,6 @@ async function handleConfirmSign(row: any) {
|
||||
} catch { ElMessage.error('确认签约失败') }
|
||||
}
|
||||
|
||||
async function handleRename(row: any) {
|
||||
try {
|
||||
const { value } = await ElMessageBox.prompt('请输入新的备注名称', '修改备注', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputValue: row.remask || row.counterparty_name,
|
||||
buttonSize: 'small'
|
||||
})
|
||||
const res = await storeWarehouseRename({ id: row.id, remask: value }) as any
|
||||
if (res?.flag === 'success' || res?.code === 200) {
|
||||
ElMessage.success('修改备注成功')
|
||||
loadList()
|
||||
} else {
|
||||
ElMessage.error(res?.message || '修改备注失败')
|
||||
}
|
||||
} catch { /* cancelled */ }
|
||||
}
|
||||
|
||||
async function handleUnbind(row: any, targetStatus: number) {
|
||||
const actionLabel = targetStatus === 0 ? '禁用' : '启用'
|
||||
try {
|
||||
@ -619,4 +712,189 @@ onMounted(() => {
|
||||
.text-danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
/* 修改备注弹窗:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) */
|
||||
.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;
|
||||
/* 右 0 让输入框右边顶到容器右边缘 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度:输入框左边缘与上方静态信息行的标签列对齐 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__field-value {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
|
||||
.el-dialog.rename-sign-row-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增 / 编辑快递编码:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) -->
|
||||
<!-- 新增 / 编辑快递编码:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
class="courier-code-dialog"
|
||||
@ -111,11 +111,6 @@
|
||||
@blur="validateCodeUnique"
|
||||
/>
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">
|
||||
{{ dialogMode === 'edit'
|
||||
? '业务编码创建后不可修改'
|
||||
: '业务编码用于对接快递接口,建议使用「快递编码.业务」格式' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -151,6 +146,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">
|
||||
{{ dialogMode === 'edit'
|
||||
? '业务编码创建后不可修改;修改快递公司会同步更新该编码的快递类型。'
|
||||
: '业务编码用于对接快递接口,建议使用「快递编码.业务」格式(如 SF.KY)。' }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -690,20 +692,34 @@ onMounted(async () => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度 + 必填星号绝对定位前缀 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -712,8 +728,11 @@ onMounted(async () => {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
&__form-tip {
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background: #f4f4f5;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
@ -735,7 +754,8 @@ onMounted(async () => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增 / 编辑平台编码:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) -->
|
||||
<!-- 新增 / 编辑平台编码:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
class="platform-code-dialog"
|
||||
@ -95,7 +95,6 @@
|
||||
<el-form-item prop="code">
|
||||
<el-input v-model="formData.code" size="default" placeholder="如 DY" />
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">业务编码用于对接平台接口,建议使用平台简称缩写</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -131,6 +130,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">
|
||||
{{ dialogMode === 'create'
|
||||
? '业务编码用于对接平台接口,建议使用平台简称缩写(如 DY);提交后该编码将用于平台订单同步。'
|
||||
: '修改平台后会同步更新该编码的对应关系,保存后立即生效。' }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -558,20 +564,34 @@ onMounted(async () => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度 + 必填星号绝对定位前缀 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -580,8 +600,11 @@ onMounted(async () => {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
&__form-tip {
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background: #f4f4f5;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
@ -603,7 +626,8 @@ onMounted(async () => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -131,6 +131,18 @@
|
||||
|
||||
<div class="task-panel__body">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" class="task-panel__form">
|
||||
<!-- 编辑态:先展示不可编辑的标识信息(对齐「手工录入运单号」的静态信息行) -->
|
||||
<template v-if="dialogMode === 'edit'">
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">店铺 ID</span>
|
||||
<strong class="task-panel__field-value">{{ formData.id ?? '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">所属平台</span>
|
||||
<strong class="task-panel__field-value">{{ platformLabel || formData.platform_code || '—' }}</strong>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">平台</span>
|
||||
<div class="task-panel__field-control">
|
||||
@ -182,16 +194,17 @@
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">
|
||||
平台真实店铺名在同一仓库同一平台下不可重复,修改后需重新授权才能同步平台数据
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p v-if="dialogMode === 'create'" class="task-panel__form-tip">
|
||||
店铺名称由服务端生成待授权占位名,完成平台授权后将自动同步真实店铺名。
|
||||
</p>
|
||||
<p v-else class="task-panel__form-tip">
|
||||
平台真实店铺名在同一仓库同一平台下不可重复,修改后需重新授权才能同步平台数据。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -204,7 +217,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 店铺授权:面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) -->
|
||||
<!-- 店铺授权:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) -->
|
||||
<el-dialog
|
||||
v-model="authDialogVisible"
|
||||
class="shop-auth-dialog"
|
||||
@ -242,14 +255,17 @@
|
||||
<span class="task-panel__field-label">平台</span>
|
||||
<strong class="task-panel__field-value">{{ authForm.platform_name || authForm.platformCode || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">授权</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-button size="small" type="primary" plain :loading="authLinkLoading" @click="handleOpenAuthorizeLink">
|
||||
去授权
|
||||
</el-button>
|
||||
<p class="task-panel__field-tip">跳转平台授权页完成授权后,回到本窗口填写下方参数</p>
|
||||
</div>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="authLinkLoading"
|
||||
@click="handleOpenAuthorizeLink"
|
||||
>
|
||||
去授权
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="!isWechatChannel" class="task-panel__field task-panel__field--input">
|
||||
@ -294,6 +310,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">
|
||||
跳转平台授权页完成授权后,回到本窗口填写下方参数并点击「确认授权」。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -427,6 +448,12 @@ const formData = reactive({
|
||||
shop_name: ''
|
||||
})
|
||||
|
||||
/** 编辑态静态信息行:把 platform_code 解析成平台显示名 */
|
||||
const platformLabel = computed(() => {
|
||||
const hit = platformOptions.value.find((item) => item.code === formData.platform_code)
|
||||
return hit ? hit.label || hit.name || '' : ''
|
||||
})
|
||||
|
||||
/** 编辑态:平台真实店铺名不允许清空(shops.edit 传入 shop_name 时要求非空且 <=100) */
|
||||
function validateShopName(_rule: any, value: any, callback: any) {
|
||||
if (dialogMode.value !== 'edit') {
|
||||
@ -1003,6 +1030,7 @@ onMounted(async () => {
|
||||
&--input {
|
||||
align-items: flex-start;
|
||||
min-height: 0;
|
||||
/* 右 0 让输入框右边顶到容器右边缘 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
@ -1010,20 +1038,34 @@ onMounted(async () => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度:输入框左边缘与静态信息行的标签列对齐 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1032,13 +1074,6 @@ onMounted(async () => {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
&__form-tip {
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
@ -1065,7 +1100,8 @@ onMounted(async () => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -100,195 +100,276 @@
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogMode === 'create' ? '新增策略' : '编辑策略'"
|
||||
width="640px"
|
||||
class="policy-form-dialog"
|
||||
width="min(720px, 94vw)"
|
||||
align-center
|
||||
append-to-body
|
||||
:show-close="false"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px" size="small">
|
||||
<el-form-item label="策略名称" prop="custom_name">
|
||||
<el-input v-model="formData.custom_name" placeholder="请输入策略名称" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="快递编码" prop="express_code">
|
||||
<el-select
|
||||
v-model="formData.express_code"
|
||||
placeholder="请选择快递"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in expressOptions"
|
||||
:key="item.code"
|
||||
:label="`${item.name} (${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺名称" prop="shop_name">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.shopNameList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.shopNameList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.shopNameList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="shopNameInput"
|
||||
placeholder="输入店铺名称,回车添加"
|
||||
maxlength="100"
|
||||
@keyup.enter="addShopName"
|
||||
/>
|
||||
<el-button size="small" @click="addShopName" :disabled="!shopNameInput.trim()">添加</el-button>
|
||||
</div>
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>{{ dialogMode === 'create' ? '新增策略' : '编辑策略' }}</h2>
|
||||
<p>按快递 / 店铺 / 地区 / 重量段配置运单可绑定的快递策略</p>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="限定货主ID" prop="store_ids">
|
||||
<el-select
|
||||
v-model="formData.storeIdsList"
|
||||
placeholder="请选择货主"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
<button class="task-panel__close" type="button" aria-label="关闭" @click="dialogVisible = 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">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
class="task-panel__form task-panel__form--wide"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="违禁品类型" prop="prohibited_type_id">
|
||||
<el-select
|
||||
v-model="formData.prohibited_type_id"
|
||||
placeholder="请选择违禁品类型"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prohibitedOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量段类型" prop="weight_type">
|
||||
<el-select v-model="formData.weight_type" placeholder="请选择重量段类型" style="width: 100%">
|
||||
<el-option label="常规" :value="0" />
|
||||
<el-option label="轻货" :value="1" />
|
||||
<el-option label="重货" :value="2" />
|
||||
<el-option label="冷链" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最小重量(g)" prop="min_weight_g">
|
||||
<el-input-number
|
||||
v-model="formData.min_weight_g"
|
||||
:min="0"
|
||||
placeholder="不限制"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最大重量(g)" prop="max_weight_g">
|
||||
<el-input-number
|
||||
v-model="formData.max_weight_g"
|
||||
:min="0"
|
||||
placeholder="不限制"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="限定地区" prop="regions">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.regionsList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.regionsList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.regionsList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">策略名称</span>
|
||||
<el-form-item prop="custom_name">
|
||||
<el-input
|
||||
v-model="formData.custom_name"
|
||||
placeholder="请输入策略名称"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="regionInput"
|
||||
placeholder="输入省/市名,回车添加"
|
||||
maxlength="50"
|
||||
@keyup.enter="addRegion"
|
||||
/>
|
||||
<el-button size="small" @click="addRegion" :disabled="!regionInput.trim()">添加</el-button>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">快递编码</span>
|
||||
<el-form-item prop="express_code">
|
||||
<el-select v-model="formData.express_code" placeholder="请选择快递" filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in expressOptions"
|
||||
:key="item.code"
|
||||
:label="`${item.name} (${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">店铺名称</span>
|
||||
<el-form-item prop="shop_name">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.shopNameList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.shopNameList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.shopNameList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="shopNameInput"
|
||||
placeholder="输入店铺名称,回车添加"
|
||||
maxlength="100"
|
||||
@keyup.enter="addShopName"
|
||||
/>
|
||||
<el-button size="small" @click="addShopName" :disabled="!shopNameInput.trim()">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">限定货主ID</span>
|
||||
<el-form-item prop="store_ids">
|
||||
<el-select
|
||||
v-model="formData.storeIdsList"
|
||||
placeholder="请选择货主"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">违禁品类型</span>
|
||||
<el-form-item prop="prohibited_type_id">
|
||||
<el-select
|
||||
v-model="formData.prohibited_type_id"
|
||||
placeholder="请选择违禁品类型"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prohibitedOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">重量段类型</span>
|
||||
<el-form-item prop="weight_type">
|
||||
<el-select v-model="formData.weight_type" placeholder="请选择重量段类型" style="width: 100%">
|
||||
<el-option label="常规" :value="0" />
|
||||
<el-option label="轻货" :value="1" />
|
||||
<el-option label="重货" :value="2" />
|
||||
<el-option label="冷链" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">最小重量(g)</span>
|
||||
<el-form-item prop="min_weight_g">
|
||||
<el-input-number
|
||||
v-model="formData.min_weight_g"
|
||||
:min="0"
|
||||
placeholder="不限制"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">最大重量(g)</span>
|
||||
<el-form-item prop="max_weight_g">
|
||||
<el-input-number
|
||||
v-model="formData.max_weight_g"
|
||||
:min="0"
|
||||
placeholder="不限制"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">限定地区</span>
|
||||
<el-form-item prop="regions">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.regionsList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.regionsList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.regionsList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="regionInput"
|
||||
placeholder="输入省/市名,回车添加"
|
||||
maxlength="50"
|
||||
@keyup.enter="addRegion"
|
||||
/>
|
||||
<el-button size="small" @click="addRegion" :disabled="!regionInput.trim()">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">排除地区</span>
|
||||
<el-form-item prop="exclude_regions">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.excludeRegionsList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.excludeRegionsList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.excludeRegionsList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="excludeRegionInput"
|
||||
placeholder="输入省/市名,回车添加"
|
||||
maxlength="50"
|
||||
@keyup.enter="addExcludeRegion"
|
||||
/>
|
||||
<el-button size="small" @click="addExcludeRegion" :disabled="!excludeRegionInput.trim()">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">
|
||||
优先级
|
||||
<el-tooltip content="优先级越大越优先匹配,命中后将不再匹配其他策略" placement="top">
|
||||
<el-icon class="task-panel__label-icon"><QuestionFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-form-item prop="priority">
|
||||
<el-input-number
|
||||
v-model="formData.priority"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
placeholder="请输入优先级"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">状态</span>
|
||||
<el-form-item prop="is_enabled">
|
||||
<el-select v-model="formData.is_enabled" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<el-form-item prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注(选填)"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<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="dialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="排除地区" prop="exclude_regions">
|
||||
<div class="tag-input-wrapper">
|
||||
<div class="tag-list" v-if="formData.excludeRegionsList.length">
|
||||
<el-tag
|
||||
v-for="(item, idx) in formData.excludeRegionsList"
|
||||
:key="idx"
|
||||
closable
|
||||
size="small"
|
||||
@close="formData.excludeRegionsList.splice(idx, 1)"
|
||||
>{{ item }}</el-tag>
|
||||
</div>
|
||||
<div class="tag-input-row">
|
||||
<el-input
|
||||
v-model="excludeRegionInput"
|
||||
placeholder="输入省/市名,回车添加"
|
||||
maxlength="50"
|
||||
@keyup.enter="addExcludeRegion"
|
||||
/>
|
||||
<el-button size="small" @click="addExcludeRegion" :disabled="!excludeRegionInput.trim()">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item prop="priority">
|
||||
<template #label>
|
||||
<span>优先级 <el-tooltip content="优先级越大越优先匹配,命中后将不再匹配其他策略" placement="top"><el-icon style="vertical-align: middle; cursor: help;"><QuestionFilled /></el-icon></el-tooltip></span>
|
||||
</template>
|
||||
<el-input-number
|
||||
v-model="formData.priority"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
placeholder="请输入优先级"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="is_enabled">
|
||||
<el-select v-model="formData.is_enabled" placeholder="请选择状态" style="width: 100%">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注(选填)"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</template>
|
||||
</footer>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -742,4 +823,216 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 新增 / 编辑策略:面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) */
|
||||
.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;
|
||||
|
||||
/* 表单行内嵌 el-form-item:占满剩余宽度,去掉默认间距 */
|
||||
:deep(.el-form-item) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0 !important;
|
||||
width: 100%;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 部分标签较长(如「最小重量(g)」),单独放宽标签列,避免换行 */
|
||||
&__form--wide {
|
||||
.task-panel__field-label {
|
||||
flex: 0 0 96px;
|
||||
width: 96px;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 右 0 让输入框右边顶到容器右边缘 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度 + 必填星号绝对定位前缀 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__label-icon {
|
||||
margin-left: 2px;
|
||||
vertical-align: middle;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
|
||||
.el-dialog.policy-form-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
CameraFormDialog — 摄像头新增/编辑表单弹窗
|
||||
|
||||
功能:
|
||||
@ -9,134 +9,236 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
:title="isEdit ? '编辑摄像头' : '新增摄像头'"
|
||||
width="560px"
|
||||
class="camera-form-dialog"
|
||||
width="min(600px, 94vw)"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div class="form-body">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" size="small">
|
||||
<el-form-item label="所属录像服务器" prop="server_id">
|
||||
<el-select
|
||||
v-model="form.server_id"
|
||||
placeholder="请选择录像服务器"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@focus="loadServerOptions"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in serverOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="task-panel">
|
||||
<header class="task-panel__head">
|
||||
<div class="task-panel__titles">
|
||||
<h2>{{ isEdit ? '编辑摄像头' : '新增摄像头' }}</h2>
|
||||
<p>{{ isEdit ? '修改后保存立即生效' : '选择录像服务器与通道后会自动填充设备信息' }}</p>
|
||||
</div>
|
||||
<button class="task-panel__close" type="button" aria-label="关闭" @click="handleClosed">
|
||||
<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-item v-if="selectedServerNeedsPassword" label="服务器密码" prop="serverPassword">
|
||||
<el-input
|
||||
v-model="serverPassword"
|
||||
type="password"
|
||||
placeholder="请输入服务器密码以拉取通道列表"
|
||||
show-password
|
||||
@blur="fetchChannelList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="task-panel__body">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" class="task-panel__form">
|
||||
<!-- 编辑态:先展示不可编辑的标识信息(对齐「手工录入运单号」的静态信息行) -->
|
||||
<template v-if="isEdit">
|
||||
<!-- <div class="task-panel__field">
|
||||
<span class="task-panel__field-label">摄像头 ID</span>
|
||||
<strong class="task-panel__field-value">{{ form.id ?? '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">通道 ID</span>
|
||||
<strong class="task-panel__field-value">{{ form.channel_id ?? '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">创建时间</span>
|
||||
<strong class="task-panel__field-value">{{ row?.created_at || '—' }}</strong>
|
||||
</div> -->
|
||||
</template>
|
||||
|
||||
<el-form-item label="选择通道" prop="channel_id">
|
||||
<el-select
|
||||
v-model="form.channel_id"
|
||||
placeholder="请先选择服务器,再选择通道"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
:loading="channelLoading"
|
||||
:disabled="!form.server_id"
|
||||
@focus="fetchChannelList"
|
||||
@change="handleChannelSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="ch in channelOptions"
|
||||
:key="ch.value"
|
||||
:label="ch.label"
|
||||
:value="ch.value"
|
||||
:disabled="ch.enabled === false"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">所属服务器</span>
|
||||
<el-form-item prop="server_id">
|
||||
<el-select
|
||||
v-model="form.server_id"
|
||||
placeholder="请选择录像服务器"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@focus="loadServerOptions"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in serverOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="通道名称" prop="channel_name">
|
||||
<el-input v-model="form.channel_name" placeholder="选择通道后自动填充" maxlength="100" show-word-limit disabled />
|
||||
</el-form-item>
|
||||
<div v-if="selectedServerNeedsPassword" class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">服务器密码</span>
|
||||
<el-form-item prop="serverPassword">
|
||||
<el-input
|
||||
v-model="serverPassword"
|
||||
type="password"
|
||||
placeholder="请输入服务器密码以拉取通道列表"
|
||||
show-password
|
||||
@blur="fetchChannelList"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="IP 地址">
|
||||
<el-input v-model="form.ip" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">选择通道</span>
|
||||
<el-form-item prop="channel_id">
|
||||
<el-select
|
||||
v-model="form.channel_id"
|
||||
placeholder="请先选择服务器,再选择通道"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
:loading="channelLoading"
|
||||
:disabled="!form.server_id"
|
||||
@focus="fetchChannelList"
|
||||
@change="handleChannelSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="ch in channelOptions"
|
||||
:key="ch.value"
|
||||
:label="ch.label"
|
||||
:value="ch.value"
|
||||
:disabled="ch.enabled === false"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="SDK 端口">
|
||||
<el-input-number v-model="form.port" placeholder="选择通道后自动填充" :min="1" :max="65535" style="width: 100%" disabled />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">通道名称</span>
|
||||
<el-form-item prop="channel_name">
|
||||
<el-input
|
||||
v-model="form.channel_name"
|
||||
placeholder="选择通道后自动填充"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="型号">
|
||||
<el-input v-model="form.model" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">IP 地址</span>
|
||||
<el-form-item>
|
||||
<el-input v-model="form.ip" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="序列号">
|
||||
<el-input v-model="form.serial_number" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">SDK 端口</span>
|
||||
<el-form-item>
|
||||
<el-input-number
|
||||
v-model="form.port"
|
||||
placeholder="选择通道后自动填充"
|
||||
:min="1"
|
||||
:max="65535"
|
||||
style="width: 100%"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="码流类型">
|
||||
<el-input v-model="form.stream_type" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">型号</span>
|
||||
<el-form-item>
|
||||
<el-input v-model="form.model" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="form.username" placeholder="请输入用户名" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">序列号</span>
|
||||
<el-form-item>
|
||||
<el-input v-model="form.serial_number" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="密码">
|
||||
<el-input v-model="form.password" type="password" placeholder="请输入密码" show-password maxlength="100" />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">码流类型</span>
|
||||
<el-form-item>
|
||||
<el-input v-model="form.stream_type" placeholder="选择通道后自动填充" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="自定义名称" prop="custom_name">
|
||||
<el-input v-model="form.custom_name" placeholder="请输入自定义名称" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">用户名</span>
|
||||
<el-form-item>
|
||||
<el-input v-model="form.username" placeholder="请输入用户名" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label">密码</span>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
show-password
|
||||
maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">自定义名称</span>
|
||||
<el-form-item prop="custom_name">
|
||||
<el-input
|
||||
v-model="form.custom_name"
|
||||
placeholder="请输入自定义名称"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--switch">
|
||||
<span class="task-panel__field-label">状态</span>
|
||||
<div class="task-panel__field-control">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input task-panel__field--textarea">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<el-form-item prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
resize="none"
|
||||
placeholder="请输入备注"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">{{ formTip }}</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
<span class="task-panel__hint">提交前请确认服务器、通道与账号无误</span>
|
||||
<div class="task-panel__actions">
|
||||
<el-button size="small" @click="handleClosed">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="handleSubmit">保存</el-button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button size="small" @click="handleClosed">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="handleSubmit">
|
||||
保存
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { computed, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { create, update } from '@/api/camera/camera'
|
||||
@ -183,6 +285,13 @@ const channelOptions = ref<ChannelItem[]>([])
|
||||
const serverPassword = ref('')
|
||||
const selectedServerNeedsPassword = ref(false)
|
||||
|
||||
/** 面板提示条:新增/编辑两种引导文案 */
|
||||
const formTip = computed(() =>
|
||||
isEdit.value
|
||||
? '所属服务器与通道决定设备来源;重新选择通道后,IP / 端口 / 型号等信息会重新自动填充。'
|
||||
: '先选择录像服务器并拉取通道,选中通道后 IP / 端口 / 型号 / 序列号等信息会自动填充。'
|
||||
)
|
||||
|
||||
const form = reactive({
|
||||
id: undefined as number | undefined,
|
||||
server_id: undefined as number | undefined,
|
||||
@ -479,3 +588,236 @@ function handleClosed() {
|
||||
emit('update:visible', false)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) */
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 字段较多:超出 60vh 时面板内滚动 */
|
||||
&__body {
|
||||
padding: 12px 16px 0;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
&__form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
/* 表单行内嵌 el-form-item:占满剩余宽度,去掉默认间距 */
|
||||
:deep(.el-form-item) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__content) {
|
||||
margin-left: 0 !important;
|
||||
width: 100%;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__error) {
|
||||
position: static;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 右 0 让输入框右边顶到容器右边缘 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 多行文本行:标签与文本域顶部对齐 */
|
||||
&--textarea {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
/* 开关行:与输入行同尺寸(输入框默认 32px),去掉灰色容器 */
|
||||
&--switch {
|
||||
align-items: flex-start;
|
||||
min-height: 36px;
|
||||
/* 右 0 与输入行一致,左 12px 与标签列对齐 */
|
||||
padding: 4px 0 0 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 开关控件列:高度对齐输入框、控件靠右对齐 */
|
||||
&__field-control {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
/* 标签列固定宽度 + 必填星号绝对定位前缀 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* el-dialog 会被 append 到 body:去掉默认头/内边距,统一交给面板 */
|
||||
.el-dialog.camera-form-dialog {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--
|
||||
ServerFormDialog — 录像服务器新增/编辑表单弹窗
|
||||
面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm)
|
||||
面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
@ -34,6 +34,22 @@
|
||||
|
||||
<div class="task-panel__body">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" class="task-panel__form">
|
||||
<!-- 编辑态:先展示不可编辑的标识信息(对齐「手工录入运单号」的静态信息行) -->
|
||||
<template v-if="isEdit">
|
||||
<!-- <div class="task-panel__field">
|
||||
<span class="task-panel__field-label">服务器 ID</span>
|
||||
<strong class="task-panel__field-value">{{ form.id ?? '—' }}</strong>
|
||||
</div> -->
|
||||
<!-- <div class="task-panel__field">
|
||||
<span class="task-panel__field-label">创建时间</span>
|
||||
<strong class="task-panel__field-value">{{ row?.created_at || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">更新时间</span>
|
||||
<strong class="task-panel__field-value">{{ row?.updated_at || '—' }}</strong>
|
||||
</div> -->
|
||||
</template>
|
||||
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">服务器名称</span>
|
||||
<div class="task-panel__field-control">
|
||||
@ -60,7 +76,6 @@
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<p class="task-panel__field-tip">公网 IP 与端口用于外部访问,端口留空使用默认端口</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -138,6 +153,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">{{ formTip }}</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -174,6 +192,13 @@ const isEdit = computed(() => props.mode === 'edit')
|
||||
const formRef = ref<FormInstance>()
|
||||
const saving = ref(false)
|
||||
|
||||
/** 面板提示条:编辑态补充「密码留空表示不修改」说明 */
|
||||
const formTip = computed(() =>
|
||||
isEdit.value
|
||||
? '编辑时密码留空表示不修改;公网 IP 与端口用于外部访问,端口留空使用默认端口。'
|
||||
: '公网 IP 与端口用于外部访问,端口留空使用默认端口;服务器地址与账号用于录像检索,请确认无误后再保存。'
|
||||
)
|
||||
|
||||
const form = reactive({
|
||||
id: undefined as number | undefined,
|
||||
name: '',
|
||||
@ -292,7 +317,7 @@ async function submitForm() {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 面板结构 / 尺寸对齐「批量修改平台信息」(UpdateOrderMetaForm) */
|
||||
/* 面板结构 / 尺寸对齐「手工录入运单号」(ManualWaybillForm) */
|
||||
.task-panel {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
@ -383,6 +408,10 @@ async function submitForm() {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -392,16 +421,26 @@ async function submitForm() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 标签列固定宽度 + 必填星号绝对定位前缀 */
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -410,8 +449,11 @@ async function submitForm() {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
&__form-tip {
|
||||
margin: 8px 0 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background: #f4f4f5;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #909399;
|
||||
@ -433,7 +475,8 @@ async function submitForm() {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
@ -291,77 +291,75 @@
|
||||
<div class="task-panel__body">
|
||||
<!-- Step 1:填写对方主体 -->
|
||||
<div v-if="signDialog.step === 1" class="task-panel__form">
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">当前货主</span>
|
||||
<strong class="task-panel__field-value">{{ currentSubject.company_name || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field task-panel__field--input">
|
||||
<span class="task-panel__field-label is-required">对方主体 ID</span>
|
||||
<div class="task-panel__field-control">
|
||||
<div class="task-panel__field-form">
|
||||
<el-input-number
|
||||
v-model.number="signForm.counterparty_id"
|
||||
size="default"
|
||||
placeholder="请输入对方主体ID"
|
||||
placeholder="请输入对方主体 ID"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
@keyup.enter="doPreviewSign"
|
||||
/>
|
||||
<p class="task-panel__field-tip">填写对方(仓库方)的主体 ID,预览确认无误后再提交</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 2:预览结果 / 提交结果 -->
|
||||
<div v-else-if="signDialog.step === 2" class="sign-preview">
|
||||
<!-- Step 2:预览 / 提交结果 -->
|
||||
<div v-else-if="signDialog.step === 2" class="task-panel__form">
|
||||
<!-- 预览模式:展示双方主体信息 -->
|
||||
<template v-if="signDialog.signMode === 'preview'">
|
||||
<el-descriptions :column="1" border size="small">
|
||||
<el-descriptions-item label="己方(货主)">
|
||||
{{ signDialog.currentSubject?.company_name || '—' }}
|
||||
<el-tag size="small" type="warning" effect="plain" style="margin-left:6px">货主方</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="对方(仓库)">
|
||||
{{ signDialog.counterparty?.company_name || '—' }}
|
||||
<el-tag size="small" type="primary" effect="plain" style="margin-left:6px">仓库方</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="sign-tip">
|
||||
<el-alert type="info" :closable="false" show-icon>
|
||||
<template #default>请确认签约信息,确认无误后点击「确认提交」。</template>
|
||||
</el-alert>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">己方(货主)</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.currentSubject?.company_name || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">对方(仓库)</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.counterparty?.company_name || '—' }}</strong>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 提交后:展示合同信息 -->
|
||||
<template v-else>
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<el-descriptions-item label="签约ID">{{ signDialog.contract?.id || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签约状态">
|
||||
<el-tag size="small" :type="getAuthStatusType(signDialog.contract?.auth_status)">
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">签约 ID</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.contract?.id || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">签约状态</span>
|
||||
<span class="task-panel__field-value">
|
||||
<span :class="getStatusTextClass(getAuthStatusType(signDialog.contract?.auth_status ?? 0))">
|
||||
{{ signDialog.contract?.auth_status_label || '—' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="仓库">{{ signDialog.contract?.warehouse_name || signDialog.contract?.counterparty_name || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="货主">{{ signDialog.contract?.store_name || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ signDialog.contract?.remask || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="面单余额">{{ signDialog.contract?.print_quantity ?? '—' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="sign-tip">
|
||||
<el-alert
|
||||
v-if="signDialog.signMode === 'initiate'"
|
||||
type="info" :closable="false" show-icon
|
||||
>
|
||||
<template #default>已提交申请,等待对方确认。</template>
|
||||
</el-alert>
|
||||
<el-alert
|
||||
v-else-if="signDialog.signMode === 'already_exists'"
|
||||
type="warning" :closable="false" show-icon
|
||||
>
|
||||
<template #default>对方已发起签约申请,等待处理。</template>
|
||||
</el-alert>
|
||||
<el-alert
|
||||
v-else-if="signDialog.signMode === 'already_confirmed'"
|
||||
type="success" :closable="false" show-icon
|
||||
>
|
||||
<template #default>该签约已完成,无需重复提交。</template>
|
||||
</el-alert>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">仓库</span>
|
||||
<strong class="task-panel__field-value">
|
||||
{{ signDialog.contract?.warehouse_name || signDialog.contract?.counterparty_name || '—' }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">货主</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.contract?.store_name || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">备注</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.contract?.remask || '—' }}</strong>
|
||||
</div>
|
||||
<div class="task-panel__field">
|
||||
<span class="task-panel__field-label">面单余额</span>
|
||||
<strong class="task-panel__field-value">{{ signDialog.contract?.print_quantity ?? '—' }}</strong>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- 提示条:对齐「手工录入运单号」的 .task-panel__form-tip -->
|
||||
<p class="task-panel__form-tip">{{ signTip }}</p>
|
||||
</div>
|
||||
|
||||
<footer class="task-panel__foot">
|
||||
@ -961,6 +959,16 @@ const signFooterHint = computed(() => {
|
||||
return '签约状态已更新'
|
||||
})
|
||||
|
||||
/** 发起签约面板提示条文案(按步骤 / 结果态变化) */
|
||||
const signTip = computed(() => {
|
||||
if (signDialog.step === 1) return '填写对方(仓库方)的主体 ID,预览确认无误后再提交。'
|
||||
if (signDialog.signMode === 'preview') return '请确认签约信息,确认无误后点击「确认提交」。'
|
||||
if (signDialog.signMode === 'already_exists') return '对方已发起签约申请,等待处理。'
|
||||
if (signDialog.signMode === 'already_confirmed') return '该签约已完成,无需重复提交。'
|
||||
if (signDialog.signMode === 'initiate') return '已提交申请,等待对方确认。'
|
||||
return '签约结果如下,可直接关闭窗口。'
|
||||
})
|
||||
|
||||
function openSignDialog() {
|
||||
signDialog.visible = true
|
||||
signDialog.step = 1
|
||||
@ -1379,12 +1387,6 @@ onMounted(() => {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.sign-preview {
|
||||
.sign-tip {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.copy-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1487,20 +1489,33 @@ onMounted(() => {
|
||||
|
||||
.task-panel__field-label {
|
||||
padding-top: 7px;
|
||||
|
||||
&.is-required::before {
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__field-label {
|
||||
position: relative;
|
||||
flex: 0 0 88px;
|
||||
width: 88px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #606266;
|
||||
flex-shrink: 0;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-required::before {
|
||||
content: '*';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 20px;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1517,6 +1532,21 @@ onMounted(() => {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field-form {
|
||||
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;
|
||||
}
|
||||
|
||||
&__field-tip {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
@ -1540,7 +1570,8 @@ onMounted(() => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
/* 与工具栏按钮组(OrderToolbarButtonGroup)保持一致:gap 6px */
|
||||
gap: 6px;
|
||||
|
||||
:deep(.el-button) {
|
||||
margin-left: 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user