Compare commits
No commits in common. "b31eef97c2d807c6cc5c620dfe3eb01b4440e924" and "0b00014427bdbc5aa75e02a3f92c8ed77d10cd8a" have entirely different histories.
b31eef97c2
...
0b00014427
@ -15,11 +15,11 @@
|
|||||||
<div class="app-info">
|
<div class="app-info">
|
||||||
<div class="app-name">WMS PDA端</div>
|
<div class="app-name">WMS PDA端</div>
|
||||||
<div class="app-version" v-if="pdaData">V {{ pdaData.version }}</div>
|
<div class="app-version" v-if="pdaData">V {{ pdaData.version }}</div>
|
||||||
<div class="app-date" v-if="pdaData">{{ formatDate(pdaData.publishedAtUtc) }}</div>
|
<div class="app-date" v-if="pdaData">{{ formatDate(pdaData.publishedAt) }}</div>
|
||||||
<div class="app-error" v-if="pdaError">获取版本信息失败</div>
|
<div class="app-error" v-if="pdaError">获取版本信息失败</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="app-action">
|
<div class="app-action">
|
||||||
<el-button type="primary" size="small" :disabled="!pdaData?.url" @click="showQrCode('扫描二维码下载 PDA', pdaData?.url)">
|
<el-button type="primary" size="small" :disabled="!pdaData?.downloadUrl" @click="showQrCode('扫描二维码下载 PDA', pdaData?.downloadUrl)">
|
||||||
下载
|
下载
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -116,16 +116,13 @@ import dayjs from 'dayjs'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
|
|
||||||
/**
|
|
||||||
* PDA(WMS PDA 端)版本信息
|
|
||||||
* 字段与 `pda/latest.json` 保持一致:{ version, file, url, sha256, publishedAtUtc }
|
|
||||||
*/
|
|
||||||
interface PdaVersionInfo {
|
interface PdaVersionInfo {
|
||||||
version: string
|
version: string
|
||||||
file: string
|
versionName: string
|
||||||
url: string
|
downloadUrl: string
|
||||||
sha256?: string
|
fileName: string
|
||||||
publishedAtUtc: string
|
forceUpdate: boolean
|
||||||
|
publishedAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PrintServerVersionInfo {
|
interface PrintServerVersionInfo {
|
||||||
|
|||||||
@ -72,7 +72,6 @@
|
|||||||
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { warehouseSearch, stockWarehouse } from '@/api/stock/stock'
|
import { warehouseSearch, stockWarehouse } from '@/api/stock/stock'
|
||||||
import { buildStockQuery } from '@/utils/stockQueryBuilder'
|
|
||||||
import {
|
import {
|
||||||
isStockApiSuccess,
|
isStockApiSuccess,
|
||||||
parseStockWarehouseSearch,
|
parseStockWarehouseSearch,
|
||||||
@ -194,8 +193,8 @@ function formatRowLabel(item: StockPickerItem): string {
|
|||||||
async function loadInitialList() {
|
async function loadInitialList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// where 统一按 stock.warehouse.list 规范:{ 字段: { operator, value, type } }
|
const where: Record<string, unknown> = {}
|
||||||
const where = buildStockQuery(props.storeId ? { store_id: props.storeId } : {})
|
if (props.storeId) where.store_id = props.storeId
|
||||||
const res: any = await stockWarehouse({ page: 1, pageSize: PICKER_LIST_PAGE_SIZE }, where)
|
const res: any = await stockWarehouse({ page: 1, pageSize: PICKER_LIST_PAGE_SIZE }, where)
|
||||||
if (!isStockApiSuccess(res)) {
|
if (!isStockApiSuccess(res)) {
|
||||||
list.value = []
|
list.value = []
|
||||||
|
|||||||
@ -60,7 +60,6 @@
|
|||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { stockWarehouse, warehouseSearch } from '@/api/stock/stock'
|
import { stockWarehouse, warehouseSearch } from '@/api/stock/stock'
|
||||||
import { buildStockQuery } from '@/utils/stockQueryBuilder'
|
|
||||||
import { isComboGoodsApiSuccess, parseStockWarehouseListResponse } from '../combo-stock-config'
|
import { isComboGoodsApiSuccess, parseStockWarehouseListResponse } from '../combo-stock-config'
|
||||||
import {
|
import {
|
||||||
getStockItemCode,
|
getStockItemCode,
|
||||||
@ -136,8 +135,10 @@ function mapRows(rawList: unknown[]): ComboStockPickerItem[] {
|
|||||||
async function loadInitialList() {
|
async function loadInitialList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// where 统一按 stock.warehouse.list 规范:{ 字段: { operator, value, type } }
|
const where: Record<string, unknown> = {}
|
||||||
const where = buildStockQuery(props.storeId ? { store_id: props.storeId } : {})
|
if (props.storeId) {
|
||||||
|
where.store_id = props.storeId
|
||||||
|
}
|
||||||
const res: any = await stockWarehouse({ page: 1, pageSize: PICKER_LIST_PAGE_SIZE }, where)
|
const res: any = await stockWarehouse({ page: 1, pageSize: PICKER_LIST_PAGE_SIZE }, where)
|
||||||
if (!isComboGoodsApiSuccess(res)) {
|
if (!isComboGoodsApiSuccess(res)) {
|
||||||
list.value = []
|
list.value = []
|
||||||
|
|||||||
@ -297,8 +297,6 @@ import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/o
|
|||||||
import { getStatusTextClass } from '@/views/order/orderManagement/config/order-common-config'
|
import { getStatusTextClass } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
import { useAsyncExportTask } from '@/composables/useAsyncExportTask'
|
import { useAsyncExportTask } from '@/composables/useAsyncExportTask'
|
||||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||||
import { buildStockQuery } from '@/utils/stockQueryBuilder'
|
|
||||||
import { stockScanField } from '@/views/stock/stock/stock-config'
|
|
||||||
|
|
||||||
// ─── 列表列配置 ─────────────────────────────────────────────────────────────
|
// ─── 列表列配置 ─────────────────────────────────────────────────────────────
|
||||||
const columns = [
|
const columns = [
|
||||||
@ -327,113 +325,119 @@ const columns = [
|
|||||||
{ prop: 'update_at_display', label: '更新时间', width: 160, sortable: true }
|
{ prop: 'update_at_display', label: '更新时间', width: 160, sortable: true }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ─── 筛选字段配置(字段结构与系统商品页 stock/stock 保持一致)────────────────
|
// ─── 筛选字段配置 ─────────────────────────────────────────────────────────
|
||||||
const availableFields: any[] = [
|
const availableFields: any[] = [
|
||||||
// ===== 商品标识 =====
|
{
|
||||||
stockScanField('product', {
|
label: '关键词',
|
||||||
value: 'id',
|
value: 'keyword',
|
||||||
label: 'SKU',
|
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: '请输入SKU',
|
operators: ['like'],
|
||||||
operators: ['eq', 'contains'],
|
placeholder: '商品编码/名称/条码',
|
||||||
defaultOperator: 'eq'
|
group: '基础信息'
|
||||||
}),
|
},
|
||||||
stockScanField('product', {
|
{
|
||||||
value: 'item_code',
|
|
||||||
label: '商品编码',
|
|
||||||
type: 'text',
|
|
||||||
placeholder: '请输入商品编码',
|
|
||||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
|
||||||
defaultOperator: 'eq'
|
|
||||||
}),
|
|
||||||
stockScanField('product', {
|
|
||||||
value: 'goods_code',
|
|
||||||
label: '货物编码',
|
|
||||||
type: 'text',
|
|
||||||
placeholder: '请输入货物编码',
|
|
||||||
operators: ['eq', 'ne', 'contains'],
|
|
||||||
defaultOperator: 'eq'
|
|
||||||
}),
|
|
||||||
|
|
||||||
// ===== 商品信息 =====
|
|
||||||
stockScanField('info', {
|
|
||||||
value: 'item_name',
|
|
||||||
label: '商品名称',
|
label: '商品名称',
|
||||||
|
value: 'item_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: '请输入商品名称',
|
group: '基础信息'
|
||||||
operators: ['eq', 'ne', 'contains'],
|
},
|
||||||
defaultOperator: 'eq'
|
{
|
||||||
}),
|
|
||||||
stockScanField('info', {
|
|
||||||
value: 'barcode',
|
|
||||||
label: '条码',
|
|
||||||
type: 'text',
|
|
||||||
placeholder: '请输入商品条码',
|
|
||||||
operators: ['eq', 'contains'],
|
|
||||||
defaultOperator: 'eq'
|
|
||||||
}),
|
|
||||||
stockScanField('info', {
|
|
||||||
value: 'brand_name',
|
|
||||||
label: '品牌',
|
label: '品牌',
|
||||||
|
value: 'brand_name',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: '请输入品牌',
|
group: '基础信息'
|
||||||
operators: ['eq', 'ne', 'contains', 'startswith', 'endswith'],
|
},
|
||||||
defaultOperator: 'eq'
|
{
|
||||||
}),
|
label: '条码',
|
||||||
|
value: 'goods_code',
|
||||||
// ===== 商品属性 =====
|
type: 'text',
|
||||||
stockScanField('attribute', {
|
group: '基础信息'
|
||||||
value: 'is_images',
|
},
|
||||||
label: '是否有图片',
|
{
|
||||||
type: 'boolean'
|
label: 'SKU',
|
||||||
}),
|
value: 'id',
|
||||||
stockScanField('attribute', {
|
type: 'text',
|
||||||
value: 'has_bound_item',
|
group: '基础信息'
|
||||||
label: '外部商品绑定',
|
},
|
||||||
type: 'boolean',
|
{
|
||||||
placeholder: '请选择是否已绑定外部商品'
|
label: '条码',
|
||||||
}),
|
value: 'barcode',
|
||||||
stockScanField('attribute', {
|
type: 'text',
|
||||||
value: 'level',
|
group: '基础信息'
|
||||||
label: 'ABC分类',
|
},
|
||||||
type: 'select',
|
{
|
||||||
placeholder: '请选择分类',
|
|
||||||
options: [
|
|
||||||
{ value: 'A', label: 'A类' },
|
|
||||||
{ value: 'B', label: 'B类' },
|
|
||||||
{ value: 'C', label: 'C类' }
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
|
|
||||||
// ===== 库存信息 =====
|
|
||||||
stockScanField('inventory', {
|
|
||||||
value: 'quantity',
|
|
||||||
label: '库存数量',
|
label: '库存数量',
|
||||||
type: 'number',
|
value: 'quantity',
|
||||||
placeholder: '请输入库存数量',
|
type: 'text',
|
||||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
|
group: '基础信息'
|
||||||
defaultOperator: 'ge'
|
},
|
||||||
}),
|
{
|
||||||
|
label: '外部商品绑定',
|
||||||
// ===== 管理标识 =====
|
value: 'has_bound_item',
|
||||||
stockScanField('management', {
|
type: 'select',
|
||||||
|
group: '流程状态',
|
||||||
|
options: [
|
||||||
|
{ label: '全部', value: undefined },
|
||||||
|
{ label: '是', value: 'Y' },
|
||||||
|
{ label: '否', value: 'N' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'ABC分类',
|
||||||
|
value: 'level',
|
||||||
|
type: 'select',
|
||||||
|
group: '流程状态',
|
||||||
|
options: [
|
||||||
|
{ label: '全部', value: undefined },
|
||||||
|
{ label: 'A', value: 'A' },
|
||||||
|
{ label: 'B', value: 'B' },
|
||||||
|
{ label: 'C', value: 'C' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否图片',
|
||||||
|
value: 'is_images',
|
||||||
|
type: 'select',
|
||||||
|
group: '流程状态',
|
||||||
|
options: [
|
||||||
|
{ label: '全部', value: undefined },
|
||||||
|
{ label: '是', value: 'Y' },
|
||||||
|
{ label: '否', value: 'N' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'SN管理',
|
||||||
value: 'is_sn_mgmt',
|
value: 'is_sn_mgmt',
|
||||||
label: '序列号管理',
|
type: 'select',
|
||||||
type: 'boolean',
|
group: '流程状态',
|
||||||
placeholder: '请选择是否序列号管理'
|
options: [
|
||||||
}),
|
{ label: '全部', value: undefined },
|
||||||
stockScanField('management', {
|
{ label: '是', value: 'Y' },
|
||||||
value: 'is_shelf_life_mgmt',
|
{ label: '否', value: 'N' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
label: '保质期管理',
|
label: '保质期管理',
|
||||||
type: 'boolean',
|
value: 'is_shelf_life_mgmt',
|
||||||
placeholder: '请选择是否保质期管理'
|
type: 'select',
|
||||||
}),
|
group: '流程状态',
|
||||||
stockScanField('management', {
|
options: [
|
||||||
value: 'is_batch_mgmt',
|
{ label: '全部', value: undefined },
|
||||||
|
{ label: '是', value: 'Y' },
|
||||||
|
{ label: '否', value: 'N' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
label: '批次管理',
|
label: '批次管理',
|
||||||
type: 'boolean',
|
value: 'is_batch_mgmt',
|
||||||
placeholder: '请选择是否批次管理'
|
type: 'select',
|
||||||
})
|
group: '流程状态',
|
||||||
|
options: [
|
||||||
|
{ label: '全部', value: undefined },
|
||||||
|
{ label: '是', value: 'Y' },
|
||||||
|
{ label: '否', value: 'N' }
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
const presetTree: any[] = []
|
const presetTree: any[] = []
|
||||||
@ -447,7 +451,7 @@ const scanBox = ref<any>(null)
|
|||||||
const activeTab = ref('info')
|
const activeTab = ref('info')
|
||||||
|
|
||||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||||
const queryForm = reactive({ warehouse_id: undefined as number | string | undefined })
|
const queryForm = reactive({ keyword: '', warehouse_id: undefined as number | string | undefined })
|
||||||
const currentCondition = ref<any>({})
|
const currentCondition = ref<any>({})
|
||||||
const currentSort = reactive({ prop: '', order: '' })
|
const currentSort = reactive({ prop: '', order: '' })
|
||||||
const summary = ref<any>(null)
|
const summary = ref<any>(null)
|
||||||
@ -476,7 +480,10 @@ const {
|
|||||||
|
|
||||||
function buildExportPayload() {
|
function buildExportPayload() {
|
||||||
const payload: any = {
|
const payload: any = {
|
||||||
where: buildStockQuery(currentCondition.value)
|
where: { ...currentCondition.value }
|
||||||
|
}
|
||||||
|
if (queryForm.keyword) {
|
||||||
|
payload.where.keyword = queryForm.keyword
|
||||||
}
|
}
|
||||||
if (queryForm.warehouse_id !== undefined && queryForm.warehouse_id !== null && queryForm.warehouse_id !== '') {
|
if (queryForm.warehouse_id !== undefined && queryForm.warehouse_id !== null && queryForm.warehouse_id !== '') {
|
||||||
payload.warehouse_id = queryForm.warehouse_id
|
payload.warehouse_id = queryForm.warehouse_id
|
||||||
@ -617,6 +624,9 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
|||||||
handler()
|
handler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─── 特殊字段键(不作为 where 条件,需要单独提取)──────────────────────
|
||||||
|
const SPECIAL_KEYS = ['keyword', 'warehouse_id']
|
||||||
|
|
||||||
// ─── 加载列表 ──────────────────────────────────────────────────────────────
|
// ─── 加载列表 ──────────────────────────────────────────────────────────────
|
||||||
async function loadList() {
|
async function loadList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -626,7 +636,10 @@ async function loadList() {
|
|||||||
page: pagination.currentPage,
|
page: pagination.currentPage,
|
||||||
pageSize: pagination.pageSize
|
pageSize: pagination.pageSize
|
||||||
},
|
},
|
||||||
where: buildStockQuery(currentCondition.value)
|
where: { ...currentCondition.value }
|
||||||
|
}
|
||||||
|
if (queryForm.keyword) {
|
||||||
|
params.where.keyword = queryForm.keyword
|
||||||
}
|
}
|
||||||
|
|
||||||
const sort: StockWarehouseListSort | undefined = currentSort.prop
|
const sort: StockWarehouseListSort | undefined = currentSort.prop
|
||||||
@ -659,14 +672,41 @@ async function loadList() {
|
|||||||
|
|
||||||
// ─── 事件处理 ──────────────────────────────────────────────────────────────
|
// ─── 事件处理 ──────────────────────────────────────────────────────────────
|
||||||
function handleConditionChange(condition: any) {
|
function handleConditionChange(condition: any) {
|
||||||
// ScanBox 直接下发 { field: { value, operator, type } } 结构,
|
const where: any = {}
|
||||||
// 原样保留,交由 buildStockQuery 转为后端 where 规范,避免丢失操作符/类型
|
// 重置特殊字段
|
||||||
currentCondition.value = condition && typeof condition === 'object' ? condition : {}
|
queryForm.keyword = ''
|
||||||
|
queryForm.warehouse_id = undefined
|
||||||
|
|
||||||
|
if (condition) {
|
||||||
|
Object.keys(condition).forEach(k => {
|
||||||
|
if (SPECIAL_KEYS.includes(k)) {
|
||||||
|
// 关键词、仓库 从 condition 提取到 queryForm
|
||||||
|
const c = condition[k]
|
||||||
|
const val = (c && typeof c === 'object' && c.value !== undefined) ? c.value : c
|
||||||
|
if (k === 'keyword' && val) {
|
||||||
|
queryForm.keyword = val
|
||||||
|
} else if (k === 'warehouse_id' && val !== undefined && val !== null && val !== '') {
|
||||||
|
queryForm.warehouse_id = val
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const c = condition[k]
|
||||||
|
if (c && typeof c === 'object' && c.value !== undefined) {
|
||||||
|
if (c.value !== '' && c.value !== null) {
|
||||||
|
where[k] = c.value
|
||||||
|
}
|
||||||
|
} else if (c !== '' && c !== null && c !== undefined) {
|
||||||
|
where[k] = c
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
currentCondition.value = where
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadList()
|
loadList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
|
queryForm.keyword = ''
|
||||||
currentCondition.value = {}
|
currentCondition.value = {}
|
||||||
if (scanBox.value?.reset) {
|
if (scanBox.value?.reset) {
|
||||||
scanBox.value.reset()
|
scanBox.value.reset()
|
||||||
|
|||||||
@ -111,7 +111,6 @@ import { ref, reactive, onMounted, watch } from 'vue'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { Search, Delete, RefreshLeft, Refresh } from '@element-plus/icons-vue'
|
import { Search, Delete, RefreshLeft, Refresh } from '@element-plus/icons-vue'
|
||||||
import * as stockApi from '@/api/stock/stock'
|
import * as stockApi from '@/api/stock/stock'
|
||||||
import { buildStockQuery } from '@/utils/stockQueryBuilder'
|
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import { formatBarcodeText } from '@/utils/barcode'
|
import { formatBarcodeText } from '@/utils/barcode'
|
||||||
|
|
||||||
@ -218,12 +217,11 @@ const loadData = async () => {
|
|||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// where 统一按 stock.warehouse.list 规范:{ 字段: { operator, value, type } }
|
const params: any = {
|
||||||
const params: any = buildStockQuery({
|
|
||||||
is_deleted: 1, // Assuming backend supports this flag for recycle bin
|
is_deleted: 1, // Assuming backend supports this flag for recycle bin
|
||||||
keyword: searchKeyword.value,
|
keyword: searchKeyword.value,
|
||||||
type: filterType.value
|
type: filterType.value
|
||||||
})
|
}
|
||||||
const response = await stockApi.stockWarehouse(pagination, params)
|
const response = await stockApi.stockWarehouse(pagination, params)
|
||||||
if (response && (response as any).code === 200) {
|
if (response && (response as any).code === 200) {
|
||||||
list.value = (response as any).data.list || []
|
list.value = (response as any).data.list || []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user