1
This commit is contained in:
parent
f7f50a3c99
commit
8cdc82b4ff
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
@ -50,9 +50,6 @@ export function create(data: {
|
|||||||
model?: string
|
model?: string
|
||||||
serial_number?: string
|
serial_number?: string
|
||||||
stream_type?: string
|
stream_type?: string
|
||||||
custom_name?: string
|
|
||||||
status?: number
|
|
||||||
remark?: string
|
|
||||||
}) {
|
}) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system',
|
url: '/system',
|
||||||
@ -83,9 +80,6 @@ export function update(data: {
|
|||||||
model?: string
|
model?: string
|
||||||
serial_number?: string
|
serial_number?: string
|
||||||
stream_type?: string
|
stream_type?: string
|
||||||
custom_name?: string
|
|
||||||
status?: number
|
|
||||||
remark?: string
|
|
||||||
}) {
|
}) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system',
|
url: '/system',
|
||||||
@ -134,23 +128,3 @@ export function del(data: { id: number }) {
|
|||||||
isSystemApi: true
|
isSystemApi: true
|
||||||
} as any)
|
} 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)
|
|
||||||
}
|
|
||||||
|
|||||||
@ -63,7 +63,8 @@ export type PendingOrderReverseReviewParams = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type PendingOrderAllocateExpressCodeParams = {
|
export type PendingOrderAllocateExpressCodeParams = {
|
||||||
orders: Array<Record<string, any>>;
|
/** 订单 ID 数组,sys_platform_code / logistics_code 等字段由后端从数据库读取 */
|
||||||
|
ids: number[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PendingOrderUpdateOrderPlatformParams = {
|
export type PendingOrderUpdateOrderPlatformParams = {
|
||||||
|
|||||||
@ -303,7 +303,7 @@ async function loadFilterData() {
|
|||||||
try {
|
try {
|
||||||
const [storesRes, expressRes]: any = await Promise.all([
|
const [storesRes, expressRes]: any = await Promise.all([
|
||||||
indexApi.loadStores(),
|
indexApi.loadStores(),
|
||||||
indexApi.getExpressList({})
|
indexApi.getExpressList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
|
|||||||
@ -1152,9 +1152,9 @@ function resolveStoreId(raw: unknown): number | undefined {
|
|||||||
async function loadImportSelectOptions() {
|
async function loadImportSelectOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, sourcePlatformRes, platformRes]: any = await Promise.all([
|
const [expressRes, sourcePlatformRes, platformRes]: any = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
settingPlatformList({ pagination: { page: 1, pageSize: 500 } }),
|
settingPlatformList({ pagination: { page: 1, pageSize: 500 } }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
const expressRaw = expressRes?.data?.list || expressRes?.data || []
|
const expressRaw = expressRes?.data?.list || expressRes?.data || []
|
||||||
const sourcePlatformRaw = sourcePlatformRes?.data?.list || sourcePlatformRes?.data || []
|
const sourcePlatformRaw = sourcePlatformRes?.data?.list || sourcePlatformRes?.data || []
|
||||||
|
|||||||
@ -298,7 +298,7 @@ async function loadFilterData() {
|
|||||||
try {
|
try {
|
||||||
const [storesRes, expressRes]: any = await Promise.all([
|
const [storesRes, expressRes]: any = await Promise.all([
|
||||||
indexApi.loadStores(),
|
indexApi.loadStores(),
|
||||||
indexApi.getExpressList({})
|
indexApi.getExpressList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
|
|||||||
@ -364,8 +364,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes, storesRes] = await Promise.all([
|
const [expressRes, platformRes, storesRes] = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({}),
|
indexApi.getPlatformList({ systemOnly: 'true' }),
|
||||||
indexApi.loadStores()
|
indexApi.loadStores()
|
||||||
])
|
])
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
|
|||||||
@ -298,7 +298,7 @@ async function loadFilterData() {
|
|||||||
try {
|
try {
|
||||||
const [storesRes, expressRes]: any = await Promise.all([
|
const [storesRes, expressRes]: any = await Promise.all([
|
||||||
indexApi.loadStores(),
|
indexApi.loadStores(),
|
||||||
indexApi.getExpressList({})
|
indexApi.getExpressList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
fillStoreScanFieldOptions(availableFieldsRef, extractStoreListFromResponse(storesRes))
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
|
|||||||
@ -712,8 +712,8 @@ async function loadFilterData() {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes] = await Promise.all([
|
const [expressRes, platformRes] = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
const platformData: any = platformRes?.data
|
const platformData: any = platformRes?.data
|
||||||
|
|||||||
@ -424,8 +424,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes, storesRes] = await Promise.all([
|
const [expressRes, platformRes, storesRes] = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({}),
|
indexApi.getPlatformList({ systemOnly: 'true' }),
|
||||||
indexApi.loadStores()
|
indexApi.loadStores()
|
||||||
])
|
])
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
|
|||||||
@ -957,8 +957,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes] = await Promise.all([
|
const [expressRes, platformRes] = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
const expressData: any = expressRes?.data
|
const expressData: any = expressRes?.data
|
||||||
const platformData: any = platformRes?.data
|
const platformData: any = platformRes?.data
|
||||||
|
|||||||
@ -284,8 +284,8 @@ function mapNameOptions(rawList: any[], nameKeys: string[]) {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [platformRes, expressRes, storesRes] = await Promise.all([
|
const [platformRes, expressRes, storesRes] = await Promise.all([
|
||||||
indexApi.getPlatformList({}),
|
indexApi.getPlatformList({ systemOnly: 'true' }),
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.loadStores()
|
indexApi.loadStores()
|
||||||
])
|
])
|
||||||
const platformData: any = platformRes?.data
|
const platformData: any = platformRes?.data
|
||||||
|
|||||||
@ -419,39 +419,13 @@ function normalizeCode(value: unknown) {
|
|||||||
return String(value ?? '').trim()
|
return String(value ?? '').trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
function computeAvailableBusinessKeys(expressNumbers: any, count = 1): number[] {
|
function buildAllocateExpressIds(rows: any[]): number[] {
|
||||||
const used = new Set<number>()
|
const ids: 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>> = []
|
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
const base = { ...row }
|
const id = normalizePositiveIntId(row.order_id ?? row.id)
|
||||||
const order_id = normalizePositiveIntId(base.order_id ?? base.id)
|
if (id !== null) ids.push(id)
|
||||||
if (order_id === null) continue
|
|
||||||
out.push({
|
|
||||||
...base,
|
|
||||||
order_id,
|
|
||||||
business_key: computeAvailableBusinessKeys(row.express_numbers, 1)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
return out
|
return ids
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeAsyncTaskStatus(value: unknown) {
|
function normalizeAsyncTaskStatus(value: unknown) {
|
||||||
@ -1207,12 +1181,12 @@ export function createPendingToolbarController(params: {
|
|||||||
if (!rows.length || allocateLoading.value) return
|
if (!rows.length || allocateLoading.value) return
|
||||||
allocateLoading.value = true
|
allocateLoading.value = true
|
||||||
try {
|
try {
|
||||||
const orders = buildAllocateExpressPayload(rows)
|
const ids = buildAllocateExpressIds(rows)
|
||||||
if (!orders.length) {
|
if (!ids.length) {
|
||||||
ElMessage.error('没有有效的订单 ID,无法分配快递号')
|
ElMessage.error('没有有效的订单 ID,无法分配快递号')
|
||||||
return
|
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')
|
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
ElMessage.error(res?.message || '分配快递号失败')
|
ElMessage.error(res?.message || '分配快递号失败')
|
||||||
|
|||||||
@ -437,8 +437,8 @@ async function loadFallbackOrderFilterOptions() {
|
|||||||
try {
|
try {
|
||||||
const [storesRes, expressRes, platformRes] = await Promise.all([
|
const [storesRes, expressRes, platformRes] = await Promise.all([
|
||||||
indexApi.loadStores(),
|
indexApi.loadStores(),
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
|
|
||||||
const storesResAny = storesRes as any
|
const storesResAny = storesRes as any
|
||||||
|
|||||||
@ -3102,8 +3102,8 @@ async function loadFallbackOrderFilterOptions() {
|
|||||||
try {
|
try {
|
||||||
const [storesRes, expressRes, platformRes] = await Promise.all([
|
const [storesRes, expressRes, platformRes] = await Promise.all([
|
||||||
indexApi.loadStores(),
|
indexApi.loadStores(),
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
|
|
||||||
const storesResAny = storesRes as any
|
const storesResAny = storesRes as any
|
||||||
|
|||||||
@ -558,8 +558,8 @@ function unwrapIndexListResponse(res: any): any[] {
|
|||||||
async function loadOrderMetaOptions() {
|
async function loadOrderMetaOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes] = await Promise.all([
|
const [expressRes, platformRes] = await Promise.all([
|
||||||
indexApi.getExpressList({}),
|
indexApi.getExpressList({ systemOnly: 'true' }),
|
||||||
indexApi.getPlatformList({})
|
indexApi.getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
const expressRaw = unwrapIndexListResponse(expressRes)
|
const expressRaw = unwrapIndexListResponse(expressRes)
|
||||||
const platformRaw = unwrapIndexListResponse(platformRes)
|
const platformRaw = unwrapIndexListResponse(platformRes)
|
||||||
|
|||||||
@ -96,6 +96,7 @@ import DirectInboundImportDialog, {
|
|||||||
import {
|
import {
|
||||||
canDirectInboundOperate,
|
canDirectInboundOperate,
|
||||||
entrydetail,
|
entrydetail,
|
||||||
|
isPendingEntryOrderStatus,
|
||||||
} from '../entry-config'
|
} from '../entry-config'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@ -131,8 +132,7 @@ const pagination = reactive({
|
|||||||
|
|
||||||
const canBatchImport = computed(() => {
|
const canBatchImport = computed(() => {
|
||||||
const status = props.row?.order_status ?? entryOrderStatus.value
|
const status = props.row?.order_status ?? entryOrderStatus.value
|
||||||
if (status === null || status === undefined || status === '') return false
|
return isPendingEntryOrderStatus(status)
|
||||||
return String(status).trim().toUpperCase() === 'CREATED'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const canDirectInbound = computed(() => {
|
const canDirectInbound = computed(() => {
|
||||||
@ -304,7 +304,7 @@ function openImportDialog(row: DirectInboundImportRow) {
|
|||||||
|
|
||||||
function openBatchImportDialog() {
|
function openBatchImportDialog() {
|
||||||
if (!canBatchImport.value) {
|
if (!canBatchImport.value) {
|
||||||
ElMessage.warning('仅「已创建」状态可使用批量导入')
|
ElMessage.warning('仅「已创建」或「待入库」状态可使用批量导入')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
importTargetItem.value = null
|
importTargetItem.value = null
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export const stockoutScanBoxConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const statusConfig: Record<string, { text: string; tagType: string }> = {
|
export const statusConfig: Record<string, { text: string; tagType: string }> = {
|
||||||
|
created: { text: '已创建', tagType: 'success' },
|
||||||
pedding: { text: '待出库', tagType: 'warning' },
|
pedding: { text: '待出库', tagType: 'warning' },
|
||||||
pending: { text: '待出库', tagType: 'warning' },
|
pending: { text: '待出库', tagType: 'warning' },
|
||||||
processing: { text: '出库中', tagType: 'primary' },
|
processing: { text: '出库中', tagType: 'primary' },
|
||||||
|
|||||||
@ -1669,8 +1669,8 @@ function mapPolicyPlatformOptions(rawList: any[]) {
|
|||||||
async function loadPolicySelectOptions() {
|
async function loadPolicySelectOptions() {
|
||||||
try {
|
try {
|
||||||
const [expressRes, platformRes]: any = await Promise.all([
|
const [expressRes, platformRes]: any = await Promise.all([
|
||||||
getExpressList({}),
|
getExpressList({ systemOnly: 'true' }),
|
||||||
getPlatformList({})
|
getPlatformList({ systemOnly: 'true' })
|
||||||
])
|
])
|
||||||
const expressRaw = expressRes?.data?.list || expressRes?.data || []
|
const expressRaw = expressRes?.data?.list || expressRes?.data || []
|
||||||
const platformRaw = platformRes?.data?.list || platformRes?.data || []
|
const platformRaw = platformRes?.data?.list || platformRes?.data || []
|
||||||
|
|||||||
@ -27,12 +27,13 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-button size="small" type="primary" :loading="loading" @click="loadData">刷新</el-button>
|
<el-button size="small" type="primary" :loading="loading" @click="loadData">刷新</el-button>
|
||||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</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">
|
<span v-if="viewMode === 'warehouse' && warehouseContextHint" class="toolbar-hint">
|
||||||
{{ warehouseContextHint }}
|
{{ warehouseContextHint }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="split-stack" ref="splitStackRef">
|
<div class="split-stack" ref="splitStackRef">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user