This commit is contained in:
yin 2026-08-01 18:15:27 +08:00
parent f7f50a3c99
commit 8cdc82b4ff
20 changed files with 40 additions and 89 deletions

Binary file not shown.

View File

@ -50,9 +50,6 @@ export function create(data: {
model?: string
serial_number?: string
stream_type?: string
custom_name?: string
status?: number
remark?: string
}) {
return request({
url: '/system',
@ -83,9 +80,6 @@ export function update(data: {
model?: string
serial_number?: string
stream_type?: string
custom_name?: string
status?: number
remark?: string
}) {
return request({
url: '/system',
@ -134,23 +128,3 @@ export function del(data: { id: number }) {
isSystemApi: true
} as any)
}
/** 设置摄像头 OSD 文字叠加 */
export function setOsd(data: {
id: number
text: string
x?: number
y?: number
}) {
return request({
url: '/system',
method: 'post',
params: {
method: 'camera.setOsd',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -63,7 +63,8 @@ export type PendingOrderReverseReviewParams = {
};
export type PendingOrderAllocateExpressCodeParams = {
orders: Array<Record<string, any>>;
/** 订单 ID 数组,sys_platform_code / logistics_code 等字段由后端从数据库读取 */
ids: number[];
};
export type PendingOrderUpdateOrderPlatformParams = {

View File

@ -303,7 +303,7 @@ async function loadFilterData() {
try {
const [storesRes, expressRes]: any = await Promise.all([
indexApi.loadStores(),
indexApi.getExpressList({})
indexApi.getExpressList({ systemOnly: 'true' })
])
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
const expressData: any = expressRes?.data

View File

@ -1152,9 +1152,9 @@ function resolveStoreId(raw: unknown): number | undefined {
async function loadImportSelectOptions() {
try {
const [expressRes, sourcePlatformRes, platformRes]: any = await Promise.all([
indexApi.getExpressList({}),
indexApi.getExpressList({ systemOnly: 'true' }),
settingPlatformList({ pagination: { page: 1, pageSize: 500 } }),
indexApi.getPlatformList({})
indexApi.getPlatformList({ systemOnly: 'true' })
])
const expressRaw = expressRes?.data?.list || expressRes?.data || []
const sourcePlatformRaw = sourcePlatformRes?.data?.list || sourcePlatformRes?.data || []

View File

@ -298,7 +298,7 @@ async function loadFilterData() {
try {
const [storesRes, expressRes]: any = await Promise.all([
indexApi.loadStores(),
indexApi.getExpressList({})
indexApi.getExpressList({ systemOnly: 'true' })
])
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
const expressData: any = expressRes?.data

View File

@ -364,8 +364,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
async function loadOrderMetaOptions() {
try {
const [expressRes, platformRes, storesRes] = await Promise.all([
indexApi.getExpressList({}),
indexApi.getPlatformList({}),
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' }),
indexApi.loadStores()
])
const expressData: any = expressRes?.data

View File

@ -298,7 +298,7 @@ async function loadFilterData() {
try {
const [storesRes, expressRes]: any = await Promise.all([
indexApi.loadStores(),
indexApi.getExpressList({})
indexApi.getExpressList({ systemOnly: 'true' })
])
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
const expressData: any = expressRes?.data

View File

@ -712,8 +712,8 @@ async function loadFilterData() {
async function loadOrderMetaOptions() {
try {
const [expressRes, platformRes] = await Promise.all([
indexApi.getExpressList({}),
indexApi.getPlatformList({})
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' })
])
const expressData: any = expressRes?.data
const platformData: any = platformRes?.data

View File

@ -424,8 +424,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
async function loadOrderMetaOptions() {
try {
const [expressRes, platformRes, storesRes] = await Promise.all([
indexApi.getExpressList({}),
indexApi.getPlatformList({}),
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' }),
indexApi.loadStores()
])
const expressData: any = expressRes?.data

View File

@ -957,8 +957,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
async function loadOrderMetaOptions() {
try {
const [expressRes, platformRes] = await Promise.all([
indexApi.getExpressList({}),
indexApi.getPlatformList({})
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' })
])
const expressData: any = expressRes?.data
const platformData: any = platformRes?.data

View File

@ -284,8 +284,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
async function loadOrderMetaOptions() {
try {
const [platformRes, expressRes, storesRes] = await Promise.all([
indexApi.getPlatformList({}),
indexApi.getExpressList({}),
indexApi.getPlatformList({ systemOnly: 'true' }),
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.loadStores()
])
const platformData: any = platformRes?.data

View File

@ -419,39 +419,13 @@ function normalizeCode(value: unknown) {
return String(value ?? '').trim()
}
function computeAvailableBusinessKeys(expressNumbers: any, count = 1): number[] {
const used = new Set<number>()
if (Array.isArray(expressNumbers)) {
for (const item of expressNumbers) {
const n = Number(item)
if (Number.isFinite(n) && n > 0 && Number.isInteger(n)) {
used.add(n)
}
}
}
const need = Math.max(1, Number(count) || 1)
const result: number[] = []
let cursor = 1
while (result.length < need) {
if (!used.has(cursor)) result.push(cursor)
cursor += 1
}
return result
}
function buildAllocateExpressPayload(rows: any[]): Array<Record<string, any>> {
const out: Array<Record<string, any>> = []
function buildAllocateExpressIds(rows: any[]): number[] {
const ids: number[] = []
for (const row of rows) {
const base = { ...row }
const order_id = normalizePositiveIntId(base.order_id ?? base.id)
if (order_id === null) continue
out.push({
...base,
order_id,
business_key: computeAvailableBusinessKeys(row.express_numbers, 1)
})
const id = normalizePositiveIntId(row.order_id ?? row.id)
if (id !== null) ids.push(id)
}
return out
return ids
}
function normalizeAsyncTaskStatus(value: unknown) {
@ -1207,12 +1181,12 @@ export function createPendingToolbarController(params: {
if (!rows.length || allocateLoading.value) return
allocateLoading.value = true
try {
const orders = buildAllocateExpressPayload(rows)
if (!orders.length) {
const ids = buildAllocateExpressIds(rows)
if (!ids.length) {
ElMessage.error('没有有效的订单 ID,无法分配快递号')
return
}
const res = await params.pendingApi.allocateExpressCode({ orders })
const res = await params.pendingApi.allocateExpressCode({ ids })
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
if (!ok) {
ElMessage.error(res?.message || '分配快递号失败')

View File

@ -437,8 +437,8 @@ async function loadFallbackOrderFilterOptions() {
try {
const [storesRes, expressRes, platformRes] = await Promise.all([
indexApi.loadStores(),
indexApi.getExpressList({}),
indexApi.getPlatformList({})
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' })
])
const storesResAny = storesRes as any

View File

@ -3102,8 +3102,8 @@ async function loadFallbackOrderFilterOptions() {
try {
const [storesRes, expressRes, platformRes] = await Promise.all([
indexApi.loadStores(),
indexApi.getExpressList({}),
indexApi.getPlatformList({})
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' })
])
const storesResAny = storesRes as any

View File

@ -558,8 +558,8 @@ function unwrapIndexListResponse(res: any): any[] {
async function loadOrderMetaOptions() {
try {
const [expressRes, platformRes] = await Promise.all([
indexApi.getExpressList({}),
indexApi.getPlatformList({})
indexApi.getExpressList({ systemOnly: 'true' }),
indexApi.getPlatformList({ systemOnly: 'true' })
])
const expressRaw = unwrapIndexListResponse(expressRes)
const platformRaw = unwrapIndexListResponse(platformRes)

View File

@ -96,6 +96,7 @@ import DirectInboundImportDialog, {
import {
canDirectInboundOperate,
entrydetail,
isPendingEntryOrderStatus,
} from '../entry-config'
const props = defineProps<{
@ -131,8 +132,7 @@ const pagination = reactive({
const canBatchImport = computed(() => {
const status = props.row?.order_status ?? entryOrderStatus.value
if (status === null || status === undefined || status === '') return false
return String(status).trim().toUpperCase() === 'CREATED'
return isPendingEntryOrderStatus(status)
})
const canDirectInbound = computed(() => {
@ -304,7 +304,7 @@ function openImportDialog(row: DirectInboundImportRow) {
function openBatchImportDialog() {
if (!canBatchImport.value) {
ElMessage.warning('仅「已创建」状态可使用批量导入')
ElMessage.warning('仅「已创建」或「待入库」状态可使用批量导入')
return
}
importTargetItem.value = null

View File

@ -24,6 +24,7 @@ export const stockoutScanBoxConfig = {
}
export const statusConfig: Record<string, { text: string; tagType: string }> = {
created: { text: '已创建', tagType: 'success' },
pedding: { text: '待出库', tagType: 'warning' },
pending: { text: '待出库', tagType: 'warning' },
processing: { text: '出库中', tagType: 'primary' },

View File

@ -1669,8 +1669,8 @@ function mapPolicyPlatformOptions(rawList: any[]) {
async function loadPolicySelectOptions() {
try {
const [expressRes, platformRes]: any = await Promise.all([
getExpressList({}),
getPlatformList({})
getExpressList({ systemOnly: 'true' }),
getPlatformList({ systemOnly: 'true' })
])
const expressRaw = expressRes?.data?.list || expressRes?.data || []
const platformRaw = platformRes?.data?.list || platformRes?.data || []

View File

@ -27,12 +27,13 @@
</el-radio-group>
<el-button size="small" type="primary" :loading="loading" @click="loadData">刷新</el-button>
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
<!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
<span v-if="viewMode === 'warehouse' && warehouseContextHint" class="toolbar-hint">
{{ warehouseContextHint }}
</span>
</div>
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
</div>
<div class="split-stack" ref="splitStackRef">