3月25号更新

This commit is contained in:
yin 2026-03-25 18:17:54 +08:00
parent 868c43be9f
commit b105e7f72b
30 changed files with 733 additions and 26789 deletions

View File

@ -31,7 +31,8 @@ export const getBindWechatCode = () => {
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
isSystemApi: true,
timeout: 120000 // 轮询接口,适当延长超时时间
} as any)
}

View File

@ -7,7 +7,7 @@ export function stockWarehouse(pagination: any, data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.stockWarehouse',
method: 'stock.warehouse.list',
v,
timestamp: new Date().getTime()
},
@ -21,7 +21,7 @@ export function getProhibitedType() {
url: '/system',
method: 'post',
params: {
method: 'stock.getProhibitedType',
method: 'stock.warehouse.getProhibitedType',
v,
timestamp: new Date().getTime()
},
@ -35,7 +35,7 @@ export function getProhibitedList() {
url: '/system',
method: 'post',
params: {
method: 'stock.getProhibitedList',
method: 'stock.warehouse.getProhibitedList',
v,
timestamp: new Date().getTime()
},
@ -49,7 +49,7 @@ export function getInfo(id: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.getInfo',
method: 'stock.warehouse.getInfo',
v,
timestamp: new Date().getTime()
},
@ -63,7 +63,7 @@ export function saveWarehouseStock(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.saveWarehouseStock',
method: 'stock.warehouse.saveWarehouseStock',
v,
timestamp: new Date().getTime()
},
@ -77,7 +77,7 @@ export function getBarcodes(id: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.getBarcodes',
method: 'stock.warehouse.getBarcodes',
v,
timestamp: new Date().getTime()
},
@ -91,7 +91,7 @@ export function saveWarehouseStockBarcode(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.saveWarehouseStockBarcode',
method: 'stock.warehouse.saveWarehouseStockBarcode',
v,
timestamp: new Date().getTime()
},
@ -105,7 +105,7 @@ export function getStoreStocks(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.getStoreStocks',
method: 'stock.warehouse.getStoreStocks',
v,
timestamp: new Date().getTime()
},
@ -119,7 +119,7 @@ export function bindItem(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.bindItem',
method: 'stock.warehouse.bindItem',
v,
timestamp: new Date().getTime()
},
@ -133,7 +133,7 @@ export function unbindItem(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.unbindItem',
method: 'stock.warehouse.unbindItem',
v,
timestamp: new Date().getTime()
},
@ -147,7 +147,7 @@ export function queryStockLogs(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.queryStockLogs',
method: 'stock.warehouse.queryStockLogs',
v,
timestamp: new Date().getTime()
},
@ -161,7 +161,7 @@ export function getStockUnits() {
url: '/system',
method: 'post',
params: {
method: 'stock.getStockUnits',
method: 'stock.warehouse.getStockUnits',
v,
timestamp: new Date().getTime()
},
@ -175,7 +175,7 @@ export function getUnitList() {
url: '/system',
method: 'post',
params: {
method: 'stock.getUnitList',
method: 'stock.warehouse.getUnitList',
v,
timestamp: new Date().getTime()
},
@ -189,7 +189,7 @@ export function createUnit(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.createUnit',
method: 'stock.warehouse.createUnit',
v,
timestamp: new Date().getTime()
},
@ -203,7 +203,7 @@ export function getBoxUnits() {
url: '/system',
method: 'post',
params: {
method: 'stock.getBoxUnits',
method: 'stock.warehouse.getBoxUnits',
v,
timestamp: new Date().getTime()
},
@ -217,7 +217,7 @@ export function checkItemCodeUnique(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.checkItemCodeUnique',
method: 'stock.warehouse.checkItemCodeUnique',
v,
timestamp: new Date().getTime()
},
@ -231,7 +231,7 @@ export function createWarehouseStock(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.createWarehouseStock',
method: 'stock.warehouse.createWarehouseStock',
v,
timestamp: new Date().getTime()
},
@ -245,7 +245,7 @@ export function handleBatchDelete(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.handleBatchDelete',
method: 'stock.warehouse.handleBatchDelete',
v,
timestamp: new Date().getTime()
},
@ -259,7 +259,7 @@ export function handleBatchChange(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.handleBatchChange',
method: 'stock.warehouse.handleBatchChange',
v,
timestamp: new Date().getTime()
},
@ -273,7 +273,7 @@ export function deleteUnit(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.deleteUnit',
method: 'stock.warehouse.deleteUnit',
v,
timestamp: new Date().getTime()
},
@ -287,7 +287,7 @@ export function createProhibited(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.createProhibited',
method: 'stock.warehouse.createProhibited',
v,
timestamp: new Date().getTime()
},
@ -301,7 +301,7 @@ export function deleteProhibited(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.deleteProhibited',
method: 'stock.warehouse.deleteProhibited',
v,
timestamp: new Date().getTime()
},
@ -315,7 +315,7 @@ export function backData(data: any) {
url: '/system',
method: 'post',
params: {
method: 'stock.backData',
method: 'stock.warehouse.backData',
v,
timestamp: new Date().getTime()
},

View File

@ -28,7 +28,7 @@ export function getReceivingDetail(data: any): Promise<any> {
})
}
// 未使用,保留
// 未使用
export function getReceivingProduct(data: any): Promise<any> {
return request({
url: '/system',
@ -81,4 +81,151 @@ export function sendPrint(data: any) {
},
data: data
})
}
export function createReceiving(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.create',
v,
timestamp: new Date().getTime()
},
data: data
})
}
// 不可用
export function cancelReceiving(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.batchCancelReceiving',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function addItem(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.addItem',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function removeItem(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.removeItem',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function saveReceiving(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.saveReceiving',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function getReceiving(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.get',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function addDetail(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.addDetail',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function deleteDetail(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.deleteDetail',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function detailChange(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.detailChange',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function cancelReceivingDetail(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.cancel',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function completeReceiving(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.completeReceiving',
v,
timestamp: new Date().getTime()
},
data: data
})
}

View File

@ -1,5 +1,5 @@
<template>
<div class="scan-box-container" :style="{ width: width }">
<div class="scan-box-container" >
<!-- Tab 切换 -->
<div class="scan-tabs">
<el-tabs v-model="activeTab" stretch @tab-click="handleTabChange">
@ -41,7 +41,7 @@
v-model="customConditions[field.value].operator"
placeholder="条件类型"
size="small"
style="width: 100%; margin-bottom: 8px;"
class="operator-select"
@change="handleTextOperatorChange(field)"
>
<el-option
@ -56,6 +56,7 @@
:placeholder="getTextPlaceholder(field)"
size="small"
clearable
class="value-input"
@change="handleCustomChange"
@blur="normalizeTextValue(field)"
/>
@ -73,7 +74,7 @@
v-model="customConditions[field.value].operator"
placeholder="请选择"
size="small"
style="width: 100%; margin-bottom: 8px;"
class="operator-select"
>
<el-option
v-for="op in getOperators(field)"
@ -87,7 +88,7 @@
:controls="false"
size="small"
:placeholder="field.placeholder || `请输入${field.label}`"
style="width: 100%;"
class="value-input"
@change="handleCustomChange"
/>
</div>
@ -104,7 +105,7 @@
v-model="customConditions[field.value].operator"
placeholder="请选择"
size="small"
style="width: 100%; margin-bottom: 8px;"
class="operator-select"
>
<el-option
v-for="op in getOperators(field)"
@ -118,7 +119,7 @@
type="date"
:placeholder="field.placeholder || `请选择${field.label}`"
size="small"
style="width: 100%;"
class="value-input"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="handleCustomChange"
@ -748,7 +749,8 @@ defineExpose({ getConditions, reset, clear })
background: #fff;
border-right: 1px solid #e8e8e8;
box-shadow: 1px 0 2px rgba(0, 0, 0, 0.05);
min-width: 200px;
width: 250px;
min-width: 160px;
}
.scan-tabs {
@ -797,6 +799,13 @@ defineExpose({ getConditions, reset, clear })
flex: 1;
overflow-y: auto;
padding: 16px;
/* 隐藏滚动条 */
&::-webkit-scrollbar {
display: none;
}
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
/* 自定义筛选样式 */
@ -828,6 +837,22 @@ defineExpose({ getConditions, reset, clear })
.field-control {
display: flex;
flex-direction: row;
gap: 4px;
}
.operator-select {
width: 85px;
flex-shrink: 0;
}
.value-input {
flex: 1;
min-width: 0;
}
.field-control :deep(.el-input__wrapper),
.field-control :deep(.el-select__wrapper) {
border-radius: 4px;
}
/* 预设筛选样式 */

View File

@ -92,6 +92,7 @@
:key="idx"
:src="img"
:preview-src-list="column.imgs(scope.row, scope.column, scope.$index)"
preview-teleported
></el-image>
</template>
<span v-else>{{ scope.row[column.prop] }}</span>
@ -589,29 +590,34 @@ defineExpose({
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
overflow: hidden;
position: relative;
flex-shrink: 0; /* Prevent vertical shrinking which might clip pagination */
/* 支持弹性高度:允许在 flex 父容器中自动伸缩 */
flex: 1 1 auto;
min-height: 0;
height: 100%;
}
.table-container {
height: 395px;
/* 移除固定高度,弹性填满 upper-table-container 剩余空间 */
flex: 1 1 auto;
min-height: 0;
overflow: auto;
z-index: 9;
}
.pagination-container {
padding: 16px 20px;
padding: 5px 10px;
border-top: 1px solid #e8e8e8;
background: #fff;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
flex-wrap: wrap; /* Allow wrapping if needed */
flex-wrap: wrap;
flex-shrink: 0;
}
.pagination-info {
font-size: 14px;
font-size: 12px;
color: #606266;
white-space: nowrap;
}
@ -621,11 +627,22 @@ defineExpose({
.pagination-container :deep(.el-pagination__jump),
.pagination-container :deep(.el-pagination__total) {
display: inline-flex !important;
margin-right: 8px;
}
.pagination-container :deep(.el-pagination) {
flex-wrap: wrap;
justify-content: flex-end;
--el-pagination-button-width: 28px;
--el-pagination-button-height: 28px;
}
.pagination-container :deep(.el-select--small) {
width: 80px;
}
.pagination-container :deep(.el-input__wrapper) {
padding: 0 4px;
}
.empty-table {

View File

@ -286,22 +286,22 @@ onMounted(() => {
}
.tags-view-wrapper {
height: 40px;
height: 32px;
// border-bottom: 1px solid #d8dce5;
// background-color: #e0dbdb;
.tags-view-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 32px;
line-height: 32px;
height: 26px;
line-height: 26px;
// border: 1px solid #d8dce5;
color: #495060;
background: #b8b5b5;
padding: 0 15px;
font-size: 14px;
padding: 0 10px;
font-size: 12px;
margin-left: 5px;
margin-top: 4px;
margin-top: 3px;
text-decoration: none;
&:first-of-type {
margin-left: 15px;
@ -347,7 +347,8 @@ onMounted(() => {
}
.navbar-wrapper {
height: 45px;
min-height: 45px;
height: auto;
}

View File

@ -6,10 +6,10 @@
<sidebar v-if="layoutMode !== 'top-bottom'" class="sidebar-container" />
<div class="main-container" :class="{ 'no-sidebar': layoutMode === 'top-bottom' }">
<div :class="{ 'fixed-header': fixedHeader, 'fixed-header-top': layoutMode === 'top-bottom' }" :style="{ height: shortcutExpanded ? '134px' : '97px' }">
<div :class="{ 'fixed-header': fixedHeader, 'fixed-header-top': layoutMode === 'top-bottom' }" :style="{ minHeight: shortcutExpanded ? '134px' : '97px' }">
<task-view />
</div>
<div v-if="fixedHeader" :style="{ height: shortcutExpanded ? '134px' : '97px' }"></div>
<div v-if="fixedHeader" :style="{ height: shortcutExpanded ? '134px' : '97px', minHeight: shortcutExpanded ? '134px' : '97px' }"></div>
<div class="main-box">
<app-main />
<transition name="ai-slide">
@ -112,7 +112,6 @@ const handleClickOutside = () => {
width: calc(100% - #{$sideBarWidth});
transition: width 0.28s;
min-height: 97px;
max-height: 134px;
&.fixed-header-top {
width: 100% !important;

View File

@ -7,7 +7,7 @@ export const componentMap: Record<string, any> = {
'auth/approve': () => import('@/views/auth/approve.vue'),
'account/index': () => import('@/views/account/index.vue'),
'warehouse/index': () => import('@/views/warehouse/index.vue'),
'stock/index': () => import('@/views/stock/index.vue'),
'stock/index': () => import('@/views/stock/stock/index.vue'),
'stock/storestock/index': () => import('@/views/stock/storestock/index.vue'),
'stock/combo_stock/index': () => import('@/views/stock/combo_stock/index.vue'),
'storage/receiving': () => import('@/views/storage/receiving/index.vue'),

View File

@ -72,9 +72,9 @@
// Increase menu item size
.el-menu-item, .el-sub-menu__title {
height: 60px !important;
line-height: 60px !important;
font-size: 16px !important;
height: 40px !important;
line-height: 40px !important;
font-size: 14px !important;
}
// menu hover

View File

@ -0,0 +1,88 @@
/**
* stock.stockWarehouse 前端查询规则封装
* 对应文档:stock-stockWarehouse-query-rules.md
*/
/**
* 构建符合后端规范的 where 查询对象
* @param params 前端原始查询参数(通常来自 ScanBox)
* @returns 后端需要的 where 对象
*/
export function buildStockQuery(params: Record<string, any>) {
const where: Record<string, any> = {};
if (!params) return where;
for (const [key, val] of Object.entries(params)) {
// 1. 基础空值检查
if (val === null || val === undefined || val === '') continue;
if (Array.isArray(val) && val.length === 0) continue;
let condition = val;
// 2. 如果值不是对象结构(简单键值对),或数组(in 查询简写),则转换
if (typeof val !== 'object' || Array.isArray(val)) {
condition = { value: val };
} else {
// 如果是对象,检查内部 value 是否有效
if (
condition.value === null ||
condition.value === undefined ||
condition.value === '' ||
(Array.isArray(condition.value) && condition.value.length === 0)
) {
continue;
}
// 浅拷贝避免修改源数据
condition = { ...val };
}
// 3. 默认操作符处理
if (!condition.operator) {
if (key === 'barcode') {
condition.operator = 'like'; // 推荐 operator=eq|like
} else if (key === 'item_code') {
condition.operator = 'like';
} else {
condition.operator = 'eq';
}
}
// 4. 类型转换与值处理
// 处理 boolean -> Y/N
if (condition.type === 'boolean') {
if (condition.value === true || condition.value === 'true') {
condition.value = 'Y';
} else if (condition.value === false || condition.value === 'false') {
condition.value = 'N';
}
}
// 处理 text (逗号分隔字符串拆分数组) - ScanBox 可能已经处理,这里做防守
if (condition.type === 'text' && typeof condition.value === 'string' && condition.value.includes(',')) {
// 如果 ScanBox 传来了 string 且 type=text,后端规则提到 "逗号分隔字符串拆分数组"
// 取決于 ScanBox 是否处理了。如果 ScanBox 里的 operator 是 in 或者 contains 可能会有逗号
// 文档说: type=text: 逗号分隔字符串拆分数组。
// 如果我们传数组给后端,JSON序列化后是数组。
if (!Array.isArray(condition.value)) {
condition.value = condition.value.split(',').filter((s: string) => s.trim() !== '');
}
}
// 5. 构造最终对象 (过滤掉多余字段如 isMultiple, placeholders 等)
const finalObj: Record<string, any> = {
operator: condition.operator,
value: condition.value
};
if (condition.type) finalObj.type = condition.type;
// 允许显式传递 field 映射
if (condition.field) finalObj.field = condition.field;
where[key] = finalObj;
}
return where;
}

View File

@ -62,7 +62,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import { CircleCheckFilled, Loading, RefreshRight } from '@element-plus/icons-vue'
import { getBindWechatCode, unbindWechat, getBindInfo } from '@/api/profile'
type QrStatus = 'waiting' | 'scanned' | 'bound' | 'expired'
type QrStatus = 'waiting' | 'pending' | 'scanned' | 'bound' | 'expired'
const isBound = ref(false)
const unbinding = ref(false)
@ -75,7 +75,7 @@ const qrBaseUrl = "https://ye4s.wms.gztbyc.com/qrcode/build?text="
const qrStatus = ref<QrStatus>('waiting')
let pollTimer: ReturnType<typeof setInterval> | null = null
const POLL_INTERVAL = 3000 // 3 秒轮询一次
const POLL_INTERVAL = 120000 // 120 秒轮询一次
/** 初始化:获取当前绑定状态 */
const fetchBindInfo = async () => {
@ -98,11 +98,11 @@ const fetchBindInfo = async () => {
const handleBind = async () => {
dialogVisible.value = true
await refreshQrCode()
startPolling()
}
/** 获取/刷新二维码 */
/** 获取/刷新二维码,刷新完成后自动重启轮询 */
const refreshQrCode = async () => {
stopPolling() // 先停止旧的轮询,避免并发干扰
loading.value = true
qrStatus.value = 'waiting'
qrCodeUrl.value = ''
@ -111,7 +111,8 @@ const refreshQrCode = async () => {
const data = res?.data
if (!data) throw new Error('无返回数据')
if (data.status === 'bound') {
const isBoundNow = data.status === 'bound' || data.is_bound === true
if (isBoundNow) {
// 已绑定,直接刷新状态关闭弹窗
isBound.value = true
binderInfo.nickname = data.nickname || ''
@ -121,8 +122,18 @@ const refreshQrCode = async () => {
return
}
qrStatus.value = data.status as QrStatus
qrCodeUrl.value = data.code ? (qrBaseUrl + data.code) : ''
// 将后端 'pending' 归为 'waiting' 处理
const mappedStatus = data.status === 'pending' ? 'waiting' : data.status as QrStatus
qrStatus.value = mappedStatus
// 有新 code 时更新二维码 URL
if (data.code) {
qrCodeUrl.value = qrBaseUrl + data.code
}
// 刷新成功后重新启动轮询(过期状态不轮询,等待用户手动刷新)
if (mappedStatus !== 'expired') {
startPolling()
}
} catch {
ElMessage.error('获取二维码失败,请重试')
dialogVisible.value = false
@ -140,22 +151,30 @@ const startPolling = () => {
const data = res?.data
if (!data) return
qrStatus.value = data.status as QrStatus
// 将后端 'pending' 归为 'waiting' 处理
const mappedStatus = data.status === 'pending' ? 'waiting' : data.status as QrStatus
qrStatus.value = mappedStatus
// 更新二维码
if (data.code) {
qrCodeUrl.value = qrBaseUrl + data.code
console.log('二维码已更新')
}
if (data.status === 'bound') {
const isBoundNow = data.status === 'bound' || data.is_bound === true
if (isBoundNow) {
stopPolling()
isBound.value = true
binderInfo.nickname = data.nickname || ''
binderInfo.openid = data.openid || ''
dialogVisible.value = false
ElMessage.success(`微信绑定成功:${data.nickname || '微信用户'}`)
} else if (data.status === 'expired') {
stopPolling()
}
// expired 状态不再停止轮询,等待后端更新 code 或 status
if (data.status === 'expired') {
// 可选:如果需要清除旧二维码,可以在这里处理
// 但为了体验平滑,保持 overlay 覆盖在旧图上即可
}
} catch {
// 轮询失败静默处理,不弹错误

View File

@ -20,11 +20,11 @@
title="建议外部ERP修改商品编码重新推送,可以自动绑定"
class="toolbar-btn"
>
添加绑定(建议外部ERP修改商品编码重新推送,可以自动绑定)
添加绑定
</el-button>
</el-button-group>
<el-table :data="tableData" border stripe style="width: 100%" :height="tableHeight">
<el-table :data="tableData" border stripe style="width: 100%; height: 100%" height="100%">
<el-table-column prop="create_from" label="来源" width="150" />
<el-table-column prop="app_name" label="应用" width="120" />
<el-table-column prop="item_code" label="外部编码" />
@ -54,7 +54,7 @@
</template>
<script setup lang="ts">
import { ref, watch, onMounted, computed } from 'vue'
import { ref, watch, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { Refresh, Plus } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
@ -69,10 +69,6 @@ const tableData = ref<any[]>([])
const showStoreStock = ref(false)
const store_id = ref(0)
const tableHeight = computed(() => {
return window.innerHeight - 300 // 根据实际情况调整
})
watch(() => props.id, (newVal) => {
if (newVal) {
fetchStockInfo()
@ -138,19 +134,18 @@ function handleAddBind() {
<style scoped lang="scss">
.erp-stock-container {
height: 100%;
padding: 20px;
padding: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.toolbar-btn-group {
margin-bottom: 10px;
margin-bottom: 5px;
}
.el-table {
flex: 1;
overflow-y: auto;
}
:deep(.el-drawer__body) {

View File

@ -18,8 +18,8 @@
:data="tableData"
border
stripe
style="width: 100%"
:height="tableHeight"
style="width: 100%; height: 100%"
height="100%"
v-loading="loading"
>
<el-table-column prop="created_at" label="时间" width="250" />
@ -81,7 +81,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, watch, onMounted, computed } from 'vue'
import { ref, reactive, watch, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Refresh } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
@ -103,10 +103,6 @@ const pagination = reactive({
total: 0
})
const tableHeight = computed(() => {
return window.innerHeight - 300 // 根据实际情况调整
})
watch(() => props.id, (newVal) => {
if (newVal) {
fetchStockInfo()
@ -193,26 +189,25 @@ function backData(row: any) {
<style scoped lang="scss">
.log-container {
height: 100%;
padding: 10px 20px;
padding: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.toolbar-btn-group {
margin-bottom: 10px;
margin-bottom: 5px;
}
.el-table {
flex: 1;
overflow-y: auto;
}
.pagination-container {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20px;
margin-top: 10px;
}
:deep(.el-drawer__body) {

View File

@ -28,8 +28,8 @@
<el-table
:data="tableData"
border
style="width: 100%"
:height="tableHeight"
style="width: 100%; height: 100%"
height="100%"
v-loading="loading"
>
<el-table-column
@ -68,7 +68,7 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { Refresh, Download } from '@element-plus/icons-vue'
// import * as stockApi from '@/api/stock'
@ -77,10 +77,6 @@ const router = useRouter()
const loading = ref(false)
const tableData = ref<any[]>([])
const tableHeight = computed(() => {
return window.innerHeight - 300
})
function loadData() {
loading.value = true
// 暂无库存详情接口,保持与Vue2一致
@ -101,18 +97,17 @@ function handleClick(row: any) {
<style scoped lang="scss">
.container {
height: 100%;
padding: 20px;
padding: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.toolbar-btn-group {
margin-bottom: 10px;
margin-bottom: 5px;
}
.el-table {
flex: 1;
overflow-y: auto;
}
</style>

View File

@ -154,7 +154,7 @@
<!-- 下层详情区域 -->
<div class="lower-level" v-if="currentStockId" :class="tableSize">
<div class="detail-header">
<el-tabs v-model="activeTab" @tab-click="handleTabChange" class="detail-tab">
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="detail-tab">
<el-tab-pane label="商品明细" name="info" />
<el-tab-pane label="图片" name="images" />
<el-tab-pane label="条码" name="barcode" />
@ -165,14 +165,14 @@
</div>
<div class="detail-container">
<KeepAlive>
<keep-alive>
<component
:is="activeComponent"
:id="currentStockId"
type="stock"
@refresh="handleRefresh"
/>
</KeepAlive>
</keep-alive>
</div>
</div>
@ -230,6 +230,7 @@ import { useUserStore } from '@/stores/modules/user'
// Utils
import { parseTime } from '@/utils/index'
import { buildStockQuery } from '@/utils/stockQueryBuilder'
import { labelInner } from 'echarts/types/src/label/labelStyle.js'
const userStore = useUserStore()
@ -742,9 +743,11 @@ const loadData = async () => {
loading.value = true
const startTime = Date.now()
try {
const params = {
...currentConditions.value
}
const params = buildStockQuery(currentConditions.value)
// 调试用:前端打印查看转换结果,确认 operator/value/type 是否符合预期
console.log('Query Params:', JSON.stringify(params, null, 2))
const res = await stockApi.stockWarehouse(pagination, params)
if (res && res.data) {
list.value = res.data.list
@ -969,7 +972,7 @@ const loadStockUnits = async () => {
overflow: hidden;
.toolbar {
padding: 10px;
padding: 5px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
@ -978,43 +981,22 @@ const loadStockUnits = async () => {
}
.upper-wrapper {
flex: 1;
flex: 1 1 auto;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
/* upper-wrapper 自动填充剩余空间 */
overflow: hidden;
}
/* 在 receiving 页面内覆盖 UpperTable,使表格容器填满可用高度,表体滚动,表头与分页固定 */
/* upper-table-container 已在组件内支持弹性高度,此处确保撑满 upper-wrapper */
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
/* 取消 UpperTable 的固定像素高度,改为弹性填充 */
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden; /* 交由 el-table__body-wrapper 控制滚动 */
}
/* 表头粘性,始终可见 */
.upper-wrapper :deep(.el-table__header-wrapper) {
position: sticky;
top: 0;
z-index: 3;
background: #fff;
}
/* 表格 body 使用自身滚动条 */
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
min-height: 0;
}
.lower-level {
flex: 1;
flex: 0 0 auto;
height: 40%;
min-height: 400px;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@ -1024,9 +1006,22 @@ const loadStockUnits = async () => {
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
.detail-tab {
margin-bottom: -1px;
:deep(.el-tabs__header) {
margin: 0;
}
:deep(.el-tabs__item) {
height: 32px;
line-height: 32px;
font-size: 13px;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
}
}
}
@ -1038,7 +1033,8 @@ const loadStockUnits = async () => {
}
.no-selection {
flex: 1;
flex: 0 0 auto;
height: 40%;
display: flex;
align-items: center;
justify-content: center;

View File

@ -3,7 +3,7 @@
<div class="header-actions">
<div class="left-actions">
<el-button size="small" @click="loadEntryDetail">刷新</el-button>
<el-button disabled>入库</el-button>
<el-button size="small" disabled>入库</el-button>
<el-button size="small" type="primary" disabled>批量入库</el-button>
<el-button size="small" disabled>EXCEL导出</el-button>
<el-button size="small" disabled>导出</el-button>

View File

@ -22,9 +22,9 @@
<el-button size="small" @click="handleImport">导入</el-button>
</div>
<div class="toolbar-right">
<!-- <div class="toolbar-right">
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
</div>
</div> -->
</div>
<div class="upper-wrapper">
@ -71,7 +71,6 @@
<div class="lower-level" v-if="selectedEntryId" :class="tableSize">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tabs></el-tabs>
<el-tab-pane label="表单操作" name="operate" />
<el-tab-pane label="入库明细" name="details" />
<el-tab-pane label="操作日志" name="logs" />
@ -428,7 +427,7 @@ function handleImport() {
overflow: hidden;
.toolbar {
padding: 10px;
padding: 5px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
@ -438,31 +437,46 @@ function handleImport() {
.toolbar-right {
display: flex;
flex-direction: row;
gap: 15px;
height: 30px;
align-items: center;
}
.upper-wrapper {
flex: 1;
flex: 0 0 auto;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
overflow: hidden;
}
/* 在 entry 页面内覆盖 UpperTable,使表格容器填满可用高度,表体滚动,表头与分页固定 */
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.table-container) {
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
/* 取消 UpperTable 的固定像素高度,改为弹性填充 */
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
overflow: hidden; /* 交由 el-table__body-wrapper 控制滚动 */
}
/* 表头粘性,始终可见 */
.upper-wrapper :deep(.el-table__header-wrapper) {
position: sticky;
top: 0;
z-index: 3;
background: #fff;
}
/* 表格 body 使用自身滚动条 */
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
min-height: 0;
}
.lower-level {
@ -476,7 +490,23 @@ function handleImport() {
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
.detail-tab { margin-bottom: -1px; }
background-color: #fafafa;
.detail-tab {
margin-bottom: -1px;
:deep(.el-tabs__header) {
margin: 0;
}
:deep(.el-tabs__item) {
height: 32px;
line-height: 32px;
font-size: 13px;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
}
}
}
.detail-container {
@ -493,7 +523,11 @@ function handleImport() {
justify-content: center;
color: #909399;
background-color: #fff;
.empty-tip { text-align: center; }
.empty-tip {
text-align: center;
font-size: 14px;
}
}
}
}

View File

@ -22,9 +22,9 @@
<el-button size="small" @click="handleImport">导入</el-button>
</div>
<div class="toolbar-right">
<!-- <div class="toolbar-right">
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
</div>
</div> -->
</div>
<div class="upper-wrapper">
@ -371,7 +371,7 @@ function handleImport() {
overflow: hidden;
.toolbar {
padding: 10px;
padding: 5px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
@ -381,31 +381,46 @@ function handleImport() {
.toolbar-right {
display: flex;
flex-direction: row;
gap: 15px;
height: 30px;
align-items: center;
}
.upper-wrapper {
flex: 1;
flex: 0 0 auto;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
overflow: hidden;
}
/* 在 inventory 页面内覆盖 UpperTable,使表格容器填满可用高度,表体滚动,表头与分页固定 */
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.table-container) {
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
/* 取消 UpperTable 的固定像素高度,改为弹性填充 */
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
overflow: hidden; /* 交由 el-table__body-wrapper 控制滚动 */
}
/* 表头粘性,始终可见 */
.upper-wrapper :deep(.el-table__header-wrapper) {
position: sticky;
top: 0;
z-index: 3;
background: #fff;
}
/* 表格 body 使用自身滚动条 */
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
min-height: 0;
}
.lower-level {
@ -419,7 +434,19 @@ function handleImport() {
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
.detail-tab { margin-bottom: -1px; }
background-color: #fafafa;
.detail-tab {
margin-bottom: -1px;
:deep(.el-tabs__header) { margin: 0; }
:deep(.el-tabs__item) {
height: 32px;
line-height: 32px;
font-size: 13px;
}
:deep(.el-tabs__nav-wrap::after) { height: 1px; }
}
}
.detail-container {
@ -436,7 +463,7 @@ function handleImport() {
justify-content: center;
color: #909399;
background-color: #fff;
.empty-tip { text-align: center; }
.empty-tip { text-align: center; font-size: 14px; }
}
}
}

View File

@ -2,9 +2,9 @@
<div class="product-details">
<div class="header-actions">
<div class="left-actions">
<el-button @click="loadProductData">刷新</el-button>
<el-button type="primary" disabled>批量操作</el-button>
<el-button disabled>导出</el-button>
<el-button size="small" @click="loadProductData">刷新</el-button>
<el-button size="small" type="primary" disabled>批量操作</el-button>
<el-button size="small" disabled>导出</el-button>
</div>
<div class="right-actions">
<!-- 可以在这里添加搜索框或其他操作 -->
@ -75,8 +75,8 @@
</KeepAlive>
</div>
<div class="window-body-bottom">
<el-button @click="resetForm" disabled>重置</el-button>
<el-button type="primary" @click="saveProductDetail" disabled>保存</el-button>
<el-button size="small" @click="resetForm" disabled>重置</el-button>
<el-button size="small" type="primary" @click="saveProductDetail" disabled>保存</el-button>
</div>
</div>
</div>
@ -464,12 +464,9 @@ onUnmounted(() => {
<style scoped>
.product-details {
padding: 12px;
/* display: grid; */
grid-template-columns: 1fr 320px;
grid-template-rows: auto 1fr;
gap: 12px 16px;
align-items: start;
/* padding: 5px; */
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background: #fff;
@ -609,19 +606,38 @@ onUnmounted(() => {
}
.header-actions {
grid-column: 1 / 3;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
margin-bottom: 8px;
flex-shrink: 0;
}
.left-col {
grid-column: 1 / 1;
grid-row: 2 / 3;
height: 100%;
flex: 1;
min-height: 0;
overflow: hidden;
padding-right: 8px;
display: flex;
flex-direction: column;
}
.left-col :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.left-col :deep(.table-container) {
flex: 1;
min-height: 0;
height: auto !important;
}
.left-col :deep(.pagination-container) {
flex-shrink: 0;
padding: 8px 0;
}
.right-col {

View File

@ -34,9 +34,9 @@
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
</div>
<div class="toolbar-right">
<!-- <div class="toolbar-right">
<el-input size="small" placeholder="搜索收货单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
</div>
</div> -->
</div>
<div class="upper-wrapper">
@ -55,6 +55,7 @@
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@sort-change="handleSortChange"
@refresh="loadData"
@selection-change="onSelectionChange"
>
@ -236,6 +237,32 @@
</div>
</template>
</el-dialog>
<!-- 新建收货单对话框 -->
<el-dialog
v-model="createDialogVisible"
title="新建收货单"
width="600px"
@closed="handleCreateDialogClosed"
>
<el-form :model="createForm" label-width="100px" size="small">
<el-row :gutter="20">
<el-col v-for="field in addReceivingFieldsRef" :key="field.prop" :span="field.type === 'textarea' ? 24 : 12">
<el-form-item :label="field.label">
<el-select v-if="field.type === 'select'" v-model="createForm[field.prop]" :placeholder="'请选择' + field.label" style="width: 100%" :filterable="field.filterable">
<el-option v-for="opt in field.options" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
<el-input v-else-if="field.type === 'textarea'" v-model="createForm[field.prop]" type="textarea" :rows="3" :placeholder="'请输入' + field.label" />
<el-input v-else v-model="createForm[field.prop]" :placeholder="'请输入' + field.label" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button size="small" @click="createDialogVisible = false">取消</el-button>
<el-button size="small" type="primary" :loading="createLoading" @click="submitCreateReceiving">确定</el-button>
</template>
</el-dialog>
</div>
</template>
@ -259,7 +286,8 @@ import {
storageStatusConfig,
deliveryMethodConfig,
loadingMethodConfig,
printFormConfig
printFormConfig,
addReceivingFields
} from './receiving-config'
import * as printerApi from '@/api/printer'
import * as templateApi from '@/api/printTemplate'
@ -271,6 +299,7 @@ const upperTable = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
const addReceivingFieldsRef = reactive(JSON.parse(JSON.stringify(addReceivingFields)))
const activeTab = ref('details')
@ -288,6 +317,8 @@ const hasSelection = ref(false)
const selectedReceivingId = ref<number | string | null>(null)
const quickSearch = ref('')
const currentSort = reactive({ prop: '', order: '' })
const currentCondition = ref<any>(null)
const componentMap: Record<string, any> = {
details: Details,
@ -312,30 +343,23 @@ async function loadData() {
loading.value = true
const start = Date.now()
try {
const rawConditions = scanBox.value?.getConditions?.() || {}
console.log('ScanBox 原始条件:', rawConditions)
// 转换条件格式:如果是对象且包含 value/operator 结构,则提取 value
const processedWhere: any = {}
Object.keys(rawConditions).forEach(key => {
const item = rawConditions[key]
if (item && typeof item === 'object' && 'value' in item) {
processedWhere[key] = item.value
} else {
processedWhere[key] = item
}
})
// 直接使用 handleConditionChange 保存的完整条件(含 operator),避免丢失操作符信息
const where = currentCondition.value || {}
console.log('当前筛选条件:', where)
const params = {
const params: any = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: processedWhere
where,
order: currentSort.prop ? { [currentSort.prop]: currentSort.order === 'ascending' ? 'ASC' : 'DESC' } : undefined
}
if (quickSearch.value) {
params.where = { ...(params.where || {}), receiving_number: quickSearch.value }
}
const res: any = await receivingApi.getReceivingList(params)
if (res && res.code === 200) {
console.log('原始数据', res.data.list)
console.log('API 返回数据:', res.data.list)
list.value = formatReceivingData(res.data.list || [])
pagination.currentPage = res.data.pagination?.currentPage || pagination.currentPage
pagination.pageSize = res.data.pagination?.pageSize || pagination.pageSize
@ -356,8 +380,12 @@ async function loadFilterData() {
try {
const [storesRes, presetRes]: any = await Promise.all([indexApi.loadStores({ type: 'receiving' }), indexApi.fastWhereTree('receiving')])
if (storesRes && storesRes.code === 200) {
const stores = storesRes.stores || []
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
if (f) f.options = storesRes.stores || []
if (f) f.options = stores
const af = addReceivingFieldsRef.find((i: any) => i.prop === 'store_id')
if (af) af.options = stores
}
if (presetRes && presetRes.code === 200) {
console.log('筛选配置', presetRes)
@ -369,21 +397,32 @@ async function loadFilterData() {
}
function handleConditionChange(condition: any) {
currentCondition.value = condition // 保存完整条件(含 operator),供 loadData 使用
pagination.currentPage = 1
loadData()
}
function handleSortChange({ prop, order }: any) {
currentSort.prop = prop
currentSort.order = order
pagination.currentPage = 1
loadData()
}
function handleSubmit() {
// condition-change 在 submit 之前已触发并更新了 currentCondition,直接加载即可
pagination.currentPage = 1
loadData()
}
const handleConditionClear = () => {
currentCondition.value = null // 清空已保存的条件
pagination.currentPage = 1
loadData()
}
function handleConditionReset() {
currentCondition.value = null // 清空已保存的条件
pagination.currentPage = 1
// 如果 ScanBox 提供 reset/clear 方法,调用以清空筛选条件
if (scanBox.value?.reset) {
@ -481,7 +520,54 @@ function onQuickSearch() {
}
function handleCreateReceiving() {
ElMessage.info('新建收货单(UI 待实现)')
// 重置表单并打开对话框
Object.keys(createForm).forEach(key => createForm[key] = '')
createDialogVisible.value = true
}
// 新建收货单相关
const createDialogVisible = ref(false)
const createLoading = ref(false)
const createForm = reactive<any>({
store_id: '',
delivery_method: '',
loading_method: '',
license_plate: '',
tracking_number: '',
remark: ''
})
function handleCreateDialogClosed() {
Object.keys(createForm).forEach(key => createForm[key] = '')
}
async function submitCreateReceiving() {
// 表单校验:除备注外必须填写
const requiredFields = addReceivingFieldsRef.filter((f: { prop: string }) => f.prop !== 'remark')
for (const field of requiredFields) {
if (!createForm[field.prop]) {
ElMessage.warning(`请填写${field.label}`)
return
}
}
createLoading.value = true
try {
const res: any = await receivingApi.createReceiving(createForm)
console.log('新建收货单返回结果:', res)
if (res && res.code === 200) {
ElMessage.success('新建收货单成功')
createDialogVisible.value = false
loadData()
} else {
ElMessage.error(res?.message || '新建失败')
}
} catch (e) {
console.error('新建收货单出错:', e)
ElMessage.error('新建收货单失败')
} finally {
createLoading.value = false
}
}
// 打印相关
@ -821,21 +907,36 @@ async function doPrint() {
async function confirmBatchCancel() {
if (!selectionRows.value.length) {
ElMessage.warning('请先选择要作废的收货单')
ElMessage.warning('请先选择要操作的收货单')
return
}
try {
await ElMessageBox.confirm(`确定要批量作废 ${selectionRows.value.length} 个收货单吗?`, '确认', { type: 'warning' })
const res: any = await receivingApi.batchCancelReceiving({ ids: selectionRows.value.map(i => i.id) })
if (res && res.code === 200) {
ElMessage.success('批量作废成功')
selectionRows.value = []
loadData()
} else {
ElMessage.error(res?.message || '批量作废失败')
await ElMessageBox.confirm(`确定要批量完成 ${selectionRows.value.length} 个收货单的收货吗?`, '确认完成', { type: 'success' })
// 根据后端报错推断:WHERE parameter "id" has invalid "undefined" value
// 后端执行 SQL 语句时缺少 id 参数。
// 这里采用遍历方式对选中的每一行调用 completeReceiving,并传入 id 字段
for (const row of selectionRows.value) {
console.log('正在执行完成收货,请求数据:', { id: row.id, type: 'complete' })
// 传递 id 标识单号,以及 type: 'complete' 来表示完成收货操作(补全请求数据)
const res: any = await receivingApi.completeReceiving({ id: row.id, type: 'complete' })
console.log('完成收货接口返回数据:', res)
if (res && res.code === 200) {
ElMessage.success(`收货单 ${row.receiving_number} 已完成`)
} else {
ElMessage.error(`收货单 ${row.receiving_number} 操作失败: ${res.message || '系统错误'}`)
}
}
selectionRows.value = []
loadData()
} catch (e) {
// cancelled or error
if (e !== 'cancel') {
console.error('完成收货操作出错:', e)
ElMessage.error('操作执行失败')
}
}
}
@ -891,7 +992,7 @@ async function handleExport() {
overflow: hidden;
.toolbar {
padding: 10px;
padding: 5px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
@ -907,43 +1008,20 @@ async function handleExport() {
}
.upper-wrapper {
flex: 1;
flex: 1 1 auto;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
/* upper-wrapper 自动填充剩余空间 */
overflow: hidden;
}
/* 在 receiving 页面内覆盖 UpperTable,使表格容器填满可用高度,表体滚动,表头与分页固定 */
/* upper-table-container 已在组件内支持弹性高度,此处确保撑满 upper-wrapper */
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
/* 取消 UpperTable 的固定像素高度,改为弹性填充 */
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden; /* 交由 el-table__body-wrapper 控制滚动 */
}
/* 表头粘性,始终可见 */
.upper-wrapper :deep(.el-table__header-wrapper) {
position: sticky;
top: 0;
z-index: 3;
background: #fff;
}
/* 表格 body 使用自身滚动条 */
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
min-height: 0;
}
.lower-level {
flex: 1;
flex: 0 0 auto;
max-height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@ -953,7 +1031,23 @@ async function handleExport() {
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
.detail-tab { margin-bottom: -1px; }
background-color: #fafafa;
.detail-tab {
margin-bottom: -1px;
:deep(.el-tabs__header) {
margin: 0;
}
:deep(.el-tabs__item) {
height: 32px;
line-height: 32px;
font-size: 13px;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
}
}
}
.detail-container {
@ -964,7 +1058,8 @@ async function handleExport() {
}
.no-selection {
flex: 1;
flex: 0 0 auto;
height: 40%;
display: flex;
align-items: center;
justify-content: center;

View File

@ -30,27 +30,25 @@ export const loadingMethodConfig: any = {
}
export const receivingColumns = [
{ prop: 'receiving_number', label: '收货单号', width: '160', fixed: 'left' },
{ prop: 'status', label: '收货状态', width: '100', align: 'center' },
{ prop: 'detail_status', label: '匹配状态', width: '100', align: 'center' },
{ prop: 'storage_status', label: '入库状态', width: '100', align: 'center' },
{ prop: 'store_name', label: '货主', width: '150' },
{ prop: 'creator_name', label: '创建人', width: '120' },
{ prop: 'delivery_method', label: '来货方式', width: '100', align: 'center' },
{ prop: 'receiving_number', label: '收货单号', width: '110', fixed: 'left' },
{ prop: 'status', label: '收货状态', width: '90', align: 'center' },
{ prop: 'detail_status', label: '匹配状态', width: '90', align: 'center' },
{ prop: 'storage_status', label: '入库状态', width: '90', align: 'center' },
{ prop: 'store_name', label: '货主', width: '100' },
{ prop: 'total_items', label: '商品种类', width: '90', align: 'right', sortable: true },
{ prop: 'total_quantity', label: '总数量', width: '90', align: 'right', sortable: true },
{ prop: 'total_boxes', label: '总箱数', width: '90', align: 'right', sortable: true },
{ prop: 'total_pallets', label: '总托盘数', width: '90', align: 'right', sortable: true },
{ prop: 'license_plate', label: '车牌号', width: '100' },
{ prop: 'tracking_number', label: '物流单号', width: '120' },
{ prop: 'delivery_method', label: '来货方式', width: '90', align: 'center' },
{ prop: 'loading_method', label: '装卸方式', width: '100', align: 'center' },
{ prop: 'license_plate', label: '车牌号', width: '120' },
{ prop: 'tracking_number', label: '物流单号', width: '180' },
{ prop: 'total_items', label: '商品种类', width: '100', align: 'right' },
{ prop: 'total_quantity', label: '总数量', width: '100', align: 'right' },
{ prop: 'total_boxes', label: '总箱数', width: '100', align: 'right' },
{ prop: 'total_pallets', label: '总托盘数', width: '100', align: 'right' },
{ prop: 'receiving_start_time', label: '收货开始', width: '150' },
{ prop: 'receiving_end_time', label: '收货结束', width: '150' },
{ prop: 'remark', label: '备注', minWidth: '150' },
{ prop: 'created_at', label: '创建时间', width: '160' },
{ prop: 'updated_at', label: '更新时间', width: '160' },
{ prop: 'creator_name', label: '创建人', width: '100' },
{ prop: 'receiving_start_time', label: '收货开始', width: '150', sortable: true },
{ prop: 'receiving_end_time', label: '收货结束', width: '150', sortable: true },
{ prop: 'created_at', label: '创建时间', width: '150', sortable: true },
{ prop: 'updated_at', label: '更新时间', width: '150', sortable: true },
{ prop: 'remark', label: '备注', minWidth: '120' },
]
@ -239,17 +237,17 @@ export const productdetail = [
]
export const productquick = [
{ prop: 'id', label: 'ID', width: '100' },
{ prop: 'product_name', label: '商品名称', width: '160', fixed: 'left' },
{ prop: 'barcode', label: '条码', width: '160' },
{ prop: 'actual_quantity', label: '实际收货数量', width: '160' },
{ prop: 'box_quantity', label: '箱数', width: '160' },
{ prop: 'storage_status', label: '入库状态', width: '160' },
{ prop: 'remark', label: '备注', width: '160' },
{ prop: 'box_length', label: '箱长', width: '160' },
{ prop: 'box_width', label: '箱宽', width: '160' },
{ prop: 'box_height', label: '箱高', width: '160' },
{ prop: 'space_id', label: '存放位置', width: '160' },
{ prop: 'product_name', label: '商品名称', width: '200', fixed: 'left' },
{ prop: 'barcode', label: '条码', width: '150' },
{ prop: 'actual_quantity', label: '收货数量', width: '100', align: 'right' },
{ prop: 'box_quantity', label: '箱数', width: '100', align: 'right' },
{ prop: 'boxes_per_pallet', label: '箱规', width: '100', align: 'right' },
{ prop: 'batch_number', label: '批次号', width: '120' },
{ prop: 'production_date', label: '生产日期', width: '120' },
{ prop: 'expiry_date', label: '有效期', width: '120' },
{ prop: 'storage_status', label: '入库', width: '80', align: 'center' },
{ prop: 'space_id', label: '库位', width: '120' },
{ prop: 'remark', label: '备注', minWidth: '150' },
]
@ -305,3 +303,13 @@ export function formatReceivingData(list: any[] = []) {
updated_at: item.updated_at || item.updatedAt || item.update_time || item.last_modified || item.modified_at || item.updated || ''
}))
}
// 新建收货单配置
export const addReceivingFields = [
{ prop: 'store_id', label: '货主', type: 'select', filterable: true, options: [] },
{ prop: 'delivery_method', label: '来货方式', type: 'select', options: Object.entries(deliveryMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
{ prop: 'loading_method', label: '装卸方式', type: 'select', options: Object.entries(loadingMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
{ prop: 'license_plate', label: '车牌号', type: 'input' },
{ prop: 'tracking_number', label: '物流单号', type: 'input' },
{ prop: 'remark', label: '备注', type: 'textarea' }
]

View File

@ -1,131 +0,0 @@
/*
Navicat MySQL Data Transfer
Source Server : wms
Source Server Type : MySQL
Source Server Version : 50744
Source Host : 112.124.21.102:3306
Source Schema : wms
Target Server Type : MySQL
Target Server Version : 50744
File Encoding : 65001
Date: 24/03/2026 16:22:27
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for wms_permission
-- ----------------------------
DROP TABLE IF EXISTS `wms_permission`;
CREATE TABLE `wms_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '路由路径',
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由名称',
`redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '重定向路径',
`meta_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面标题',
`meta_icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
`hidden` tinyint(1) NULL DEFAULT 0 COMMENT '是否隐藏(0:显示,1:隐藏)',
`always_show` tinyint(1) NULL DEFAULT 0 COMMENT '是否始终显示',
`parent_id` int(11) NULL DEFAULT NULL COMMENT '父级ID(根节点为NULL)',
`sort` int(11) NULL DEFAULT 0 COMMENT '排序',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0:禁用,1:启用)',
`created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`update_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
`type` enum('web_pages','pda_pages','btns','api','miniprogram_pages','block') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'web_pages' COMMENT '设备类型(1:电脑端,2:小程序,3:手持设备,4:管理后台)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `name`(`name`, `type`) USING BTREE,
INDEX `idx_parent_id`(`parent_id`) USING BTREE,
INDEX `idx_status`(`status`) USING BTREE,
CONSTRAINT `fk_wms_permission_parent` FOREIGN KEY (`parent_id`) REFERENCES `wms_permission` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限路由表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wms_permission
-- ----------------------------
INSERT INTO `wms_permission` VALUES (1, '/order', 'Layout', 'Order', '', '订单', 'el-icon-s-order', 0, 0, NULL, 2, 1, '2025-10-10 01:44:57', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (4, '/setting', 'Layout', 'Setting', NULL, '设置', 'el-icon-s-tools', 0, 0, NULL, 99, 1, '2025-10-11 20:06:57', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (5, 'permission', '@/views/permission/index', 'Permission', NULL, '权限管理', 'setting', 1, 0, 4, 2, 1, '2025-10-11 20:08:49', '2025-12-19 15:18:23', 'web_pages');
INSERT INTO `wms_permission` VALUES (6, 'account', '@/views/account/index', 'userAccount', NULL, '账号管理', 'user', 0, 0, 4, 1, 1, '2025-10-11 20:14:42', '2026-03-09 18:30:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (7, 'role', '@/view/role/index', 'Role', NULL, '角色管理', 'role', 1, 0, 4, 3, 1, '2025-10-11 20:22:01', '2025-12-19 15:18:29', 'web_pages');
INSERT INTO `wms_permission` VALUES (8, 'basicManagement', '@/views/system/setting/index', 'BasicManagement', '/system/basicManagement/permission', '基础设置', NULL, 0, 0, 4, 3, 1, '2025-10-11 23:02:37', '2026-03-09 16:22:54', 'web_pages');
INSERT INTO `wms_permission` VALUES (9, 'StoreManagement', '@/views/system/setting/index', 'StoreManagement', '/system/storeManagement/store', '主体设置', NULL, 0, 0, 4, 2, 1, '2025-10-22 15:34:36', '2026-03-09 18:25:50', 'web_pages');
INSERT INTO `wms_permission` VALUES (10, 'deliverOrder', '@/views/order/deliverOrder', 'DeliverOrder', '', '波次管理', NULL, 0, 0, 1, 1, 1, '2025-10-22 15:37:46', '2026-03-09 16:22:49', 'web_pages');
INSERT INTO `wms_permission` VALUES (11, 'orderManagement', '@/views/order/index', 'OrderManagement', '', '订单管理', NULL, 0, 0, 1, 0, 1, '2025-10-22 16:27:30', '2026-03-09 16:22:45', 'web_pages');
INSERT INTO `wms_permission` VALUES (12, 'orderSetting', '@/views/order/setting', 'OrderSetting', NULL, '订单策略设置', NULL, 0, 0, 1, 2, 1, '2025-12-08 16:44:55', '2026-03-09 16:22:43', 'web_pages');
INSERT INTO `wms_permission` VALUES (13, '/stock', 'Layout', 'Stock', NULL, '商品', 'el-icon-s-goods', 0, 0, NULL, 3, 1, '2025-12-08 19:48:32', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (14, '/warehouse', 'Layout', 'Warehouse', '/warehouse/warehouse', '仓位', 'el-icon-s-grid', 0, 0, NULL, 4, 1, '2025-12-08 20:08:53', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (15, '/material', 'Layout', 'Material', NULL, '物料', 'el-icon-s-cooperation', 0, 0, NULL, 5, 1, '2025-12-08 20:13:34', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (16, '/data', 'Layout', 'Data', NULL, '数据', 'el-icon-s-marketing', 0, 0, NULL, 6, 1, '2025-12-08 20:15:04', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (17, '/store', 'Layout', 'Store', NULL, '货主', 'el-icon-s-custom', 0, 0, NULL, 4, 1, '2025-12-08 20:16:51', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (18, '/storage', 'Layout', 'Storage', NULL, '库存', 'el-icon-s-data', 0, 0, NULL, 3, 1, '2025-12-08 20:19:59', '2026-03-24 16:19:01', 'web_pages');
INSERT INTO `wms_permission` VALUES (19, '/express', 'Layout', 'Express', NULL, '物流', 'el-icon-truck', 0, 0, NULL, 5, 1, '2025-12-08 20:23:06', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (20, 'stock', '@/views/stock/index', 'Stock Info', NULL, '商品资料', NULL, 0, 0, 13, 0, 1, '2025-12-08 21:47:05', '2026-03-09 17:29:14', 'web_pages');
INSERT INTO `wms_permission` VALUES (21, 'store_stock', 'Layout', 'Store Stock', NULL, '货主商品', NULL, 0, 0, 13, 1, 1, '2025-12-08 21:48:04', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (22, 'combo_stock', 'Layout', 'Combo Stock', NULL, '组合商品', NULL, 0, 0, 13, 2, 1, '2025-12-08 22:06:22', '2026-03-10 13:57:02', 'web_pages');
INSERT INTO `wms_permission` VALUES (23, 'stock', 'Layout', 'Stock Storage', NULL, '商品库存', NULL, 0, 0, 18, 0, 1, '2025-12-08 22:09:52', '2026-03-24 16:16:37', 'web_pages');
INSERT INTO `wms_permission` VALUES (24, 'entry', '@/views/storage/entry', 'Entry Order', NULL, '入库单', NULL, 0, 0, 18, 1, 1, '2025-12-08 22:10:29', '2026-03-19 14:05:24', 'web_pages');
INSERT INTO `wms_permission` VALUES (25, 'stockout', '@/views/storage/stockout', 'Stock out', NULL, '出库单', NULL, 0, 0, 18, 2, 1, '2025-12-08 22:11:42', '2026-03-20 09:50:57', 'web_pages');
INSERT INTO `wms_permission` VALUES (26, 'inventory', 'Layout', 'Inventory', NULL, '盘点', NULL, 0, 0, 18, 3, 1, '2025-12-08 22:13:38', '2026-03-09 16:23:01', 'web_pages');
INSERT INTO `wms_permission` VALUES (27, 'exception', 'Layout', 'Exception', NULL, '异常处理', NULL, 0, 0, 18, 5, 1, '2025-12-08 22:19:09', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (28, '/finance', 'Layout', 'Finance', NULL, '财务', 'el-icon-s-finance', 0, 0, NULL, 7, 1, '2025-12-09 14:32:57', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (29, 'materialInfo', 'Layout', 'Material Info', NULL, '物料资料', 'el-icon-info', 0, 0, 15, 0, 1, '2025-12-09 20:46:06', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (30, 'materialStorage', 'Layout', 'materialStorage', NULL, '物料库存', NULL, 0, 0, 15, 0, 1, '2025-12-09 20:46:56', '2026-03-09 18:23:09', 'web_pages');
INSERT INTO `wms_permission` VALUES (31, 'bill', 'Layout', 'Bill', NULL, '账单', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:05:25', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (32, 'daily', 'Layout', 'Daily', NULL, '流水', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:06:43', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (33, 'account', 'Layout', 'Account', NULL, '账户', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:07:17', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (34, 'statistics', 'Layout', 'Statistics', NULL, '统计', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:08:15', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (35, 'valuation', 'Layout', 'Valuation', NULL, '定价', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:09:09', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (36, 'receivable', 'Layout', 'Receivable', NULL, '应收', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:10:14', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (37, 'encoding', 'Layout', 'Encoding', NULL, '编码设置', NULL, 0, 0, 28, 0, 1, '2025-12-10 11:11:52', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (38, 'log', 'Layout', 'Commodity Inbound and Outbound Log', NULL, '商品出入库日志', NULL, 0, 0, 18, 4, 1, '2025-12-10 14:24:25', '2026-03-09 18:27:27', 'web_pages');
INSERT INTO `wms_permission` VALUES (39, 'log', 'Layout', 'Log', NULL, '物料出入库日志', NULL, 0, 0, 15, 3, 1, '2025-12-10 14:26:23', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (40, 'encoding', 'Layout', 'Encoding2', NULL, '仓库编码设置', NULL, 0, 0, 4, 0, 1, '2025-12-10 14:30:11', '2026-03-09 18:28:27', 'web_pages');
INSERT INTO `wms_permission` VALUES (41, 'open', 'Layout', 'Open', NULL, '第三方开发接口', NULL, 0, 0, 4, 1, 1, '2025-12-10 14:39:55', '2025-12-12 14:23:03', 'web_pages');
INSERT INTO `wms_permission` VALUES (42, 'dashboard.warehouseBaseData', 'dashboard.base_data', 'Base Data', NULL, '仓库基础数据', NULL, 0, 0, NULL, 0, 1, '2025-12-12 14:17:26', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (43, 'dashboard.hotOrderRank', 'dashboard.HotOrderRank', 'Hot STOCK Rank', NULL, '热门商品排行', NULL, 0, 0, NULL, 0, 1, '2025-12-12 15:10:10', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (44, 'dashboard.orderTrend', 'dashboard.order_trend', 'Order Trend', NULL, '订单趋势', NULL, 0, 0, NULL, 0, 1, '2025-12-12 15:11:21', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (45, 'dashboard.platformDist', 'dashboard.platform_distribution', 'Platform Distribution', NULL, '平台分布', NULL, 0, 0, NULL, 0, 1, '2025-12-12 15:11:58', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (46, 'dashboard.expressRatio', 'dashboard.expressRatio', 'Express Ratio', NULL, '快递分布', NULL, 0, 0, NULL, 0, 1, '2025-12-12 16:39:52', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (47, 'video', 'Layout', 'Video', NULL, '视频监控', 'el-icon-video-camera-solid', 0, 0, NULL, 8, 1, '2025-12-12 16:55:18', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (48, 'dashboard.storeBaseData', NULL, NULL, NULL, '商家基础数据', NULL, 0, 0, NULL, 0, 1, '2025-12-14 17:06:27', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (49, 'dashboard.auth', NULL, NULL, NULL, '系统剩余有效期', NULL, 0, 0, NULL, 0, 1, '2025-12-15 17:56:51', '2026-03-23 11:54:04', 'block');
INSERT INTO `wms_permission` VALUES (50, '/auth/approve', '@/views/auth/approve', 'Auth Approve', '', '成员加入审核', NULL, 1, 0, NULL, 0, 1, '2025-12-16 14:20:00', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (52, 'store.getStoreRoles', NULL, NULL, NULL, '获取审核信息接口', NULL, 0, 0, 50, 0, 1, '2025-12-16 14:46:40', '2025-12-17 17:20:55', 'api');
INSERT INTO `wms_permission` VALUES (53, 'store.auditApply', NULL, NULL, NULL, '提交审核接口', NULL, 0, 0, 50, 0, 1, '2025-12-17 17:19:14', '2025-12-17 17:20:47', 'api');
INSERT INTO `wms_permission` VALUES (54, 'warehouse', '@/views/warehouse/index', 'WarehouseZone', NULL, '仓库区位', NULL, 0, 0, 14, 0, 1, '2025-12-19 20:58:16', '2026-03-09 18:32:21', 'web_pages');
INSERT INTO `wms_permission` VALUES (55, 'warehouse.getWarehouseZones', '', NULL, NULL, '获取所有仓库', NULL, 0, 0, NULL, 0, 1, '2025-12-22 15:28:10', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (56, 'warehouse.create', NULL, NULL, NULL, '创建实体库', NULL, 0, 0, NULL, 0, 1, '2025-12-22 17:11:59', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (57, 'warehouse.getWarehouseTree', NULL, NULL, NULL, '获取仓库下的元素', NULL, 0, 0, NULL, 0, 1, '2025-12-22 18:57:42', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (58, 'warehouse.detail', NULL, NULL, NULL, '获取元素信息', NULL, 0, 0, NULL, 0, 1, '2025-12-22 21:17:54', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (59, 'warehouse.update', NULL, NULL, NULL, '更新仓库元素', NULL, 0, 0, NULL, 0, 1, '2025-12-23 15:57:57', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (60, 'warehouse.delete', NULL, NULL, NULL, '删除仓库元素', NULL, 0, 0, NULL, 0, 1, '2025-12-24 15:25:46', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (61, 'warehouse.updateSpaceInfo', NULL, NULL, NULL, '修改仓位信息', NULL, 0, 0, NULL, 0, 1, '2025-12-27 20:28:39', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (62, 'stock.saveWarehouseStock', NULL, NULL, NULL, '保存商品资料', NULL, 0, 0, NULL, 0, 1, '2026-01-06 21:54:27', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (63, 'stock.saveWarehouseStockBarcode', NULL, NULL, NULL, '修改商品条码', NULL, 0, 0, NULL, 0, 1, '2026-01-08 14:49:45', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (64, 'stock.bindItem', NULL, NULL, NULL, '绑定货主商品到仓库', NULL, 0, 0, NULL, 0, 1, '2026-01-09 21:45:09', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (65, 'stock.unbindItem', NULL, NULL, NULL, '解除绑定货主商品到仓库', NULL, 0, 0, NULL, 0, 1, '2026-01-09 23:11:57', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (66, 'index.ReferenceFile', NULL, NULL, NULL, '图片设置权限', NULL, 0, 0, NULL, 0, 1, '2026-01-15 22:56:05', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (67, 'warehouseExport', NULL, NULL, NULL, '仓库所有导出权限', NULL, 0, 0, NULL, 0, 1, '2026-01-15 23:10:12', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (68, 'warehouseRecycle', NULL, NULL, NULL, '仓库所有回收站数据权限', NULL, 0, 0, NULL, 0, 1, '2026-01-15 23:13:05', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (69, 'stock.createWarehouseStock', NULL, NULL, NULL, '仓库商品创建', NULL, 0, 0, NULL, 0, 1, '2026-01-16 16:01:48', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (70, 'stock.handleBatchDelete', NULL, NULL, NULL, '删除仓库商品', NULL, 0, 0, NULL, 0, 1, '2026-01-16 18:39:41', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (71, 'stock.handleBatchChange', NULL, NULL, NULL, '批量修改', NULL, 0, 0, NULL, 0, 1, '2026-01-17 16:28:47', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (72, 'receiving', '@/views/storage/receiving', 'Receiving', NULL, '收货列表', NULL, 0, 0, 18, 0, 1, '2026-01-18 19:12:08', '2026-03-09 16:27:23', 'web_pages');
INSERT INTO `wms_permission` VALUES (73, '/system', 'Layout', 'System', NULL, '系统', 'el-icon-s-tools', 0, 0, NULL, 100, 1, '2026-01-22 16:02:02', '2026-03-23 11:54:04', 'web_pages');
INSERT INTO `wms_permission` VALUES (74, 'warehouse', 'Layout', 'Warehouse', NULL, '仓库作业', NULL, 0, 0, NULL, 0, 1, '2026-01-24 16:28:28', '2026-03-23 11:54:04', 'pda_pages');
INSERT INTO `wms_permission` VALUES (75, 'Receiving', '/pages/work/storage/receiving/receiving', 'Receiving', NULL, '收货作业', 'shopping-cart', 0, 0, 74, 0, 1, '2026-01-24 16:29:55', '2026-01-31 20:10:19', 'pda_pages');
INSERT INTO `wms_permission` VALUES (76, 'Relocation', '/pages/work/storage/relocation', 'Relocation', NULL, '移库作业', 'arrow-right-double', 0, 0, 74, 0, 1, '2026-01-28 21:04:30', '2026-01-28 21:14:17', 'pda_pages');
INSERT INTO `wms_permission` VALUES (77, 'Stock', '/pages/work/stock/list', 'FindStock', NULL, '商品查询', 'gift', 0, 0, 78, 0, 1, '2026-01-30 13:53:33', '2026-03-09 18:30:54', 'pda_pages');
INSERT INTO `wms_permission` VALUES (78, 'Stock', 'Layout', 'Stock', NULL, '商品管理', 'gift', 0, 0, NULL, 0, 1, '2026-01-30 13:55:16', '2026-03-23 11:54:04', 'pda_pages');
INSERT INTO `wms_permission` VALUES (79, 'storage.receiving.create', NULL, NULL, NULL, '创建收货单', NULL, 0, 0, NULL, 0, 1, '2026-01-31 00:38:19', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (80, 'printTemplate', '@/views/system/setting/printTemplate/index', 'PrintTemplate', NULL, '打印模板设置', NULL, 0, 0, 4, 0, 1, '2026-02-05 22:27:55', '2026-03-09 16:27:30', 'web_pages');
INSERT INTO `wms_permission` VALUES (81, 'printStation', '@/views/system/print/station', 'PrintStation', NULL, '打印台管理', NULL, 0, 0, 4, 0, 1, '2026-03-10 13:40:38', '2026-03-10 13:41:44', 'web_pages');
INSERT INTO `wms_permission` VALUES (82, 'storage.receiving.getReceivingDetail', NULL, NULL, NULL, '获取收货单明细', NULL, 0, 0, NULL, 0, 1, '2026-03-19 14:17:10', '2026-03-23 11:54:04', 'api');
INSERT INTO `wms_permission` VALUES (83, 'storage.receiving.batchCancelReceiving', NULL, NULL, NULL, '批量作废收货单', NULL, 0, 0, NULL, 0, 1, '2026-03-19 14:50:43', '2026-03-23 11:54:04', 'api');
SET FOREIGN_KEY_CHECKS = 1;

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
# 微信绑定功能 TODO
## 任务目标
实现微信公众号扫码绑定/解绑账号功能,前后端联调。
---
## 后端接口设计(参考)
### 一、`user.getBindWechatCode` — 获取微信绑定二维码及轮询状态
**请求:** POST `/system`,params: `{ method: 'user.getBindWechatCode', v, timestamp }`
**逻辑:**
1. 查询 ye4s 数据库,判断当前账号是否已绑定微信。
2. 若已绑定,直接返回绑定信息(status: 'bound',nickname 等)。
3. 若未绑定:
- 优先从缓存中读取该账号对应的随机码 `code`,避免重复查数据库。
- 若缓存无随机码,则生成新随机码写入缓存(key: `wechat:bind:{accountId}`,TTL 可设 5 分钟)。
- 返回随机码 + 公众号二维码 URL(将 `code` 作为 state 参数带入)。
4. 微信用户扫码关注后,公众号后台回调将 openid 与 code 关联,更新缓存状态为 `scanned` / `bound`。
5. 前端通过轮询本接口,命中缓存即可感知状态变化,无需重复查数据库。
**返回结构(建议):**
```json
{
"code": 0,
"data": {
"status": "waiting | scanned | bound | expired",
"bindCode": "随机码(未绑定时返回)",
"qrUrl": "微信公众号带参二维码地址",
"nickname": "(已绑定时返回微信昵称)",
"openid": "(已绑定时返回openid)"
}
}
```
---
### 二、`user.unbindWechat` — 解除微信绑定
**请求:** POST `/system`,params: `{ method: 'user.unbindWechat', v, timestamp }`
**逻辑:**
1. 根据当前登录账号,删除 ye4s 数据库中对应的微信绑定关联记录。
2. 同步清除缓存中的绑定随机码。
3. 返回操作结果。
**返回结构(建议):**
```json
{
"code": 0,
"data": { "success": true }
}
```
---
## 前端任务
- [x] 更新 `src/api/profile.ts`:新增 `getBindWechatCode` / `unbindWechat` 接口
- [x] 重构 `src/views/profile/components/Bind.vue`:
- 打开弹窗时调用 `getBindWechatCode` 获取二维码 URL 及 bindCode
- 轮询(3s interval)`getBindWechatCode` 检测 status 变化
- status 变为 `bound` 时关闭弹窗,刷新绑定状态
- 调用 `unbindWechat` 实现解绑
---
## 临时文件列表(任务完成后删除)
- `temp/wechat-bind/TODO.md`(本文件)
---
## 回归清理
任务完成、联调通过后:
- 删除 `temp/wechat-bind/` 目录及其所有文件

View File

@ -32,4 +32,23 @@
修复页面“筛选”功能不可用问题。
更新注册/登录页面。
完成“微信绑定”功能。
完善“库存”相关页面操作与功能。
完善“库存”相关页面操作与功能。
2026.3.25
一、今日完成
-优化layout框架,、stock页面、receiving页面、entry页面和部分页面组件适配不同尺寸显示屏幕,增大数据显示密度。
-优化绑定微信接口,调整超时和轮询时间。
-修复页面“筛选”功能不可用问题。
-修复“商品明细”查看图片显示异常问题。
-“收货单”新增“新建收货单”菜单及功能。
-更新receiving接口、profile接口、stock接口。
-更新scan-box、Upper-table公共组件样式。
-stock接口新增二次封装。
二、问题记录
后端tracking_number物流单号缺失
三、后续计划
完善项目页面及其组件屏幕尺寸适配。
添加后端已完成的api接口并进行功能的完善与开发。