3月24日更新

This commit is contained in:
yin 2026-03-24 18:26:53 +08:00
parent 0070f15944
commit 868c43be9f
30 changed files with 28259 additions and 143 deletions

View File

@ -157,3 +157,21 @@ export function savePrinters(data: any) {
data: data
})
}
// 发送打印任务
export function sendPrint(data: any) {
return request({
url: '/system',
method: 'post',
params: {
method: 'print.send',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function getStationList(arg0: {}): any {
throw new Error('Function not implemented.');
}

View File

@ -194,3 +194,7 @@ export function saveTemplate (data:any) {
} as any)
}
export function getTemplateList(arg0: { type: string }): any {
throw new Error('Function not implemented.')
}

54
src/api/profile.ts Normal file
View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
const v = "1.0";
/** 获取账号绑定基础信息(页面初始化用) */
export const getBindInfo = () => {
return request({
url: '/system',
method: 'post',
params: {
method: 'account.getBindInfo',
v,
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
} as any)
}
/**
* 获取微信绑定二维码及轮询状态
* 支持轮询,优先命中缓存,不重复查库
* 返回: { status: 'waiting'|'scanned'|'bound'|'expired', bindCode, qrUrl, nickname, openid }
*/
export const getBindWechatCode = () => {
return request({
url: '/system',
method: 'post',
params: {
method: 'user.getBindWechatCode',
v,
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
} as any)
}
/**
* 解绑微信
* 删除 ye4s 数据库中的绑定关联记录,并清除缓存
*/
export const unbindWechat = () => {
return request({
url: '/system',
method: 'post',
params: {
method: 'user.unbindWechat',
v,
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
} as any)
}

View File

@ -66,4 +66,19 @@ export function exportReceiving(data: any): Promise<any> {
},
data: data
})
}
// 发送打印任务
// data: { stationId, printerName, templateId, businessType, businessId, printData }
export function sendPrint(data: any) {
return request({
url: '/system',
method: 'post',
params: {
method: 'print.send',
v,
timestamp: new Date().getTime()
},
data: data
})
}

26
src/api/storage/stock.ts Normal file
View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
const v = "1.0"
export const getinventoryList = (params: any) => {
return request({
url: `/api/storage/stock/list`,
method: 'get',
params: {
method: 'storage.stock.getProductstockList',
version: v,
}
})
}
// 未使用,保留
export const getinventoryDetail = (data: any) => {
return request({
url: `/api/storage/stock/detail`,
method: 'get',
params: {
method: 'storage.stock.getProductstockDetail',
version: v,
...data
}
})
}

View File

@ -3,7 +3,7 @@ export const componentMap: Record<string, any> = {
'login/index': () => import('@/views/login/index.vue'),
'permission/index': () => import('@/views/permission/index.vue'),
// 'system/setting/index': () => import('@/views/system/setting/index.vue'),
'order/index': () => import('@/views/order/index.vue'),
'order/index': () => import('@/views/order/orderManagement/index.vue'),
'auth/approve': () => import('@/views/auth/approve.vue'),
'account/index': () => import('@/views/account/index.vue'),
'warehouse/index': () => import('@/views/warehouse/index.vue'),
@ -12,9 +12,7 @@ export const componentMap: Record<string, any> = {
'stock/combo_stock/index': () => import('@/views/stock/combo_stock/index.vue'),
'storage/receiving': () => import('@/views/storage/receiving/index.vue'),
'storage/entry': () => import('@/views/storage/entry/index.vue'),
'storage/entry/index': () => import('@/views/storage/entry/index.vue'),
'storage/stock': () => import('@/views/storage/stock/index.vue'),
//'storage/stock/index': () => import('@/views/storage/stock/index.vue'),
'storage/inventory': () => import('@/views/storage/inventory/index.vue'),
'system/setting/printTemplate/index': () => import('@/views/system/setting/printTemplate/index.vue'),
// 'system/setting/printStation/index': () => import('@/views/system/setting/printStation/index.vue'),
'system/print/station': () => import('@/views/system/setting/printStation/index.vue'),

View File

@ -0,0 +1,316 @@
<template>
<div class="bind-container">
<div class="bind-item">
<div class="bind-info">
<div class="label">微信绑定</div>
<div class="desc">绑定微信后,即可快速登录,且能接收系统重要通知</div>
</div>
<div class="bind-action">
<template v-if="isBound">
<span class="bound-status">
<el-icon><CircleCheckFilled /></el-icon>
已绑定:{{ binderInfo.nickname || '微信用户' }}
</span>
<el-button type="danger" plain size="small" :loading="unbinding" @click="handleUnbind">解绑</el-button>
</template>
<el-button v-else type="primary" size="small" @click="handleBind">去绑定</el-button>
</div>
</div>
<!-- 绑定二维码对话框 -->
<el-dialog
v-model="dialogVisible"
title="微信扫码绑定"
width="350px"
append-to-body
center
@close="handleDialogClose"
>
<div class="qrcode-wrapper">
<!-- 加载中 -->
<div v-if="loading" class="loading-overlay">
<el-icon class="is-loading"><Loading /></el-icon>
</div>
<!-- 二维码过期 -->
<div v-else-if="qrStatus === 'expired'" class="expired-overlay" @click="refreshQrCode">
<el-icon><RefreshRight /></el-icon>
<span>二维码已过期,点击刷新</span>
</div>
<!-- 扫码成功等待确认 -->
<div v-else-if="qrStatus === 'scanned'" class="scanned-overlay">
<el-icon><CircleCheckFilled /></el-icon>
<span>扫码成功,正在确认...</span>
</div>
<!-- 二维码图片 -->
<template v-else>
<img :src="qrCodeUrl" alt="微信二维码" class="qrcode-img">
</template>
<p class="qrcode-tip">
<template v-if="qrStatus === 'scanned'">请在微信中确认绑定</template>
<template v-else-if="qrStatus === 'expired'">二维码已失效</template>
<template v-else>请使用微信扫码关注公众号完成绑定</template>
</p>
</div>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from 'vue'
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'
const isBound = ref(false)
const unbinding = ref(false)
const binderInfo = reactive({ nickname: '', openid: '' })
const loading = ref(false)
const dialogVisible = ref(false)
const qrCodeUrl = ref("")
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 fetchBindInfo = async () => {
try {
const res = await getBindInfo()
const data = res?.data
if (data?.status === 'bound' || data?.isBound) {
isBound.value = true
binderInfo.nickname = data.nickname || ''
binderInfo.openid = data.openid || ''
} else {
isBound.value = false
}
} catch {
// 获取失败不阻断页面
}
}
/** 打开绑定弹窗,获取二维码 */
const handleBind = async () => {
dialogVisible.value = true
await refreshQrCode()
startPolling()
}
/** 获取/刷新二维码 */
const refreshQrCode = async () => {
loading.value = true
qrStatus.value = 'waiting'
qrCodeUrl.value = ''
try {
const res = await getBindWechatCode()
const data = res?.data
if (!data) throw new Error('无返回数据')
if (data.status === 'bound') {
// 已绑定,直接刷新状态关闭弹窗
isBound.value = true
binderInfo.nickname = data.nickname || ''
binderInfo.openid = data.openid || ''
dialogVisible.value = false
ElMessage.success('微信已绑定')
return
}
qrStatus.value = data.status as QrStatus
qrCodeUrl.value = data.code ? (qrBaseUrl + data.code) : ''
} catch {
ElMessage.error('获取二维码失败,请重试')
dialogVisible.value = false
} finally {
loading.value = false
}
}
/** 启动轮询 */
const startPolling = () => {
stopPolling()
pollTimer = setInterval(async () => {
try {
const res = await getBindWechatCode()
const data = res?.data
if (!data) return
qrStatus.value = data.status as QrStatus
// 更新二维码
if (data.code) {
qrCodeUrl.value = qrBaseUrl + data.code
}
if (data.status === 'bound') {
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()
}
} catch {
// 轮询失败静默处理,不弹错误
}
}, POLL_INTERVAL)
}
/** 停止轮询 */
const stopPolling = () => {
if (pollTimer) {
clearInterval(pollTimer)
pollTimer = null
}
}
/** 关闭弹窗时停止轮询 */
const handleDialogClose = () => {
stopPolling()
qrStatus.value = 'waiting'
qrCodeUrl.value = ''
}
/** 解绑微信 */
const handleUnbind = () => {
ElMessageBox.confirm('确定要解除微信绑定吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
unbinding.value = true
try {
await unbindWechat()
isBound.value = false
binderInfo.nickname = ''
binderInfo.openid = ''
ElMessage.success('微信绑定已解除')
} catch {
ElMessage.error('解绑失败,请重试')
} finally {
unbinding.value = false
}
}).catch(() => {})
}
onMounted(() => {
fetchBindInfo()
})
onUnmounted(() => {
stopPolling()
})
</script>
<style lang="scss" scoped>
.bind-container {
padding: 10px 0;
.bind-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
border: 1px solid var(--el-border-color-lighter);
border-radius: 8px;
background-color: var(--el-fill-color-blank);
.bind-info {
.label {
font-size: 16px;
font-weight: bold;
color: var(--el-text-color-primary);
margin-bottom: 8px;
}
.desc {
font-size: 14px;
color: var(--el-text-color-secondary);
}
}
.bind-action {
display: flex;
align-items: center;
gap: 15px;
.bound-status {
display: flex;
align-items: center;
gap: 5px;
color: var(--el-color-success);
font-size: 14px;
.el-icon {
font-size: 18px;
}
}
}
}
.qrcode-wrapper {
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
.qrcode-img {
width: 200px;
height: 200px;
border: 1px solid var(--el-border-color);
}
.qrcode-tip {
margin-top: 15px;
font-size: 13px;
color: var(--el-text-color-secondary);
text-align: center;
}
.loading-overlay,
.expired-overlay,
.scanned-overlay {
width: 200px;
height: 200px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
font-size: 13px;
border: 1px solid var(--el-border-color);
border-radius: 4px;
.el-icon {
font-size: 36px;
}
}
.loading-overlay {
background: var(--el-fill-color-light);
.el-icon { color: var(--el-color-primary); }
}
.expired-overlay {
background: var(--el-fill-color);
color: var(--el-text-color-secondary);
cursor: pointer;
transition: background 0.2s;
&:hover { background: var(--el-fill-color-dark); }
.el-icon { color: var(--el-color-warning); }
}
.scanned-overlay {
background: var(--el-color-success-light-9);
color: var(--el-color-success);
.el-icon { color: var(--el-color-success); }
}
}
}
</style>

View File

@ -41,6 +41,11 @@
<el-tab-pane label="加入公司" name="joinStore">
<WelcomCard />
</el-tab-pane>
<!-- 微信绑定 -->
<el-tab-pane label="微信绑定" name="bind">
<Bind />
</el-tab-pane>
</el-tabs>
</el-card>
</div>
@ -66,6 +71,7 @@ import AccountSecurity from './components/AccountSecurity.vue'
import OperationLogs from './components/OperationLogs.vue'
import ChangePasswordDialog from './components/ChangePasswordDialog.vue'
import WelcomCard from '../dashboard/components/WelcomCard.vue'
import Bind from './components/Bind.vue'
const router = useRouter()
const userStore = useUserStore()
@ -124,10 +130,6 @@ const operationLogs = reactive({
})
onMounted(() => {
// Initial load logic if needed
// In Vue 2: loadUserData() and loadOperationLogs()
// Here we use watch for user data and mocked logs
// To simulate log loading:
loadOperationLogs()
})

View File

@ -1,6 +1,6 @@
<template>
<div class="">
<h1>库存管理</h1>
<h1>操作日志</h1>
</div>
</template>

View File

@ -0,0 +1,118 @@
<template>
<div class="panel-stock-detail">
<div class="main-content">
<el-table :data="detailList" border stripe size="small" v-loading="loading">
<el-table-column
v-for="col in productstockDetail"
:key="col.prop"
:prop="col.prop"
:label="col.label"
:width="col.width"
show-overflow-tooltip
>
<template #default="{ row }" v-if="col.prop === 'inventory_status'">
<el-tag :type="row[col.prop] === '正常' ? 'success' : 'warning'" size="small">
{{ row[col.prop] }}
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { productstockDetail } from '../entry-config'
const props = defineProps<{
id: string | number,
row?: any
}>()
const loading = ref(false)
const detailList = ref<any[]>([])
// 模拟明细数据
const getMockDetails = (id: string | number) => {
return [
{
id: 101379,
sku_code: 'OUSI9002',
barcode: '6955416420550',
product_name: 'OUSI欧似香水9002(炙爱之水)',
spec_name: '默认规格',
unit: '个',
actual_qty: 100,
available_qty: 318,
batch_no: 'BAT20260111',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'A-01-01',
inventory_status: '正常'
},
{
id: 101384,
sku_code: 'TEST001',
barcode: '011000000228',
product_name: '测试商品',
spec_name: '默认规格3',
unit: '个',
actual_qty: 50,
available_qty: 1500,
batch_no: 'BAT20260120',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'B-02-05',
inventory_status: '正常'
},
{
id: 101409,
sku_code: 'BAG-BLU',
barcode: '6900000000333',
product_name: '蓝色包',
spec_name: '默认规格',
unit: '个',
actual_qty: 20,
available_qty: 173,
batch_no: 'BAT20260212',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'C-01-02',
inventory_status: '正常'
}
]
}
const loadData = () => {
loading.value = true
// 模拟接口延迟
setTimeout(() => {
detailList.value = getMockDetails(props.id)
loading.value = false
}, 300)
}
watch(() => props.id, () => {
loadData()
}, { immediate: true })
onMounted(() => {
loadData()
})
</script>
<style scoped lang="scss">
.panel-stock-detail {
padding: 10px;
background: #fff;
height: 100%;
display: flex;
flex-direction: column;
.main-content {
flex: 1;
overflow: hidden;
}
}
</style>

View File

@ -0,0 +1,63 @@
export const availableFields = [
{ label: '入库单号', value: 'entry_order_code', type: 'input' },
{ label: '货主', value: 'store_id', type: 'select', options: [] },
{ label: '状态', value: 'order_status', type: 'select', options: [
{ label: '待处理', value: 'CREATED' },
{ label: '已完成', value: 'COMPLETED' },
{ label: '已关闭', value: 'CLOSED' },
{ label: '已取消', value: 'CANCELLED' }
]},
{ label: '业务类型', value: 'order_type', type: 'select', options: [
{ label: '采购入库', value: 'CGRK' },
{ label: '退货入库', value: 'THRK' },
{ label: '调拨入库', value: 'DBRK' },
{ label: '盘盈入库', value: 'PYRK' },
{ label: '其他入库', value: 'QTRK' }
]},
{ label: '供应商', value: 'supplier_name', type: 'input' },
{ label: '运单号', value: 'express_code', type: 'input' },
{ label: '单据编号', value: 'purchase_order_code', type: 'input' },
{ label: '是否同步', value: 'sync_status', type: 'select', options: [
{ label: '同步成功', value: 'SUCCESS' },
{ label: '等待同步', value: 'PENDING' },
{ label: '同步失败', value: 'FAIL' }
]},
{ label: '数据来源', value: 'source_type', type: 'select', options: [
{ label: '奇门', value: 'QM' },
{ label: '手工创建', value: 'MANUAL' },
{ label: '接口导入', value: 'API' }
]},
{ label: '创建日期', value: 'create_time_range', type: 'daterange' }
]
export const productstockColums = [
{ prop: 'id', label: 'ID', width: '80' },
{ prop: 'entry_order_code', label: '入库单号', width: '180' },
{ prop: 'store_name', label: '货主', width: '120' },
{ prop: 'order_type', label: '业务类型', width: '100' },
{ prop: 'purchase_order_code', label: '单据编号', width: '150' },
{ prop: 'order_status', label: '状态', width: '100' },
{ prop: 'total_order_lines', label: '物料种数', width: '100' },
{ prop: 'supplier_name', label: '供应商', width: '150' },
{ prop: 'logistics_name', label: '物流公司', width: '120' },
{ prop: 'express_code', label: '运单号', width: '150' },
{ prop: 'order_create_time', label: '创建时间', width: '160' },
{ prop: 'sync_status', label: '同步状态', width: '100' },
{ prop: 'source_type', label: '数据来源', width: '100' }
]
export const productstockDetail = [
{ prop: 'id', label: 'ID', width: '80' },
{ prop: 'sku_code', label: '商品编码', width: '150' },
{ prop: 'barcode', label: '条码', width: '150' },
{ prop: 'product_name', label: '商品名称', width: '250' },
{ prop: 'spec_name', label: '规格', width: '120' },
{ prop: 'unit', label: '单位', width: '80' },
{ prop: 'actual_qty', label: '入库数量', width: '100' },
{ prop: 'available_qty', label: '可用库存', width: '100' },
{ prop: 'batch_no', label: '批次号', width: '120' },
{ prop: 'warehouse_name', label: '库房', width: '120' },
{ prop: 'area_name', label: '库区', width: '100' },
{ prop: 'location_name', label: '库位', width: '120' },
{ prop: 'inventory_status', label: '库存状态', width: '100' }
]

View File

@ -0,0 +1,443 @@
<template>
<div class="storage-entry-container">
<scan-box
ref="scanBox"
width="320px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="availableFieldsRef"
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
/>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
<el-button size="small" @click="handleCreateEntry">新建入库单</el-button>
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
<el-button size="small" @click="handleImport">导入</el-button>
</div>
<div class="toolbar-right">
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
</div>
</div>
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="入库单列表"
:data="list"
:columns="columns"
:table-size="tableSize"
:pagination="pagination"
:show-index="true"
:show-actions="true"
:show-selection="true"
:loading="loading"
:queryTime="queryTime"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
@selection-change="onSelectionChange"
>
<template #column-status="{ row }">
<el-tag v-if="row.status" size="small">
{{ row.status }}
</el-tag>
</template>
<template #empty>
<div class="empty-tip">暂无入库单</div>
</template>
</upper-table>
</div>
<div class="lower-level" v-if="selectedEntryId" :class="tableSize">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tab-pane label="入库明细" name="details" />
<el-tab-pane label="操作日志" name="logs" />
</el-tabs>
</div>
<div class="detail-container">
<KeepAlive>
<component
:is="activeComponent"
:id="selectedEntryId"
:row="selectedRow"
@refresh="loadData"
/>
</KeepAlive>
</div>
</div>
<div class="no-selection" v-else>
<div class="empty-tip">
<p>请从上方列表中选择一项查看详情</p>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import * as indexApi from '@/api/index'
import * as entryApi from '@/api/storage/entry'
import * as stockApi from '@/api/storage/stock'
import {
availableFields,
productstockColums,
} from './entry-config'
import entrydetail from './component/panelstockdetail.vue'
import log from './component/log.vue'
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
const activeTab = ref('details')
const list = ref<any[]>([])
const loading = ref(false)
const exportLoading = ref(false)
const queryTime = ref(0)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const tableSize = ref('small')
const columns = ref(productstockColums)
const selectionRows = ref<any[]>([])
const hasSelection = ref(false)
const selectedEntryId = ref<number | string | null>(null)
const quickSearch = ref('')
const componentMap: Record<string, any> = {
details: entrydetail,
logs: log
}
const activeComponent = computed(() => componentMap[activeTab.value] || componentMap.details)
const selectedRow = computed(() => {
return list.value.find((i: any) => i.id === selectedEntryId.value) || null
})
onMounted(() => {
loadData()
loadFilterData()
})
async function loadData() {
if (loading.value) return
loading.value = true
const start = Date.now()
// 备用模拟数据(当接口不可用时使用)
const mockData = [
{
id: 90,
entry_order_code: '2885-2011062548597596161',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026011301',
order_status: 'COMPLETED',
total_order_lines: 5,
supplier_name: '广州美妆供应链',
logistics_name: '顺丰速运',
express_code: 'SF123456789',
order_create_time: '2026-01-13 13:07:36',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 93,
entry_order_code: '2885-2011043642256453634',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026011302',
order_status: 'COMPLETED',
total_order_lines: 3,
supplier_name: '上海精化有限公司',
logistics_name: '圆通快递',
express_code: 'YT987654321',
order_create_time: '2026-01-13 13:17:13',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 95,
entry_order_code: 'CGW2601201120',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026012011',
order_status: 'COMPLETED',
total_order_lines: 12,
supplier_name: 'NBBT30',
logistics_name: '中通快递',
express_code: 'ZT20260120',
order_create_time: '2026-01-20 12:48:05',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 97,
entry_order_code: '2885-2021923981203890178',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026021201',
order_status: 'CREATED',
total_order_lines: 8,
supplier_name: '武汉贸易中心',
logistics_name: '邮政EMS',
express_code: 'EMS666888',
order_create_time: '2026-02-12 12:27:01',
sync_status: 'PENDING',
source_type: 'QM',
status: '待入库'
}
]
try {
const params: any = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: scanBox.value?.getConditions?.() || {}
}
if (quickSearch.value) {
params.where = { ...(params.where || {}), entry_order_code: quickSearch.value }
}
const res: any = await stockApi.getinventoryList(params)
if (res && (res.code === 200 || res.status === 'success') && res.data) {
// 优先使用后端返回的数据,做最小结构映射以兼容前端列定义
const rows = Array.isArray(res.data.list) ? res.data.list : (res.data || [])
list.value = rows.map((item: any) => ({
id: item.id,
entry_order_code: item.entry_order_code || item.entry_order_code || item.code || '',
store_name: item.store_name || item.store || '',
order_type: item.order_type || item.type || '',
purchase_order_code: item.purchase_order_code || item.purchase_code || '',
order_status: item.order_status || item.status || '',
total_order_lines: item.total_order_lines || item.total_lines || item.lines || 0,
supplier_name: item.supplier_name || item.supplier || '',
logistics_name: item.logistics_name || item.logistics || '',
express_code: item.express_code || item.tracking_no || '',
order_create_time: item.order_create_time || item.create_time || item.created_at || '',
sync_status: item.sync_status || item.sync || '',
source_type: item.source_type || item.source || '',
status: item.display_status || (item.order_status === 'COMPLETED' ? '已完成' : item.order_status || '')
}))
pagination.currentPage = res.data.pagination?.currentPage || pagination.currentPage
pagination.pageSize = res.data.pagination?.pageSize || pagination.pageSize
pagination.total = res.data.pagination?.total || res.data.total || list.value.length
} else {
// 接口未返回预期结构,回退到模拟数据
list.value = mockData
pagination.total = mockData.length
}
} catch (e) {
console.error('获取入库单列表失败,使用模拟数据', e)
ElMessage.error('加载入库单失败,已使用本地模拟数据')
list.value = mockData
pagination.total = mockData.length
} finally {
loading.value = false
queryTime.value = Date.now() - start
}
}
async function loadFilterData() {
try {
const [storesRes, presetRes]: any = await Promise.all([
indexApi.loadStores({ type: 'entry' }),
indexApi.fastWhereTree('entry')
])
if (storesRes && storesRes.code === 200) {
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
if (f) f.options = storesRes.stores || []
}
if (presetRes && presetRes.code === 200) {
presetTree.value = presetRes.presetTree || []
}
} catch (e) {
console.error('加载筛选配置失败', e)
}
}
function handleConditionChange(condition: any) {
pagination.currentPage = 1
loadData()
}
const handleConditionClear = () => {
pagination.currentPage = 1
loadData()
}
function handleConditionReset() {
pagination.currentPage = 1
if (scanBox.value?.reset) {
scanBox.value.reset()
}
loadData()
}
function onSelectionChange(rows: any[]) {
selectionRows.value = rows || []
hasSelection.value = selectionRows.value.length > 0
}
async function handleRowClick(row: any) {
selectedEntryId.value = row?.id || null
}
function handlePageChange(page: number) {
pagination.currentPage = page
loadData()
}
function handlePageSizeChange(size: number) {
pagination.pageSize = size
pagination.currentPage = 1
loadData()
}
function onQuickSearch() {
pagination.currentPage = 1
loadData()
}
function handleCreateEntry() {
ElMessage.info('新建入库单')
}
async function confirmBatchCancel() {
if (!selectionRows.value.length) {
ElMessage.warning('请先选择要作废的入库单')
return
}
try {
await ElMessageBox.confirm(`确定要批量作废 ${selectionRows.value.length} 个入库单吗?`, '确认', { type: 'warning' })
// 调用作废 API
ElMessage.success('操作成功')
loadData()
} catch (e) {}
}
async function handleExport() {
exportLoading.value = true
setTimeout(() => {
exportLoading.value = false
ElMessage.success('导出成功')
}, 1000)
}
function handleImport() {
ElMessage.info('导入功能')
}
</script>
<style scoped lang="scss">
.storage-entry-container {
display: flex;
height: calc(100vh - 130px);
width: 100%;
background-color: #f0f2f5;
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
padding: 10px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
}
.toolbar-right {
display: flex;
gap: 15px;
align-items: center;
}
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.table-container) {
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
}
.lower-level {
flex: 1;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
overflow: hidden;
background-color: #fff;
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
.detail-tab { margin-bottom: -1px; }
}
.detail-container {
flex: 1;
overflow: auto;
padding: 10px;
}
}
.no-selection {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
background-color: #fff;
.empty-tip { text-align: center; }
}
}
}
</style>

