From 24e4114c6cca7e34f71b0be7def69bde974cfa18 Mon Sep 17 00:00:00 2001
From: yin <3313488199@qq.com>
Date: Thu, 26 Mar 2026 18:23:54 +0800
Subject: [PATCH] =?UTF-8?q?3=E6=9C=8826=E6=97=A5=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/setting/account.ts | 55 ++
src/api/stock.ts | 43 +-
src/components/ImagesUpload/index.vue | 25 +-
src/router/map.ts | 2 +-
src/views/account/index.vue | 2 +-
.../orderManagement/component/detail.vue | 2 +
.../order/orderManagement/component/log.vue | 10 +-
.../order/orderManagement/deliveryOrder.vue | 64 +--
.../orderManagement/styles/order-sub.scss | 3 +-
src/views/stock/stock/component/add.vue | 50 +-
src/views/stock/stock/component/barcode.vue | 26 +-
src/views/stock/stock/component/info.vue | 86 +--
src/views/stock/stock/index.vue | 490 +-----------------
src/views/stock/stock/stock-config.ts | 475 +++++++++++++++++
.../storage/entry/component/entryoperate.vue | 206 ++++----
src/views/storage/entry/entry-config.ts | 32 +-
src/views/storage/entry/index.vue | 19 +-
src/views/storage/inventory/index.vue | 8 +-
.../receiving/component/DetailsPanel.vue | 201 +++----
.../storage/receiving/component/Product.vue | 45 +-
src/views/storage/receiving/index.vue | 6 +-
.../storage/receiving/receiving-config.ts | 40 +-
.../system/setting/account/account-config.ts | 27 +
src/views/system/setting/account/index.vue | 254 +++++++++
日志.md | 23 +
25 files changed, 1337 insertions(+), 857 deletions(-)
create mode 100644 src/api/setting/account.ts
create mode 100644 src/views/stock/stock/stock-config.ts
create mode 100644 src/views/system/setting/account/account-config.ts
create mode 100644 src/views/system/setting/account/index.vue
diff --git a/src/api/setting/account.ts b/src/api/setting/account.ts
new file mode 100644
index 00000000..c896a79a
--- /dev/null
+++ b/src/api/setting/account.ts
@@ -0,0 +1,55 @@
+import request from '@/utils/request'
+
+const v = "1.0";
+
+export function accountList(query: any) {
+ return request({
+ url: '/system',
+ method: 'post',
+ params: {
+ method: 'setting.account.list',
+ v,
+ timestamp: new Date().getTime(),
+ },
+ data: query || {}
+ })
+}
+
+export function accountAdd(data: any) {
+ return request({
+ url: '/system',
+ method: 'post',
+ params: {
+ method: 'setting.account.add',
+ v,
+ timestamp: new Date().getTime()
+ },
+ data
+ })
+}
+
+export function accountdelete(data: { employee_id: number }) {
+ return request({
+ url: '/system',
+ method: 'post',
+ params: {
+ method: 'setting.account.delete',
+ v,
+ timestamp: new Date().getTime()
+ },
+ data
+ })
+}
+
+export function accountUpdate(data: { employee_id: number, real_name?: string, file_id?: number }) {
+ return request({
+ url: '/system',
+ method: 'post',
+ params: {
+ method: 'setting.account.update',
+ v,
+ timestamp: new Date().getTime()
+ },
+ data
+ })
+}
\ No newline at end of file
diff --git a/src/api/stock.ts b/src/api/stock.ts
index 9f61752d..5470b535 100644
--- a/src/api/stock.ts
+++ b/src/api/stock.ts
@@ -30,6 +30,7 @@ export function getProhibitedType() {
} as any)
}
+// 未使用,获取违禁品(限制品)列表
export function getProhibitedList() {
return request({
url: '/system',
@@ -198,19 +199,19 @@ export function createUnit(data: any) {
} as any)
}
-export function getBoxUnits() {
- return request({
- url: '/system',
- method: 'post',
- params: {
- method: 'stock.warehouse.getBoxUnits',
- v,
- timestamp: new Date().getTime()
- },
- data: {},
- isSystemApi: true
- } as any)
-}
+// export function getBoxUnits() {
+// return request({
+// url: '/system',
+// method: 'post',
+// params: {
+// method: 'stock.warehouse.getBoxUnits',
+// v,
+// timestamp: new Date().getTime()
+// },
+// data: {},
+// isSystemApi: true
+// } as any)
+// }
export function checkItemCodeUnique(data: any) {
return request({
@@ -310,6 +311,7 @@ export function deleteProhibited(data: any) {
} as any)
}
+// 未使用,在库存日志或历史记录组件中,用于执行“回退”到某个历史状态的操作
export function backData(data: any) {
return request({
url: '/system',
@@ -323,3 +325,18 @@ export function backData(data: any) {
isSystemApi: true
} as any)
}
+
+// 已弃用
+// export function warehouseSearch(data:any) {
+// return request({
+// url: '/system',
+// method: 'post',
+// params: {
+// method: 'stock.warehouse.search',
+// v,
+// timestamp: new Date().getTime()
+// },
+// data: data,
+// isSystemApi: true
+// } as any)
+// }
\ No newline at end of file
diff --git a/src/components/ImagesUpload/index.vue b/src/components/ImagesUpload/index.vue
index 098b057c..e6d984b9 100644
--- a/src/components/ImagesUpload/index.vue
+++ b/src/components/ImagesUpload/index.vue
@@ -251,9 +251,18 @@ const uploadAllFiles = async () => {
file.status = 'uploading'
const result = await uploadFile(file)
- file.url = result.fileUrl
- file.uid = result.fileId
- file.status = 'success'
+ // 注意:这里需要根据后端返回的结构来映射
+ // 如果后端返回的是 { success: true },那么 result 可能没有 fileUrl 和 fileId
+ // 这种情况下,可能需要重新 loadImages 或者等待后端返回完整信息
+ if (result && result.fileUrl) {
+ file.url = result.fileUrl
+ file.uid = result.fileId
+ file.status = 'success'
+ } else if (result && result.success) {
+ // 如果后端只返回了 success: true,说明上传通知成功
+ // 我们标记为成功,但可能需要刷新列表来获取真实的 file_id
+ file.status = 'success'
+ }
} catch (error: any) {
file.status = 'fail'
ElMessage.error(error.message || '上传失败')
@@ -292,8 +301,8 @@ const uploadFile = async (file: any) => {
throw new Error(`上传失败: ${response.status}`)
}
- const { data } = await indexApi.uploadSuccessNotify(cosConfig.fileInfo || cosConfig) // 注意这里可能需要根据实际接口返回调整
- return data
+ const { data: resultData } = await indexApi.uploadSuccessNotify(cosConfig.fileInfo || cosConfig)
+ return resultData
}
const getCOSUploadConfig = async (file: File) => {
@@ -494,6 +503,12 @@ const handleReset = () => {
capturedImage.value = null
stopCamera()
}
+
+// 暴露给父组件,方便父组件在关闭弹窗等环节主动停止摄像头
+defineExpose({
+ stopCamera,
+ handleReset
+})
diff --git a/src/views/order/orderManagement/component/log.vue b/src/views/order/orderManagement/component/log.vue
index dc7c1b2c..a376f6e0 100644
--- a/src/views/order/orderManagement/component/log.vue
+++ b/src/views/order/orderManagement/component/log.vue
@@ -1,7 +1,13 @@
- 日志
+ 日志
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/views/order/orderManagement/deliveryOrder.vue b/src/views/order/orderManagement/deliveryOrder.vue
index 3904a295..ae7e2853 100644
--- a/src/views/order/orderManagement/deliveryOrder.vue
+++ b/src/views/order/orderManagement/deliveryOrder.vue
@@ -98,29 +98,31 @@
-
-
+
+
+
-
@@ -481,7 +483,7 @@ function handleDeliveryPrintOperation(command: string) {
}
.lower-level {
- flex: 1;
+ height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@@ -497,18 +499,16 @@ function handleDeliveryPrintOperation(command: string) {
.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; }
+ .no-selection {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #909399;
+ .empty-tip { text-align: center; }
+ }
}
}
}
diff --git a/src/views/order/orderManagement/styles/order-sub.scss b/src/views/order/orderManagement/styles/order-sub.scss
index fd8b2f17..6539973f 100644
--- a/src/views/order/orderManagement/styles/order-sub.scss
+++ b/src/views/order/orderManagement/styles/order-sub.scss
@@ -50,7 +50,7 @@
}
.lower-level {
- flex: 1;
+ height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@@ -66,7 +66,6 @@
.detail-container {
flex: 1;
overflow: auto;
- padding: 10px;
}
}
diff --git a/src/views/stock/stock/component/add.vue b/src/views/stock/stock/component/add.vue
index 616e1dbb..d97960f3 100644
--- a/src/views/stock/stock/component/add.vue
+++ b/src/views/stock/stock/component/add.vue
@@ -281,6 +281,7 @@ import { ref, reactive, watch, onMounted, nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Check, Refresh, InfoFilled, Plus } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
+import { stockDefaultFormData, stockFormRules } from '../stock-config'
const props = defineProps({
id: {
@@ -314,39 +315,7 @@ const newUnitName = ref('')
const newProhibitedName = ref('')
const newProhibitedLevel = ref(1)
-const formData = reactive({
- item_code: '',
- store_id: undefined as number | undefined,
- barcode: '',
- item_name: '',
- sku_property: '',
- stock_unit: '',
- packing_requirements: '',
- length: 0.00,
- width: 0.00,
- height: 0.00,
- volume: 0.00,
- gross_weight: 0,
- net_weight: 0,
- tag_price: 0.00,
- retail_price: 0.00,
- is_sn_mgmt: 'N',
- is_shelf_life_mgmt: 'N',
- is_batch_mgmt: 'N',
- prohibited_id: undefined as number | undefined,
- brand_name: '',
- managementFlags: [] as string[],
- // Box specs
- enable_box_spec: false,
- quantity_per_box: 0,
- box_gross_weight: 0,
- box_net_weight: 0,
- box_length: 0.00,
- box_width: 0.00,
- box_height: 0.00,
- box_volume: 0.00,
- box_unit: ''
-})
+const formData = reactive(JSON.parse(JSON.stringify(stockDefaultFormData)))
const originalData = reactive({})
@@ -415,21 +384,8 @@ const validateItemCode = async (rule: any, value: any, callback: any) => {
}
const formRules = {
- store_id: [{ required: true, message: '货主不能为空', trigger: 'change' }],
- barcode: [{ required: true, message: '条码不能为空', trigger: 'blur' }],
+ ...stockFormRules,
item_code: [{ validator: validateItemCode, trigger: 'blur' }],
- item_name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
- stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'change' }],
- gross_weight: [
- { required: true, message: '毛重不能为空', trigger: 'blur' },
- {
- validator: (rule: any, value: any, callback: any) => {
- if (value < 0) callback(new Error('毛重不能小于0'))
- else callback()
- },
- trigger: 'blur'
- }
- ],
quantity_per_box: [
{
validator: (rule: any, value: any, callback: any) => {
diff --git a/src/views/stock/stock/component/barcode.vue b/src/views/stock/stock/component/barcode.vue
index ec627436..83b59513 100644
--- a/src/views/stock/stock/component/barcode.vue
+++ b/src/views/stock/stock/component/barcode.vue
@@ -1,6 +1,6 @@
-
+
@@ -22,11 +22,11 @@
@blur="handleBlur"
/>
- 一行一个
+
-
+
diff --git a/src/views/stock/stock/component/info.vue b/src/views/stock/stock/component/info.vue
index 20751bfd..574b47e2 100644
--- a/src/views/stock/stock/component/info.vue
+++ b/src/views/stock/stock/component/info.vue
@@ -465,6 +465,7 @@ import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'elem
import { Plus, Check, Refresh, Close, QuestionFilled } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
import { useUserStore } from '@/stores/modules/user'
+import { stockDefaultFormData, stockFormRules } from '../stock-config'
const userStore = useUserStore()
const hasPermission = (key: string) => userStore.checkPermission(key)
@@ -480,39 +481,7 @@ const loading = ref(false)
// 基础表单数据
const baseFormData = {
- item_code: '',
- store_id: 0,
- item_name: '',
- sku_property: '',
- stock_unit: '',
- packing_requirements: '',
- length: 0.00,
- width: 0.00,
- height: 0.00,
- volume: 0.00,
- gross_weight: 0,
- net_weight: 0,
- tag_price: 0.00,
- retail_price: 0.00,
- is_sn_mgmt: 'N',
- is_shelf_life_mgmt: 'N',
- is_batch_mgmt: 'N',
- prohibited_id: null,
- brand_name: '',
- // 管理标识复选框
- managementFlags: [] as string[],
-
- // 箱规相关字段
- enable_box_spec: false,
- quantity_per_box: 0,
- box_gross_weight: 0,
- box_net_weight: 0,
- box_length: 0.00,
- box_width: 0.00,
- box_height: 0.00,
- box_volume: 0.00,
- // 补充可能缺失的字段
- box_unit: '',
+ ...stockDefaultFormData,
id: undefined as number | undefined
}
@@ -594,22 +563,8 @@ const validateItemCode = async (rule: any, value: string, callback: any) => {
}
const formRules = reactive({
+ ...stockFormRules,
item_code: [{ validator: validateItemCode, trigger: 'blur' }],
- item_name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
- stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'blur' }],
- gross_weight: [
- { required: true, message: '毛重不能为空', trigger: 'change' },
- {
- validator: (rule: any, value: number, callback: any) => {
- if (value <= 0) {
- callback(new Error('毛重不能小于或等于0'))
- } else {
- callback()
- }
- },
- trigger: 'blur'
- }
- ],
quantity_per_box: [{
required: true,
message: '每箱数量不能为空',
@@ -943,9 +898,25 @@ async function handleDeleteProhibited(id: number) {
diff --git a/src/views/storage/entry/entry-config.ts b/src/views/storage/entry/entry-config.ts
index 8e0041c2..6e0d8d0d 100644
--- a/src/views/storage/entry/entry-config.ts
+++ b/src/views/storage/entry/entry-config.ts
@@ -44,7 +44,7 @@ export const entryColums = [
{ prop: 'order_type',label:'类型',width:'160' },
{ prop: 'purchase_order_code',label:'单据编号 ',width:'160' },
- { prop: 'total_order_lines',label:'商品数',width:'160' },
+ { prop: 'total_order_lines',label:'商品数',width:'160', sortable: 'custom' },
{ prop: 'order_status',label:'订单状态',width:'160' },
{ prop: 'sync_status',label:'同步状态',width:'160' },
{ prop: 'supplier_code',label:'供应商编码',width:'160' },
@@ -77,20 +77,18 @@ export const entrydetail = [
{ prop: 'received_quantity', label: '实收数量', width: '160' },
{ prop: 'confirm_quantity', label: '确认数量', width: '160' },
{ prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
- { prop: '', label: '', width: '160' },
+]
+
+export const detailpanel = [
+ { label: '入库单号', prop: 'entry_order_code', disabled: true },
+ { label: '货主名称', prop: 'store_name', disabled: true },
+ { label: '订单状态', prop: 'order_status', type: 'select' },
+ { label: '入库类型', prop: 'order_type', type: 'select' },
+ { label: '单据编号', prop: 'purchase_order_code' },
+ { label: '同步状态', prop: 'sync_status', type: 'select' },
+ { label: '供应商编码', prop: 'supplier_code' },
+ { label: '供应商名称', prop: 'supplier_name' },
+ { label: '运单号', prop: 'express_code' },
+ { label: '物流公司', prop: 'logistics_name' },
+ { label: '备注', prop: 'remark' }
]
\ No newline at end of file
diff --git a/src/views/storage/entry/index.vue b/src/views/storage/entry/index.vue
index 9cb551d0..f57d8fc4 100644
--- a/src/views/storage/entry/index.vue
+++ b/src/views/storage/entry/index.vue
@@ -41,6 +41,7 @@
:loading="loading"
:queryTime="queryTime"
@current-change="handleRowClick"
+ @sort-change="handleSortChange"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
@@ -138,6 +139,7 @@ const hasSelection = ref(false)
const selectedEntryId = ref(null)
const quickSearch = ref('')
+const currentSort = reactive({ prop: '', order: '' })
const componentMap: Record = {
details: entrydetail,
@@ -195,6 +197,8 @@ async function loadData() {
page: pagination.currentPage,
page_size: pagination.pageSize,
quick_search: quickSearch.value,
+ sort_prop: currentSort.prop,
+ sort_order: currentSort.order,
...(scanBox.value?.getConditions() || {})
}
@@ -343,6 +347,13 @@ function handleConditionChange(condition: any) {
loadData()
}
+function handleSortChange({ prop, order }: any) {
+ currentSort.prop = prop
+ currentSort.order = order
+ pagination.currentPage = 1
+ loadData()
+}
+
const handleConditionClear = () => {
pagination.currentPage = 1
loadData()
@@ -444,7 +455,7 @@ function handleImport() {
}
.upper-wrapper {
- flex: 0 0 auto;
+ flex: 1;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
overflow: hidden;
@@ -480,7 +491,8 @@ function handleImport() {
}
.lower-level {
- flex: 1;
+ flex: 0 0 40%;
+ height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@@ -517,7 +529,8 @@ function handleImport() {
}
.no-selection {
- flex: 1;
+ flex: 0 0 40%;
+ height: 40%;
display: flex;
align-items: center;
justify-content: center;
diff --git a/src/views/storage/inventory/index.vue b/src/views/storage/inventory/index.vue
index c90b3771..019e6a70 100644
--- a/src/views/storage/inventory/index.vue
+++ b/src/views/storage/inventory/index.vue
@@ -388,7 +388,7 @@ function handleImport() {
}
.upper-wrapper {
- flex: 0 0 auto;
+ flex: 1;
min-height: 0;
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
overflow: hidden;
@@ -424,7 +424,8 @@ function handleImport() {
}
.lower-level {
- flex: 1;
+ flex: 0 0 40%;
+ height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
@@ -457,7 +458,8 @@ function handleImport() {
}
.no-selection {
- flex: 1;
+ flex: 0 0 40%;
+ height: 40%;
display: flex;
align-items: center;
justify-content: center;
diff --git a/src/views/storage/receiving/component/DetailsPanel.vue b/src/views/storage/receiving/component/DetailsPanel.vue
index 62983a0f..c129c599 100644
--- a/src/views/storage/receiving/component/DetailsPanel.vue
+++ b/src/views/storage/receiving/component/DetailsPanel.vue
@@ -1,55 +1,70 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+ 重置
+
+
+
-
diff --git a/src/views/storage/receiving/component/Product.vue b/src/views/storage/receiving/component/Product.vue
index be979034..daec5a75 100644
--- a/src/views/storage/receiving/component/Product.vue
+++ b/src/views/storage/receiving/component/Product.vue
@@ -36,6 +36,16 @@
--
+
+
+
+ {{ formatProductStorageStatus(row.storage_status).text }}
+
+
@@ -96,7 +106,7 @@
+
+
\ No newline at end of file
diff --git a/日志.md b/日志.md
index 11b75644..50adca49 100644
--- a/日志.md
+++ b/日志.md
@@ -15,6 +15,7 @@
根据需要更新完善orderManagement的"待审核订单"、"待处理订单"、"异常订单"、"配送订单"、"归档订单"五个页面的字段明细、筛选条件
根据情况设计新增其他页面、新增操作功能或修复已有问题。
+
2026.3.24
一、今日完成
“收货单”添加打印/批量打印收货单功能,能够根据所选的打印单号打印/批量打印收货单。
@@ -52,3 +53,25 @@
三、后续计划
完善项目页面及其组件屏幕尺寸适配。
添加后端已完成的api接口并进行功能的完善与开发。
+
+
+2026.3.26
+一、今日完成
+-新增用户管理页面,添加account-config.ts用户管理配置文件和account.ts接口文件,实现用户管理功能。
+-优化stock、receving、entry、inventory、deliveryOrder页面和相关组件布局,统一结构设计和样式布局,提升可维护性。
+-修复receiving页面时间格式显示异常问题。
+-优化stock接口,排除删除废弃或无用接口。
+-更新stock-config.ts配置文件,提升stock页面维护性;更新表格状态字段数据。
+-
+
+二、问题记录
+-stock回收站,后端 stock.warehouse.list 接口(对应的数据库表)中不存在 is_deleted 字段,或者该接口不支持通过 is_deleted 参数进行过滤。
+-stock.warehouse.bindItem接口错误,数据库架构与查询语句不匹配。
+-图片上传遇到跨域问题。
+
+三、后续计划
+完善接口设计,排除故障接口,测试接口功能。
+完善各页面config.ts配置设计,优化功能结构。
+完善各页面布局设计,统一样式和风格,降低维护成本。
+解决跨域问题。
+解决路由相关的一些潜在小问题。
\ No newline at end of file