diff --git a/dist.tar.gz b/dist.tar.gz index 0e537f35..1488d0be 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/lang/en-US.ts b/src/lang/en-US.ts index 08af6054..d7ee150f 100644 --- a/src/lang/en-US.ts +++ b/src/lang/en-US.ts @@ -54,6 +54,7 @@ export default { "Profile": "Profile", "printTemplate": "Print Template", 'Permission': 'Permission', + 'Role':'Role', }, "login": { "title": "Login", diff --git a/src/lang/zh-CN.ts b/src/lang/zh-CN.ts index f6cef620..38b9c1da 100644 --- a/src/lang/zh-CN.ts +++ b/src/lang/zh-CN.ts @@ -54,6 +54,7 @@ export default { "Profile": "个人中心", "printTemplate": "打印模板", 'Permission': '权限管理', + 'Role':'角色管理', }, "login": { "title": "登录", diff --git a/src/router/map.ts b/src/router/map.ts index 65253cbf..5193bfb4 100644 --- a/src/router/map.ts +++ b/src/router/map.ts @@ -15,6 +15,7 @@ export const componentMap: Record = { 'storage/entry': () => import('@/views/storage/entry/index.vue'), 'storage/inventory': () => import('@/views/storage/inventory/index.vue'), 'storage/stockout': () => import('@/views/storage/stockout/index.vue'), + 'role/index': () => import('@/views/system/setting/role/index.vue'),'system/setting/role/index': () => import('@/views/system/setting/role/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'), diff --git a/src/views/dashboard/components/AppDownload.vue b/src/views/dashboard/components/AppDownload.vue new file mode 100644 index 00000000..64f2ae10 --- /dev/null +++ b/src/views/dashboard/components/AppDownload.vue @@ -0,0 +1,197 @@ + + + + + \ No newline at end of file diff --git a/src/views/dashboard/composables/dashboard-config.ts b/src/views/dashboard/composables/dashboard-config.ts index 003c5dd3..0ec90779 100644 --- a/src/views/dashboard/composables/dashboard-config.ts +++ b/src/views/dashboard/composables/dashboard-config.ts @@ -8,6 +8,7 @@ export const MODULE_PERMISSIONS = { PLATFORM_DISTRIBUTION: 'dashboard.platformDist', HOT_ORDER_RANK: 'dashboard.hotOrderRank', EXPRESS_RATIO: 'dashboard.expressRatio', + APP_DOWNLOAD: 'dashboard.appDownload', // App download does not need actual permission check } // Dynamic Components Map @@ -18,6 +19,7 @@ export const moduleComponents: Record = { PlatformDistribution: defineAsyncComponent(() => import('../components/PlatformDistribution.vue')), HotOrderRank: defineAsyncComponent(() => import('../components/HotOrderRank.vue')), ExpressRatio: defineAsyncComponent(() => import('../components/ExpressRatio.vue')), + AppDownload: defineAsyncComponent(() => import('../components/AppDownload.vue')), } export interface DashboardModule { @@ -65,5 +67,11 @@ export const RAW_MODULE_CONFIGS: Record = { component: 'ExpressRatio', titleKey: 'dashboard.expressRatio', colSpan: 1 + }, + [MODULE_PERMISSIONS.APP_DOWNLOAD]: { + name: 'AppDownload', + component: 'AppDownload', + titleKey: 'dashboard.appDownload', // You can add translation or handle it dynamically + colSpan: 1 } } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 458636d2..360d4b1e 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -72,6 +72,11 @@ const getAccessibleModules = (perms: string[]) => { modules.push({ ...configs[MODULE_PERMISSIONS.WAREHOUSE_BASE] }) } + // 1.5 Store Statistics (if accessible) + if (isAccessible(MODULE_PERMISSIONS.STORE_BASE)) { + modules.push({ ...configs[MODULE_PERMISSIONS.STORE_BASE] }) + } + // 2. Order Trend (if accessible) if (isAccessible(MODULE_PERMISSIONS.ORDER_TREND)) { modules.push({ ...configs[MODULE_PERMISSIONS.ORDER_TREND] }) @@ -85,6 +90,7 @@ const getAccessibleModules = (perms: string[]) => { // 4. Add remaining modules const prioritized = [ MODULE_PERMISSIONS.WAREHOUSE_BASE, + MODULE_PERMISSIONS.STORE_BASE, MODULE_PERMISSIONS.ORDER_TREND, MODULE_PERMISSIONS.PLATFORM_DISTRIBUTION, MODULE_PERMISSIONS.EXPRESS_RATIO // Also prioritized but handled below @@ -95,8 +101,13 @@ const getAccessibleModules = (perms: string[]) => { modules.push({ ...configs[MODULE_PERMISSIONS.EXPRESS_RATIO] }) } + // App Download Component (unrestricted by permissions) + if (configs[MODULE_PERMISSIONS.APP_DOWNLOAD]) { + modules.push({ ...configs[MODULE_PERMISSIONS.APP_DOWNLOAD] }) + } + Object.keys(configs).forEach(permission => { - if (prioritized.includes(permission)) return + if (prioritized.includes(permission) || permission === MODULE_PERMISSIONS.APP_DOWNLOAD) return if (isAccessible(permission)) { modules.push({ diff --git a/src/views/system/setting/permission/index.vue b/src/views/system/setting/permission/index.vue index 7eb7e8c1..76595108 100644 --- a/src/views/system/setting/permission/index.vue +++ b/src/views/system/setting/permission/index.vue @@ -62,12 +62,12 @@ - - - + + + - + @@ -87,19 +87,61 @@ - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 启用 禁用 @@ -107,8 +149,8 @@ @@ -257,92 +299,102 @@ const handleDelete = (row: any) => { } /* ---------------- 弹窗表单逻辑 ---------------- */ -const dialogVisible = ref(false) -const dialogStatus = ref('create') +const createDialogVisible = ref(false) +const updateDialogVisible = ref(false) const submitLoading = ref(false) -const dataFormRef = ref() +const createFormRef = ref() +const updateFormRef = ref() -const defaultTemp = { - permission_id: undefined, +const tempCreate = reactive({ parent_id: undefined as number | undefined, type: 'web_pages', path: '', meta_title: '', name: '', + sort: 0 +}) + +const tempUpdate = reactive({ + permission_id: undefined as number | undefined, + parent_id: undefined as number | undefined, + type: 'web_pages', + path: '', + name: '', sort: 0, status: 1 -} - -const temp = reactive({ ...defaultTemp }) +}) const rules = { path: [{ required: true, message: '请输入权限路径', trigger: 'blur' }], type: [{ required: true, message: '请选择权限类型', trigger: 'change' }] } -const resetTemp = (parentId?: number) => { - Object.assign(temp, defaultTemp) - if (parentId) { - temp.parent_id = parentId - } -} - const handleCreate = () => { getParentOptions() - resetTemp() - dialogStatus.value = 'create' - dialogVisible.value = true - if (dataFormRef.value) { - dataFormRef.value.clearValidate() + Object.assign(tempCreate, { + parent_id: undefined, + type: 'web_pages', + path: '', + meta_title: '', + name: '', + sort: 0 + }) + createDialogVisible.value = true + if (createFormRef.value) { + createFormRef.value.clearValidate() } } const handleCreateChild = (row: any) => { getParentOptions() - resetTemp(row.permission_id) - dialogStatus.value = 'create' - dialogVisible.value = true - if (dataFormRef.value) { - dataFormRef.value.clearValidate() + Object.assign(tempCreate, { + parent_id: row.permission_id, + type: 'web_pages', + path: '', + meta_title: '', + name: '', + sort: 0 + }) + createDialogVisible.value = true + if (createFormRef.value) { + createFormRef.value.clearValidate() } } const handleUpdate = (row: any) => { getParentOptions() - Object.assign(temp, { + Object.assign(tempUpdate, { permission_id: row.permission_id, parent_id: row.parent_id === 0 ? undefined : row.parent_id, - type: row.type, - path: row.path, - meta_title: row.meta_title || '', + type: row.type || 'web_pages', + path: row.path || '', name: row.name || '', sort: row.sort || 0, status: row.status }) - dialogStatus.value = 'update' - dialogVisible.value = true - if (dataFormRef.value) { - dataFormRef.value.clearValidate() + updateDialogVisible.value = true + if (updateFormRef.value) { + updateFormRef.value.clearValidate() } } const createData = async () => { - if (!dataFormRef.value) return - await dataFormRef.value.validate(async (valid: boolean) => { + if (!createFormRef.value) return + await createFormRef.value.validate(async (valid: boolean) => { if (valid) { submitLoading.value = true try { const payload = { - path: temp.path, - type: temp.type, - name: temp.name, - parent_id: temp.parent_id || 0, - meta_title: temp.meta_title, - sort: temp.sort + path: tempCreate.path, + type: tempCreate.type, + name: tempCreate.name, + parent_id: tempCreate.parent_id || 0, + meta_title: tempCreate.meta_title, + sort: tempCreate.sort } await permissionAdd(payload) ElMessage.success('新增成功') - dialogVisible.value = false + createDialogVisible.value = false getList() } catch (err) { console.error(err) @@ -354,23 +406,23 @@ const createData = async () => { } const updateData = async () => { - if (!dataFormRef.value) return - await dataFormRef.value.validate(async (valid: boolean) => { + if (!updateFormRef.value) return + await updateFormRef.value.validate(async (valid: boolean) => { if (valid) { submitLoading.value = true try { const payload = { - permission_id: temp.permission_id!, - path: temp.path, - type: temp.type, - name: temp.name, - parent_id: temp.parent_id || 0, - sort: temp.sort, - status: temp.status + permission_id: tempUpdate.permission_id!, + path: tempUpdate.path, + type: tempUpdate.type, + name: tempUpdate.name, + parent_id: tempUpdate.parent_id || 0, + sort: tempUpdate.sort, + status: tempUpdate.status } await permissionUpdate(payload) ElMessage.success('修改成功') - dialogVisible.value = false + updateDialogVisible.value = false getList() } catch (err) { console.error(err) diff --git a/src/views/system/setting/role/index.vue b/src/views/system/setting/role/index.vue new file mode 100644 index 00000000..89a07fea --- /dev/null +++ b/src/views/system/setting/role/index.vue @@ -0,0 +1,540 @@ + + + + + diff --git a/src/接口文档.txt b/src/接口文档.txt new file mode 100644 index 00000000..30dfab68 --- /dev/null +++ b/src/接口文档.txt @@ -0,0 +1,954 @@ +工号角色组管理模块 + +setting.account.list +查询当前主体下且在当前账号角色组可操作范围内的工号列表 + +名称 类型 必填 说明 +status number 否 状态筛选,默认 1,仅查有效工号 +includeDisabled boolean 否 是否包含已删除工号 +where object 否 动态筛选条件,仅支持 employee_id、account_id、real_name、status、username、phone、email、quickWhere;其中 username/phone/email 为账号字段,quickWhere 按 real_name/username/phone/email 模糊搜索 + +Response (18) +名称 类型 必填 说明 +data[] object 是 工号列表项 +data[].employee_id number 是 工号ID +data[].account_id number 是 账号ID +data[].store_id number 是 主体ID +data[].real_name string 是 工号姓名 +data[].status number 是 工号状态:1=启用,0=停用 +data[].username string 是 账号用户名 +data[].phone string 是 账号手机号 +data[].email string 是 账号邮箱 +data[].avatar_file_id number 否 头像文件ID,为空表示未设置 +data[].avatar_url string 是 头像访问地址 +data[].role_ids number[] 是 工号绑定的角色ID数组 +data[].roles[] object 是 工号绑定的角色组详情 +data[].roles[].role_id number 是 角色ID +data[].roles[].role_code string 是 角色编码 +data[].roles[].role_name string 是 角色名称 +data[].roles[].pid number 是 父级角色ID +data[].roles[].status number 是 角色状态:1=启用,0=停用 + +接口响应:HTTP 200 + +{ + "flag": "success", + "code": 200, + "message": "ok", + "data": [ + { + "employee_id": 42, + "account_id": 10, + "store_id": 1000028, + "real_name": "wwwww", + "status": 1, + "created_at": "2026-03-30T14:14:59.000Z", + "updated_at": "2026-03-30T14:14:59.000Z", + "username": "acct_mnd9s9hrrzqomy", + "phone": "", + "email": "acct_mnd9s9hrrzqomy@autotest.local", + "account_real_name": "wwwww", + "avatar_file_id": null, + "avatar_url": "", + "avatar_name": "", + "role_ids": [ + 2 + ], + "roles": [ + { + "role_id": 2, + "role_code": "warehouse_admin_default", + "role_name": "仓库管理员", + "pid": 0, + "status": 1 + } + ] + }, + { + "employee_id": 41, + "account_id": 9, + "store_id": 1000028, + "real_name": "刘付明仁", + "status": 1, + "created_at": "2026-03-28T11:46:09.000Z", + "updated_at": "2026-03-28T11:53:04.000Z", + "username": "acct_mna9l5tydneenb", + "phone": "", + "email": "acct_mna9l5tydneenb@autotest.local", + "account_real_name": "刘付明仁2", + "avatar_file_id": null, + "avatar_url": "", + "avatar_name": "", + "role_ids": [], + "roles": [] + }, + { + "employee_id": 36, + "account_id": 5, + "store_id": 1000028, + "real_name": "测试工号保留", + "status": 1, + "created_at": "2026-03-25T11:54:50.000Z", + "updated_at": "2026-03-25T11:54:52.000Z", + "username": "autotest_acc_mgmt_keep", + "phone": "", + "email": "autotest_acc_mgmt_keep@autotest.local", + "account_real_name": "测试工号预留初始化", + "avatar_file_id": 108352, + "avatar_url": "https://ye4s.file.gzxunren.com//1000028/images/20260203/909D1F8B898B80AF31E9D65B3741D5EA.jpg", + "avatar_name": "1770127007294.jpg", + "role_ids": [ + 2 + ], + "roles": [ + { + "role_id": 2, + "role_code": "warehouse_admin_default", + "role_name": "仓库管理员", + "pid": 0, + "status": 1 + } + ] + } + ], + "timestamp": 1774941219 +} + +----- +setting.account.add +新增工号,按手机号复用或创建账号后绑定到当前主体,并校验角色组 ids 不超出当前角色范围 + +Params (6) +名称 类型 必填 说明 +phone string 是 手机号,作为账号复用/创建依据 +real_name string 是 工号姓名,新增时禁止直接使用保留名称 +username string 否 新账号用户名,不传时系统自动生成 +password string 否 新账号密码,不传默认 111111 +ids number[] 是 角色组ID数组,必须在当前登录工号可分配角色范围内;若同时传入父子节点,仅保留父节点 +email string 否 新账号邮箱,不传时按 username 自动生成 + +Response (7) +名称 类型 必填 说明 +employee_id number 是 新增或复用后的工号ID +account_id number 是 绑定账号ID +role_id number 是 绑定后的角色ID +role_ids number[] 是 绑定后的角色组ID数组 +is_new_account boolean 是 是否为本次新建账号 +phone string 是 绑定账号手机号 +username string 是 绑定账号用户名 + +----- +setting.account.delete +删除工号绑定关系,仅停用工号,不删除账号 + +名称 类型 必填 说明 +employee_id number 是 要删除的工号ID + +Response (4) +名称 类型 必填 说明 +employee_id number 是 被停用的工号ID +account_id number 是 关联账号ID +status string 是 固定返回 deleted +already_deleted boolean 否 可选,true 表示该工号原本已停用 + +----- +setting.account.update +更新工号姓名、头像引用和角色组 ids(含当前角色范围校验) + +名称 类型 必填 说明 +employee_id number 是 要更新的工号ID +real_name string 否 更新后的工号姓名 +file_id number 否 已有文件ID,作为头像引用 +ids number[] 是 角色组ID数组,传入时将整体替换为该数组,且必须在当前登录工号可分配角色范围内;若同时传入父子节点,仅保留父节点 + +Response (5) +名称 类型 必填 说明 +employee_id number 是 更新后的工号ID +real_name string 是 更新后的工号姓名 +avatar_file_id number 否 更新后的头像文件ID +avatar_url string 是 更新后的头像地址 +role_ids number[] 是 更新后的角色组ID数组 + +---------- +工号角色管理模块 +所有请求为Post请求,请求Body为JSON格式 + +setting.role.list +查询当前主体可分配角色列表,按当前登录工号返回角色选中状态 + +名称 类型 必填 说明 +includeDisabled boolean 否 是否包含停用角色,默认 false +includeSystem boolean 否 是否包含系统默认角色(store_id=0/null),默认 false + +response: +名称 类型 必填 说明 +employee_id number 否 当前登录工号ID,未识别到登录工号时为 null +roles[] object 是 角色列表 +roles[].role_id number 是 角色ID +roles[].role_name string 是 角色名称 +roles[].selected boolean 是 表示当前登录工号是否已绑定该角色 + +接口返回数据: +HTTP 200 + +{ + "flag": "success", + "code": 200, + "message": "ok", + "data": { + "employee_id": 34, + "roles": [ + { + "role_id": 2, + "role_code": "warehouse_admin_default", + "role_name": "仓库管理员", + "description": "仓库全部权限", + "role_type": 1, + "scope": 1, + "is_system": 1, + "status": 1, + "store_id": null, + "pid": 0, + "selected": true, + "children": [ + { + "role_id": 8, + "role_code": "2", + "role_name": "仓库经理", + "description": "仓库经理权限", + "role_type": 1, + "scope": 1, + "is_system": 0, + "status": 1, + "store_id": 1000028, + "pid": 2, + "selected": false, + "children": [] + } + ] + } + ] + }, + "timestamp": 1774923128 +} + +----- +setting.role.add +新增角色并一次性提交权限集(permission_ids) + +名称 类型 必填 说明 +role_code string 是 角色编码(主体内唯一) +role_name string 是 角色名称 +description string 否 角色描述 +pid number 否 父级角色ID,默认 0 +permission_ids number[] 是 权限ID数组,一次性提交 + +response: +名称 类型 必填 说明 +role_id number 是 新建角色ID +role_code string 是 角色编码 +role_name string 是 角色名称 +permission_ids number[] 是 提交后的权限ID集合 + +----- +setting.role.delete +批量删除角色(软删除),并清理对应角色权限关联 + +名称 类型 必填 说明 +ids number[] 是 角色ID数组 + +response: +名称 类型 必填 说明 +ids number[] 是 请求的角色ID数组 +deleted_ids number[] 是 本次实际删除(由启用变为停用)的角色ID数组 +already_deleted_ids number[] 是 本就处于删除状态的角色ID数组 +status string 是 固定返回 deleted + +----- +setting.role.update +更新角色信息并一次性重置角色权限(permission_ids) + + +名称 类型 必填 说明 +role_id number 是 角色ID +role_name string 否 角色名称 +description string 否 角色描述 +status number 否 角色状态:1=启用,0=禁用 +pid number 否 父级角色ID +permission_ids number[] 是 权限ID数组,一次性提交 + +response: +名称 类型 必填 说明 +role_id number 是 角色ID +permission_ids number[] 是 更新后的权限ID集合 + +---------- +权限管理模块 + +setting.permission.list +查询当前登录工号实际可用权限集合,可选按角色返回已绑定权限选中状态 + +名称 类型 必填 说明 +role_id number 否 可选,不传时默认使用当前登录工号的当前角色计算权限选中状态 +type string 否 可选,按权限类型筛选,如 api/web_pages/pda_pages/btns +keyword string 否 可选,按 path/name/meta_title 模糊搜索 +includeDisabled boolean 否 是否包含禁用权限,默认 false + +response: +名称 类型 必填 说明 +role_id number 否 查询目标角色ID,未传 role_id 时返回当前登录工号的当前角色ID +permissions[] object 是 权限列表 +permissions[].permission_id number 是 权限ID +permissions[].path string 是 权限路径 +permissions[].type string 是 权限类型 +permissions[].selected boolean 是 当传入 role_id 时,表示该权限是否已绑定 + +接口返回数据: +HTTP 200 + +{ + "flag": "success", + "code": 200, + "message": "ok", + "data": { + "role_id": 2, + "permissions": [ + { + "permission_id": 42, + "path": "dashboard.warehouseBaseData", + "name": "Base Data", + "type": "block", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "仓库基础数据", + "selected": true + }, + { + "permission_id": 43, + "path": "dashboard.hotOrderRank", + "name": "Hot STOCK Rank", + "type": "block", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "热门商品排行", + "selected": true + }, + { + "permission_id": 44, + "path": "dashboard.orderTrend", + "name": "Order Trend", + "type": "block", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "订单趋势", + "selected": true + }, + { + "permission_id": 45, + "path": "dashboard.platformDist", + "name": "Platform Distribution", + "type": "block", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "平台分布", + "selected": true + }, + { + "permission_id": 49, + "path": "dashboard.auth", + "name": "", + "type": "block", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "系统剩余有效期", + "selected": true + }, + { + "permission_id": 52, + "path": "store.getStoreRoles", + "name": "", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 53, + "path": "store.auditApply", + "name": "", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "提交审核接口", + "selected": true + }, + { + "permission_id": 55, + "path": "warehouse.getWarehouseZones", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "获取所有仓库", + "selected": true + }, + { + "permission_id": 56, + "path": "warehouse.create", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "创建实体库", + "selected": true + }, + { + "permission_id": 57, + "path": "warehouse.getWarehouseTree", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "获取仓库下的元素", + "selected": true + }, + { + "permission_id": 59, + "path": "warehouse.update", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "更新仓库元素", + "selected": true + }, + { + "permission_id": 60, + "path": "warehouse.delete", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "删除仓库元素", + "selected": true + }, + { + "permission_id": 61, + "path": "warehouse.updateSpaceInfo", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "修改仓位信息", + "selected": true + }, + { + "permission_id": 62, + "path": "stock.saveWarehouseStock", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "保存商品资料", + "selected": true + }, + { + "permission_id": 63, + "path": "stock.saveWarehouseStockBarcode", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "修改商品条码", + "selected": true + }, + { + "permission_id": 64, + "path": "stock.bindItem", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "绑定货主商品到仓库", + "selected": true + }, + { + "permission_id": 65, + "path": "stock.unbindItem", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "解除绑定货主商品到仓库", + "selected": true + }, + { + "permission_id": 66, + "path": "index.ReferenceFile", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "图片设置权限", + "selected": true + }, + { + "permission_id": 67, + "path": "warehouseExport", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "仓库所有导出权限", + "selected": true + }, + { + "permission_id": 68, + "path": "warehouseRecycle", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "仓库所有回收站数据权限", + "selected": true + }, + { + "permission_id": 69, + "path": "stock.createWarehouseStock", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "仓库商品创建", + "selected": true + }, + { + "permission_id": 70, + "path": "stock.handleBatchDelete", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "删除仓库商品", + "selected": true + }, + { + "permission_id": 71, + "path": "stock.handleBatchChange", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "批量修改", + "selected": true + }, + { + "permission_id": 79, + "path": "storage.receiving.create", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "创建收货单", + "selected": true + }, + { + "permission_id": 82, + "path": "storage.receiving.getReceivingDetail", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "获取收货单明细", + "selected": true + }, + { + "permission_id": 83, + "path": "storage.receiving.batchCancelReceiving", + "name": "", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "批量作废收货单", + "selected": true + }, + { + "permission_id": 84, + "path": "index.getCOSUploadConfig", + "name": "index.getCOSUploadConfig", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 85, + "path": "index.getExpressList", + "name": "index.getExpressList", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 86, + "path": "index.tryAutoTranslateNewKeys", + "name": "index.tryAutoTranslateNewKeys", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 87, + "path": "index.uploadSuccessNotify", + "name": "index.uploadSuccessNotify", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 88, + "path": "order.getOrderModels", + "name": "order.getOrderModels", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 89, + "path": "stock.warehouse.bindItem", + "name": "stock.warehouse.bindItem", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 90, + "path": "stock.warehouse.createProhibited", + "name": "stock.warehouse.createProhibited", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 91, + "path": "stock.warehouse.createUnit", + "name": "stock.warehouse.createUnit", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 92, + "path": "stock.warehouse.createWarehouseStock", + "name": "stock.warehouse.createWarehouseStock", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 93, + "path": "stock.warehouse.deleteProhibited", + "name": "stock.warehouse.deleteProhibited", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 94, + "path": "stock.warehouse.deleteUnit", + "name": "stock.warehouse.deleteUnit", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 95, + "path": "stock.warehouse.handleBatchChange", + "name": "stock.warehouse.handleBatchChange", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 96, + "path": "stock.warehouse.handleBatchDelete", + "name": "stock.warehouse.handleBatchDelete", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 97, + "path": "stock.warehouse.saveWarehouseStock", + "name": "stock.warehouse.saveWarehouseStock", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 98, + "path": "stock.warehouse.saveWarehouseStockBarcode", + "name": "stock.warehouse.saveWarehouseStockBarcode", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 99, + "path": "stock.warehouse.unbindItem", + "name": "stock.warehouse.unbindItem", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 100, + "path": "storage.receiving.addItem", + "name": "storage.receiving.addItem", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 101, + "path": "storage.receiving.removeItem", + "name": "storage.receiving.removeItem", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 102, + "path": "storage.receiving.saveReceiving", + "name": "storage.receiving.saveReceiving", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 103, + "path": "warehouse.createRack", + "name": "warehouse.createRack", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 104, + "path": "warehouse.createRackWithSpaces", + "name": "warehouse.createRackWithSpaces", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 105, + "path": "warehouse.recalculatePickPath", + "name": "warehouse.recalculatePickPath", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 106, + "path": "warehouse.updateNeighbors", + "name": "warehouse.updateNeighbors", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 107, + "path": "warehouse.updateRackPosition", + "name": "warehouse.updateRackPosition", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 108, + "path": "stock.getInfo", + "name": "stock.getInfo", + "type": "api", + "status": 1, + "parent_id": 50, + "sort": 0, + "meta_title": "获取审核信息接口", + "selected": true + }, + { + "permission_id": 109, + "path": "printer.bind", + "name": "printer.bind", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "打印台绑定权限", + "selected": true + }, + { + "permission_id": 119, + "path": "setting.permission.add", + "name": "setting.permission.add", + "type": "api", + "status": 1, + "parent_id": null, + "sort": 0, + "meta_title": "setting.permission.add", + "selected": true + } + ] + }, + "timestamp": 1774923263 +} + +----- +setting.permission.add +新增权限 + +名称 类型 必填 说明 +path string 是 权限路径 +type string 是 权限类型:web_pages/pda_pages/btns/api/miniprogram_pages/block +name string 否 权限名称 +parent_id number 否 父级权限ID,传 0 或不传表示顶级;若传入必须在当前登录工号可用权限集内 +meta_title string 否 页面标题 +sort number 否 排序,默认 0 + +response: +名称 类型 必填 说明 +permission_id number 是 权限ID +path string 是 权限路径 +type string 是 权限类型 + +----- +setting.permission.delete +批量删除权限(软删除) + + +名称 类型 必填 说明 +ids number[] 是 权限ID数组,必须在当前登录工号可用权限集内 + +response: +名称 类型 必填 说明 +ids number[] 是 请求的权限ID数组 +deleted_ids number[] 是 本次实际删除(由启用变为停用)的权限ID数组 +already_deleted_ids number[] 是 本就处于删除状态的权限ID数组 +status string 是 固定返回 deleted + +----- +setting.permission.update +更新权限(非角色绑定重置),目标权限必须在当前登录工号可用权限集内 + +名称 类型 必填 说明 +permission_id number 是 权限ID,必须在当前登录工号可用权限集内 +path string 否 权限路径 +type string 否 权限类型:web_pages/pda_pages/btns/api/miniprogram_pages/block +name string 否 权限名称 +parent_id number 否 父级权限ID,传 0 表示顶级;若传入必须在当前登录工号可用权限集内 +sort number 否 排序 +status number 否 权限状态:1=启用,0=禁用 + +response: +名称 类型 必填 说明 +permission_id number 是 权限ID +path string 是 更新后的权限路径 +type string 是 更新后的权限类型 diff --git a/src/需求文档.txt b/src/需求文档.txt new file mode 100644 index 00000000..f646d4af --- /dev/null +++ b/src/需求文档.txt @@ -0,0 +1,21 @@ +http://dl.wms.gztbyc.com/pda/latest.json PDA版本信息以及下载链接,访问链接,内容如下: +{ + "version": "1.0.18", + "versionName": "1.0.18", + "downloadUrl": "http://dl.wms.gztbyc.com/pda/WMS_PDA_v1.0.18.apk", + "fileName": "WMS_PDA_v1.0.18.apk", + "forceUpdate": false, + "releaseNotes": [ + + ], + "publishedAt": "2026-03-31T23:40:27+08:00" +}。 + +http://dl.wms.gztbyc.com/printServer/latest.json 打印台版本信息以及下载链接,访问链接,内容如下: +{ + "version": "1.0.10", + "file": "printServer-1.0.10-setup.exe", + "url": "https://dl.wms.gztbyc.com/printServer/printServer-1.0.10-setup.exe", + "sha256": "564EB4E6BD77A746C7061AE2C1EBC274B2DC66ADD29442486A8D877EAD000926", + "publishedAtUtc": "2026-03-30T06:09:20Z" +} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 89ecd617..7860bfd7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -25,6 +25,11 @@ export default defineConfig({ target: 'http://localhost:9528', // Assuming Vue 2 backend is running here, user can change changeOrigin: true, rewrite: (path) => path.replace(/^\/dev-api/, '') + }, + '/dl-api': { + target: 'http://dl.wms.gztbyc.com', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/dl-api/, '') } } }, diff --git a/日志.md b/日志.md index c3da338c..883fda5f 100644 --- a/日志.md +++ b/日志.md @@ -15,7 +15,7 @@ 根据需要更新完善orderManagement的"待审核订单"、"待处理订单"、"异常订单"、"配送订单"、"归档订单"五个页面的字段明细、筛选条件 根据情况设计新增其他页面、新增操作功能或修复已有问题。 - +----- 2026.3.24 一、今日完成 “收货单”添加打印/批量打印收货单功能,能够根据所选的打印单号打印/批量打印收货单。 @@ -35,7 +35,7 @@ 完成“微信绑定”功能。 完善“库存”相关页面操作与功能。 - +----- 2026.3.25 一、今日完成 -优化layout框架,、stock页面、receiving页面、entry页面和部分页面组件适配不同尺寸显示屏幕,增大数据显示密度。 @@ -54,7 +54,7 @@ 完善项目页面及其组件屏幕尺寸适配。 添加后端已完成的api接口并进行功能的完善与开发。 - +----- 2026.3.26 一、今日完成 -新增用户管理页面,添加account-config.ts用户管理配置文件和account.ts接口文件,实现用户管理功能。 @@ -75,7 +75,7 @@ 解决跨域问题。 解决路由相关的一些潜在小问题。 - +----- 2026.3.27 一、今日完成 -修复stock无法删除/批量删除商品问题。 @@ -103,6 +103,7 @@ stock获取回收站商品接口复用了商品信息接口stock.warehouse.list 完善接口设计,排除故障接口,测试接口功能。 实现将项目打包并上传到服务器实现静态资源托管。 +----- 2026.3.28 一、今日完成 -404页面新增路由重定向和返回上一个页面功能,优化使用体验。 @@ -116,4 +117,58 @@ stock获取回收站商品接口复用了商品信息接口stock.warehouse.list 三、后续计划 更新项目样式、布局。 -完善测试api接口,修复问题。 \ No newline at end of file +完善测试api接口,修复问题。 + +----- +2026.3.30 +一、今日完成 +添加仪表板和角色管理 API +- 优化仓库统计、商店统计、订单趋势、平台分布、热销订单排名和快递比例的仪表板 API 功能。 +- 为仪表板配置和动态组件映射添加了新的可组合函数。 +- 在接口文档中记录了角色管理 API 端点。 +-新增工号角色管理模块功能,添加相关接口。 +-调整优化layout页面样式。 +- + +二、问题记录 +-基础模块-index.tryAutoTranslateNewKeys未使用。 +-基础模块-index.searchSpace未使用。 +-工号角色管理模块-接口设计有问题。 + +三、后续计划 +完善接口设计,排除故障接口,测试接口功能。 +熟悉开源远程电脑项目billd-desk,准备学习开发相关功能应用。 + +----- +2026.3.31 +一、今日完成 +添加权限管理 API 和 UI + +- 实现了权限管理的 API 功能,包括列出、添加、更新和删除权限。 +- 创建了一个新的 Vue 组件用于权限管理界面,具有过滤、创建、编辑和删除权限的功能。 +- 增加了用于显示权限及其层级结构的树状结构。 +- 集成了表单验证和用户反馈,用于权限管理 UI 中执行的操作。 +- + +二、问题记录 +无 + +三、后续计划 +完善接口、功能设计,排除故障接口,测试接口功能。 +熟悉开源远程电脑项目billd-desk,准备学习开发相关功能应用。 + +----- +2026.4.1 +一、今日完成 +为账户和角色管理模块添加 API 文档;包括 PDA 和打印服务器的版本信息. +-修改permission权限管理、account用户管理,优化使用逻辑,完成接口测试。 +-新增role角色管理页面,添加角色组管理功能。 + +二、问题记录 +-角色管理新增分组/将角色移动到新建角色下失败。role表中测试管理员无法成为其他角色的父级。 +-setting.permission.add接口新增权限返回成功,实际并未返回添加数据。 +-测试删除了一个商品的批量操作权限。 + +三、后续计划 +完善接口、功能设计,排除故障接口,测试接口功能。 +熟悉开源远程电脑项目billd-desk,准备学习开发相关功能应用。 \ No newline at end of file