1
This commit is contained in:
parent
5b9a529c84
commit
a241495afc
@ -181,6 +181,8 @@ export type PickWaveClaimScanResponse = {
|
||||
waybill_no: string
|
||||
/** 波次下订单总数 */
|
||||
total_order_count: number
|
||||
/** 波次下拦截订单数(拦截订单跳过领料,其未打印/未领料状态不阻隔领料与拣货) */
|
||||
intercepted_order_count: number
|
||||
/** 本次置为 fin 的订单数(已全部领单时返回 0) */
|
||||
claimed_order_count: number
|
||||
/** 操作结果:claimed(整波领单完成)或 already_claimed(波次已领单) */
|
||||
|
||||
@ -87,7 +87,7 @@ export type ReturnUnpackRecord = {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** 原订单商品明细行(order.items 顶层透出) */
|
||||
/** 原订单商品明细行(order.items 的元素) */
|
||||
export type ReturnUnpackOrderItem = {
|
||||
/** 商品编码 */
|
||||
item_code?: string
|
||||
@ -170,9 +170,9 @@ export type ReturnUnpackCreateResponse = {
|
||||
is_original_return: boolean
|
||||
/** 货主的合约货主备注名称,未命中时为空字符串 */
|
||||
store_remark: string
|
||||
/** 原订单详情(仅原单退回时返回,非原单为 null) */
|
||||
/** 原订单详情(含 items 明细,仅原单退回时返回,非原单为 null) */
|
||||
order?: ReturnUnpackOriginalOrder | null
|
||||
/** 原订单商品明细数组(order.items 顶层透出,仅原单退回时返回;非原单退回或原订单详情缺失时为 null) */
|
||||
/** 原订单商品明细数组(即 order.items 的顶层透出,仅原单退回时返回;非原单退回或原订单详情缺失时为 null) */
|
||||
order_items?: ReturnUnpackOrderItem[] | null
|
||||
/** 是否幂等复用已有拆包单 */
|
||||
reused?: boolean
|
||||
@ -380,6 +380,10 @@ export type ReturnUnpackListWhere = {
|
||||
order_express_id?: number
|
||||
/** 原订单ID(等值) */
|
||||
order_id?: number
|
||||
/** 是否有视频记录(等值):1 有视频记录 / 2 无视频记录 */
|
||||
has_video?: 1 | 2
|
||||
/** 录像是否可用(等值):1 可用(存在 video_url 非空且 status!=failed 的记录) / 2 不可用 */
|
||||
video_enable?: 1 | 2
|
||||
}
|
||||
|
||||
/** returnUnpack.list 排序参数 */
|
||||
@ -405,8 +409,15 @@ export type ReturnUnpackListParams = {
|
||||
sort?: ReturnUnpackListSort
|
||||
}
|
||||
|
||||
/** returnUnpack.list 响应 */
|
||||
export type ReturnUnpackListResponse = {
|
||||
/** 拆包单列表,每条含主表字段 + is_original_return 派生字段 + 格式化时间字段 + camera_ids 数组 + 视频派生字段 has_video(1=有视频记录/2=无)与 video_enable(1=录像可用/2=不可用)+ videos 视频数组(id/video_url/status/camera_id/camera_name) */
|
||||
list: ReturnUnpackRecord[]
|
||||
pagination: ReturnUnpackPagination
|
||||
}
|
||||
|
||||
/** returnUnpack.list:拆包单分页列表(仓库隔离,服务端注入 warehouse_id) */
|
||||
export function returnUnpackList(data: ReturnUnpackListParams = {}): Promise<any> {
|
||||
export function returnUnpackList(data: ReturnUnpackListParams = {}): Promise<ReturnUnpackListResponse> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
|
||||
@ -103,6 +103,13 @@ export function getProhibitedList() {
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** stock.warehouse.getInfo 响应 data */
|
||||
export type StockWarehouseInfoResponse = {
|
||||
/** 是否需要复核:Y=需要复核,N=不需要复核 */
|
||||
need_recheck?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export function getInfo(id: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -117,7 +124,15 @@ export function getInfo(id: any) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function saveWarehouseStock(data: any) {
|
||||
/** stock.warehouse.saveWarehouseStock 请求参数 */
|
||||
export type SaveWarehouseStockParams = {
|
||||
/** 是否需要复核:Y=需要复核,N=不需要复核(非 Y/N 值会报错) */
|
||||
need_recheck?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** stock.warehouse.saveWarehouseStock:新增/更新仓库商品 */
|
||||
export function saveWarehouseStock(data: SaveWarehouseStockParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -299,7 +314,15 @@ export function checkItemCodeUnique(data: CheckItemCodeUniqueParams) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function createWarehouseStock(data: any) {
|
||||
/** stock.warehouse.createWarehouseStock 请求参数 */
|
||||
export type CreateWarehouseStockParams = {
|
||||
/** 是否需要复核:Y=需要复核,N=不需要复核;缺省默认 Y(需要复核) */
|
||||
need_recheck?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** stock.warehouse.createWarehouseStock:新增仓库商品 */
|
||||
export function createWarehouseStock(data: CreateWarehouseStockParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -327,7 +350,21 @@ export function handleBatchDelete(data: any) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function handleBatchChange(data: any) {
|
||||
/** stock.warehouse.handleBatchChange 请求参数 */
|
||||
export type HandleBatchChangeParams = {
|
||||
/** 要批量修改的仓库商品记录 ID 数组(stock_warehouse.id) */
|
||||
ids?: number[]
|
||||
/** 要修改的字段名:brand_name、prohibited_id、gross_weight、packing_requirements、managementFlags、stock_unit、need_recheck */
|
||||
method?: string
|
||||
/** 修改值,类型依 method 而定:brand_name/packing_requirements/stock_unit 为 string(<=255 字符);prohibited_id 为 number(整数);gross_weight 为 number(正整数,单位 g);managementFlags 为 object(含 is_sn_mgmt/is_shelf_life_mgmt/is_batch_mgmt,值为 Y/N);need_recheck 为 string(仅支持 Y/N) */
|
||||
value?: string | number | Record<string, any>
|
||||
/** 兼容字段:当前实现以 value 为准,不使用 values */
|
||||
values?: any
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** stock.warehouse.handleBatchChange:批量修改仓库商品字段 */
|
||||
export function handleBatchChange(data: HandleBatchChangeParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
|
||||
@ -3,7 +3,20 @@ import request from '@/utils/request'
|
||||
const v = "1.0"
|
||||
|
||||
|
||||
export function getInventoryList(data: any): Promise<any> {
|
||||
/** storage.inventory.list 请求参数 */
|
||||
export type InventoryListParams = {
|
||||
/** 统一 where 条件对象,可用字段:stock_id(商品ID)、space_id(库位ID)、store_id(货主ID)、inventory_type(ZP/CC/JS/XS/ZT/DJ/FP)、batch_no(批次号)、inbound_order_no(入库单号)、available_quantity(可用数量,支持 gt/lt)、inbound_time(入库时间,支持 between)、created_at(创建时间,支持 between)、stock_query(虚拟筛选字段:按商品编码/名称/货物编码/条码/SKU ID 模糊匹配,如 { operator: 'like', value: '111' }) */
|
||||
where?: Record<string, any>
|
||||
/** 分页参数 { page, pageSize },默认 page=1, pageSize=20 */
|
||||
pagination?: { page?: number; pageSize?: number }
|
||||
/** 排序参数 { sortField, sortOrder },默认 sortField='created_at', sortOrder='DESC' */
|
||||
sort?: { sortField?: string; sortOrder?: 'ASC' | 'DESC' }
|
||||
/** 是否按批次查询,默认 false。false=合并模式(按库位+商品聚合 quantity/locked_quantity/available_quantity),true=明细模式(逐条返回含 batch_no/production_date/expiry_date 等) */
|
||||
group_by_batch?: boolean
|
||||
}
|
||||
|
||||
/** 库存明细列表查询 */
|
||||
export function getInventoryList(data: InventoryListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -182,16 +195,14 @@ export function getExpiryList(data: any): Promise<any> {
|
||||
|
||||
/** storage.inventory.export 请求参数 */
|
||||
export type InventoryExportParams = {
|
||||
/** 导出模式:'stock_location'(默认,按商品+库位聚合)| 'storage'(按库存记录逐条导出) */
|
||||
exportMode?: 'stock_location' | 'storage'
|
||||
/** 统一 where 条件对象,与 storage.inventory.list 的 where 语义一致 */
|
||||
/** 统一 where 条件对象,与 storage.inventory.list 的 where 语义完全一致(暂不支持 stock_query 虚拟筛选)。支持字段:stock_id(商品ID)、space_id(库位ID)、store_id(货主ID)、inventory_type(ZP/CC/JS/XS/ZT/DJ/FP)、batch_no(批次号)、inbound_order_no(入库单号)、available_quantity(可用数量,支持 gt/lt)、inbound_time(入库时间,支持 between)、created_at(创建时间,支持 between) */
|
||||
where?: Record<string, any>
|
||||
/** 排序参数 { sortField, sortOrder } */
|
||||
/** 排序参数,与 storage.inventory.list 的 sort 语义一致。sortField 支持:id/stock_id/space_id/created_at/updated_at/inbound_time/quantity,sortOrder 支持 ASC/DESC。默认 id DESC */
|
||||
sort?: {
|
||||
sortField?: string
|
||||
sortOrder?: 'ASC' | 'DESC'
|
||||
}
|
||||
/** 是否按批次查询导出,对齐查询模式 group_by_batch */
|
||||
/** 是否按批次导出,默认 false。false=合并模式(按 stock_id+库位聚合导出库存汇总,含总库存/锁定/可用/批次数/最近入库时间),true=明细模式(按 storage_id 逐条导出库存明细,含批次号/库存类型/生产日期/过期日期/入库单号等) */
|
||||
group_by_batch?: boolean
|
||||
}
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
<el-button link size="small" type="primary" @click="printScanStickers">打印贴纸</el-button>
|
||||
</div>
|
||||
<div
|
||||
v-for="cmd in SCAN_COMMANDS"
|
||||
v-for="cmd in displayCommands"
|
||||
:key="cmd"
|
||||
class="scan-command-row"
|
||||
:class="{
|
||||
@ -1310,6 +1310,13 @@ function doCancel() {
|
||||
doCancelCore().finally(() => { cancelLoading.value = false })
|
||||
}
|
||||
|
||||
/** 扫码指令:删除拆包(条码即确认,单次直接执行,不弹二次确认;物理删除不可恢复) */
|
||||
function doDelete() {
|
||||
const id = createResult.value?.id
|
||||
if (!id || deleteLoading.value) return
|
||||
void confirmDelete()
|
||||
}
|
||||
|
||||
/** 确认取消拆包(弹窗路径,复用 doCancelCore) */
|
||||
async function confirmCancel() {
|
||||
if (cancelLoading.value) return
|
||||
@ -1380,8 +1387,8 @@ function routeScan(barcode: string) {
|
||||
|
||||
// 1) 未创建拆包单
|
||||
if (!id) {
|
||||
if (cmd === 'submit' || cmd === 'cancel') {
|
||||
ElMessage.warning('当前无拆包中单据')
|
||||
if (cmd === 'submit' || cmd === 'cancel' || cmd === 'delete') {
|
||||
ElMessage.warning('当前无拆包单,无法扫码操作')
|
||||
} else if (cmd) {
|
||||
// NORMAL/DAMAGED:仍可设置默认状态(为后续拆包做准备)
|
||||
setDefaultStatus(cmd)
|
||||
@ -1391,12 +1398,17 @@ function routeScan(barcode: string) {
|
||||
}
|
||||
return
|
||||
}
|
||||
// 2) 已创建但非拆包中 → 提示
|
||||
// 2) 删除指令:任何状态均可删除(物理删除当前拆包单,扫码即确认)
|
||||
if (cmd === 'delete') {
|
||||
doDelete()
|
||||
return
|
||||
}
|
||||
// 3) 已创建但非拆包中 → 提示
|
||||
if (record?.status !== 'unpacking') {
|
||||
ElMessage.warning('当前拆包单已终态,无法扫码操作')
|
||||
return
|
||||
}
|
||||
// 3) 指令条码
|
||||
// 4) 指令条码
|
||||
if (cmd) {
|
||||
if (cmd === 'submit') {
|
||||
doSubmit()
|
||||
@ -1407,7 +1419,7 @@ function routeScan(barcode: string) {
|
||||
}
|
||||
return
|
||||
}
|
||||
// 4) 商品条码 → 复用快速添加(回填输入框做视觉反馈)
|
||||
// 5) 商品条码 → 复用快速添加(回填输入框做视觉反馈)
|
||||
detailBarcode.value = barcode
|
||||
void handleBarcodeQuickAdd(true)
|
||||
}
|
||||
@ -1428,6 +1440,9 @@ async function copyScanCommand(code: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面展示的指令(隐藏「取消拆包」条码;扫码识别与打印贴纸仍保留全部指令) */
|
||||
const displayCommands = computed(() => SCAN_COMMANDS.filter((cmd) => cmd !== 'cancel'))
|
||||
|
||||
/** 页面展示的指令条形码:jsbarcode 生成 Code 128 图形,工人可直接扫屏幕 */
|
||||
const barcodeEls: Record<string, SVGElement | null> = {}
|
||||
const barcodeRefs: Record<string, (el: any) => void> = {}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* 识别时 trim + 忽略大小写。
|
||||
*/
|
||||
|
||||
export type ScanCommand = 'submit' | 'normal' | 'damaged' | 'cancel'
|
||||
export type ScanCommand = 'submit' | 'normal' | 'damaged' | 'cancel' | 'delete'
|
||||
|
||||
/** 指令条码内容:条码 → 动作(精简为简单单词,识别忽略大小写) */
|
||||
export const CMD: Record<ScanCommand, string> = {
|
||||
@ -14,6 +14,7 @@ export const CMD: Record<ScanCommand, string> = {
|
||||
normal: 'NORMAL',
|
||||
damaged: 'DAMAGED',
|
||||
cancel: 'CANCEL',
|
||||
delete: 'DELETE',
|
||||
}
|
||||
|
||||
/** 指令动作中文名(页面展示 / 打印贴纸) */
|
||||
@ -22,6 +23,7 @@ export const CMD_LABEL: Record<ScanCommand, string> = {
|
||||
normal: '设为正常',
|
||||
damaged: '设为破损',
|
||||
cancel: '取消拆包',
|
||||
delete: '删除拆包',
|
||||
}
|
||||
|
||||
/** 指令标签类型(element-plus el-tag type,与明细表状态配色一致) */
|
||||
@ -30,10 +32,11 @@ export const CMD_TAG_TYPE: Record<ScanCommand, 'warning' | 'success' | 'danger'
|
||||
normal: 'success',
|
||||
damaged: 'danger',
|
||||
cancel: 'info',
|
||||
delete: 'danger',
|
||||
}
|
||||
|
||||
/** 全部指令(按展示顺序) */
|
||||
export const SCAN_COMMANDS: ScanCommand[] = ['submit', 'normal', 'damaged', 'cancel']
|
||||
export const SCAN_COMMANDS: ScanCommand[] = ['submit', 'normal', 'damaged', 'cancel', 'delete']
|
||||
|
||||
/** 解析条码是否为指令条码(trim + 忽略大小写),非指令返回 null */
|
||||
export function resolveScanCommand(barcode: string): ScanCommand | null {
|
||||
|
||||
@ -1555,7 +1555,7 @@ export const deliveryColumns = applyOrderListCopyActions([
|
||||
{ prop: 'pay_time', label: '支付时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'delivery_time', label: '配送时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'operate_time', label: '操作时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'place_order_time', label: '时效', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'place_order_time', label: '下单时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'create_at', label: '创建时间', width: '160', formatter: orderTimeFormatter },
|
||||
])
|
||||
|
||||
@ -1839,7 +1839,7 @@ export const pendingCloums = [
|
||||
{ prop: 'province', label: '省份', width: '100' },
|
||||
{ prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'pay_time', label: '支付时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'place_order_time', label: '时效', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'place_order_time', label: '下单时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'create_channel', label: '来源', width: '120' },
|
||||
{ prop: 'source_order_codes', label: '平台交易单号', width: '140' },
|
||||
{ prop: 'logistics_name', label: '快递', width: '120' },
|
||||
|
||||
@ -100,6 +100,14 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 跳过复核(need_recheck:Y=需要复核,N=跳过复核,非 Y/N 报错) -->
|
||||
<el-form-item label="跳过复核">
|
||||
<el-radio-group v-model="formData.need_recheck">
|
||||
<el-radio :label="'N'">是</el-radio>
|
||||
<el-radio :label="'Y'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 尺寸信息卡片 -->
|
||||
<div class="info-card">
|
||||
<div class="card-header">
|
||||
|
||||
@ -138,6 +138,14 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 跳过复核(need_recheck:Y=需要复核,N=跳过复核,非 Y/N 报错) -->
|
||||
<el-form-item label="跳过复核">
|
||||
<el-radio-group v-model="formData.need_recheck">
|
||||
<el-radio :label="'N'">是</el-radio>
|
||||
<el-radio :label="'Y'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-card v-if="hasManagementFlag('is_shelf_life_mgmt')" class="info-card" shadow="never" style="margin-top: 20px;">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
||||
@ -105,6 +105,12 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-need_recheck="{ row }">
|
||||
<el-tag :type="row.need_recheck === 'N' ? 'warning' : 'info'" size="small">
|
||||
{{ row.need_recheck === 'N' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="custom-empty">
|
||||
<el-icon><User /></el-icon>
|
||||
|
||||
@ -192,6 +192,13 @@ export const stockColumns = [
|
||||
slotName: 'is_batch_mgmt',
|
||||
formatter: (row: any) => row.is_batch_mgmt === 'Y' ? '是' : '否'
|
||||
},
|
||||
{
|
||||
prop: 'need_recheck',
|
||||
label: '跳过复核',
|
||||
width: '90',
|
||||
slotName: 'need_recheck',
|
||||
formatter: (row: any) => row.need_recheck === 'N' ? '是' : '否'
|
||||
},
|
||||
{
|
||||
prop: 'dimensions',
|
||||
label: '尺寸(长×宽×高)',
|
||||
@ -495,6 +502,7 @@ export const stockDefaultFormData = {
|
||||
is_shelf_life_mgmt: 'N',
|
||||
shelf_life_days: 0,
|
||||
is_batch_mgmt: 'N',
|
||||
need_recheck: 'Y',
|
||||
inbound_min_days: 0,
|
||||
outbound_min_days: 0,
|
||||
remaining_threshold_days: 0,
|
||||
|
||||
@ -84,6 +84,14 @@
|
||||
<span>{{ formatInventoryOptionalText(row.remaining_threshold_days) }}</span>
|
||||
</template>
|
||||
|
||||
<template #column-is_shelf_life_warning_triggered="{ row }">
|
||||
<div style="text-align:center">
|
||||
<el-tag :type="row.is_shelf_life_warning_triggered ? 'danger' : 'success'" size="small">
|
||||
{{ row.is_shelf_life_warning_triggered ? '预警' : '正常' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #column-first_inbound_time="{ row }">
|
||||
<span>{{ row.first_inbound_time || '--' }}</span>
|
||||
</template>
|
||||
|
||||
@ -221,6 +221,7 @@ export const productstockColums = [
|
||||
{ prop: 'last_inbound_time', label: '最后入库时间', width: '160' },
|
||||
{ prop: 'is_shelf_life_mgmt', label: '保质期管理', width: '100' },
|
||||
{ prop: 'remaining_threshold_days', label: '临期阈值(天)', width: '110' },
|
||||
{ prop: 'is_shelf_life_warning_triggered', label: '临期预警', width: '100' },
|
||||
{ prop: 'is_batch_mgmt_enabled', label: '批次管理', width: '100' },
|
||||
{ prop: 'batch_count', label: '批次数', width: '80' }
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user