View File

@ -100,6 +100,7 @@ import { productdetail,productquick,productsnapshop,windowtopbar } from '../rece
import { ElMessage } from 'element-plus'
import { FullScreen, Close, CopyDocument } from '@element-plus/icons-vue'
import UpperTable from '@/components/UpperTable/index.vue'
import * as receivingApi from '@/api/storage/receiving'
import basic from '../window/basic.vue'
import log from '../window/log.vue'
@ -270,6 +271,34 @@ const loadProductData = () => {
emit('refresh-product')
}
async function fetchReceivingDetail() {
try {
const params = {
id: props.id,
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize }
}
const res: any = await receivingApi.getReceivingDetail(params)
if (res && res.code === 200 && res.data) {
const receivingData = res.data.receiving || {}
if (Array.isArray(receivingData.details)) {
tableData.value = receivingData.details
pagination.total = receivingData.pagination?.total || receivingData.details.length || 0
} else {
tableData.value = []
pagination.total = 0
}
} else {
tableData.value = []
pagination.total = 0
}
} catch (e) {
console.error('加载商品明细失败', e)
tableData.value = []
pagination.total = 0
ElMessage.error('加载商品明细失败')
}
}
@ -418,10 +447,12 @@ const handleSave = async () => {
onMounted(() => {
if (props.productData && props.productData.length > 0) {
tableData.value = [...props.productData]
pagination.total = props.productData.length
pagination.total = props.productTotal || props.productData.length
} else if (!props.loading) {
// tableData.value = [...mockProductData]
// pagination.total = mockProductData.length
// 如果父组件没有传入商品数据且提供了 id,则尝试通过接口加载
if (props.id) {
fetchReceivingDetail()
}
}
window.addEventListener('click', closeMenu)
})

View File

@ -10,6 +10,7 @@
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
@submit="handleSubmit"
/>
<div class="main-content">
@ -26,7 +27,7 @@
一键入库
</el-button>
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
<el-button type="info" size="small" icon="el-icon-printer" @click="printReceiving" title="打印收货单"
<el-button type="info" size="small" icon="el-icon-printer" @click="handleOpenPrintDialog" title="打印收货单"
:disabled="!hasSelection" class="toolbar-btn">
打印收货单
</el-button>
@ -126,11 +127,120 @@
</div>
</div>
</div>
<!-- 打印对话框 -->
<el-dialog
v-model="printDialogVisible"
title="批量打印收货单"
width="1135px"
custom-class="print-dialog"
>
<div class="print-dialog-layout">
<!-- 左侧待打印列表 -->
<div class="print-batch-list">
<div class="list-title">打印队列 ({{ selectionRows.length }})</div>
<div
v-for="(row, index) in selectionRows"
:key="row.id"
class="batch-item"
:class="{ active: currentPrintIndex === index }"
@click="switchPrintItem(index)"
>
<span class="item-index">{{ index + 1 }}</span>
<span class="item-number">{{ row.receiving_number }}</span>
<el-tag size="small" :type="printStatusMap[row.id] === 'done' ? 'success' : printStatusMap[row.id] === 'error' ? 'danger' : 'info'">
{{ printStatusMap[row.id] === 'done' ? '已打印' : printStatusMap[row.id] === 'error' ? '失败' : '待打印' }}
</el-tag>
</div>
</div>
<!-- 右侧:打印设置 + 模板预览 -->
<div class="print-preview-main">
<!-- 打印设置工具栏 -->
<div class="print-settings-bar">
<el-select v-model="printSettings.station" placeholder="请选择打印台" size="small" @change="handleStationChange">
<el-option v-for="item in stationOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-select v-model="printSettings.printer" placeholder="请选择打印机" size="small" :loading="printerLoading">
<el-option v-for="item in printerOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="printSettings.template" placeholder="请选择打印模板" size="small">
<el-option v-for="item in templateOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
<!-- 模板画布预览 -->
<div class="print-canvas-area">
<div v-if="previewInfo.width && previewInfo.height"
class="preview-page"
:style="{ width: previewInfo.width + 'mm', height: previewInfo.height + 'mm', position: 'relative' }"
>
<div
v-for="(item, idx) in previewObjects"
:key="item.id"
:style="computePreviewItemStyle(item, idx)"
>
<template v-if="item.type === 'text'">
<span>{{ getPreviewValue(item) }}</span>
</template>
<template v-else-if="item.type === 'barcode'">
<barcode-img :text="getPreviewValue(item) || '0123456789'" />
</template>
<template v-else-if="item.type === 'qrcode'">
<img
:src="'https://ye4s.wms.gztbyc.com/qrcode/build?text=' + encodeURIComponent(getPreviewValue(item) || '')"
alt=""
style="width: 100%; height: 100%; object-fit: contain;"
/>
</template>
<template v-else-if="item.type === 'image'">
<img :src="item.content" alt="" style="width: 100%; height: 100%; object-fit: fill;" />
</template>
<template v-else-if="item.type === 'table'">
<table style="border: 1px solid #000; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0" width="100%" height="auto">
<thead>
<tr>
<td v-for="c in item.rows" :key="c.id" :style="{ width: c.width + 'mm', fontSize: '3mm', textAlign: 'center', border: '1px solid #000', height: (item.headerHeight || 4) + 'mm' }">{{ c.title }}</td>
</tr>
</thead>
<tbody>
<!-- 如果有 details 数据则遍历显示,否则显示一行占位 -->
<tr v-for="(detailItem, dIdx) in (printForm.details && printForm.details.length ? printForm.details : [printForm])" :key="dIdx">
<td v-for="c in item.rows" :key="c.id + '_v'" :style="{ fontSize: '3mm', textAlign: 'center', border: '1px solid #000', height: (item.rowHeight || 4) + 'mm' }">
{{ detailItem[c.field_code] || '' }}
</td>
</tr>
</tbody>
</table>
</template>
<template v-else-if="item.type === 'shape'">
<div style="width: 100%; height: 100%;"></div>
</template>
</div>
</div>
<div v-else class="preview-empty">
<el-empty description="请在上方选择打印模板" :image-size="60" />
</div>
</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<span class="progress-tip">进度: {{ completedPrintCount }} / {{ selectionRows.length }}</span>
<div>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" :loading="printing" @click="doPrint">
{{ currentPrintIndex < selectionRows.length - 1 ? '打印并切换下一个' : '打印当前单据' }}
</el-button>
</div>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue'
import { ref, reactive, onMounted, computed, watch, h } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
@ -148,8 +258,13 @@ import {
detailStatusConfig,
storageStatusConfig,
deliveryMethodConfig,
loadingMethodConfig
loadingMethodConfig,
printFormConfig
} from './receiving-config'
import * as printerApi from '@/api/printer'
import * as templateApi from '@/api/printTemplate'
import * as stationApi from '@/api/print/station'
import JsBarcode from 'jsbarcode'
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
@ -197,9 +312,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
}
})
const params = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: scanBox.value?.getConditions?.() || {}
where: processedWhere
}
if (quickSearch.value) {
params.where = { ...(params.where || {}), receiving_number: quickSearch.value }
@ -231,7 +360,7 @@ async function loadFilterData() {
if (f) f.options = storesRes.stores || []
}
if (presetRes && presetRes.code === 200) {
//console.log('筛选配置', presetRes)
console.log('筛选配置', presetRes)
presetTree.value = presetRes.presetTree || []
}
} catch (e) {
@ -244,6 +373,11 @@ function handleConditionChange(condition: any) {
loadData()
}
function handleSubmit() {
pagination.currentPage = 1
loadData()
}
const handleConditionClear = () => {
pagination.currentPage = 1
loadData()
@ -350,7 +484,340 @@ function handleCreateReceiving() {
ElMessage.info('新建收货单(UI 待实现)')
}
// 打印相关
const printDialogVisible = ref(false)
const printing = ref(false)
const currentPrintIndex = ref(0)
const printStatusMap = ref<Record<string, string>>({})
const printForm = reactive<any>({})
const printSettings = reactive({ station: '' as string | number, printer: '', template: '' })
const stationOptions = ref<any[]>([])
const printerOptions = ref<any[]>([])
const templateOptions = ref<any[]>([])
const printerLoading = ref(false)
// --- 模板预览辅助组件(条码) ---
const barcodeImg = {
props: ['text'],
setup(props: any) {
const src = ref('')
const renderBarcode = (val: string) => {
if (!val) { src.value = ''; return }
const canvas = document.createElement('canvas')
try {
JsBarcode(canvas, val, { format: 'CODE128', width: 2, height: 40, displayValue: false, margin: 0 })
src.value = canvas.toDataURL()
} catch (e) { src.value = '' }
}
watch(() => props.text, (val: string) => renderBarcode(val), { immediate: true })
return () => h('img', { src: src.value, style: { display: 'block', width: '100%', height: '100%', objectFit: 'fill' } })
}
}
// 当前选中模板的画布尺寸
const previewInfo = computed(() => {
const t = templateOptions.value.find((t: any) => t.id === printSettings.template)
if (!t) return { width: 0, height: 0 }
return { width: t.page_width || 0, height: t.page_height || 0 }
})
// 当前选中模板的元素列表
const previewObjects = computed(() => {
const t = templateOptions.value.find((t: any) => t.id === printSettings.template)
if (!t || !Array.isArray(t.template_content)) return []
return t.template_content
})
// 获取元素的实际展示值(用 printForm 中的值替换 field_code 占位符)
function getPreviewValue(item: any): string {
if (item.field_code && printForm[item.field_code] !== undefined && printForm[item.field_code] !== '') {
return String(printForm[item.field_code])
}
return item.content || ''
}
// 计算预览元素的绝对定位样式(与 TemplateEditor 保持一致)
function computePreviewItemStyle(value: any, idx: string | number): any {
const idxNum = Number(idx)
const base: any = {
position: 'absolute',
left: value.left + 'mm',
top: value.top + 'mm',
width: value.width + 'mm',
height: value.height + 'mm',
zIndex: idxNum + 1,
textAlign: value.textAlign || 'left',
lineHeight: (value.lineHeight || 6) + 'mm',
transform: `rotate(${(value.rotate || 0) * 90}deg)`,
transformOrigin: 'center center',
overflow: 'hidden',
}
if (value.type === 'text') {
Object.assign(base, {
fontSize: (value.fontSize || 8) + 'pt',
lineHeight: (value.lineHeight || 6) + 'mm',
fontWeight: value.bold ? 'bold' : 'normal',
fontStyle: value.italic ? 'italic' : 'normal',
textDecoration: value.underline ? 'underline' : 'none',
whiteSpace: value.autoWrap ? 'pre-wrap' : 'nowrap',
writingMode: value.direction === 'vertical' ? 'vertical-rl' : 'horizontal-tb'
})
}
if (value.type === 'table') {
base.width = 'auto'
base.height = 'auto'
}
if (value.type === 'shape') {
if (value.shapeType === 'line') {
base.border = 'none'
base.borderTop = `${value.lineWeight || 1}pt ${value.lineStyle || 'solid'} #000`
base.backgroundColor = 'transparent'
base.height = 'auto'
} else if (value.shapeType === 'vertical-line') {
base.border = 'none'
base.borderLeft = `${value.lineWeight || 1}pt ${value.lineStyle || 'solid'} #000`
base.backgroundColor = 'transparent'
base.width = 'auto'
} else if (value.shapeType === 'box') {
base.border = `${value.lineWeight || 1}pt ${value.lineStyle || 'solid'} #000`
base.backgroundColor = 'transparent'
}
}
return base
}
const completedPrintCount = computed(() => {
return Object.values(printStatusMap.value).filter(s => s === 'done').length
})
async function handleOpenPrintDialog() {
if (!selectionRows.value.length) {
ElMessage.warning('请先选择要打印的收货单')
return
}
// 校验收货状态,只有“已完成”的才能打印
const invalidRows = selectionRows.value.filter(row => row.status !== 'completed')
if (invalidRows.length > 0) {
ElMessage.warning(`只有“已完成”状态的单据才能打印。当前选中包含 ${invalidRows.length} 个非已完成单据。`)
return
}
// 重置打印状态
currentPrintIndex.value = 0
printStatusMap.value = {}
selectionRows.value.forEach(row => {
printStatusMap.value[row.id] = 'pending'
})
// 加载第一项数据
await loadPrintFormData(0)
// 加载打印台和模板
loadPrintOptions()
printDialogVisible.value = true
}
async function switchPrintItem(index: number) {
if (printing.value) return
currentPrintIndex.value = index
await loadPrintFormData(index)
}
async function loadPrintFormData(index: number) {
const mainRow = selectionRows.value[index]
if (!mainRow) return
// 1. 从主表填充
const formData: any = {}
printFormConfig.forEach(group => {
group.fields.forEach((field: any) => {
const val = mainRow[field.prop] || ''
// 如果是选择器类型,尝试从 options 中提取 label(翻译后的文本)
if (field.type === 'select' && field.options) {
const opt = field.options.find((o: any) => o.value === val)
formData[field.prop] = opt ? opt.label : val
} else {
formData[field.prop] = val
}
})
})
// 2. 清空旧明细字段
const detailFields = ['product_name', 'barcode', 'box_quantity', 'boxes_per_pallet', 'actual_quantity', 'remark']
detailFields.forEach(f => formData[f] = '')
// 3. 获取详情填充第一个商品的明细(如果有的话)
try {
const res: any = await receivingApi.getReceivingDetail({
id: mainRow.id,
pagination: { page: 1, pageSize: 1000 }
})
if (res && res.code === 200) {
const details = res.data.receiving?.details || []
// 翻译并整理明细列表
const processedDetails = details.map((item: any) => {
const newItem = { ...item }
// 尝试对明细字段进行翻译(如果有配置)
const detailConfig = printFormConfig.find(g => g.group === '商品明细')
if (detailConfig) {
detailConfig.fields.forEach((field: any) => {
const val = newItem[field.prop]
if (field.type === 'select' && field.options) {
const opt = field.options.find((o: any) => o.value === val)
newItem[field.prop] = opt ? opt.label : val
} else if (val === undefined || val === null) {
newItem[field.prop] = ''
}
})
}
return newItem
})
// 将明细列表挂载到 formData,通常命名为 details 以便模板遍历
formData.details = processedDetails
if (processedDetails.length > 0) {
const detail = processedDetails[0]
const detailConfig = printFormConfig.find(g => g.group === '商品明细')
if (detailConfig) {
detailConfig.fields.forEach((field: any) => {
// 使用处理过的数据
formData[field.prop] = detail[field.prop]
})
}
}
}
} catch (e) {
console.error('加载打印明细失败', e)
}
Object.assign(printForm, formData)
}
async function loadPrintOptions() {
try {
const [stations, templates]: any = await Promise.all([
stationApi.getList({ page: 1, pageSize: 100, where: {} }),
templateApi.listTemplates({})
])
// 打印台:兼容 code 0 和 code 200,数据在 data.list 中
if (stations && (stations.code === 200 || stations.code === 0)) {
const rawList: any[] = stations.data?.list || stations.data || []
stationOptions.value = rawList.map((item: any) => ({
id: item.id,
name: item.name || item.label || String(item.id)
}))
} else {
console.warn('获取打印台列表失败:', stations)
}
// 打印模板:与模板编辑页保持一致,从 res.presetTree 中递归提取所有非分类节点
if (templates && templates.code === 200) {
const flattenTree = (nodes: any[]): any[] => {
const result: any[] = []
for (const node of nodes) {
if (node.type !== 'category') {
// 保存原始节点数据,特别是 template_content 等后端需要的字段
result.push({
...node,
id: node.id,
name: node.title || node.name || node.template_name || String(node.id)
})
}
if (node.children && node.children.length > 0) {
result.push(...flattenTree(node.children))
}
}
return result
}
templateOptions.value = flattenTree(templates.presetTree || [])
} else {
console.warn('获取模板列表失败:', templates)
}
} catch (e) {
console.error('加载打印配置失败', e)
}
}
async function handleStationChange(val: string | number) {
printSettings.printer = ''
printerOptions.value = []
if (!val) return
printerLoading.value = true
try {
const res: any = await stationApi.getComputerPrinter(String(val))
if (res && res.code === 0 && res.data) {
// res.data 可能是一个包含打印机列表的对象,具体取决于后端实现
// 这里的逻辑参考 system/setting/printStation 页面的预期数据格式
const printerList = Array.isArray(res.data) ? res.data : (res.data.list || [])
printerOptions.value = printerList.map((p: any) => ({
label: p.name || p.printerName || p,
value: p.name || p.printerName || p
}))
} else {
console.warn('获取打印机列表失败:', res)
}
} catch (e) {
console.error('获取打印机列表出错:', e)
} finally {
printerLoading.value = false
}
}
async function doPrint() {
if (!printSettings.station || !printSettings.template) {
ElMessage.warning('请选择打印台和模板')
return
}
if (!printSettings.printer) {
ElMessage.warning('请选择打印机')
return
}
printing.value = true
const currentRow = selectionRows.value[currentPrintIndex.value]
try {
// 后端字段:computerId (打印台id)、printer (打印机名)、template (模板对象)、data、type、size
const selectedTemplateObj = templateOptions.value.find((t: any) => t.id === printSettings.template) || null
const printPayload = {
type: 'customize',
computerId: printSettings.station,
printer: printSettings.printer,
template: selectedTemplateObj,
data: { ...printForm },
timestamp: Date.now(),
size: 1
}
const res: any = await stationApi.sendPrint(printPayload)
// 兼容 code 0(PDA 风格)和 code 200 两种后端响应
if (res && (res.code === 0 || res.code === 200 || res.status === 'success' || res.flag === 'success')) {
printStatusMap.value[currentRow.id] = 'done'
ElMessage.success(`单据 ${currentRow.receiving_number} 打印成功`)
// 自动切换到下一个待打印单据
if (currentPrintIndex.value < selectionRows.value.length - 1) {
currentPrintIndex.value++
await loadPrintFormData(currentPrintIndex.value)
} else {
ElMessage.info('已完成所有选中单据的打印操作')
}
} else {
printStatusMap.value[currentRow.id] = 'error'
ElMessage.error(res?.msg || res?.message || `单据 ${currentRow.receiving_number} 打印失败`)
}
} catch (e: any) {
console.error('打印出错:', e)
printStatusMap.value[currentRow.id] = 'error'
ElMessage.error('打印请求失败,请检查网络或打印台状态')
} finally {
printing.value = false
}
}
async function confirmBatchCancel() {
if (!selectionRows.value.length) {
@ -510,4 +977,112 @@ async function handleExport() {
}
}
}
.print-dialog-layout {
display: flex;
height: 1150px;
border: 1px solid #ebeef5;
.print-batch-list {
width: 250px;
border-right: 1px solid #ebeef5;
background-color: #fafafa;
display: flex;
flex-direction: column;
overflow-y: auto;
/* 限制左侧列表高度,使其在对话框中可滚动 */
max-height: 100%;
.list-title {
padding: 10px;
font-weight: bold;
border-bottom: 1px solid #ebeef5;
background-color: #fff;
}
.batch-item {
padding: 12px 15px;
cursor: pointer;
display: flex;
align-items: center;
gap: 10px;
border-bottom: 1px dotted #eee;
transition: background 0.2s;
&:hover { background-color: #f0f7ff; }
&.active {
background-color: #e6f7ff;
border-left: 3px solid #1890ff;
}
.item-index { color: #999; font-size: 12px; }
.item-number { flex: 1; font-weight: 500; font-family: monospace; }
}
}
.print-preview-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background-color: #fff;
.print-settings-bar {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 15px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
flex-shrink: 0;
.el-select { flex: 1; min-width: 130px; }
}
.print-canvas-area {
flex: 1;
overflow: auto;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px;
background-color: #f0f2f5;
.preview-page {
background: #fff;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
border: 1px solid #ddd;
flex-shrink: 0;
}
.preview-empty {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
}
}
}
.dialog-footer {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.progress-tip {
color: #606266;
font-size: 14px;
font-weight: 500;
}
}
/* 居中打印对话框(垂直居中) */
.print-dialog .el-dialog {
top: 50% !important;
transform: translateY(-50%) !important;
}
</style>

View File

@ -53,6 +53,8 @@ export const receivingColumns = [
]
// receiving配置
export const availableFields = [
{ value: 'receiving_number', label: '收货单号', type: 'text' },
{ value: 'status', label: '收货状态', type: 'select', options: Object.entries(statusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
@ -258,10 +260,31 @@ export const windowtopbar = [
{ label: '操作日志', key: 'logs' }
]
// 打印配置表单
export const printFormConfig = [
{ group: '基本信息', fields: [
{ prop: 'delivery_method', label: '来货方式', type: 'select', options: Object.entries(deliveryMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
{ prop: 'license_plate', label: '车牌号', type: 'input' },
{ prop: 'receiving_number', label: '收货单号', type: 'input' },
{ prop: 'store_name', label: '货主', type: 'input' },
{ prop: 'total_items', label: '总商品种类', type: 'number' },
{ prop: 'total_quantity', label: '总商品数量', type: 'number' },
{ prop: 'total_boxes', label: '总箱数', type: 'number' },
]},
{ group: '商品明细', fields: [
{ prop: 'product_name', label: '商品名称', type: 'input' },
{ prop: 'barcode', label: '商品条码', type: 'input' },
{ prop: 'box_quantity', label: '箱数', type: 'number' },
{ prop: 'boxes_per_pallet', label: '箱规', type: 'number' },
{ prop: 'actual_quantity', label: '实际收货数量', type: 'number' },
{ prop: 'remark', label: '明细备注', type: 'input' },
]}
]
export const printFormFields = [
...(printFormConfig[0]?.fields || []),
...(printFormConfig[1]?.fields || [])
]
export function formatReceivingData(list: any[] = []) {
return (list || []).map(item => ({

View File

@ -1,122 +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: 23/03/2026 10:27:25
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for wms_order_delivery_100000
-- ----------------------------
DROP TABLE IF EXISTS `wms_order_delivery_100000`;
CREATE TABLE `wms_order_delivery_100000` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`delivery_order_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发货单号',
`pre_delivery_order_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预发货单号',
`pre_delivery_order_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预发货单ID',
`order_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单类型',
`warehouse_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '仓库编码',
`order_flag` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单标记',
`source_platform_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源平台编码',
`source_platform_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源平台名称',
`create_at` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`delete_at` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
`updated_at` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`place_order_time` datetime(0) NULL DEFAULT NULL COMMENT '店铺创建订单时间',
`pay_time` datetime(0) NULL DEFAULT NULL COMMENT '支付时间',
`pay_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付单号',
`service_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集包服务编码',
`operator_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ERP审核人',
`operate_time` datetime(0) NULL DEFAULT NULL COMMENT 'ERP审核时间',
`delivery_time` datetime(0) NULL DEFAULT NULL COMMENT '发货时间',
`shop_nick` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店铺名称',
`seller_nick` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '卖家名称',
`buyer_nick` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '买家名称',
`total_amount` decimal(18, 2) NULL DEFAULT NULL COMMENT '订单总金额',
`item_amount` decimal(18, 2) NULL DEFAULT NULL COMMENT '商品总金额',
`discount_amount` decimal(18, 2) NULL DEFAULT NULL COMMENT '订单折扣金额',
`freight` decimal(18, 2) NULL DEFAULT NULL COMMENT '快递费用',
`ar_amount` decimal(18, 2) NULL DEFAULT NULL COMMENT '应收金额',
`got_amount` decimal(18, 2) NULL DEFAULT NULL COMMENT '已收金额',
`service_fee` decimal(18, 2) NULL DEFAULT NULL COMMENT 'COD服务费',
`logistics_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物流公司编码',
`logistics_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物流公司名称',
`express_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '面单号前置',
`logistics_area_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快递区域编码, 大头笔信息',
`delivery_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发货服务类型',
`is_urgency` enum('Y','N') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否紧急',
`invoice_flag` enum('Y','N') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否需要发票',
`status` enum('pedding','created','cancel','error','after-sales-error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'created' COMMENT '状态',
`name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '收件人姓名',
`zip_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收件人邮编',
`tel` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '收件人电话',
`mobile` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '收件人移动电话',
`email` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '收件人邮箱',
`country_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家编码',
`province` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份',
`city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '城市',
`area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区',
`town` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '镇',
`detail_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
`id_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证件类型',
`id_number` int(11) NULL DEFAULT NULL COMMENT '证件号码',
`oaid` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'OAID',
`sync_status` enum('padding','fin','error','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'padding' COMMENT '同步状态',
`store_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '货主id',
`warehouse_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '仓库id',
`from_key` int(11) NULL DEFAULT NULL COMMENT '来源键',
`items` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '商品结构字符串',
`items_count` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品种类数',
`items_total` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品总数',
`items_weight` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总重量',
`items_hash` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '哈希值',
`items_crc` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '校验码',
`wave_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '波次ID,0表示未分配',
`post_status` enum('padding','fin','timeout','error','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '分配快递号状态机',
`storage_status` enum('padding','fin','error','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '分配储位状态机',
`pick_status` enum('padding','fin','error','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '拣货状态机',
`pack_status` enum('none','padding','fin','error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '打包状态机',
`inspection_status` enum('none','padding','running','fin','error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '检验状态机',
`print_status` enum('none','padding','fin','error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '打印状态机',
`claim_status` enum('none','padding','fin','error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '领取状态机',
`outbound_status` enum('none','padding','fin','error') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '出库状态机',
`lock_status` enum('none','warehouse','store') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '锁定状态机',
`intercept_status` enum('none','requesting','requested','intercepting','intercepted_in_transit','intercepted_at_warehouse','returning','returned','delivered_by_mistake','timeout','cancelled','failed','exception') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'none' COMMENT '拦截状态机',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_100000_current_delivery_code`(`delivery_order_code`, `store_id`, `warehouse_id`) USING BTREE,
INDEX `idx_100000_current_store_id`(`store_id`) USING BTREE,
INDEX `idx_100000_current_warehouse_id`(`warehouse_id`) USING BTREE,
INDEX `idx_100000_current_items`(`items`(50)) USING BTREE,
INDEX `idx_100000_current_items_hash`(`items_hash`) USING BTREE,
INDEX `idx_100000_current_hash_crc`(`items_hash`, `items_crc`, `warehouse_id`) USING BTREE,
INDEX `idx_100000_current_wave`(`status`, `wave_id`) USING BTREE,
INDEX `idx_100000_current_statuses`(`status`, `post_status`, `pick_status`, `pack_status`, `outbound_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '仓库100000发货单常用表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wms_order_delivery_100000
-- ----------------------------
INSERT INTO `wms_order_delivery_100000` VALUES (14, '2885-831', '', '', 'JYCK', 'khgj2025100902', '', 'OFFLINE', '线下', '2026-01-13 14:17:35', NULL, '2026-01-13 14:17:35', '2026-01-13 13:37:42', '2026-01-13 13:37:42', '', NULL, NULL, '2026-01-13 13:38:05', NULL, '线下店铺', NULL, NULL, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SF', NULL, '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', '', '广东省', '广州市', '白云区', '', '钟落潭良沙二路32号', NULL, NULL, NULL, 'padding', 1000016, 100000, 34597803, '101845+5', 1, 5, 0.00, 'cbb47c0389ebc6c930a4671a4ea5d3a3', 403, 0, 'none', 'none', 'none', 'none', 'none', 'none', 'none', 'none', 'none', 'none');
INSERT INTO `wms_order_delivery_100000` VALUES (17, '2885-832', '', '', 'JYCK', 'khgj2025100902', '', 'OFFLINE', '线下', '2026-01-13 14:46:22', NULL, '2026-01-13 14:46:22', '2026-01-13 14:36:37', '2026-01-13 14:36:37', '', NULL, NULL, '2026-01-13 14:40:48', NULL, '线下店铺', NULL, NULL, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SF', NULL, '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', '', '广东省', '广州市', '白云区', '', '钟落潭良沙二路32号', NULL, NULL, NULL, 'padding', 1000016, 100000, 34597803, '101842+1|101845+1', 2, 2, 0.00, '78ebc40a9cfca92e44e69e4cc3828c3e', 919, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (19, '935496', '', '', 'JYCK', '100000', '', 'OFFLINE', '线下', '2026-01-13 15:05:38', NULL, '2026-01-13 15:05:40', '2026-01-13 14:49:50', '2026-01-13 14:51:36', 'S20260113225136223', NULL, NULL, '2026-01-13 15:05:38', NULL, '{线下}', NULL, '刘付明仁', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SF', '顺丰', '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', '', '广东省', '广州市', '白云区', '', '钟落潭良沙二路32号', NULL, NULL, NULL, 'padding', 1000000, 100000, 23060081, '101391+5', 1, 5, 0.00, '26939f46b9fb7d216a485c89b6bda980', 399, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (20, '935502', '', '', 'JYCK', '100000', '', 'OFFLINE', '线下', '2026-01-13 15:09:37', NULL, '2026-01-13 15:09:40', '2026-01-13 14:49:50', '2026-01-13 14:51:36', 'S20260113225136223', NULL, NULL, '2026-01-13 15:09:37', NULL, '{线下}', NULL, '刘付明仁', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SF', '顺丰', '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', '', '广东省', '广州市', '白云区', '', '钟落潭良沙二路32号', NULL, NULL, NULL, 'padding', 1000000, 100000, 23060081, '101391+5', 1, 5, 0.00, '26939f46b9fb7d216a485c89b6bda980', 399, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (21, 'JY2026011327233', '', '', 'JYCK', '100000', '', 'PDD', '拼多多', '2026-01-13 15:26:07', NULL, '2026-01-13 15:26:07', '2026-01-13 15:22:03', '2026-01-13 15:22:03', '', NULL, '1', '2026-01-13 15:26:07', NULL, '火火家de小店', '1', '刘付明仁18022440198', 10.00, 10.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SFKY', '顺丰空运', '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', 'CN', '广东省', '广州市', '白云区', '太和镇', '广东省 广州市 白云区 太和镇 二路32号', NULL, NULL, NULL, 'padding', 1000000, 100000, 24869601, '101384+10', 1, 10, 0.00, '0043ebfd4f730160a5e9db969f1b856c', 445, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (22, '935520', '', '', 'JYCK', '100000', '', 'OFFLINE', '线下', '2026-01-13 15:27:36', NULL, '2026-01-13 15:27:38', '2026-01-13 14:49:50', '2026-01-13 14:51:36', 'S20260113225136223', NULL, NULL, '2026-01-13 15:27:36', NULL, '{线下}', NULL, '刘付明仁', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NULL, 'SFKY', '顺丰速运_空运', '', '', NULL, 'N', 'N', 'pedding', '刘付明仁', '', '', '18022440198', '', '', '广东省', '广州市', '白云区', '', '钟落潭良沙二路32号', NULL, NULL, NULL, 'padding', 1000000, 100000, 23060081, '101391+5', 1, 5, 0.00, '26939f46b9fb7d216a485c89b6bda980', 399, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (29, 'CK26012000894', '', '', 'JYCK', 'wdt02060120001', '', 'OFFLINE', '线下', '2026-01-20 13:02:59', NULL, '2026-01-20 13:11:33', '2026-01-20 13:02:59', '2026-01-20 13:02:59', '', NULL, NULL, '2026-01-20 13:11:33', NULL, 'af69a68', NULL, '肖宇玄', 12990.00, 0.00, 0.00, 5.00, 0.00, 12990.00, NULL, 'YTO', NULL, '', '', NULL, 'N', 'N', 'pedding', '肖宇玄', '', '18727038559', '18727038559', '', '', '北京', '北京市', '西城区', '', '湖北省襄阳市宏泰越秀星汇城', NULL, NULL, NULL, 'padding', 1000016, 100000, 21363512, '101874+100|101875+1@2', 2, 101, 2.00, '4dc8eceb86a6dfeb730321a6779bc360', 1137, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (30, 'CK26012000895', '', '', 'JYCK', 'wdt02060120001', '', 'OFFLINE', '线下', '2026-01-20 13:00:40', NULL, '2026-01-20 13:11:37', '2026-01-20 13:00:41', '2026-01-20 13:00:41', '', NULL, NULL, '2026-01-20 13:11:37', NULL, 'af69a68', NULL, '测试', 6495.00, 0.00, 0.00, 5.00, 0.00, 6495.00, NULL, 'YTO', NULL, '', '', NULL, 'N', 'N', 'pedding', '测试', '', '11111111111', '11111111111', '', '', '北京', '北京市', '东城区', '', '测试', NULL, NULL, NULL, 'padding', 1000016, 100000, 21363512, '101874+50|101875+1@2', 2, 51, 2.00, 'e87473418ea8a893825a3b13c2663c10', 1093, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (31, 'CK26012800003', '', '', 'JYCK', 'wdt02060120001', '', 'OFFLINE', '线下', '2026-01-20 13:02:59', NULL, '2026-01-28 02:33:35', '2026-01-20 13:02:59', '2026-01-20 13:02:59', '', NULL, NULL, '2026-01-28 02:33:35', NULL, 'af69a68', NULL, '肖宇玄', 12990.00, 0.00, 0.00, 5.00, 0.00, 12990.00, NULL, 'YTO', NULL, '', '', NULL, 'N', 'N', 'pedding', '肖宇玄', '', '18727038559', '18727038559', '', '', '北京', '北京市', '西城区', '', '湖北省襄阳市宏泰越秀星汇城', NULL, NULL, NULL, 'padding', 1000016, 100000, 21363512, '101874+100|101875+1@2', 2, 101, 2.00, '4dc8eceb86a6dfeb730321a6779bc360', 1137, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
INSERT INTO `wms_order_delivery_100000` VALUES (32, 'CK26013001179', '', '', 'JYCK', 'wdt02060120001', '', 'OFFLINE', '线下', '2026-01-20 13:02:59', NULL, '2026-01-30 02:42:45', '2026-01-20 13:02:59', '2026-01-20 13:02:59', '', NULL, NULL, '2026-01-30 02:42:44', NULL, 'af69a68', NULL, '肖宇玄', 12990.00, 0.00, 0.00, 5.00, 0.00, 12990.00, NULL, 'YTO', NULL, '', '', NULL, 'N', 'N', 'pedding', '肖宇玄', '', '18727038559', '18727038559', '', '', '北京', '北京市', '西城区', '', '湖北省襄阳市宏泰越秀星汇城', NULL, NULL, NULL, 'padding', 1000016, 100000, 21363512, '101874+100|101875+1@2', 2, 101, 2.00, '4dc8eceb86a6dfeb730321a6779bc360', 1137, 0, 'none', 'none', 'none', 'none', 'none', NULL, 'none', 'none', NULL, NULL);
SET FOREIGN_KEY_CHECKS = 1;

131
src/wms_permission.sql Normal file
View File

@ -0,0 +1,131 @@
/*
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;

26325
src/wms_stock_warehouse.sql Normal file

File diff suppressed because it is too large Load Diff

77
temp/wechat-bind/TODO.md Normal file
View File

@ -0,0 +1,77 @@
# 微信绑定功能 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

@ -13,4 +13,23 @@
三、后续计划
开发"收货单"的打印收货单功能
根据需要更新完善orderManagement的"待审核订单"、"待处理订单"、"异常订单"、"配送订单"、"归档订单"五个页面的字段明细、筛选条件
根据情况设计新增其他页面、新增操作功能或修复已有问题。
根据情况设计新增其他页面、新增操作功能或修复已有问题。
2026.3.24
一、今日完成
“收货单”添加打印/批量打印收货单功能,能够根据所选的打印单号打印/批量打印收货单。
调整部分页面项目结构,规范化页面结构,防止后续扩展页面冲突。
新增微信绑定页面,开发微信绑定/解绑功能。
新增“库存”页面及其相关接口,搭建页面基础。
排查删除permission数据库表无用字段。
二、问题记录
页面“筛选”功能不可用。
微信绑定页面二维码刷新功能失败。接口待测试。
三、后续计划
修复页面“筛选”功能不可用问题。
更新注册/登录页面。
完成“微信绑定”功能。
完善“库存”相关页面操作与功能。