613
This commit is contained in:
parent
5480033c3c
commit
f7c0951737
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
36
req.txt
Normal file
36
req.txt
Normal file
@ -0,0 +1,36 @@
|
||||
stock.warehouse.search自动匹配商品,返回数据:
|
||||
{
|
||||
"flag": "success",
|
||||
"code": 200,
|
||||
"message": "ok",
|
||||
"data": [
|
||||
{
|
||||
"id": 150181,
|
||||
"item_code": null,
|
||||
"goods_code": "581229",
|
||||
"item_name": "自然派猪肉脯炭烧100g",
|
||||
"sku_property": "",
|
||||
"stock_unit": "个",
|
||||
"quantity": 0,
|
||||
"locked_quantity": 0,
|
||||
"brand_name": null,
|
||||
"item_type": "ZC",
|
||||
"inbound_min_days": null,
|
||||
"outbound_min_days": null,
|
||||
"shelf_life_days": null,
|
||||
"remaining_threshold_days": null,
|
||||
"is_shelf_life_mgmt": false,
|
||||
"gross_weight": "130.00",
|
||||
"barcodes": [
|
||||
"6945309363606"
|
||||
],
|
||||
"store_stock": {
|
||||
"store_id": 1000195,
|
||||
"store_remask": "盛昇"
|
||||
},
|
||||
"is_batch_mgmt_enabled": false
|
||||
}
|
||||
],
|
||||
"total": 1,
|
||||
"timestamp": 1781342370
|
||||
}
|
||||
@ -81,27 +81,33 @@
|
||||
|
||||
<div class="create-order-body">
|
||||
<div class="create-order-left">
|
||||
<div class="preview-table-wrap">
|
||||
<UpperTable
|
||||
ref="previewTableRef"
|
||||
:data="importPreviewRows"
|
||||
table-id="order-create-pending-preview"
|
||||
:data="previewTableRows"
|
||||
:show-selection="true"
|
||||
:selectable="isPreviewRowSelectable"
|
||||
:loading="parseImportFileLoading"
|
||||
:pagination="{ currentPage: 1, pageSize: 500, total: importPreviewRows.length }"
|
||||
:pagination="previewPagination"
|
||||
:page-sizes="[50, 100, 200, 500]"
|
||||
:columns="importPreviewColumns"
|
||||
row-key="_rowKey"
|
||||
:current-row-key="activePreviewRowKey"
|
||||
:virtual-threshold="80"
|
||||
@row-click="handlePreviewRowClick"
|
||||
@selection-change="handlePreviewSelectionChange"
|
||||
@page-change="handlePreviewPageChange"
|
||||
@page-size-change="handlePreviewPageSizeChange"
|
||||
>
|
||||
<template #column-_issue="{ row }">
|
||||
<div v-if="getRowIssues(row).length" class="issue-indicator">
|
||||
<div v-if="row._issueCount" class="issue-indicator">
|
||||
<el-tooltip
|
||||
:content="getRowIssues(row).join(';')"
|
||||
:content="row._issueText"
|
||||
placement="right"
|
||||
effect="dark"
|
||||
>
|
||||
<span class="issue-text">{{ getRowIssues(row).length }}项异常</span>
|
||||
<span class="issue-text">{{ row._issueCount }}项异常</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
@ -304,7 +310,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
<template #column-selected_items="{ row }">
|
||||
<div :class="{ 'cell-required-empty': hasUnmatchedItems(row) }">
|
||||
<div :class="{ 'cell-required-empty': row._hasUnmatchedItems }">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@ -328,6 +334,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</UpperTable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="create-order-right">
|
||||
@ -409,7 +416,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { DialogBeforeCloseFn } from 'element-plus'
|
||||
import { useCreateOrderSession, type CreateOrderDraftSnapshot } from '../composables/useCreateOrderSession'
|
||||
@ -418,7 +425,9 @@ import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import SelectProductDialog from './SelectProductDialog.vue'
|
||||
import type { SelectProductItem } from './SelectProductDialog.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { warehouseSearch } from '@/api/stock/stock'
|
||||
import {
|
||||
lookupStockProductByKeyword
|
||||
} from '../utils/stock-picker-helpers'
|
||||
import { orderList } from '@/api/order.index/orderindex'
|
||||
import {
|
||||
extractPendingOrderParseAddressData,
|
||||
@ -480,6 +489,10 @@ type PreviewSelectedItem = SelectProductItem
|
||||
type ImportPreviewRow = {
|
||||
_rowKey: string
|
||||
_orderExists?: boolean
|
||||
/** 缓存异常计数,避免表格渲染时重复计算 */
|
||||
_issueCount?: number
|
||||
_issueText?: string
|
||||
_hasUnmatchedItems?: boolean
|
||||
/** Excel/表格「详细地址」列原始完整文本,供地址解析/重识使用 */
|
||||
_source_address?: string
|
||||
row_no: number
|
||||
@ -543,6 +556,12 @@ const defaultStoreId = ref<number | undefined>(undefined)
|
||||
const provinceOptions = buildProvinceOptions()
|
||||
|
||||
const previewTableRef = ref<InstanceType<typeof UpperTable> | null>(null)
|
||||
const previewPagination = reactive({ currentPage: 1, pageSize: 100, total: 0 })
|
||||
const previewTableRows = computed(() => {
|
||||
const rows = importPreviewRows.value
|
||||
const start = (previewPagination.currentPage - 1) * previewPagination.pageSize
|
||||
return rows.slice(start, start + previewPagination.pageSize)
|
||||
})
|
||||
const activePreviewRowKey = ref('')
|
||||
const selectedPreviewRowKeys = ref<Set<string>>(new Set())
|
||||
const addressPasteText = ref('')
|
||||
@ -599,13 +618,39 @@ watch(resetToken, () => {
|
||||
})
|
||||
|
||||
watch(
|
||||
importPreviewRows,
|
||||
() => {
|
||||
() => importPreviewRows.value.length,
|
||||
(length) => {
|
||||
previewPagination.total = length
|
||||
const maxPage = Math.max(1, Math.ceil(length / previewPagination.pageSize) || 1)
|
||||
if (previewPagination.currentPage > maxPage) {
|
||||
previewPagination.currentPage = maxPage
|
||||
}
|
||||
restorePreviewRowSelection()
|
||||
},
|
||||
{ deep: true }
|
||||
}
|
||||
)
|
||||
|
||||
function resetPreviewPagination() {
|
||||
previewPagination.currentPage = 1
|
||||
previewPagination.total = importPreviewRows.value.length
|
||||
}
|
||||
|
||||
function handlePreviewPageChange(page: number) {
|
||||
previewPagination.currentPage = page
|
||||
restorePreviewRowSelection()
|
||||
}
|
||||
|
||||
function handlePreviewPageSizeChange(size: number) {
|
||||
previewPagination.pageSize = size
|
||||
previewPagination.currentPage = 1
|
||||
restorePreviewRowSelection()
|
||||
}
|
||||
|
||||
function navigatePreviewPageToRow(row: ImportPreviewRow) {
|
||||
const index = importPreviewRows.value.findIndex((item) => item._rowKey === row._rowKey)
|
||||
if (index < 0) return
|
||||
previewPagination.currentPage = Math.floor(index / previewPagination.pageSize) + 1
|
||||
}
|
||||
|
||||
function handleMinimize() {
|
||||
persistCreateOrderDraft()
|
||||
minimizeCreateOrderDialog()
|
||||
@ -639,6 +684,8 @@ function restoreCreateOrderDraft() {
|
||||
activePreviewRowKey.value = snapshot.activePreviewRowKey
|
||||
selectedPreviewRowKeys.value = new Set(snapshot.selectedPreviewRowKeys)
|
||||
addressPasteText.value = snapshot.addressPasteText
|
||||
syncAllPreviewRowIssues()
|
||||
resetPreviewPagination()
|
||||
void nextTick(() => restorePreviewRowSelection())
|
||||
}
|
||||
|
||||
@ -719,11 +766,6 @@ function hasValidSelectedItemId(item: PreviewSelectedItem) {
|
||||
return Number.isInteger(itemId) && itemId > 0
|
||||
}
|
||||
|
||||
function getStockItemId(row: any): number | undefined {
|
||||
const itemId = Number(row?.item_id ?? row?.id ?? 0)
|
||||
return Number.isInteger(itemId) && itemId > 0 ? itemId : undefined
|
||||
}
|
||||
|
||||
function buildSelectedItemFromImport(itemCode: string, planQty: string): PreviewSelectedItem {
|
||||
return {
|
||||
item_code: itemCode,
|
||||
@ -752,18 +794,16 @@ function collectGroupOrderItems(rows: ImportPreviewRow[]) {
|
||||
}
|
||||
|
||||
async function lookupStockItemByCode(storeId: number, itemCode: string) {
|
||||
const res: any = await warehouseSearch({
|
||||
keyword: itemCode,
|
||||
store_id: storeId
|
||||
})
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) return null
|
||||
const list = (Array.isArray(res?.data) ? res.data : []).map(mapStockPickerItem)
|
||||
return (
|
||||
list.find((row: any) => getStockItemCode(row) === itemCode) ||
|
||||
list.find((row: any) => String(row.item_id) === itemCode) ||
|
||||
null
|
||||
)
|
||||
return lookupStockProductByKeyword(storeId, itemCode)
|
||||
}
|
||||
|
||||
function applyMatchedStockToSelectedItem(item: PreviewSelectedItem, matched: PreviewSelectedItem) {
|
||||
const displayCode = String(item.item_code || '').trim()
|
||||
item.item_id = matched.item_id
|
||||
item.item_name = String(item.item_name || '').trim() || matched.item_name
|
||||
item.item_code = displayCode || matched.item_code
|
||||
item.barcode = String(item.barcode || '').trim() || matched.barcode
|
||||
item.store_id = item.store_id || matched.store_id
|
||||
}
|
||||
|
||||
async function resolveMissingItemIdsForGroup(rows: ImportPreviewRow[]) {
|
||||
@ -783,9 +823,7 @@ async function resolveMissingItemIdsForGroup(rows: ImportPreviewRow[]) {
|
||||
ElMessage.warning(`订单「${orderLabel}」:商品「${itemCode}」未匹配到有效商品,请在右侧重新选择`)
|
||||
return false
|
||||
}
|
||||
item.item_id = matched.item_id
|
||||
if (!item.item_name) item.item_name = matched.item_name
|
||||
if (!item.item_code) item.item_code = matched.item_code
|
||||
applyMatchedStockToSelectedItem(item, matched)
|
||||
}
|
||||
}
|
||||
return true
|
||||
@ -873,7 +911,7 @@ function hasUnmatchedItems(row: ImportPreviewRow): boolean {
|
||||
})
|
||||
}
|
||||
|
||||
function getRowIssues(row: ImportPreviewRow): string[] {
|
||||
function computeRowIssues(row: ImportPreviewRow): string[] {
|
||||
const issues: string[] = []
|
||||
if (row._orderExists) issues.push('发货单号已存在')
|
||||
if (isRequiredFieldEmpty(row, 'store_id')) issues.push('货主未选择')
|
||||
@ -888,6 +926,19 @@ function getRowIssues(row: ImportPreviewRow): string[] {
|
||||
return issues
|
||||
}
|
||||
|
||||
function refreshRowIssues(row: ImportPreviewRow) {
|
||||
const issues = computeRowIssues(row)
|
||||
row._issueCount = issues.length
|
||||
row._issueText = issues.join(';')
|
||||
row._hasUnmatchedItems = hasUnmatchedItems(row)
|
||||
}
|
||||
|
||||
function syncAllPreviewRowIssues() {
|
||||
for (const row of importPreviewRows.value) {
|
||||
refreshRowIssues(row)
|
||||
}
|
||||
}
|
||||
|
||||
function isRequiredFieldEmpty(row: ImportPreviewRow, field: string): boolean {
|
||||
if (isPreviewRowLocked(row)) return false
|
||||
switch (field) {
|
||||
@ -921,7 +972,7 @@ function restorePreviewRowSelection() {
|
||||
void nextTick(() => {
|
||||
const table = previewTableRef.value
|
||||
if (!table) return
|
||||
for (const row of importPreviewRows.value) {
|
||||
for (const row of previewTableRows.value) {
|
||||
const shouldSelect = selectedPreviewRowKeys.value.has(row._rowKey) && !isPreviewRowLocked(row)
|
||||
table.toggleRowSelection(row, shouldSelect)
|
||||
}
|
||||
@ -1089,6 +1140,7 @@ function getNextPreviewRowTemplate(copyFrom?: ImportPreviewRow): ImportPreviewRo
|
||||
|
||||
function addImportPreviewRow(copyFrom?: ImportPreviewRow) {
|
||||
const nextRow = getNextPreviewRowTemplate(copyFrom)
|
||||
refreshRowIssues(nextRow)
|
||||
importPreviewRows.value.push(nextRow)
|
||||
renumberPreviewRows()
|
||||
importOrderResult.value = null
|
||||
@ -1120,6 +1172,7 @@ function markPreviewRowDirty(row: ImportPreviewRow) {
|
||||
row.import_status = '待创建'
|
||||
row.import_message = ''
|
||||
importOrderResult.value = null
|
||||
refreshRowIssues(row)
|
||||
}
|
||||
|
||||
function handleDeliveryOrderCodeChange(row: ImportPreviewRow) {
|
||||
@ -1265,6 +1318,7 @@ async function handleReRecognizeAddresses() {
|
||||
ElMessage.error('地址重识失败')
|
||||
} finally {
|
||||
reRecognizeAddressLoading.value = false
|
||||
syncAllPreviewRowIssues()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1296,10 +1350,12 @@ async function handleCheckDeliveryOrderCodes() {
|
||||
|
||||
if (!duplicateRowCount) {
|
||||
ElMessage.success('未发现重复发货单号')
|
||||
syncAllPreviewRowIssues()
|
||||
return
|
||||
}
|
||||
|
||||
ElMessage.warning(`发现 ${existingCodeSet.size} 个重复发货单号,共 ${duplicateRowCount} 行`)
|
||||
syncAllPreviewRowIssues()
|
||||
} catch (error) {
|
||||
console.error('check delivery order code failed:', error)
|
||||
ElMessage.error('发货单号查重失败')
|
||||
@ -1314,6 +1370,7 @@ function resetImportOrderDialog() {
|
||||
importOrderResult.value = null
|
||||
defaultStoreId.value = undefined
|
||||
activePreviewRowKey.value = ''
|
||||
resetPreviewPagination()
|
||||
clearPreviewRowSelection()
|
||||
resetAddressPanelState()
|
||||
if (importFileInputRef.value) {
|
||||
@ -1326,6 +1383,7 @@ function clearImportData() {
|
||||
importPreviewRows.value = []
|
||||
importOrderResult.value = null
|
||||
activePreviewRowKey.value = ''
|
||||
resetPreviewPagination()
|
||||
clearPreviewRowSelection()
|
||||
resetAddressPanelState()
|
||||
if (importFileInputRef.value) {
|
||||
@ -1530,8 +1588,7 @@ async function parseImportPreviewFromFile(file: File) {
|
||||
try {
|
||||
const matched = await lookupStockItemByCode(storeId, itemCode)
|
||||
if (matched?.item_id) {
|
||||
item.item_id = matched.item_id
|
||||
if (!item.item_name) item.item_name = matched.item_name
|
||||
applyMatchedStockToSelectedItem(item, matched)
|
||||
}
|
||||
} catch {
|
||||
// 匹配失败不影响导入
|
||||
@ -1540,6 +1597,8 @@ async function parseImportPreviewFromFile(file: File) {
|
||||
}
|
||||
|
||||
const firstRow = mergedRows[0]
|
||||
syncAllPreviewRowIssues()
|
||||
resetPreviewPagination()
|
||||
if (firstRow) {
|
||||
void selectPreviewRow(firstRow)
|
||||
}
|
||||
@ -1728,6 +1787,7 @@ function applyOrderGroupResult(
|
||||
import_message: apiMessage || '创建失败'
|
||||
}
|
||||
})
|
||||
syncAllPreviewRowIssues()
|
||||
}
|
||||
|
||||
function base64ToBlob(base64: string, mime = 'application/octet-stream') {
|
||||
@ -1894,9 +1954,12 @@ function handlePreviewRowClick(row: ImportPreviewRow) {
|
||||
}
|
||||
|
||||
function selectPreviewRow(row: ImportPreviewRow) {
|
||||
navigatePreviewPageToRow(row)
|
||||
activePreviewRowKey.value = row._rowKey
|
||||
addressPasteText.value = ''
|
||||
selectPreviewRowInTable(row, true)
|
||||
void nextTick(() => {
|
||||
selectPreviewRowInTable(row, true)
|
||||
})
|
||||
}
|
||||
|
||||
function resetAddressPanelState() {
|
||||
@ -1953,6 +2016,7 @@ function createPreviewRowFromParsedAddress(
|
||||
nextRow._source_address = fallbackAddress
|
||||
if (!nextRow.detail_address) nextRow.detail_address = fallbackAddress
|
||||
}
|
||||
refreshRowIssues(nextRow)
|
||||
return nextRow
|
||||
}
|
||||
|
||||
@ -1999,6 +2063,7 @@ async function handleCreateOrderFromAddress() {
|
||||
|
||||
importPreviewRows.value.push(...createdRows)
|
||||
renumberPreviewRows()
|
||||
syncAllPreviewRowIssues()
|
||||
importOrderResult.value = null
|
||||
if (!importOrderFileName.value) {
|
||||
importOrderFileName.value = '手动录入'
|
||||
@ -2059,21 +2124,6 @@ async function handleParseAddress() {
|
||||
parseAddressLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function mapStockPickerItem(row: any) {
|
||||
const itemId = getStockItemId(row)
|
||||
return {
|
||||
...row,
|
||||
item_id: itemId,
|
||||
item_code: String(row?.item_code || row?.goods_code || '').trim(),
|
||||
item_name: String(row?.item_name || row?.product_name || '').trim(),
|
||||
barcode: String(row?.barcode || '').trim()
|
||||
}
|
||||
}
|
||||
|
||||
function getStockItemCode(row: any) {
|
||||
return String(row?.item_code || row?.goods_code || '').trim()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -2180,6 +2230,18 @@ function getStockItemCode(row: any) {
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.preview-table-wrap {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.preview-table-wrap :deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.create-order-right {
|
||||
|
||||
@ -87,16 +87,19 @@
|
||||
<script setup lang="ts">
|
||||
import { nextTick, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { warehouseSearch } from '@/api/stock/stock'
|
||||
import {
|
||||
applyStockMatchToSelectedItem,
|
||||
findStockRowForSelectedItem,
|
||||
getStockItemId,
|
||||
indexStockRowsByLookupKeys,
|
||||
isStockApiSuccess,
|
||||
mapStockPickerItem,
|
||||
queryStockProducts,
|
||||
toOrderSelectedProductItem,
|
||||
type OrderSelectedProductItem
|
||||
} from '../utils/stock-picker-helpers'
|
||||
|
||||
export type SelectProductItem = {
|
||||
item_id?: number
|
||||
item_code: string
|
||||
item_name: string
|
||||
barcode: string
|
||||
plan_qty: string
|
||||
store_id?: number
|
||||
}
|
||||
export type SelectProductItem = OrderSelectedProductItem
|
||||
|
||||
const visible = defineModel<boolean>({ default: false })
|
||||
|
||||
@ -175,206 +178,75 @@ function resetListState() {
|
||||
tableRef.value?.clearSelection?.()
|
||||
}
|
||||
|
||||
function hasValidItemId(item: SelectProductItem) {
|
||||
const itemId = Number(item.item_id)
|
||||
return Number.isInteger(itemId) && itemId > 0
|
||||
}
|
||||
|
||||
function getStockItemId(row: any): number | undefined {
|
||||
const candidates = [
|
||||
row?.item_id,
|
||||
row?.id,
|
||||
row?.store_stock?.item_id,
|
||||
row?.store_stock?.id,
|
||||
row?.stock?.item_id,
|
||||
row?.stock?.id,
|
||||
row?.goods?.item_id,
|
||||
row?.goods?.id
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const itemId = Number(candidate)
|
||||
if (Number.isInteger(itemId) && itemId > 0) return itemId
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function getStockItemCode(row: any) {
|
||||
const candidates = [
|
||||
row?.item_code,
|
||||
row?.goods_code,
|
||||
row?.store_stock?.item_code,
|
||||
row?.store_stock?.goods_code,
|
||||
row?.stock?.item_code,
|
||||
row?.stock?.goods_code,
|
||||
row?.goods?.item_code,
|
||||
row?.goods?.goods_code
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockItemName(row: any) {
|
||||
const candidates = [
|
||||
row?.item_name,
|
||||
row?.product_name,
|
||||
row?.goods_name,
|
||||
row?.name,
|
||||
row?.store_stock?.item_name,
|
||||
row?.store_stock?.product_name,
|
||||
row?.stock?.item_name,
|
||||
row?.goods?.item_name,
|
||||
row?.goods?.product_name
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockBarcode(row: any) {
|
||||
const candidates = [
|
||||
row?.barcode,
|
||||
row?.store_stock?.barcode,
|
||||
row?.stock?.barcode,
|
||||
row?.goods?.barcode
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockStoreId(row: any): number | undefined {
|
||||
const storeId = Number(row?.store_stock?.store_id ?? row?.store_id)
|
||||
return Number.isFinite(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
|
||||
function mapStockPickerItem(row: any) {
|
||||
const itemId = getStockItemId(row)
|
||||
return {
|
||||
...row,
|
||||
item_id: itemId,
|
||||
item_code: getStockItemCode(row),
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row)
|
||||
}
|
||||
}
|
||||
|
||||
function buildSelectedItemFromStock(row: any, planQty: string): SelectProductItem | null {
|
||||
const itemId = getStockItemId(row)
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (!itemId || !itemCode) return null
|
||||
return {
|
||||
item_id: itemId,
|
||||
item_code: itemCode,
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row),
|
||||
plan_qty: planQty || '1',
|
||||
store_id: getStockStoreId(row)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichSelectedItemFromStockRow(item: SelectProductItem, stockRow: any): SelectProductItem {
|
||||
return {
|
||||
...item,
|
||||
item_id: item.item_id || getStockItemId(stockRow),
|
||||
item_code: item.item_code || getStockItemCode(stockRow),
|
||||
item_name: String(item.item_name || '').trim() || getStockItemName(stockRow),
|
||||
barcode: String(item.barcode || '').trim() || getStockBarcode(stockRow),
|
||||
store_id: item.store_id || getStockStoreId(stockRow)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichLocalSelectedItemsFromRows(rows: any[]) {
|
||||
if (!localSelectedItems.value.length || !rows.length) return
|
||||
|
||||
const byId = new Map<number, any>()
|
||||
const byCode = new Map<string, any>()
|
||||
for (const row of rows) {
|
||||
const itemId = getStockItemId(row)
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (itemId) byId.set(itemId, row)
|
||||
if (itemCode) byCode.set(itemCode, row)
|
||||
}
|
||||
|
||||
localSelectedItems.value = localSelectedItems.value.map((item) => {
|
||||
const stockRow =
|
||||
(hasValidItemId(item) ? byId.get(Number(item.item_id)) : undefined)
|
||||
|| (item.item_code ? byCode.get(item.item_code) : undefined)
|
||||
if (!stockRow) return item
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
})
|
||||
}
|
||||
|
||||
async function fetchStockRowsForSelectedItems(items: SelectProductItem[]) {
|
||||
const codes = Array.from(new Set(
|
||||
items
|
||||
.filter((item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim())
|
||||
.map((item) => String(item.item_code).trim())
|
||||
))
|
||||
if (!codes.length) return []
|
||||
|
||||
const requestData: { keyword?: string; store_id?: number } = {
|
||||
keyword: codes.join(',')
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) return []
|
||||
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
return rawList.map(mapStockPickerItem).filter((item: any) => item.item_id)
|
||||
}
|
||||
|
||||
async function enrichLocalSelectedItems() {
|
||||
enrichLocalSelectedItemsFromRows(allRows.value)
|
||||
|
||||
const needsFetch = localSelectedItems.value.some(
|
||||
(item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim()
|
||||
)
|
||||
if (!needsFetch) return
|
||||
|
||||
try {
|
||||
const extraRows = await fetchStockRowsForSelectedItems(localSelectedItems.value)
|
||||
enrichLocalSelectedItemsFromRows(extraRows)
|
||||
} catch (error) {
|
||||
console.error('enrich selected product names failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
function applyPageSlice() {
|
||||
const start = (pagination.currentPage - 1) * pagination.pageSize
|
||||
const end = start + pagination.pageSize
|
||||
list.value = allRows.value.slice(start, end)
|
||||
}
|
||||
|
||||
function hasValidItemId(item: SelectProductItem) {
|
||||
const itemId = Number(item.item_id)
|
||||
return Number.isInteger(itemId) && itemId > 0
|
||||
}
|
||||
|
||||
function buildSelectedItemFromStock(row: any, planQty: string): SelectProductItem | null {
|
||||
return toOrderSelectedProductItem(row, { planQty })
|
||||
}
|
||||
|
||||
function enrichLocalSelectedItemsFromRows(rows: any[]) {
|
||||
if (!localSelectedItems.value.length || !rows.length) return
|
||||
|
||||
const indexes = indexStockRowsByLookupKeys(rows)
|
||||
localSelectedItems.value = localSelectedItems.value.map((item) => {
|
||||
const stockRow = findStockRowForSelectedItem(item, indexes)
|
||||
if (!stockRow) return item
|
||||
return applyStockMatchToSelectedItem(item, stockRow)
|
||||
})
|
||||
}
|
||||
|
||||
function needsStockMatchEnrichment(item: SelectProductItem) {
|
||||
const displayCode = String(item.item_code || '').trim()
|
||||
if (!displayCode) return false
|
||||
return !hasValidItemId(item) || !String(item.item_name || '').trim()
|
||||
}
|
||||
|
||||
async function enrichLocalSelectedItems() {
|
||||
enrichLocalSelectedItemsFromRows(allRows.value)
|
||||
|
||||
const pendingItems = localSelectedItems.value.filter((item) => needsStockMatchEnrichment(item))
|
||||
if (!pendingItems.length) return
|
||||
|
||||
const codes = Array.from(new Set(
|
||||
pendingItems.map((item) => String(item.item_code).trim()).filter(Boolean)
|
||||
))
|
||||
if (!codes.length) return
|
||||
|
||||
try {
|
||||
const { res, list: rawList } = await queryStockProducts({
|
||||
keyword: codes.join(','),
|
||||
storeId: props.storeId
|
||||
})
|
||||
if (!isStockApiSuccess(res)) return
|
||||
|
||||
const matchedRows = rawList.map(mapStockPickerItem).filter((item: any) => item.item_id)
|
||||
enrichLocalSelectedItemsFromRows(matchedRows)
|
||||
} catch (error) {
|
||||
console.error('enrich selected product names failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const requestData: { keyword?: string; store_id?: number } = {}
|
||||
const normalizedKeyword = keyword.value.trim()
|
||||
if (normalizedKeyword) {
|
||||
requestData.keyword = normalizedKeyword
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
const { res, list: rawList } = await queryStockProducts({
|
||||
keyword: keyword.value.trim(),
|
||||
storeId: props.storeId
|
||||
})
|
||||
if (!isStockApiSuccess(res)) {
|
||||
resetListState()
|
||||
ElMessage.error(res?.message || '查询商品失败')
|
||||
return
|
||||
}
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
allRows.value = rawList.map(mapStockPickerItem).filter((item: any) => item.item_id)
|
||||
pagination.total = allRows.value.length
|
||||
const maxPage = Math.max(1, Math.ceil(pagination.total / pagination.pageSize))
|
||||
@ -436,14 +308,11 @@ function applySelectedItems(selections: any[]) {
|
||||
}
|
||||
return selectedIdsInTable.has(Number(item.item_id))
|
||||
}).map((item) => {
|
||||
if (!String(item.item_name || '').trim()) {
|
||||
const stockRow = allRows.value.find((row) => {
|
||||
const itemId = getStockItemId(row)
|
||||
return (hasValidItemId(item) && itemId === Number(item.item_id))
|
||||
|| (item.item_code && getStockItemCode(row) === item.item_code)
|
||||
})
|
||||
if (!String(item.item_name || '').trim() || !hasValidItemId(item)) {
|
||||
const indexes = indexStockRowsByLookupKeys(allRows.value)
|
||||
const stockRow = findStockRowForSelectedItem(item, indexes)
|
||||
if (stockRow) {
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
return applyStockMatchToSelectedItem(item, stockRow)
|
||||
}
|
||||
}
|
||||
return item
|
||||
|
||||
@ -1170,8 +1170,11 @@ export const deliverybuttonList: any[] = [
|
||||
]
|
||||
|
||||
/** deliveryOrder */
|
||||
export const deliveryOrderToolbarButtonKeys = simpleListToolbarButtonKeys
|
||||
export const deliveryOrderToolbarButtons = simpleListToolbarButtons
|
||||
export const deliveryOrderToolbarButtonKeys = [
|
||||
...simpleListToolbarButtonKeys,
|
||||
'batchPrint',
|
||||
]
|
||||
export const deliveryOrderToolbarButtons = pickToolbarButtons(deliveryOrderToolbarButtonKeys)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -192,6 +192,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<wave-platform-print-preview-dialog
|
||||
v-model="batchPrintDialogVisible"
|
||||
:error-message="batchPrintErrorMessage"
|
||||
:payload="batchPrintPayload"
|
||||
:request-meta="batchPrintRequestMeta"
|
||||
@refresh="handleBatchPrintRefresh"
|
||||
@print-success="onBatchPrintSuccess"
|
||||
/>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
@ -230,14 +239,15 @@ import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import WavePlatformPrintPreviewDialog from '@/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { buildOrderWhereConditions, parseOrderListResponse, resolveOrderRecheckStatus } from './utils/order-index-helpers'
|
||||
import { useOrderListPageCleanup } from './utils/use-order-list-page-cleanup'
|
||||
import { useOrderBatchPrint } from './utils/use-order-batch-print'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
const presetTree = ref<any[]>([])
|
||||
@ -296,7 +306,28 @@ onMounted(() => {
|
||||
loadOrderMetaOptions()
|
||||
})
|
||||
|
||||
useOrderListPageCleanup({ list, selectionRows, selectedOrderId })
|
||||
const {
|
||||
batchPrintDialogVisible,
|
||||
batchPrintLoading,
|
||||
batchPrintErrorMessage,
|
||||
batchPrintPayload,
|
||||
batchPrintRequestMeta,
|
||||
resetBatchPrintState,
|
||||
handleBatchPrint,
|
||||
handleBatchPrintRefresh,
|
||||
onBatchPrintSuccess
|
||||
} = useOrderBatchPrint({
|
||||
getSelectionRows: () => selectionRows.value,
|
||||
onPrintSuccess: () => loadData(),
|
||||
emptySelectionMessage: '请先勾选需要批量打印的订单'
|
||||
})
|
||||
|
||||
useOrderListPageCleanup({
|
||||
list,
|
||||
selectionRows,
|
||||
selectedOrderId,
|
||||
onCleanup: resetBatchPrintState
|
||||
})
|
||||
|
||||
function normalizeOptionValue(value: unknown) {
|
||||
return String(value ?? '').trim()
|
||||
@ -460,7 +491,8 @@ function openColumnConfigPanel() {
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
batchPrintLoading: batchPrintLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
@ -487,6 +519,8 @@ const { actionMap: toolbarActionMap } = createSimpleListToolbarController({
|
||||
toggleDetailVisible
|
||||
})
|
||||
|
||||
toolbarActionMap.handleBatchPrint = handleBatchPrint
|
||||
|
||||
function resolveButtonLoading(loadingKey?: string) {
|
||||
if (!loadingKey) return false
|
||||
return Boolean(buttonLoadingMap.value[loadingKey])
|
||||
|
||||
@ -360,21 +360,17 @@ import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { buildOrderWhereConditions, parseOrderListResponse, resolveOrderRecheckStatus } from './utils/order-index-helpers'
|
||||
import { useOrderListPageCleanup } from './utils/use-order-list-page-cleanup'
|
||||
import { useOrderBatchPrint } from './utils/use-order-batch-print'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue'
|
||||
import { createPendingToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import QrcodeDialog from '@/components/QR/qrcode.vue'
|
||||
import WavePlatformPrintPreviewDialog from '@/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue'
|
||||
import { getOrderPrintData } from '@/api/order.print/orderprint'
|
||||
import type { WavePlatformPrintDataPayload } from '@/api/order.print/orderprint'
|
||||
import { unwrapWavePlatformPrintPayload } from '@/views/order/waveOrder/config/wave-config'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
|
||||
defaultLowerPercent: 38,
|
||||
@ -404,12 +400,6 @@ const columns = ref(buildPendingStyleColumns())
|
||||
const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
|
||||
// 批量打印
|
||||
const batchPrintDialogVisible = ref(false)
|
||||
const batchPrintLoading = ref(false)
|
||||
const batchPrintErrorMessage = ref('')
|
||||
const batchPrintPayload = ref<WavePlatformPrintDataPayload | null>(null)
|
||||
const batchPrintRequestMeta = ref<{ warehouse_id: number; wave_ids: Array<number | string> } | null>(null)
|
||||
const selectedOrderId = ref<number | string | null>(null)
|
||||
const detailVisible = ref(true)
|
||||
|
||||
@ -470,14 +460,26 @@ onUnmounted(() => {
|
||||
unregisterCreateOrderSuccess(loadData)
|
||||
})
|
||||
|
||||
const {
|
||||
batchPrintDialogVisible,
|
||||
batchPrintLoading,
|
||||
batchPrintErrorMessage,
|
||||
batchPrintPayload,
|
||||
batchPrintRequestMeta,
|
||||
resetBatchPrintState,
|
||||
handleBatchPrint,
|
||||
handleBatchPrintRefresh,
|
||||
onBatchPrintSuccess
|
||||
} = useOrderBatchPrint({
|
||||
getSelectionRows: () => selectionRows.value,
|
||||
onPrintSuccess: () => loadData()
|
||||
})
|
||||
|
||||
useOrderListPageCleanup({
|
||||
list,
|
||||
selectionRows,
|
||||
selectedOrderId,
|
||||
onCleanup: () => {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintRequestMeta.value = null
|
||||
}
|
||||
onCleanup: resetBatchPrintState
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
@ -705,76 +707,6 @@ const {
|
||||
// 注册批量打印处理函数
|
||||
toolbarActionMap['handleBatchPrint'] = handleBatchPrint
|
||||
|
||||
async function handleBatchPrint() {
|
||||
const rows = selectionRows.value
|
||||
if (!rows.length) {
|
||||
ElMessage.warning('请先勾选需要批量打印的订单')
|
||||
return
|
||||
}
|
||||
if (batchPrintLoading.value) return
|
||||
|
||||
const orderIds: Array<number | string> = []
|
||||
for (const row of rows) {
|
||||
const id = row?.id
|
||||
if (id !== undefined && id !== null && id !== '') {
|
||||
orderIds.push(id)
|
||||
}
|
||||
}
|
||||
if (!orderIds.length) {
|
||||
ElMessage.warning('当前勾选记录缺少可用的订单 ID')
|
||||
return
|
||||
}
|
||||
|
||||
const warehouseId = Number(rows[0]?.warehouse_id ?? userStore.user?.warehouse_id ?? userStore.user?.store_id)
|
||||
if (!Number.isFinite(warehouseId) || warehouseId <= 0) {
|
||||
ElMessage.error('无法确定仓库 ID,请确认列表中的仓库字段或当前登录仓库上下文')
|
||||
return
|
||||
}
|
||||
|
||||
batchPrintRequestMeta.value = { warehouse_id: warehouseId, wave_ids: orderIds }
|
||||
batchPrintErrorMessage.value = ''
|
||||
batchPrintPayload.value = null
|
||||
batchPrintLoading.value = true
|
||||
try {
|
||||
const res: any = await getOrderPrintData({ order_ids: orderIds })
|
||||
if (res?.code !== undefined && res?.code !== null && res?.code !== 1 && res?.code !== 200 && res?.code !== 0) {
|
||||
throw new Error(res?.message || '获取打印数据失败')
|
||||
}
|
||||
batchPrintPayload.value = unwrapWavePlatformPrintPayload(res)
|
||||
batchPrintDialogVisible.value = true
|
||||
ElMessage.success(res?.message || '已获取打印数据')
|
||||
} catch (error: any) {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintErrorMessage.value = error?.message || '获取打印数据失败'
|
||||
batchPrintDialogVisible.value = true
|
||||
ElMessage.error(batchPrintErrorMessage.value)
|
||||
} finally {
|
||||
batchPrintLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBatchPrintRefresh() {
|
||||
const meta = batchPrintRequestMeta.value
|
||||
if (!meta) return
|
||||
try {
|
||||
const res: any = await getOrderPrintData({ order_ids: meta.wave_ids })
|
||||
if (res?.code !== undefined && res?.code !== null && res?.code !== 1 && res?.code !== 200 && res?.code !== 0) {
|
||||
throw new Error(res?.message || '刷新打印数据失败')
|
||||
}
|
||||
batchPrintPayload.value = unwrapWavePlatformPrintPayload(res)
|
||||
batchPrintErrorMessage.value = ''
|
||||
} catch (error: any) {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintErrorMessage.value = error?.message || '刷新打印数据失败'
|
||||
ElMessage.error(batchPrintErrorMessage.value)
|
||||
}
|
||||
}
|
||||
|
||||
function onBatchPrintSuccess() {
|
||||
// 打印成功后刷新列表
|
||||
loadData()
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
|
||||
275
src/views/order/orderManagement/utils/stock-picker-helpers.ts
Normal file
275
src/views/order/orderManagement/utils/stock-picker-helpers.ts
Normal file
@ -0,0 +1,275 @@
|
||||
import { warehouseSearch } from '@/api/stock/stock'
|
||||
|
||||
export type OrderSelectedProductItem = {
|
||||
item_id?: number
|
||||
item_code: string
|
||||
item_name: string
|
||||
barcode: string
|
||||
plan_qty: string
|
||||
store_id?: number
|
||||
}
|
||||
|
||||
export function isStockApiSuccess(res: any) {
|
||||
return !!res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
}
|
||||
|
||||
export function buildWarehouseSearchRequest(options: {
|
||||
keyword?: string
|
||||
storeId?: number
|
||||
withStock?: boolean
|
||||
isBatch?: boolean
|
||||
}) {
|
||||
const requestData: {
|
||||
keyword?: string
|
||||
store_id?: number
|
||||
with_stock?: boolean
|
||||
is_batch?: boolean
|
||||
} = {}
|
||||
const normalizedKeyword = String(options.keyword || '').trim()
|
||||
if (normalizedKeyword) {
|
||||
requestData.keyword = normalizedKeyword
|
||||
}
|
||||
if (options.storeId) {
|
||||
requestData.store_id = options.storeId
|
||||
}
|
||||
if (options.withStock === true) {
|
||||
requestData.with_stock = true
|
||||
}
|
||||
if (options.isBatch === true) {
|
||||
requestData.is_batch = true
|
||||
}
|
||||
return requestData
|
||||
}
|
||||
|
||||
/** stock.warehouse.search 响应:data 为数组,total 为本次返回条数(≤50) */
|
||||
export function parseStockWarehouseSearch(res: any): { list: any[]; total: number } {
|
||||
if (!isStockApiSuccess(res)) {
|
||||
return { list: [], total: 0 }
|
||||
}
|
||||
const list = Array.isArray(res?.data) ? res.data : []
|
||||
const total = Number(res?.total ?? list.length)
|
||||
return { list, total }
|
||||
}
|
||||
|
||||
export async function queryStockProducts(options: {
|
||||
keyword?: string
|
||||
storeId?: number
|
||||
withStock?: boolean
|
||||
isBatch?: boolean
|
||||
}) {
|
||||
const requestData = buildWarehouseSearchRequest(options)
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
return { res, ...parseStockWarehouseSearch(res) }
|
||||
}
|
||||
|
||||
export function getStockItemId(row: any): number | undefined {
|
||||
const candidates = [
|
||||
row?.item_id,
|
||||
row?.id,
|
||||
row?.store_stock?.item_id,
|
||||
row?.store_stock?.id,
|
||||
row?.stock?.item_id,
|
||||
row?.stock?.id,
|
||||
row?.goods?.item_id,
|
||||
row?.goods?.id
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const itemId = Number(candidate)
|
||||
if (Number.isInteger(itemId) && itemId > 0) return itemId
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
export function getStockItemCode(row: any) {
|
||||
const candidates = [
|
||||
row?.item_code,
|
||||
row?.goods_code,
|
||||
row?.store_stock?.item_code,
|
||||
row?.store_stock?.goods_code,
|
||||
row?.stock?.item_code,
|
||||
row?.stock?.goods_code,
|
||||
row?.goods?.item_code,
|
||||
row?.goods?.goods_code
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text && text.toLowerCase() !== 'null') return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
export function getStockBarcodes(row: any): string[] {
|
||||
const arrayCandidates = [
|
||||
row?.barcodes,
|
||||
row?.store_stock?.barcodes,
|
||||
row?.stock?.barcodes,
|
||||
row?.goods?.barcodes
|
||||
]
|
||||
for (const candidate of arrayCandidates) {
|
||||
if (!Array.isArray(candidate)) continue
|
||||
const values = candidate.map((value) => String(value ?? '').trim()).filter(Boolean)
|
||||
if (values.length) return values
|
||||
}
|
||||
|
||||
const singleCandidates = [
|
||||
row?.barcode,
|
||||
row?.store_stock?.barcode,
|
||||
row?.stock?.barcode,
|
||||
row?.goods?.barcode
|
||||
]
|
||||
for (const candidate of singleCandidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return [text]
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
export function getStockBarcode(row: any) {
|
||||
const barcodes = getStockBarcodes(row)
|
||||
return barcodes[0] || ''
|
||||
}
|
||||
|
||||
export function getStockStoreId(row: any): number | undefined {
|
||||
const storeId = Number(row?.store_stock?.store_id ?? row?.store_id)
|
||||
return Number.isFinite(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
|
||||
export function getStockItemName(row: any) {
|
||||
const candidates = [
|
||||
row?.item_name,
|
||||
row?.product_name,
|
||||
row?.goods_name,
|
||||
row?.name,
|
||||
row?.store_stock?.item_name,
|
||||
row?.store_stock?.product_name,
|
||||
row?.stock?.item_name,
|
||||
row?.goods?.item_name,
|
||||
row?.goods?.product_name
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
export function mapStockPickerItem(row: any) {
|
||||
const itemId = getStockItemId(row)
|
||||
return {
|
||||
...row,
|
||||
item_id: itemId,
|
||||
item_code: getStockItemCode(row),
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row)
|
||||
}
|
||||
}
|
||||
|
||||
export function stockRowMatchesKeyword(row: any, keyword: string) {
|
||||
const normalized = String(keyword || '').trim().toLowerCase()
|
||||
if (!normalized) return false
|
||||
|
||||
const itemId = getStockItemId(row)
|
||||
if (itemId && String(itemId) === normalized) return true
|
||||
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (itemCode && itemCode.toLowerCase() === normalized) return true
|
||||
|
||||
return getStockBarcodes(row).some((barcode) => barcode.toLowerCase() === normalized)
|
||||
}
|
||||
|
||||
/** 在 stock.warehouse.search 结果中按编码/条码/id 定位商品 */
|
||||
export function findStockRowByKeyword(list: any[], keyword: string) {
|
||||
const normalized = String(keyword || '').trim()
|
||||
if (!normalized || !list.length) return undefined
|
||||
|
||||
const mappedList = list.map((row) => (getStockItemId(row) ? mapStockPickerItem(row) : row))
|
||||
const direct = mappedList.find((row) => stockRowMatchesKeyword(row, normalized))
|
||||
if (direct) return direct
|
||||
return mappedList.length === 1 ? mappedList[0] : undefined
|
||||
}
|
||||
|
||||
/** 将搜索命中结果转为建单所需商品字段,保留用户输入的展示编码 */
|
||||
export function toOrderSelectedProductItem(
|
||||
stockRow: any,
|
||||
options: { displayCode?: string; planQty?: string } = {}
|
||||
): OrderSelectedProductItem | null {
|
||||
const mapped = mapStockPickerItem(stockRow)
|
||||
const itemId = mapped.item_id
|
||||
if (!itemId) return null
|
||||
|
||||
const displayCode = String(options.displayCode || '').trim() || mapped.item_code
|
||||
return {
|
||||
item_id: itemId,
|
||||
item_code: displayCode,
|
||||
item_name: mapped.item_name,
|
||||
barcode: mapped.barcode,
|
||||
plan_qty: String(options.planQty || '1').trim() || '1',
|
||||
store_id: getStockStoreId(stockRow)
|
||||
}
|
||||
}
|
||||
|
||||
export function applyStockMatchToSelectedItem<T extends OrderSelectedProductItem>(item: T, stockRow: any): T {
|
||||
const mapped = mapStockPickerItem(stockRow)
|
||||
const displayCode = String(item.item_code || '').trim()
|
||||
|
||||
return {
|
||||
...item,
|
||||
item_id: mapped.item_id || item.item_id,
|
||||
item_code: displayCode || mapped.item_code,
|
||||
item_name: String(item.item_name || '').trim() || mapped.item_name,
|
||||
barcode: String(item.barcode || '').trim() || mapped.barcode,
|
||||
store_id: getStockStoreId(stockRow) || item.store_id
|
||||
}
|
||||
}
|
||||
|
||||
export async function lookupStockProductByKeyword(storeId: number | undefined, keyword: string) {
|
||||
const normalizedKeyword = String(keyword || '').trim()
|
||||
if (!normalizedKeyword) return null
|
||||
|
||||
const { res, list } = await queryStockProducts({
|
||||
keyword: normalizedKeyword,
|
||||
storeId
|
||||
})
|
||||
if (!isStockApiSuccess(res)) return null
|
||||
|
||||
const matched = findStockRowByKeyword(list, normalizedKeyword)
|
||||
if (!matched) return null
|
||||
|
||||
return toOrderSelectedProductItem(matched, { displayCode: normalizedKeyword })
|
||||
}
|
||||
|
||||
export function indexStockRowsByLookupKeys(rows: any[]) {
|
||||
const byId = new Map<number, any>()
|
||||
const byCode = new Map<string, any>()
|
||||
const byBarcode = new Map<string, any>()
|
||||
|
||||
for (const row of rows) {
|
||||
const mapped = getStockItemId(row) ? mapStockPickerItem(row) : row
|
||||
const itemId = getStockItemId(mapped)
|
||||
const itemCode = getStockItemCode(mapped)
|
||||
if (itemId) byId.set(itemId, mapped)
|
||||
if (itemCode) byCode.set(itemCode, mapped)
|
||||
for (const barcode of getStockBarcodes(mapped)) {
|
||||
byBarcode.set(barcode, mapped)
|
||||
}
|
||||
}
|
||||
|
||||
return { byId, byCode, byBarcode }
|
||||
}
|
||||
|
||||
export function findStockRowForSelectedItem(
|
||||
item: Pick<OrderSelectedProductItem, 'item_id' | 'item_code'>,
|
||||
indexes: ReturnType<typeof indexStockRowsByLookupKeys>
|
||||
) {
|
||||
const displayCode = String(item.item_code || '').trim()
|
||||
const itemId = Number(item.item_id)
|
||||
|
||||
if (Number.isInteger(itemId) && itemId > 0) {
|
||||
const byId = indexes.byId.get(itemId)
|
||||
if (byId) return byId
|
||||
}
|
||||
if (displayCode) {
|
||||
return indexes.byCode.get(displayCode) || indexes.byBarcode.get(displayCode)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
123
src/views/order/orderManagement/utils/use-order-batch-print.ts
Normal file
123
src/views/order/orderManagement/utils/use-order-batch-print.ts
Normal file
@ -0,0 +1,123 @@
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getOrderPrintData } from '@/api/order.print/orderprint'
|
||||
import type { WavePlatformPrintDataPayload } from '@/api/order.print/orderprint'
|
||||
import { unwrapWavePlatformPrintPayload } from '@/views/order/waveOrder/config/wave-config'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
|
||||
type OrderBatchPrintRequestMeta = {
|
||||
warehouse_id: number
|
||||
wave_ids: Array<number | string>
|
||||
}
|
||||
|
||||
type UseOrderBatchPrintOptions = {
|
||||
getSelectionRows: () => any[]
|
||||
onPrintSuccess?: () => void
|
||||
emptySelectionMessage?: string
|
||||
}
|
||||
|
||||
function isOrderPrintApiSuccess(code: unknown) {
|
||||
return code === undefined || code === null || code === 1 || code === 200 || code === 0
|
||||
}
|
||||
|
||||
function collectOrderIdsFromRows(rows: any[]) {
|
||||
const orderIds: Array<number | string> = []
|
||||
for (const row of rows) {
|
||||
const id = row?.id
|
||||
if (id !== undefined && id !== null && id !== '') {
|
||||
orderIds.push(id)
|
||||
}
|
||||
}
|
||||
return orderIds
|
||||
}
|
||||
|
||||
export function useOrderBatchPrint(options: UseOrderBatchPrintOptions) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
const batchPrintDialogVisible = ref(false)
|
||||
const batchPrintLoading = ref(false)
|
||||
const batchPrintErrorMessage = ref('')
|
||||
const batchPrintPayload = ref<WavePlatformPrintDataPayload | null>(null)
|
||||
const batchPrintRequestMeta = ref<OrderBatchPrintRequestMeta | null>(null)
|
||||
|
||||
function resetBatchPrintState() {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintRequestMeta.value = null
|
||||
batchPrintErrorMessage.value = ''
|
||||
}
|
||||
|
||||
async function handleBatchPrint() {
|
||||
const rows = options.getSelectionRows()
|
||||
if (!rows.length) {
|
||||
ElMessage.warning(options.emptySelectionMessage || '请先勾选需要批量打印的订单')
|
||||
return
|
||||
}
|
||||
if (batchPrintLoading.value) return
|
||||
|
||||
const orderIds = collectOrderIdsFromRows(rows)
|
||||
if (!orderIds.length) {
|
||||
ElMessage.warning('当前勾选记录缺少可用的订单 ID')
|
||||
return
|
||||
}
|
||||
|
||||
const warehouseId = Number(rows[0]?.warehouse_id ?? userStore.user?.warehouse_id ?? userStore.user?.store_id)
|
||||
if (!Number.isFinite(warehouseId) || warehouseId <= 0) {
|
||||
ElMessage.error('无法确定仓库 ID,请确认列表中的仓库字段或当前登录仓库上下文')
|
||||
return
|
||||
}
|
||||
|
||||
batchPrintRequestMeta.value = { warehouse_id: warehouseId, wave_ids: orderIds }
|
||||
batchPrintErrorMessage.value = ''
|
||||
batchPrintPayload.value = null
|
||||
batchPrintLoading.value = true
|
||||
try {
|
||||
const res: any = await getOrderPrintData({ order_ids: orderIds })
|
||||
if (!isOrderPrintApiSuccess(res?.code)) {
|
||||
throw new Error(res?.message || '获取打印数据失败')
|
||||
}
|
||||
batchPrintPayload.value = unwrapWavePlatformPrintPayload(res)
|
||||
batchPrintDialogVisible.value = true
|
||||
ElMessage.success(res?.message || '已获取打印数据')
|
||||
} catch (error: any) {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintErrorMessage.value = error?.message || '获取打印数据失败'
|
||||
batchPrintDialogVisible.value = true
|
||||
ElMessage.error(batchPrintErrorMessage.value)
|
||||
} finally {
|
||||
batchPrintLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBatchPrintRefresh() {
|
||||
const meta = batchPrintRequestMeta.value
|
||||
if (!meta) return
|
||||
try {
|
||||
const res: any = await getOrderPrintData({ order_ids: meta.wave_ids })
|
||||
if (!isOrderPrintApiSuccess(res?.code)) {
|
||||
throw new Error(res?.message || '刷新打印数据失败')
|
||||
}
|
||||
batchPrintPayload.value = unwrapWavePlatformPrintPayload(res)
|
||||
batchPrintErrorMessage.value = ''
|
||||
} catch (error: any) {
|
||||
batchPrintPayload.value = null
|
||||
batchPrintErrorMessage.value = error?.message || '刷新打印数据失败'
|
||||
ElMessage.error(batchPrintErrorMessage.value)
|
||||
}
|
||||
}
|
||||
|
||||
function onBatchPrintSuccess() {
|
||||
options.onPrintSuccess?.()
|
||||
}
|
||||
|
||||
return {
|
||||
batchPrintDialogVisible,
|
||||
batchPrintLoading,
|
||||
batchPrintErrorMessage,
|
||||
batchPrintPayload,
|
||||
batchPrintRequestMeta,
|
||||
resetBatchPrintState,
|
||||
handleBatchPrint,
|
||||
handleBatchPrintRefresh,
|
||||
onBatchPrintSuccess
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-05 09:15:19",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-20 08:59:09",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-09 09:52:14",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-06-03 16:55:40",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-25 17:05:16",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-15 17:32:36",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-12 15:55:40",
|
||||
"updatedAt": "2026-06-13 17:11:23",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-12 15:55:40",
|
||||
"generatedAtLocal": "2026-06-12 15:55:40",
|
||||
"generatedAt": "2026-06-13 17:11:23",
|
||||
"generatedAtLocal": "2026-06-13 17:11:23",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user