Compare commits

...

24 Commits

Author SHA1 Message Date
55f13bb47b feat: 添加下拉远程搜索并完善登录会话
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 15:57:46 +08:00
e785a99b7d chore(env): 更新为周商环境接口配置
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 09:45:49 +08:00
470a474d70 fix(storegoods): 修复重扫仓位时旧码拼接问题
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 09:44:48 +08:00
9fffe228d5 feat: 扫码与细码明细展示外部卷号
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 09:43:48 +08:00
e7827c4714 优化(ui): 放大细码与表格等字体提升可读性
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 17:55:38 +08:00
fc6e9915a6 fix(storegoods): 调整纸筒与包装重量默认值
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 17:13:51 +08:00
ab9d199fe3 fix(storegoods): 扫码详情展示细码数量并去掉本行匹数
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 14:06:20 +08:00
863f0fe850 feat(storegoods): 扣重改为扫码提交并展示细码重量
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 14:06:13 +08:00
ce5f5a956f feat(storegoods): 新增成品采购进仓模块
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 14:06:09 +08:00
c94a009caf feat(storegoods): 新增加工退货进仓并支持出仓类型选择
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 14:07:21 +08:00
12187283cc fix(storegoods): 扫码超25位判为二维码
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 10:34:23 +08:00
0e105c78e1 chore(http): 请求日志改为JSON字符串输出
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 10:34:23 +08:00
e1ac017a3c fix(storegoods): 加工出仓去掉扫仓位流程
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 17:03:13 +08:00
066f1c623c feat(storegoods): 新增加工出仓并去除仓位重复提示
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 14:17:27 +08:00
d660d6fcf1 feat(storegoods): 新增加工进仓模块并适配智盛ERP
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 18:32:02 +08:00
02f192cac6 fix(storefabric): 限制接收单位下拉仅显示织厂类型
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 13:17:04 +08:00
530ca0c3ad chore(version): 更新应用版本号
- 将版本名称从 1.1.4 更新为 1.1.5
- 将版本代码从 104 更新为 105
2026-06-24 20:00:58 +08:00
b3ecd77fb2 chore(build): 添加周商环境构建配置
- 在package.json中添加build:app-plus:zhoushang构建命令
- 删除默认模块.openapi.json文件
- 创建.env.zhoushang环境配置文件,包含生产环境API地址等配置项
2026-06-24 19:59:39 +08:00
36c0f9a3a0 feat(scan): 添加手机扫码功能支持
- 在 FabricOutScanBar 组件中添加手机扫码图标和事件处理
- 更新工作台页面的扫码逻辑以支持手机扫码回退
- 在销售拣货详情页添加手机扫码按钮和处理方法
- 重构扫码设置页面以支持扫码方式选择
- 添加手机扫码配置和判断逻辑到扫码配置模块
- 扩展扫码混入模块以支持手机扫码模式和设备检测
- 在多个业务页面中集成手机扫码功能和界面元素
- 更新扫码配置存储和读取逻辑以兼容新配置结构
2026-06-23 17:08:17 +08:00
084bb235f8 feat(storefabric): 新增坯布库存管理功能
- 在http.api.js中添加坯布库存接口前缀和相关API定义
- 更新工作台页面,将坯布库存菜单链接到新的库存查询页面
- 在pages.json中注册坯布库存相关的三个新页面路由
- 创建storeFabricWarehouse.js文件,包含库存查询的常量、格式化函数和参数处理逻辑
- 新增storeFabricWarehouseDetail.vue页面,实现细码明细查看功能
- 添加storeFabricWarehouseGroupList.vue页面,实现坯布库存汇总查询
- 创建storeFabricWarehouseStockList.vue页面,实现库存维度汇总功能
- 新增storeFabricWarehouseGroupItem.vue和storeFabricWarehouseStockItem.vue组件,用于显示库存卡片
- 添加WarehouseDataTable.vue组件,提供可滚动的表格展示功能
2026-06-22 14:06:06 +08:00
567da03aea feat(storefabric): 新增坯布出库相关页面及功能
- 在 manifest.json 中添加 Android 包名配置
- 在 package.json 中添加 pnpm 依赖覆盖配置
- 在 pages.json 中注册坯布出库相关页面路由
- 重命名 storefabricBusinessOutAdd.vue 为 storeFabricBusinessOutAdd.vue
- 重构坯布出库新增页面,优化界面布局和交互逻辑
- 添加坯布出库列表、编辑、查看等功能页面
- 集成订单状态栏、面料信息弹窗、细码弹窗等组件
- 实现坯布出库详情列表和扫码功能模块
- 优化表单验证和数据提交流程
2026-06-17 16:59:31 +08:00
d5b2e19658 refactor(workbench): 调整工作台界面布局和功能模块
- 将销售管理和成品管理模块注释掉,暂时隐藏相关功能
- 启用坯布管理模块,显示坯布相关业务功能
- 修改坯布出仓功能链接,使用新的业务流程页面
- 更新坯布出仓功能名称,从"坯布出仓"改为"坯布出库"
- 保留坯布库存查询功能,其他坯布管理功能暂时注释
2026-06-17 16:32:39 +08:00
cff4debea4 feat(pda): 添加坯布出仓单功能和扫码设置界面
- 新增坯布出仓单相关API接口,包括列表、详情、新增、审核等功能
- 添加营销体系、往来单位、字典明细等基础数据接口
- 在用户中心添加扫描设置入口,支持PDA扫码枪配置
- 创建扫描设置页面,支持选择PDA品牌并配置广播动作和数据标签
- 重构扫码混入逻辑,支持远程配置和本地配置合并
- 添加扫码配置存储和读取功能,支持配置持久化
- 优化扫码广播注册流程,优先使用用户配置的扫码枪设置
2026-06-17 16:32:24 +08:00
ebfa5bf2a0 docs(env): 更新环境配置文件和API端点地址
- 修改 .env 文件中的环境名称和API端点地址
- 新增 .env.cjt 配置文件用于本地开发环境
- 更新 .env.mes 和 .env.zhisheng 中的API端点地址
- 在 config.js 中更新生产环境API URL和服务名段
- 添加本地环境API URL选项到开发环境选项列表
- 更新登录页面中的自定义API URL地址
- 更新 README.md 中的打包部署说明文档
2026-06-17 16:30:35 +08:00
98 changed files with 13961 additions and 1525 deletions

10
.env
View File

@ -1,5 +1,5 @@
NODE_ENV = development
VUE_APP_ENV_NAME = zhisheng环境
VUE_APP_UPGRADE_NAME = erp_pda_pre
VUE_APP_PRODUCTION_API_URL = https://hcscmpre.zzfzyc.com/hcscm/pda/v1
VUE_APP_DEV_API_URL = https://hcscmpre.zzfzyc.com/hcscm/pda/v1
NODE_ENV = production
VUE_APP_ENV_NAME = zhoushang环境
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang
VUE_APP_PRODUCTION_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
VUE_APP_DEV_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1

5
.env.cjt Normal file
View File

@ -0,0 +1,5 @@
NODE_ENV = development
VUE_APP_ENV_NAME = 本地环境
VUE_APP_UPGRADE_NAME = erp_pda_dev
VUE_APP_PRODUCTION_API_URL = http://192.168.1.66:7010/hcscm_weave/pda/v1
VUE_APP_DEV_API_URL = https://192.168.1.66:7010/hcscm_weave/pda/v1

5
.env.devlocal Normal file
View File

@ -0,0 +1,5 @@
NODE_ENV = development
VUE_APP_ENV_NAME = 本地穿透环境
VUE_APP_UPGRADE_NAME = erp_pda_dev
VUE_APP_PRODUCTION_API_URL = https://2yd52gx88533.vicp.fun/hcscm/pda/v1
VUE_APP_DEV_API_URL = https://2yd52gx88533.vicp.fun/hcscm/pda/v1

View File

@ -1,5 +1,5 @@
NODE_ENV = development
VUE_APP_ENV_NAME = mes环境
VUE_APP_UPGRADE_NAME = erp_pda
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm/mes/server/pda/v1
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm/mes/server/pda/v1
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1

5
.env.zhoushang Normal file
View File

@ -0,0 +1,5 @@
NODE_ENV = production
VUE_APP_ENV_NAME = zhoushang环境
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang
VUE_APP_PRODUCTION_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
VUE_APP_DEV_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1

View File

@ -1,5 +1,20 @@
# 不使用 pda项目,以后的新需求或者修改 使用 本项目
打包正式环境发布:
先修改 .env 文件,修改为目标请求路径
NODE_ENV = development
VUE_APP_ENV_NAME = 默认环境
VUE_APP_UPGRADE_NAME = erp_pda
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm/mes/server/pda/v1
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm/mes/server/pda/v1
HBuilderX中 点击 生成本地打包APP资源
点击云打包 选择自有证书 输入证书库密码和证书私钥密码:123456 点击快速安心打包
# pda-cli
## Project setup

View File

@ -8,7 +8,9 @@
"build": "npm run build:h5",
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
"build:app-plus:zhisheng": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build --mode zhisheng",
"build:app-plus:zhoushang": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build --mode zhoushang",
"build:app-plus:mes": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build --mode mes",
"build:app-plus:devlocal": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build --mode devlocal",
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
"build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
@ -29,6 +31,7 @@
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
"dev:app-plus:zhisheng": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch --mode zhisheng",
"dev:app-plus:mes": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch --mode mes",
"dev:app-plus:devlocal": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch --mode devlocal",
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
"dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
@ -117,6 +120,11 @@
"Android >= 4.4",
"ios >= 9"
],
"pnpm": {
"overrides": {
"postcss-urlrewrite": "0.3.0"
}
},
"uni-app": {
"scripts": {}
}

View File

@ -6,6 +6,7 @@ import { audioManager } from '@/utils/audioManager'
import util from '@/common/util.js';
import md5 from '@/common/md5.js';
import { restoreUserSession } from '@/common/userSession.js';
export default {
globalData: {
AppName: '',
@ -25,6 +26,7 @@ import { audioManager } from '@/utils/audioManager'
onLaunch() {
console.log('App Launch');
restoreUserSession();
// 初始化音频管理器
audioManager.init();
@ -58,7 +60,7 @@ import { audioManager } from '@/utils/audioManager'
.textCenter {
width: 100%;
text-align: center;
font-size: 15px;
font-size: 16px;
color: #808080;
margin-top: 88rpx;
}
@ -105,7 +107,7 @@ import { audioManager } from '@/utils/audioManager'
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
font-size: 16px;
}
.flex-white-plr26-column {
@ -114,7 +116,7 @@ import { audioManager } from '@/utils/audioManager'
padding-right: 26rpx;
display: flex;
flex-direction: column;
font-size: 15px;
font-size: 16px;
}
.bdb_f5 {
@ -155,12 +157,12 @@ import { audioManager } from '@/utils/audioManager'
.redXingh {
color: #FF0000;
font-size: 14px;
font-size: 15px;
}
.bluecolor {
color: #0000FF;
font-size: 16px;
font-size: 17px;
}
.udropdown {
@ -174,7 +176,7 @@ import { audioManager } from '@/utils/audioManager'
.width276 {
width: 546rpx;
color: #c5c5c5;
font-size: 14px;
font-size: 15px;
}
.cBlack {
@ -185,7 +187,7 @@ import { audioManager } from '@/utils/audioManager'
margin-bottom: -10rpx;
margin-top: 16rpx;
padding-left: 26rpx;
font-size: 30rpx;
font-size: 32rpx;
color: #555555;
font-weight: bold;
}
@ -193,7 +195,7 @@ import { audioManager } from '@/utils/audioManager'
.width242 {
width: 484rpx;
color: #c5c5c5;
font-size: 14px;
font-size: 15px;
}
.myCard {
@ -211,7 +213,7 @@ import { audioManager } from '@/utils/audioManager'
.cardRow {
display: flex;
align-items: center;
font-size: 14px;
font-size: 15px;
margin-bottom: 8rpx;
}
@ -231,7 +233,7 @@ import { audioManager } from '@/utils/audioManager'
}
.cardTopName {
font-size: 16px;
font-size: 17px;
margin-bottom: 8rpx;
color: #000000;
overflow: hidden;
@ -265,7 +267,7 @@ import { audioManager } from '@/utils/audioManager'
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 15px;
font-size: 16px;
color: #007AFF;
margin-top: 12rpx;
margin-bottom: 16rpx;
@ -279,7 +281,7 @@ import { audioManager } from '@/utils/audioManager'
position: absolute;
right: 26rpx;
bottom: 80rpx;
font-size: 15px;
font-size: 16px;
}
.fzrLeft {
@ -359,4 +361,32 @@ import { audioManager } from '@/utils/audioManager'
height: 32rpx;
background-color: #EEEEEE;
}
/* PDA:放大 u-select 确认/取消按钮点击区域 */
.u-select__header {
height: 110rpx !important;
padding: 0 16rpx !important;
}
.u-select__header__btn {
font-size: 36rpx !important;
line-height: 110rpx !important;
padding: 0 40rpx !important;
min-width: 140rpx;
text-align: center;
box-sizing: border-box;
}
.u-select__search,
.u-action-sheet-search,
.u-dropdown-item__search {
height: 88rpx !important;
}
.u-select__search__input,
.u-action-sheet-search__input,
.u-dropdown-item__search__input {
font-size: 32rpx !important;
height: 88rpx !important;
}
</style>

View File

@ -9,7 +9,7 @@ const config = {
upgradeName: process.env.VUE_APP_UPGRADE_NAME || 'erp_pda',
// 产品名称
productName: '浩拓技术',
productName: '浩拓ERP',
// 公司名称
companyName: '浩拓科技',
@ -20,13 +20,15 @@ const config = {
// 环境判断
isDevelopment: isDevelopment,
// 生产环境API URL
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm/mes/server/pda/v1',
// 生产环境API URL(服务名段 hcscm)
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm/pda/v1',
// 开发环境API URL选项
// 开发环境API URL选项(服务名段 hcscm)
devApiUrlOptions: [
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm/pda/v1' },
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || 'https://www.haotopai.com/hcscm/mes/server/pda/v1' },
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm/pda/v1' },
{ label: '本地穿透', value: 'https://2yd52gx88533.vicp.fun/hcscm/pda/v1' },
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || 'https://www.haotopai.com/hcscm/pda/v1' },
{ label: '自定义', value: 'custom' }
]

View File

@ -7,8 +7,132 @@ const install = (Vue, vm) => {
// 参数配置对象
const config = vm.vuex_config;
console.log('install u',config)
// 接口前缀统一走 hcscm(apiurl 已在 config.js 配置为 hcscm 服务)
const getApiUrl = () => String(vm.$store.state.apiurl || '');
const GFM_OTHER_DELIVERY_PREFIX = '/grey_fabric_manage/gfmOtherDeliveryOrder/';
const gfmOtherDeliveryUrl = (name) => getApiUrl() + GFM_OTHER_DELIVERY_PREFIX + name;
const GFM_WAREHOUSE_PREFIX = '/grey_fabric_manage/gfmWarehouse/';
const gfmWarehouseUrl = (name) => getApiUrl() + GFM_WAREHOUSE_PREFIX + name;
const FPM_PROCESS_IN_PREFIX = '/product/fpmProcessInOrder/';
const fpmProcessInUrl = (name) => getApiUrl() + FPM_PROCESS_IN_PREFIX + name;
const FPM_PROCESS_RETURN_IN_PREFIX = '/product/fpmProcessReturnInOrder/';
const fpmProcessReturnInUrl = (name) => getApiUrl() + FPM_PROCESS_RETURN_IN_PREFIX + name;
const FPM_PROCESS_OUT_PREFIX = '/product/fpmProcessOutOrder/';
const fpmProcessOutUrl = (name) => getApiUrl() + FPM_PROCESS_OUT_PREFIX + name;
const FPM_PRC_IN_PREFIX = '/product/fpmPrcInOrder/';
const fpmPrcInUrl = (name) => getApiUrl() + FPM_PRC_IN_PREFIX + name;
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
vm.$u.api = {
// 坯布出仓单(其他出货单)相关接口
gfmOtherDeliveryOrder: {
// 获取坯布出仓单列表(query: page,size,order_no,audit_status)
list: (params = {}) => vm.$u.get(gfmOtherDeliveryUrl('getGfmOtherDeliveryOrderList'), params),
// 获取坯布出仓单详情(query: id)
detail: (params = {}) => vm.$u.get(gfmOtherDeliveryUrl('getGfmOtherDeliveryOrder'), params),
// 新增坯布出仓单(提交表头信息保存,返回 { id })
add: (params = {}) => vm.$u.postJson(gfmOtherDeliveryUrl('addGfmOtherDeliveryOrder'), params),
// 扫码新增/删除细码(scan_type: 1新增 2删除;勾选锁定维度时附带 *_lock 字段),返回最新详情
scanUpdate: (params = {}) => vm.$u.putJson(gfmOtherDeliveryUrl('updateGfmOtherDeliveryOrder'), params),
// 审核
statusPass: (params = {}) => vm.$u.putJson(gfmOtherDeliveryUrl('updateGfmOtherDeliveryOrderStatusPass'), params),
// 消审
statusWait: (params = {}) => vm.$u.putJson(gfmOtherDeliveryUrl('updateGfmOtherDeliveryOrderStatusWait'), params),
// 驳回
statusReject: (params = {}) => vm.$u.putJson(gfmOtherDeliveryUrl('updateGfmOtherDeliveryOrderStatusReject'), params),
// 作废
statusCancel: (params = {}) => vm.$u.putJson(gfmOtherDeliveryUrl('updateGfmOtherDeliveryOrderStatusCancel'), params),
},
// 坯布库存相关接口
gfmWarehouse: {
groupSummaryList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseSummaryWeavingFactoryStockGroupList'), params),
stockSummaryList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseSummaryWeavingFactoryStockList'), params),
detailList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseList'), params),
},
// 加工进仓单
fpmProcessInOrder: {
list: (params = {}) => vm.$u.get(fpmProcessInUrl('getFpmProcessInOrderList'), params),
detail: (params = {}) => vm.$u.get(fpmProcessInUrl('getFpmProcessInOrder'), params),
add: (params = {}) => vm.$u.postJson(fpmProcessInUrl('addFpmProcessInOrder'), params),
scanUpdate: (params = {}) => vm.$u.putJson(fpmProcessInUrl('updateFpmProcessInOrder'), params),
statusPass: (params = {}) => vm.$u.putJson(fpmProcessInUrl('updateFpmProcessInOrderStatusPass'), params),
statusWait: (params = {}) => vm.$u.putJson(fpmProcessInUrl('updateFpmProcessInOrderStatusWait'), params),
statusReject: (params = {}) => vm.$u.putJson(fpmProcessInUrl('updateFpmProcessInOrderStatusReject'), params),
statusCancel: (params = {}) => vm.$u.putJson(fpmProcessInUrl('updateFpmProcessInOrderStatusCancel'), params),
},
// 加工退货进仓单
fpmProcessReturnInOrder: {
list: (params = {}) => vm.$u.get(fpmProcessReturnInUrl('getFpmProcessReturnInOrderList'), params),
detail: (params = {}) => vm.$u.get(fpmProcessReturnInUrl('getFpmProcessReturnInOrder'), params),
add: (params = {}) => vm.$u.postJson(fpmProcessReturnInUrl('addFpmProcessReturnInOrder'), params),
scanUpdate: (params = {}) => vm.$u.putJson(fpmProcessReturnInUrl('updateFpmProcessReturnInOrder'), params),
statusPass: (params = {}) => vm.$u.putJson(fpmProcessReturnInUrl('updateFpmProcessReturnInOrderStatusPass'), params),
statusWait: (params = {}) => vm.$u.putJson(fpmProcessReturnInUrl('updateFpmProcessReturnInOrderStatusWait'), params),
statusReject: (params = {}) => vm.$u.putJson(fpmProcessReturnInUrl('updateFpmProcessReturnInOrderStatusReject'), params),
statusCancel: (params = {}) => vm.$u.putJson(fpmProcessReturnInUrl('updateFpmProcessReturnInOrderStatusCancel'), params),
},
// 加工出仓单
fpmProcessOutOrder: {
list: (params = {}) => vm.$u.get(fpmProcessOutUrl('getFpmProcessOutOrderList'), params),
detail: (params = {}) => vm.$u.get(fpmProcessOutUrl('getFpmProcessOutOrder'), params),
add: (params = {}) => vm.$u.postJson(fpmProcessOutUrl('addFpmProcessOutOrder'), params),
scanUpdate: (params = {}) => vm.$u.putJson(fpmProcessOutUrl('updateFpmProcessOutOrder'), params),
statusPass: (params = {}) => vm.$u.putJson(fpmProcessOutUrl('updateFpmProcessOutOrderStatusPass'), params),
statusWait: (params = {}) => vm.$u.putJson(fpmProcessOutUrl('updateFpmProcessOutOrderStatusWait'), params),
statusReject: (params = {}) => vm.$u.putJson(fpmProcessOutUrl('updateFpmProcessOutOrderStatusReject'), params),
statusCancel: (params = {}) => vm.$u.putJson(fpmProcessOutUrl('updateFpmProcessOutOrderStatusCancel'), params),
/** 加工出仓类型枚举:正常加工出仓 / 回修加工出仓 */
getOutTypeEnum: (params = {}) => vm.$u.get(getApiUrl() + '/product/enum/getProcessOutTypeTypeEnum', params),
},
// 成品采购进仓单
fpmPrcInOrder: {
list: (params = {}) => vm.$u.get(fpmPrcInUrl('getFpmPrcInOrderList'), params),
detail: (params = {}) => vm.$u.get(fpmPrcInUrl('getFpmPrcInOrder'), params),
add: (params = {}) => vm.$u.postJson(fpmPrcInUrl('addFpmPrcInOrder'), params),
scanUpdate: (params = {}) => vm.$u.putJson(fpmPrcInUrl('updateFpmPrcInOrder'), params),
statusPass: (params = {}) => vm.$u.putJson(fpmPrcInUrl('updateFpmPrcInOrderStatusPass'), params),
statusWait: (params = {}) => vm.$u.putJson(fpmPrcInUrl('updateFpmPrcInOrderStatusWait'), params),
statusReject: (params = {}) => vm.$u.putJson(fpmPrcInUrl('updateFpmPrcInOrderStatusReject'), params),
statusCancel: (params = {}) => vm.$u.putJson(fpmPrcInUrl('updateFpmPrcInOrderStatusCancel'), params),
},
// 物理仓库下拉
physicalWarehouse: {
getDropdownList: (params = {}) => vm.$u.get('/warehouse/physicalWarehouse/getPhysicalWarehouseDropdownList', params),
},
// 仓位查询(Request: qr_code / warehouse_id / name;Response: GetPhysicalWarehouseBinData)
warehouseBin: {
getByQrCode: (params = {}) => vm.$u.get('/warehouse/warehouseBin/getWarehouseBin', params),
},
// 营销体系下拉
saleSystem: {
getDropdownList: (params = {}) => vm.$u.get(getApiUrl() + '/saleSystem/getSaleSystemDropdownList', params),
},
// 往来单位列表
businessUnit: {
list: (params = {}) => vm.$u.get('/business_unit/list', params),
},
// 字典明细枚举(路径相对 apiurl:.../pda/v1/dictionaryDetail/getDictionaryDetailEnumList)
dictionary: {
getDetailEnumList: (params = {}) => vm.$u.get('/dictionaryDetail/getDictionaryDetailEnumList', params),
},
// 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等
lang: (params = {}) => vm.$u.get('/lang/'+params.lang),
@ -18,6 +142,8 @@ const install = (Vue, vm) => {
// PDA登录接口
pdaLogin: (params = {}) => vm.$u.postJson('/login', params),
pdaLogout: (params = {}) => vm.$u.postJson('/logout', params),
// 登录后获取当前用户信息、菜单与按钮权限
pdaGetInformation: (params = {}) => vm.$u.get('/information', params),
// 获取配布单列表
getFpmArrangeOrderList: (params = {}) => vm.$u.get('/product/fpmArrangeOrder/getFpmArrangeOrderList', params),
// 获取成品配布单详情

View File

@ -2,6 +2,8 @@
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作
import { clearUserSession } from '@/common/userSession.js';
const install = (Vue, vm) => {
// 通用请求头设定
const ajaxHeader = 'x-ajax';
@ -22,9 +24,16 @@ const install = (Vue, vm) => {
// 请求拦截,配置Token等参数
Vue.prototype.$u.http.interceptor.request = (req) => {
console.log('request', req);
console.log('baseUrl', vm.$store.state.apiurl);
console.log('完整URL', vm.$store.state.apiurl + req.url);
const reqUrl = req && req.url ? String(req.url) : '';
const isAbsolute = /^https?:\/\//i.test(reqUrl);
const fullUrl = isAbsolute ? reqUrl : (vm.$store.state.apiurl + reqUrl);
// 用 JSON 字符串输出,避免 HBuilderX 控制台对象被截断、点击 URL 跳浏览器
console.log('request => ' + JSON.stringify({
url: fullUrl,
method: req.method,
data: req.data,
header: req.header
}, null, 2));
if (!req.header){
req.header = [];
}
@ -36,8 +45,9 @@ const install = (Vue, vm) => {
}
// 设定传递 Token 认证参数 aidex
if (!req.header[sessionIdHeader] && vm.vuex_token){
req.header[sessionIdHeader] = vm.vuex_token;
if (!req.header[sessionIdHeader]){
const loginData = uni.getStorageSync('RemoteTokenData');
req.header[sessionIdHeader] = vm.vuex_token || (loginData && loginData.token) || '';
}
// 为节省流量,记住我数据不是每次都发送的,当会话失效后,尝试重试登录 aidex
@ -58,21 +68,28 @@ const install = (Vue, vm) => {
// 处理401未授权状态码
if (res.statusCode === 401) {
vm.$u.toast('登录已过期,请重新登录');
// 清除token和用户信息
uni.removeStorageSync('token');
vm.$u.vuex('vuex_token', '');
vm.$u.vuex('vuex_user', {});
// 跳转到登录页面
clearUserSession();
uni.reLaunch({
url: '/pages/sys/login/index'
});
return false;
}
// 非业务 JSON(如 404 page not found)
if (res.statusCode && res.statusCode !== 200) {
const msg = (res.data && res.data.msg) || `请求失败(${res.statusCode})`;
vm.$u.toast(msg);
return Promise.reject(new Error(msg));
}
console.log('res',res)
if (!(res.data)){
vm.$u.toast('未连接到服务器')
return Promise.reject(new Error('未连接到服务器'));
}
if (typeof res.data !== 'object') {
const msg = '接口返回异常';
vm.$u.toast(msg);
return Promise.reject(new Error(msg));
}
if(res.data.code !== 0) {
vm.$u.toast(res.data.msg)

View File

@ -0,0 +1,46 @@
/**
* 从往来单位等列表接口中取出数组。
* 兼容拦截器解包后的 { list, total },以及完整响应
* { data: { code, data: { list, total } } }。
*/
export function extractList(data, depth = 0) {
if (!data || depth > 6) return [];
if (Array.isArray(data)) return data;
if (Array.isArray(data.list)) return data.list;
if (Array.isArray(data.items)) return data.items;
if (Array.isArray(data.records)) return data.records;
if (data.data && typeof data.data === 'object') return extractList(data.data, depth + 1);
return [];
}
/** 将下拉/列表接口响应转为 u-select 所需的 { value, label } */
export function mapToSelectOptions(data) {
return extractList(data).filter((item) => item && typeof item === 'object').map((item) => ({
value: item.id != null ? item.id : item.value,
label: item.name || item.label || item.code || (item.id != null ? String(item.id) : ''),
}));
}
/**
* 下拉远程搜索:把关键字写入接口常用的 name 参数。
* 空关键字时不带 name,让后端返回默认列表。
*/
export function withNameParam(params, keyword) {
const next = Object.assign({}, params || {});
const name = String(keyword || '').trim();
if (name) next.name = name;
else delete next.name;
return next;
}
export const REMOTE_SELECT_TYPES = [
'染厂',
'加工单位',
'供应商',
'仓库名称',
'营销体系',
];
export function isRemoteSelectType(type) {
return REMOTE_SELECT_TYPES.indexOf(type) !== -1;
}

View File

@ -0,0 +1,54 @@
import { isRemoteSelectType } from '@/common/remoteSelect';
/**
* 表单页远程下拉搜索。
* 使用方需实现 fetchRemoteSelectOptions(type, keyword),返回 { value, label }[]。
*
* 注意:不要用 `_` / `$` 前缀的 data 字段名——Vue2 不会代理到 this,
* `++this._xxx` 会得到 NaN,导致列表不更新、loading 不关。
*/
export default {
data() {
return {
selectSearching: false,
selectSearchSeq: 0,
};
},
computed: {
isRemoteSelect() {
return isRemoteSelectType(this.selectType);
},
},
methods: {
isRemoteSelectType,
openSelectPicker(type, cachedList) {
this.selectType = type;
this.selectList = Array.isArray(cachedList) ? cachedList.slice() : [];
this.selectShow = true;
},
onSelectSearch(keyword) {
if (!isRemoteSelectType(this.selectType)) return;
if (typeof this.fetchRemoteSelectOptions !== 'function') return;
const seq = ++this.selectSearchSeq;
this.selectSearching = true;
const finish = () => {
if (seq === this.selectSearchSeq) this.selectSearching = false;
};
Promise.resolve()
.then(() => this.fetchRemoteSelectOptions(this.selectType, keyword))
.then((list) => {
if (seq !== this.selectSearchSeq) return;
this.selectList = Array.isArray(list) ? list.slice() : [];
})
.catch((e) => {
if (seq !== this.selectSearchSeq) return;
if (typeof this.showError === 'function') {
this.showError((e && e.message) || '搜索失败');
} else {
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
}
})
.then(finish, finish);
},
},
};

111
src/common/scanConfig.js Normal file
View File

@ -0,0 +1,111 @@
export const STORAGE_KEY = 'pda_scan_config';
export const DICTIONARY_TYPE_SCANNER = 10046;
export const PHONE_SCAN_BRAND = 'phone';
export const PHONE_SCAN_CONFIG = {
brand: PHONE_SCAN_BRAND,
name: '手机扫码',
isPhoneScan: true,
};
const NO_SETUP_HINT_KEY = 'pda_scan_config_hint_shown';
export function isPhoneScanConfig(config) {
return !!(config && (config.isPhoneScan || config.brand === PHONE_SCAN_BRAND));
}
function enrichFromBuiltinConfig(config, builtinConfigs = []) {
if (!config || !builtinConfigs.length) {
return config;
}
const builtin = builtinConfigs.find((item) => {
return item.action === config.action
|| item.name === config.name
|| item.brand === config.brand;
});
if (!builtin) {
return config;
}
return {
...config,
needSetup: builtin.needSetup,
setupAction: builtin.setupAction || '',
setupParams: builtin.setupParams || null,
};
}
export function normalizeConfig(raw, builtinConfigs = []) {
if (!raw || typeof raw !== 'object') return null;
const brand = String(raw.brand || raw.id || raw.dictionary_detail_id || raw.name || '');
const isPhoneScan = raw.isPhoneScan === true || brand === PHONE_SCAN_BRAND;
if (isPhoneScan) {
return { ...PHONE_SCAN_CONFIG };
}
const config = enrichFromBuiltinConfig({
brand,
name: raw.name || '',
action: raw.action || raw.code || '',
dataKey: raw.dataKey || raw.data_key || raw.remark || '',
needSetup: raw.needSetup != null ? raw.needSetup : !!raw.need_setup,
setupAction: raw.setupAction || raw.setup_action || '',
setupParams: raw.setupParams || raw.setup_params || null,
}, builtinConfigs);
if (!config.brand || !config.action || !config.dataKey) {
return null;
}
return config;
}
export function mapDictionaryToScannerConfig(raw, builtinConfigs = []) {
return normalizeConfig(raw, builtinConfigs);
}
export function getScanConfig(builtinConfigs = []) {
try {
const data = uni.getStorageSync(STORAGE_KEY);
return normalizeConfig(data, builtinConfigs);
} catch (e) {
console.log('读取扫码枪配置失败', e);
return null;
}
}
export function saveScanConfig(config) {
const normalized = normalizeConfig(config);
if (!normalized) {
return false;
}
try {
uni.setStorageSync(STORAGE_KEY, normalized);
return true;
} catch (e) {
console.log('保存扫码枪配置失败', e);
return false;
}
}
export function hasShownNoConfigHint() {
try {
return !!uni.getStorageSync(NO_SETUP_HINT_KEY);
} catch (e) {
return false;
}
}
export function markNoConfigHintShown() {
try {
uni.setStorageSync(NO_SETUP_HINT_KEY, true);
} catch (e) {
console.log('记录扫码枪提示状态失败', e);
}
}

View File

@ -1,20 +1,35 @@
// common/scanMixin.js
// 多厂商PDA扫码器兼容方案 - 策略模式 + 配置表驱动
import {
getScanConfig,
hasShownNoConfigHint,
isPhoneScanConfig,
markNoConfigHintShown,
normalizeConfig,
PHONE_SCAN_CONFIG,
} from '@/common/scanConfig.js';
const PDA_DEVICE_KEYWORDS = [
'newland', 'nls', 'sunmi', 'urovo', 'zebra', 'honeywell', 'idata', 'seuic',
];
export default {
data() {
return {
scanReceivers: [], // 支持多个接收器
scanReceivers: [],
isPageActive: false,
registeredBrands: [] // 已注册的品牌
registeredBrands: [],
remoteScannerConfigs: [],
usePhoneScanFallback: false,
_scanCallback: null,
}
},
methods: {
// 扫码器配置表 - 方便扩展新厂商
getScannerConfigs() {
return [
{
brand: 'newland', // 东集
brand: 'newland',
name: '东集',
action: 'com.android.server.scannerservice.broadcast',
dataKey: 'scannerdata',
@ -27,96 +42,201 @@ export default {
}
},
{
brand: 'sunmi', // 商米
brand: 'sunmi',
name: '商米',
action: 'com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED',
dataKey: 'data',
needSetup: false
},
// {
// brand: 'honeywell', // 霍尼韦尔
// name: '霍尼韦尔',
// action: 'com.honeywell.decode.intent.action.EDIT_DATA',
// dataKey: 'data',
// needSetup: false
// },
// {
// brand: 'zebra', // 斑马
// name: '斑马',
// action: 'com.symbol.datawedge.api.RESULT_ACTION',
// dataKey: 'com.symbol.datawedge.data_string',
// needSetup: false
// },
// {
// brand: 'idata', // 盈达聚力
// name: '盈达聚力',
// action: 'android.intent.action.SCANRESULT',
// dataKey: 'value',
// needSetup: false
// },
// {
// brand: 'urovo', // 优博讯
// name: '优博讯',
// action: 'android.intent.ACTION_DECODE_DATA',
// dataKey: 'barcode_string',
// needSetup: false
// }
{ ...PHONE_SCAN_CONFIG },
];
},
// 注册所有扫码广播(推荐方式:同时注册所有厂商)
registerScanBroadcast(scanCallback) {
getPhoneScanConfig() {
return { ...PHONE_SCAN_CONFIG };
},
isPdaDevice() {
// #ifdef APP-PLUS
const configs = this.getScannerConfigs();
configs.forEach(config => {
try {
this.registerSingleBroadcast(config, scanCallback);
this.registeredBrands.push(config.brand);
console.log(`${config.name}扫码广播注册成功`);
} catch (error) {
console.log(`${config.name}扫码广播注册失败:`, error);
}
});
if (this.registeredBrands.length > 0) {
console.log('扫码广播注册完成,已注册厂商:', this.registeredBrands.join(', '));
try {
const Build = plus.android.importClass('android.os.Build');
const manufacturer = String(Build.MANUFACTURER || '').toLowerCase();
const model = String(Build.MODEL || '').toLowerCase();
return PDA_DEVICE_KEYWORDS.some((keyword) => {
return manufacturer.includes(keyword) || model.includes(keyword);
});
} catch (error) {
console.log('检测设备类型失败', error);
return false;
}
// #endif
return false;
},
shouldUsePhoneScan() {
const builtinConfigs = this.getScannerConfigs();
const activeConfig = getScanConfig(builtinConfigs);
if (activeConfig && isPhoneScanConfig(activeConfig)) {
return true;
}
if (!activeConfig && !this.isPdaDevice()) {
return true;
}
console.error('所有扫码广播注册均失败');
return false;
},
getAllScannerConfigs() {
const builtinConfigs = this.getScannerConfigs();
if (!this.remoteScannerConfigs.length) {
return builtinConfigs;
}
const configMap = new Map();
builtinConfigs.forEach((item) => configMap.set(item.brand, item));
this.remoteScannerConfigs.forEach((item) => configMap.set(item.brand, item));
if (!configMap.has(PHONE_SCAN_CONFIG.brand)) {
configMap.set(PHONE_SCAN_CONFIG.brand, { ...PHONE_SCAN_CONFIG });
}
return Array.from(configMap.values());
},
getActiveScanConfig() {
return getScanConfig(this.getScannerConfigs());
},
getDefaultScanConfig() {
const configs = this.getAllScannerConfigs().filter((item) => !isPhoneScanConfig(item));
return configs.length ? configs[0] : null;
},
openPhoneScan(options = {}) {
const callback = options.callback || this._scanCallback;
// #ifdef APP-PLUS || MP-WEIXIN
uni.scanCode({
scanType: options.scanType || ['qrCode', 'barCode'],
success: (res) => {
this.handleScanResult(res.result, callback);
},
fail: (err) => {
console.error('手机扫码失败:', err);
if (options.fail) {
options.fail(err);
return;
}
uni.showToast({
title: '扫码失败',
icon: 'none',
});
},
});
return;
// #endif
// #ifdef H5
uni.showToast({
title: 'H5环境不支持扫码功能',
icon: 'none',
});
// #endif
},
triggerScan() {
if (this.usePhoneScanFallback) {
this.openPhoneScan();
}
},
registerScanBroadcast(scanCallback) {
this._scanCallback = scanCallback;
// #ifndef APP-PLUS
this.usePhoneScanFallback = true;
return true;
// #endif
// #ifdef APP-PLUS
if (this.shouldUsePhoneScan()) {
this.usePhoneScanFallback = true;
console.log('使用手机扫码模式');
return true;
}
this.usePhoneScanFallback = false;
const activeConfig = this.getActiveScanConfig();
if (activeConfig && !isPhoneScanConfig(activeConfig)) {
return this.registerScanBroadcastByConfig(activeConfig, scanCallback);
}
if (!hasShownNoConfigHint()) {
markNoConfigHintShown();
uni.showToast({
title: '请先在「我的-扫描设置」配置扫码枪',
icon: 'none',
duration: 2500,
});
}
const defaultConfig = this.getDefaultScanConfig();
if (!defaultConfig) {
console.error('未找到默认可用的扫码枪配置');
return false;
}
return this.registerScanBroadcastByConfig(defaultConfig, scanCallback);
// #endif
},
// 注册指定厂商的扫码广播
registerScanBroadcastByBrand(brand, scanCallback) {
// #ifdef APP-PLUS
const configs = this.getScannerConfigs();
const configs = this.getAllScannerConfigs();
const config = configs.find(c => c.brand === brand);
if (!config) {
console.error(`未找到厂商配置: ${brand}`);
return false;
}
if (isPhoneScanConfig(config)) {
this._scanCallback = scanCallback;
this.usePhoneScanFallback = true;
return true;
}
return this.registerScanBroadcastByConfig(config, scanCallback);
// #endif
},
registerScanBroadcastByConfig(config, scanCallback) {
// #ifdef APP-PLUS
const normalizedConfig = normalizeConfig(config, this.getScannerConfigs());
if (!normalizedConfig) {
console.error('扫码枪配置无效');
return false;
}
if (isPhoneScanConfig(normalizedConfig)) {
this._scanCallback = scanCallback;
this.usePhoneScanFallback = true;
return true;
}
try {
this.registerSingleBroadcast(config, scanCallback);
this.registeredBrands.push(config.brand);
console.log(`${config.name}扫码广播注册成功`);
this.registerSingleBroadcast(normalizedConfig, scanCallback);
this.registeredBrands.push(normalizedConfig.brand);
this.usePhoneScanFallback = false;
console.log(`${normalizedConfig.name}扫码广播注册成功`);
return true;
} catch (error) {
console.error(`${config.name}扫码广播注册失败:`, error);
console.error(`${normalizedConfig.name}扫码广播注册失败:`, error);
return false;
}
// #endif
},
// 单个广播注册的核心方法
registerSingleBroadcast(config, scanCallback) {
const main = plus.android.runtimeMainActivity();
// 如果需要预配置(如东集)
if (config.needSetup && config.setupAction) {
try {
const Intent = plus.android.importClass('android.content.Intent');
@ -133,7 +253,6 @@ export default {
}
}
// 注册广播接收器
const IntentFilter = plus.android.importClass('android.content.IntentFilter');
const filter = new IntentFilter();
filter.addAction(config.action);
@ -165,17 +284,14 @@ export default {
main.registerReceiver(receiver, filter);
// 保存接收器引用,用于后续注销
this.scanReceivers.push({
brand: config.brand,
receiver: receiver
});
},
// 处理扫码结果的统一方法
handleScanResult(scanResult, scanCallback) {
try {
// 数据清理:去除空格、换行符等
let cleanCode = scanResult.replace(/\s+/g, '').replace(/[\r\n]/g, '');
console.log("扫码结果:", cleanCode);
@ -188,7 +304,6 @@ export default {
}
},
// 取消所有扫码广播监听
unregisterScanBroadcast() {
// #ifdef APP-PLUS
if (this.scanReceivers.length === 0) return;
@ -214,7 +329,6 @@ export default {
// #endif
},
// 通用的商品扫描处理方法
handleGoodsScan(scanCode, successCallback, errorCallback) {
const trimmedCode = scanCode ? scanCode.toString().trim() : "";
@ -224,17 +338,14 @@ export default {
return;
}
// 根据业务类型处理不同的扫码逻辑
if (this.processScanCode) {
this.processScanCode(trimmedCode, successCallback, errorCallback);
} else {
// 默认处理方式
successCallback && successCallback(trimmedCode);
}
}
},
// 页面激活状态管理
onShow() {
this.isPageActive = true;
console.log('页面显示,设置 isPageActive 为 true');

View File

@ -0,0 +1,580 @@
/**
* 坯布出仓单(其他出货单)常量与数据工具
*
* 仅存放与接口无关的常量 / 状态映射 / 字段规范化 / 单位换算等纯工具,
* 真实接口请求统一注册在 src/common/http.api.js 的 vm.$u.api.gfmOtherDeliveryOrder 下。
*/
import dayjs from 'dayjs';
// 审核状态(对应 openapi common.OrderStatus)
export const AUDIT_STATUS = {
PENDING: 1, // 待审核
APPROVED: 2, // 已审核
REJECTED: 3, // 已驳回
VOIDED: 4, // 已作废
};
/** 前端草稿态(未保存) */
export const DRAFT_AUDIT_STATUS = 0;
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
export const AUDIT_STATUS_MAP = {
1: '待审核',
2: '已审核',
3: '已驳回',
4: '已作废',
};
/** 坯布资料弹窗字段 */
export const FABRIC_INFO_FIELDS = [
{ label: '坯布编号', key: 'grey_fabric_code' },
{ label: '名称', key: 'grey_fabric_name' },
{ label: '客户', key: 'customer_name' },
{ label: '幅宽', key: 'grey_fabric_width' },
{ label: '克重', key: 'grey_fabric_gram_weight' },
{ label: '纱批', key: 'yarn_batch' },
{ label: '针寸数', key: 'needle_size' },
{ label: '原料纱名称', key: 'raw_material_yarn_name' },
{ label: '原料批号', key: 'raw_material_batch_num' },
{ label: '原料品牌', key: 'raw_material_batch_brand' },
{ label: '颜色', key: 'gray_fabric_color_name' },
{ label: '等级', key: 'grey_fabric_level_name' },
{ label: '机台号', key: 'machine_number' },
{ label: '织造工艺', key: 'weaving_process' },
{ label: '坯布备注', key: 'grey_fabric_remark' },
];
/** 细码表格列(不含操作列) */
export const FINE_CODE_TABLE_COLUMNS = [
{ label: '序号', key: 'seq', width: 80 },
{ label: '卷号', key: 'roll_no', width: 110 },
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
{ label: '匹数', key: 'roll', width: 100 },
{ label: '数量(重量)', key: 'weight', width: 140 },
{ label: '条码', key: 'bar_code', width: 280 },
{ label: '仓位', key: 'position', width: 130 },
];
/** 审核状态变更操作配置(apiKey 对应 gfmOtherDeliveryOrder 下的方法名) */
export const STATUS_ACTION_CONFIG = {
approve: { status: AUDIT_STATUS.APPROVED, msg: '确认审核该单据?', apiKey: 'statusPass' },
void: { status: AUDIT_STATUS.VOIDED, msg: '确认作废该单据?', apiKey: 'statusCancel' },
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
};
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
export const BILL_TYPES = [
{ value: 'other', label: '坯布其他出货单' },
];
/** 列表分页拉取每页条数 */
export const LIST_PAGE_SIZE = 100;
/** 往来单位类型:染厂(染厂下拉筛选) */
export const BUSINESS_UNIT_TYPE_DYE_FACTORY = 12;
export function getStatusOptions() {
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
value,
label: AUDIT_STATUS_MAP[value],
}));
}
export { mapToSelectOptions } from '@/common/remoteSelect';
// 匹数:后端以 0.01 匹存储(乘以100的整数),展示需除以100
export function formatRoll(value) {
const n = Number(value || 0) / 100;
return Number.isInteger(n) ? n : Number(n.toFixed(2));
}
// 重量:后端整数存储(×10000),展示需除以 10000 为 KG
export function formatWeightKg(value) {
const n = Number(value || 0) / 10000;
return Number(n.toFixed(2));
}
/** 从详情对象取展示用总重量(优先用原始值换算) */
export function getOrderDisplayWeight(order) {
if (!order) return 0;
if (order._raw?.total_weight != null) return formatWeightKg(order._raw.total_weight);
return order.total_weight ?? 0;
}
/** 从细码取展示用重量(优先用原始值换算) */
export function getFineCodeDisplayWeight(fineCode) {
if (!fineCode) return 0;
if (fineCode.raw_weight != null) return formatWeightKg(fineCode.raw_weight);
return fineCode.weight || 0;
}
/**
* 将接口详情数据规范化为页面使用的结构
*/
export function normalizeOrder(order) {
if (!order) return null;
const itemData = groupItemData((order.item_data || []).map((item) => normalizeItem(item)));
return {
id: order.id,
order_no: order.order_no || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
// 表头
sale_system_id: order.sale_system_id || '',
sale_system_name: order.sale_system_name || '',
delivery_unit_id: order.delivery_unit_id || '',
delivery_unit_name: order.delivery_unit_name || '',
business_unit_id: order.business_unit_id || '',
business_unit_name: order.business_unit_name || '',
delivery_time: (order.delivery_time || '').slice(0, 10),
remark: order.remark || '',
// 人员/时间
creator_name: order.creator_name || '',
create_time: order.create_time || '',
auditer_name: order.auditer_name || '',
audit_time: order.audit_time || '',
// 汇总
total_roll: formatRoll(order.total_roll),
total_weight: formatWeightKg(order.total_weight),
item_data: itemData,
_raw: order,
};
}
/** 扫码详情区表格列 */
export const SCAN_DETAIL_TABLE_COLUMNS = [
{ label: '坯布编号', key: 'grey_fabric_code', width: 160 },
{ label: '坯布名称', key: 'grey_fabric_name', width: 160 },
{ label: '纱批', key: 'yarn_batch', width: 130 },
{ label: '机号', key: 'machine_number', width: 110 },
{ label: '条数', key: 'roll', width: 90 },
{ label: '重量', key: 'weight', width: 110 },
];
/** 扫码详情区可勾选锁定维度(对应 PDAScanGfmOtherDeliveryOrderParam 的 *_lock;勾选后参与表格分组并随扫码请求传给后端) */
export const SCAN_GROUP_OPTIONS = [
{ key: 'produce_order_no', label: '合同' },
{ key: 'grey_fabric_code', label: '布编' },
{ key: 'yarn_batch', label: '纱批' },
{ key: 'machine_number', label: '机号' },
{ key: 'grey_fabric_level_name', label: '等级' },
];
/** 勾选维度对应扫码接口锁定字段名(PDAScanGfmOtherDeliveryOrderParam) */
export const SCAN_MERGE_FIELD_MAP = {
produce_order_no: 'produce_order_no_lock',
grey_fabric_code: 'grey_fabric_code_lock',
yarn_batch: 'yarn_batch_lock',
machine_number: 'machine_number_lock',
grey_fabric_level_name: 'grey_fabric_level_id_lock',
};
/** 扫码锁定维度不匹配时的语音文案(按匹配优先级排列) */
const SCAN_MISMATCH_VOICE_RULES = [
{ patterns: ['机台', '机号', 'machine_number'], voice: '机台不同' },
{ patterns: ['纱批', 'yarn_batch'], voice: '纱批不同' },
{ patterns: ['合同号', '合同', '生产通知单', 'produce_order'], voice: '合同号不同' },
{ patterns: ['布编', 'grey_fabric_code'], voice: '布编不同' },
{ patterns: ['等级', 'grey_fabric_level', 'level'], voice: '等级不同' },
];
/**
* 根据后端错误信息解析锁定维度不匹配的播报文案
* @param {string} message
* @returns {string} 如「机台不同」;无法识别则返回空串
*/
export function resolveScanMismatchVoice(message) {
const msg = String(message || '');
if (!msg) return '';
for (let i = 0; i < SCAN_MISMATCH_VOICE_RULES.length; i++) {
const rule = SCAN_MISMATCH_VOICE_RULES[i];
if (rule.patterns.some((p) => msg.indexOf(p) !== -1)) {
return rule.voice;
}
}
return '';
}
/** 构建扫码新增/删除请求参数(勾选锁定维度时附带当前详情区字段值) */
export function buildScanUpdateParams({ id, scanCode, scanType, groupKeys = [], detail = {} }) {
const params = {
id: Number(id),
scan_code: scanCode,
scan_type: scanType,
};
(groupKeys || []).forEach((key) => {
const apiKey = SCAN_MERGE_FIELD_MAP[key];
if (!apiKey) return;
if (apiKey === 'grey_fabric_level_id_lock') {
const levelIds = detail.grey_fabric_level_id;
params.grey_fabric_level_id_lock = Array.isArray(levelIds) ? levelIds : [];
return;
}
const value = detail[key];
params[apiKey] = value != null && value !== '' ? value : '';
});
return params;
}
export function getEmptyScanDetail() {
return {
customer_id: '',
customer_name: '',
produce_order_no: '',
grey_fabric_code: '',
grey_fabric_name: '',
yarn_batch: '',
machine_number: '',
volume_number: '',
extern_volume_number: '',
grey_fabric_level_id: [],
grey_fabric_level_name: '',
weight: 0,
scanned_roll: 0,
machine_stock: 0,
total_roll: 0,
total_weight: 0,
};
}
/** 扫码接口响应是否包含条码详情字段 */
export function hasScanDetailFields(raw) {
if (!raw) return false;
return raw.scanned_total_roll != null
|| raw.summary_stock_roll != null
|| !!raw.customer_name
|| !!raw.grey_fabric_code
|| !!raw.produce_order_no;
}
/** 从扫码接口返回的详情构建扫码详情区数据 */
export function buildScanDetailFromOrderResponse(order) {
const raw = order?._raw || order;
if (!hasScanDetailFields(raw)) return null;
const detail = {
customer_id: raw.customer_id || '',
customer_name: raw.customer_name || '',
produce_order_no: raw.produce_order_no || '',
grey_fabric_code: raw.grey_fabric_code || '',
grey_fabric_name: raw.grey_fabric_name || '',
yarn_batch: raw.yarn_batch || '',
machine_number: raw.machine_number || '',
volume_number: raw.volume_number || '',
extern_volume_number: raw.extern_volume_number != null && raw.extern_volume_number !== ''
? String(raw.extern_volume_number)
: '',
grey_fabric_level_id: raw.grey_fabric_level_id || [],
grey_fabric_level_name: raw.grey_fabric_level_name || '',
weight: 0,
scanned_roll: formatRoll(raw.scanned_total_roll),
machine_stock: raw.summary_stock_roll != null ? formatRoll(raw.summary_stock_roll) : 0,
total_roll: order?.total_roll ?? 0,
total_weight: getOrderDisplayWeight(order),
};
return detail;
}
/** 在单据明细中定位本次扫描的坯布行与细码 */
export function findScanContext(itemData, scanCode) {
const code = (scanCode || '').trim();
if (!code) return null;
for (const item of itemData || []) {
for (const fc of item.fine_codes || []) {
const candidates = [
fc.fabric_piece_code,
fc.bar_code,
fc.roll_no,
fc.scan_code,
].filter(Boolean).map(String);
if (candidates.includes(code)) {
return { item, fineCode: fc };
}
}
}
return null;
}
/** 根据扫码上下文构建详情区展示数据 */
export function buildScanDetailFromContext(context, order) {
if (!context) return getEmptyScanDetail();
const { item, fineCode } = context;
const groupKey = getItemGroupKey(item);
let scannedRoll = 0;
(order.item_data || []).forEach((row) => {
if (getItemGroupKey(row) !== groupKey) return;
(row.fine_codes || []).forEach((fc) => {
scannedRoll += Number(fc.roll || 0);
});
});
return {
customer_name: item.customer_name || '',
produce_order_no: item.produce_order_no || item.contract_no || '',
grey_fabric_code: item.grey_fabric_code || '',
grey_fabric_name: item.grey_fabric_name || '',
yarn_batch: item.yarn_batch || '',
machine_number: item.machine_number || '',
volume_number: fineCode.fabric_piece_code || fineCode.roll_no || fineCode.bar_code || '',
extern_volume_number: fineCode.extern_volume_number || '',
grey_fabric_level_name: item.grey_fabric_level_name || '',
weight: getFineCodeDisplayWeight(fineCode),
scanned_roll: Number(scannedRoll.toFixed(2)),
machine_stock: item.machine_stock ?? 0,
total_roll: order.total_roll ?? 0,
total_weight: getOrderDisplayWeight(order),
};
}
function aggregateScanTableRows(rows, keys) {
const map = new Map();
rows.forEach((row) => {
const groupId = keys.map((k) => row[k] || '').join('|');
const existing = map.get(groupId);
if (!existing) {
map.set(groupId, { ...row, roll: 0, raw_weight: 0 });
}
const agg = map.get(groupId);
agg.roll = Number((agg.roll + Number(row.roll || 0)).toFixed(2));
agg.raw_weight = Number(agg.raw_weight || 0) + Number(row.raw_weight || 0);
});
return Array.from(map.values()).map((row) => ({
...row,
weight: formatWeightKg(row.raw_weight),
}));
}
/** 构建扫码详情区汇总表格数据 */
export function buildScanDetailTableRows(itemData, groupKeys = []) {
const rows = [];
(itemData || []).forEach((item) => {
(item.fine_codes || []).forEach((fc) => {
rows.push({
customer_name: item.customer_name || '',
produce_order_no: item.produce_order_no || item.contract_no || '',
grey_fabric_code: item.grey_fabric_code || '',
grey_fabric_name: item.grey_fabric_name || '',
yarn_batch: item.yarn_batch || '',
machine_number: item.machine_number || '',
volume_number: fc.roll_no || fc.fabric_piece_code || '',
grey_fabric_level_name: item.grey_fabric_level_name || '',
roll: fc.roll || 0,
raw_weight: fc.raw_weight != null ? fc.raw_weight : 0,
});
});
});
if (!rows.length) return [];
const keys = (groupKeys || []).filter(Boolean);
if (!keys.length) {
return aggregateScanTableRows(rows, ['grey_fabric_code', 'grey_fabric_name', 'yarn_batch', 'machine_number']);
}
return aggregateScanTableRows(rows, keys);
}
export function getScanDetailTableWidth(columns) {
const total = (columns || []).reduce((sum, col) => sum + (col.width || 120), 0);
return `${total}rpx`;
}
export function normalizeItem(item) {
const machineStockRaw = item.machine_stock_roll ?? item.machine_stock ?? item.machine_inventory_roll;
return {
id: item.id,
grey_fabric_id: item.grey_fabric_id || '',
grey_fabric_code: item.grey_fabric_code || '',
grey_fabric_name: item.grey_fabric_name || '',
customer_name: item.customer_name || '',
produce_order_no: item.produce_order_no || item.contract_no || item.sale_contract_no || item.grey_fabric_contract_no || '',
machine_stock: machineStockRaw != null ? formatRoll(machineStockRaw) : 0,
grey_fabric_width: item.grey_fabric_width_and_unit_name || item.grey_fabric_width || '',
grey_fabric_gram_weight: item.grey_fabric_gram_weight_and_unit_name || item.grey_fabric_gram_weight || '',
yarn_batch: item.yarn_batch || '',
needle_size: item.needle_size || '',
raw_material_yarn_name: item.raw_material_yarn_name || '',
raw_material_batch_num: item.raw_material_batch_num || '',
raw_material_batch_brand: item.raw_material_batch_brand || '',
gray_fabric_color_name: item.gray_fabric_color_name || '',
grey_fabric_level_name: item.grey_fabric_level_name || '',
machine_number: item.machine_number || '',
weaving_process: item.weaving_process || '',
grey_fabric_remark: item.grey_fabric_remark || '',
roll: formatRoll(item.roll),
weight: formatWeightKg(item.total_weight),
fine_codes: (item.item_fc_data || []).map((fc) => ({
id: fc.id,
roll_no: fc.volume_number || '',
extern_volume_number: fc.extern_volume_number != null && fc.extern_volume_number !== ''
? String(fc.extern_volume_number)
: '',
fabric_piece_code: fc.fabric_piece_code || '',
bar_code: fc.fabric_piece_code || fc.bar_code || '',
position: fc.position || '',
raw_weight: fc.weight,
weight: formatWeightKg(fc.weight),
roll: formatRoll(fc.roll),
// 删除细码走 scanUpdate,优先 fabric_piece_code,其次卷号
scan_code: fc.fabric_piece_code || fc.volume_number || fc.bar_code || '',
})),
};
}
/** 细码扫码/删除时传给 scanUpdate 的 scan_code(fabric_piece_code 或卷号) */
export function getFineCodeScanCode(fineCode) {
if (!fineCode) return '';
return fineCode.fabric_piece_code
|| fineCode.scan_code
|| fineCode.bar_code
|| fineCode.roll_no
|| '';
}
/** 坯布明细归类 key:优先 grey_fabric_id,否则 code + name */
export function getItemGroupKey(item) {
if (item.grey_fabric_id) return `id:${item.grey_fabric_id}`;
return `code:${item.grey_fabric_code}|${item.grey_fabric_name}`;
}
/** 将相同坯布的 item_data 合并为一行,细码 item_fc_data 汇总展示 */
export function groupItemData(items) {
const grouped = new Map();
(items || []).forEach((item) => {
const groupKey = getItemGroupKey(item);
const existing = grouped.get(groupKey);
if (!existing) {
grouped.set(groupKey, {
...item,
group_key: groupKey,
source_ids: [item.id],
fine_codes: [...(item.fine_codes || [])],
});
return;
}
existing.source_ids.push(item.id);
existing.fine_codes.push(...(item.fine_codes || []));
existing.roll = Number((existing.roll + item.roll).toFixed(2));
existing.weight = Number((existing.weight + item.weight).toFixed(2));
});
return Array.from(grouped.values()).map((row) => ({
...row,
id: row.grey_fabric_id || row.group_key,
}));
}
// 构造审核状态变更接口的入参(id 为字符串)
export function buildStatusParam(id, auditStatus) {
return { id: String(id), audit_status: auditStatus };
}
export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
if (!value) return '';
const parsed = dayjs(value);
return parsed.isValid() ? parsed.format(format) : String(value).slice(0, 10);
}
export function canScanAtStatus(status) {
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
}
export function isLockedOrderStatus(status) {
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
}
/** 分页拉取全部列表(直至末页) */
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
const loadPage = (page, acc) => listFn({ ...params, page, size: pageSize })
.then((res) => {
const batch = Array.isArray(res) ? res : (res && res.list) || [];
const merged = acc.concat(batch);
if (batch.length < pageSize) return merged;
return loadPage(page + 1, merged);
});
return loadPage(1, []);
}
/** 新增/编辑页底部:审核、作废 */
export function getFormStatusActionButtons(headerSaved, orderId, status) {
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
return [
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
/** 查看页底部:编辑、审核、作废 / 消审 */
export function getViewStatusActionButtons(status) {
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
return [
{ label: '编辑', action: 'edit' },
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
if (status === AUDIT_STATUS.APPROVED) {
return [{ label: '消审', action: 'unapprove' }];
}
return [];
}
/** 将 normalizeOrder 结果映射为表单字段 */
export function orderToFormFields(order) {
return {
order_no: order.order_no,
business_unit_id: order.business_unit_id,
business_unit_name: order.business_unit_name,
delivery_time: order.delivery_time,
remark: order.remark,
item_data: order.item_data,
};
}
export function getFineCodeTableColumns(readonly) {
const cols = [...FINE_CODE_TABLE_COLUMNS];
if (!readonly) cols.push({ label: '操作', key: 'action', width: 100 });
return cols;
}
export function mapFineCodeTableRows(list, readonly) {
return (list || []).map((item, index) => ({
seq: index + 1,
roll_no: item.roll_no || '-',
extern_volume_number: item.extern_volume_number || '-',
roll: item.roll != null && item.roll !== '' ? item.roll : '-',
weight: item.weight != null && item.weight !== '' ? `${item.weight}` : '-',
bar_code: item.bar_code || '-',
position: item.position || '-',
action: readonly ? '' : '删除',
}));
}
export function getFineCodeTableWidth(columns) {
const total = (columns || []).reduce((sum, col) => sum + (col.width || 120), 0);
return `${total}rpx`;
}
/**
* 确认并执行审核状态变更(新增/编辑/查看页共用)
* @param {Vue} vm 页面实例,需有 $u.api 与 showError
* @param {{ orderId: number, action: string, onSuccess?: Function }} options
*/
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
const cfg = STATUS_ACTION_CONFIG[action];
if (!cfg || !orderId) return;
const api = vm.$u.api.gfmOtherDeliveryOrder;
const requestFn = api[cfg.apiKey];
if (typeof requestFn !== 'function') return;
uni.showModal({
title: '提示',
content: cfg.msg,
success: (res) => {
if (!res.confirm) return;
uni.showLoading({ title: '处理中...' });
requestFn(buildStatusParam(orderId, cfg.status))
.then(() => {
if (typeof onSuccess === 'function') return onSuccess();
uni.hideLoading();
})
.catch((e) => {
uni.hideLoading();
if (vm.showError) vm.showError(e.message || '操作失败');
});
},
});
}

View File

@ -0,0 +1,276 @@
/**
* 坯布库存查询:常量、格式化、查询参数组装
*/
import {
formatRoll,
formatWeightKg,
fetchAllOrderList,
LIST_PAGE_SIZE,
} from '@/common/storeFabricBusinessOut';
export { formatRoll, formatWeightKg, fetchAllOrderList, LIST_PAGE_SIZE };
/** 第一维度:坯布汇总表格列 */
export const GROUP_TABLE_COLUMNS = [
{ label: '坯布', key: 'fabric_label', width: 300 },
{ label: '仓库名称', key: 'warehouse_name', width: 180 },
{ label: '库存匹数', key: 'stock_roll_display', width: 130 },
{ label: '库存数量', key: 'stock_weight_display', width: 160 },
];
/** 第二维度:排除上期/本期字段后的表格列 */
export const STOCK_TABLE_COLUMNS = [
{ label: '颜色', key: 'gray_fabric_color_name', width: 120 },
{ label: '坯布编号', key: 'grey_fabric_code', width: 140 },
{ label: '坯布名称', key: 'grey_fabric_name', width: 160 },
{ label: '等级', key: 'grey_fabric_level_name', width: 100 },
{ label: '幅宽', key: 'grey_fabric_width_and_unit_name', width: 120 },
{ label: '克重', key: 'grey_fabric_gram_weight_and_unit_name', width: 120 },
{ label: '成分', key: 'component', width: 120 },
{ label: '客户', key: 'customer_name', width: 120 },
{ label: '织厂', key: 'supplier_name', width: 140 },
{ label: '机台号', key: 'machine_number', width: 100 },
{ label: '针寸数', key: 'needle_size', width: 100 },
{ label: '纱批', key: 'yarn_batch', width: 120 },
{ label: '原料纱名', key: 'raw_material_yarn_name', width: 140 },
{ label: '原料批号', key: 'raw_material_batch_num', width: 120 },
{ label: '原料品牌', key: 'raw_material_batch_brand', width: 120 },
{ label: '仓库', key: 'warehouse_name', width: 140 },
{ label: '收货单位', key: 'receiver_name', width: 140 },
{ label: '工厂备注', key: 'warehouse_remark', width: 140 },
{ label: '染厂用坯单号', key: 'dye_unit_use_order_no', width: 150 },
{ label: '生产通知单号', key: 'produce_order_no', width: 150 },
{ label: '出坯单号', key: 'source_code', width: 140 },
{ label: '出坯日期', key: 'source_time', width: 120 },
{ label: '坯布备注', key: 'source_remark', width: 140 },
{ label: '预约匹数', key: 'book_roll_display', width: 110 },
{ label: '库存匹数', key: 'stock_roll_display', width: 110 },
{ label: '库存数量', key: 'stock_weight_display', width: 140 },
{ label: '库存成本', key: 'stock_cost_display', width: 110 },
{ label: '单价', key: 'single_price_display', width: 100 },
{ label: '毛重成本', key: 'buoyant_weight_price_display', width: 110 },
];
/** 细码明细表格列 */
export const WAREHOUSE_DETAIL_COLUMNS = [
{ label: '序号', key: 'seq', width: 80 },
{ label: '卷号', key: 'volume_number', width: 110 },
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
{ label: '匹数', key: 'roll', width: 100 },
{ label: '数量(KG)', key: 'weight', width: 130 },
{ label: '条码', key: 'bar_code', width: 280 },
{ label: '仓位', key: 'position', width: 120 },
{ label: '颜色', key: 'gray_fabric_color_name', width: 120 },
{ label: '织厂', key: 'supplier_name', width: 140 },
{ label: '机台', key: 'machine_number', width: 100 },
{ label: '库龄(天)', key: 'days_of_age', width: 110 },
];
export function formatStockWeightWithUnit(weight, unitName) {
const val = formatWeightKg(weight);
if (val === 0 && (weight === 0 || weight === '0')) return unitName ? `0 ${unitName}` : '0';
if (!weight && weight !== 0) return '-';
return unitName ? `${val} ${unitName}` : `${val}`;
}
export function formatDisplayCell(value) {
if (value === null || value === undefined || value === '') return '-';
return String(value);
}
export function toQueryString(params = {}) {
return Object.keys(params)
.filter((key) => {
const val = params[key];
return val !== '' && val !== null && val !== undefined;
})
.map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
}
export function parsePageQuery(options = {}) {
const parsed = { ...options };
['grey_fabric_id', 'warehouse_id', 'supplier_id', 'gray_fabric_color_id', 'warehouse_sum_id'].forEach((key) => {
if (parsed[key] !== undefined && parsed[key] !== '') {
const num = Number(parsed[key]);
if (!Number.isNaN(num)) parsed[key] = num;
}
});
return parsed;
}
/** 第一维度接口筛选:仅坯布编号、坯布名称 */
export function buildGroupListQuery(filters = {}) {
const params = {};
if (filters.grey_fabric_code) params.grey_fabric_code = filters.grey_fabric_code;
if (filters.grey_fabric_name) params.grey_fabric_name = filters.grey_fabric_name;
return params;
}
/** 第二维度接口筛选:坯布 id + 机台号 */
export function buildStockListQuery(filters = {}, context = {}) {
const params = {};
if (context.grey_fabric_id) params.grey_fabric_id = context.grey_fabric_id;
if (filters.machine_number) params.machine_number = filters.machine_number;
return params;
}
export function buildDetailQuery(row = {}, context = {}) {
const params = {};
const greyFabricId = row.grey_fabric_id || context.grey_fabric_id;
if (greyFabricId) params.grey_fabric_id = greyFabricId;
if (row.warehouse_id || context.warehouse_id) {
params.warehouse_id = row.warehouse_id || context.warehouse_id;
}
if (row.supplier_id) params.supplier_id = row.supplier_id;
if (row.gray_fabric_color_id) params.gray_fabric_color_id = row.gray_fabric_color_id;
if (row.machine_number) params.machine_number = row.machine_number;
if (row.yarn_batch) params.yarn_batch = row.yarn_batch;
if (row.produce_order_no) params.produce_order_no = row.produce_order_no;
if (row.source_code) params.source_code = row.source_code;
if (row.id) params.warehouse_sum_id = row.id;
if (row.warehouse_sum_id) params.warehouse_sum_id = row.warehouse_sum_id;
return params;
}
export function buildStockListNavigateQuery(item) {
return {
grey_fabric_id: item.grey_fabric_id,
grey_fabric_code: item.grey_fabric_code || '',
grey_fabric_name: item.grey_fabric_name || '',
warehouse_id: item.warehouse_id || '',
};
}
export function buildDetailNavigateQuery(row, context = {}) {
const detailQuery = buildDetailQuery(row, context);
return {
...detailQuery,
grey_fabric_code: row.grey_fabric_code || context.grey_fabric_code || '',
grey_fabric_name: row.grey_fabric_name || context.grey_fabric_name || '',
gray_fabric_color_name: row.gray_fabric_color_name || '',
supplier_name: row.supplier_name || '',
machine_number: row.machine_number || '',
yarn_batch: row.yarn_batch || '',
warehouse_name: row.warehouse_name || '',
stock_roll: row.stock_roll_display || '',
stock_weight: row.stock_weight_display || '',
};
}
export function mapGroupTableRow(row) {
const code = row.grey_fabric_code || '';
const name = row.grey_fabric_name || '';
return {
...row,
_key: `${row.grey_fabric_id || ''}_${row.warehouse_id || ''}`,
fabric_label: code && name ? `${code}#${name}` : (code || name || '-'),
warehouse_name: formatDisplayCell(row.warehouse_name || row.receiver_name),
stock_roll_display: formatRoll(row.stock_roll),
stock_weight_display: formatStockWeightWithUnit(row.stock_weight, row.unit_name),
};
}
export function mapStockTableRow(row) {
const unitName = row.unit_name || '';
return {
...row,
_key: row.id || `${row.grey_fabric_id}_${row.gray_fabric_color_id}_${row.supplier_id}_${row.machine_number}`,
gray_fabric_color_name: formatDisplayCell(row.gray_fabric_color_name),
grey_fabric_code: formatDisplayCell(row.grey_fabric_code),
grey_fabric_name: formatDisplayCell(row.grey_fabric_name),
grey_fabric_level_name: formatDisplayCell(row.grey_fabric_level_name),
grey_fabric_width_and_unit_name: formatDisplayCell(row.grey_fabric_width_and_unit_name),
grey_fabric_gram_weight_and_unit_name: formatDisplayCell(row.grey_fabric_gram_weight_and_unit_name),
component: formatDisplayCell(row.component),
customer_name: formatDisplayCell(row.customer_name),
supplier_name: formatDisplayCell(row.supplier_name),
machine_number: formatDisplayCell(row.machine_number),
needle_size: formatDisplayCell(row.needle_size),
yarn_batch: formatDisplayCell(row.yarn_batch),
raw_material_yarn_name: formatDisplayCell(row.raw_material_yarn_name),
raw_material_batch_num: formatDisplayCell(row.raw_material_batch_num),
raw_material_batch_brand: formatDisplayCell(row.raw_material_batch_brand),
warehouse_name: formatDisplayCell(row.warehouse_name),
receiver_name: formatDisplayCell(row.receiver_name),
warehouse_remark: formatDisplayCell(row.warehouse_remark),
dye_unit_use_order_no: formatDisplayCell(row.dye_unit_use_order_no),
produce_order_no: formatDisplayCell(row.produce_order_no),
source_code: formatDisplayCell(row.source_code),
source_time: formatDisplayCell((row.source_time || '').slice(0, 10)),
source_remark: formatDisplayCell(row.source_remark),
book_roll_display: row.book_roll != null && row.book_roll !== '' ? formatRoll(row.book_roll) : '-',
stock_roll_display: formatRoll(row.stock_roll),
stock_weight_display: formatStockWeightWithUnit(row.stock_weight, unitName),
stock_cost_display: row.stock_cost != null && row.stock_cost !== '' ? formatWeightKg(row.stock_cost) : '-',
single_price_display: row.single_price != null && row.single_price !== '' ? formatWeightKg(row.single_price) : '-',
buoyant_weight_price_display: row.buoyant_weight_price != null && row.buoyant_weight_price !== ''
? formatWeightKg(row.buoyant_weight_price) : '-',
creator_name: formatDisplayCell(row.creator_name),
create_time: formatDisplayCell(row.create_time),
update_user_name: formatDisplayCell(row.update_user_name),
update_time: formatDisplayCell(row.update_time),
};
}
export function sumStockTotals(list = []) {
let roll = 0;
let weight = 0;
(list || []).forEach((item) => {
roll += Number(item.stock_roll || 0);
weight += Number(item.stock_weight || 0);
});
return {
roll: formatRoll(roll),
weight: formatWeightKg(weight),
count: list.length,
};
}
export function sumDetailTotals(list = []) {
let roll = 0;
let weight = 0;
(list || []).forEach((item) => {
roll += Number(item.num || 0);
weight += Number(item.weight || 0);
});
return {
roll: formatRoll(roll),
weight: formatWeightKg(weight),
count: list.length,
};
}
export function mapWarehouseDetailRows(list = []) {
return (list || []).map((item, index) => ({
seq: index + 1,
volume_number: item.volume_number || '-',
extern_volume_number: item.extern_volume_number || '-',
roll: item.num != null && item.num !== '' ? formatRoll(item.num) : '-',
weight: item.weight != null && item.weight !== '' ? formatWeightKg(item.weight) : '-',
bar_code: item.bar_code || item.fabric_piece_code || '-',
position: item.warehouse_bin_Name || '-',
gray_fabric_color_name: item.gray_fabric_color_name || '-',
supplier_name: item.supplier_name || '-',
machine_number: item.machine_number || '-',
days_of_age: item.days_of_age != null && item.days_of_age !== '' ? item.days_of_age : '-',
}));
}
export function getWarehouseDetailTableWidth(columns = WAREHOUSE_DETAIL_COLUMNS) {
const total = columns.reduce((sum, col) => sum + (col.width || 120), 0);
return `${total}rpx`;
}
export function fetchAllWarehouseList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
return fetchAllOrderList(listFn, params, pageSize);
}
export function calcTableHeight(rowCount, options = {}) {
const headerPx = options.headerPx || 44;
const rowPx = options.rowPx || 44;
const minPx = options.minPx || 200;
const maxPx = options.maxPx || 520;
const total = headerPx + rowCount * rowPx;
return `${Math.min(Math.max(total, minPx), maxPx)}px`;
}

View File

@ -0,0 +1,456 @@
/**
* 加工进仓单常量与数据工具
*
* 真实接口请求统一注册在 src/common/http.api.js 的 vm.$u.api.fpmProcessInOrder 下。
*/
import dayjs from 'dayjs';
export const AUDIT_STATUS = {
PENDING: 1,
APPROVED: 2,
REJECTED: 3,
VOIDED: 4,
};
export const DRAFT_AUDIT_STATUS = 0;
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
export const AUDIT_STATUS_MAP = {
1: '待审核',
2: '已审核',
3: '已驳回',
4: '已作废',
};
/** 操作类型:1录入 3删除 */
export const ARRANGE_TYPE = {
IN: 1,
DEL: 3,
};
/** 入仓类型:加工进仓单 */
export const IN_ORDER_TYPE_PROCESS = 5;
/** 入仓类型:返修进仓 */
export const IN_ORDER_TYPE_REPAIR = 6;
export const IN_ORDER_TYPE_MAP = {
[IN_ORDER_TYPE_PROCESS]: '加工进仓单',
[IN_ORDER_TYPE_REPAIR]: '返修进仓',
};
export const IN_ORDER_TYPE_OPTIONS = [
{ value: IN_ORDER_TYPE_PROCESS, label: IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PROCESS] },
{ value: IN_ORDER_TYPE_REPAIR, label: IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_REPAIR] },
];
/** 默认纸筒重量(公斤,表单展示值) */
export const DEFAULT_PAPER_TUBE_WEIGHT = 0.3;
/** 默认包装重量(公斤,表单展示值) */
export const DEFAULT_PACKAGE_WEIGHT = 0.15;
/** 往来单位类型:加工单位 */
export const BUSINESS_UNIT_TYPE_PROCESS = 12;
/** 成品物理仓类型 */
export const WAREHOUSE_TYPE_FINISHED = 103;
/** 默认仓库名称 */
export const DEFAULT_WAREHOUSE_NAME = '成品仓';
export const LIST_PAGE_SIZE = 100;
export const STATUS_ACTION_CONFIG = {
approve: { status: AUDIT_STATUS.APPROVED, msg: '确认审核该单据?', apiKey: 'statusPass' },
void: { status: AUDIT_STATUS.VOIDED, msg: '确认作废该单据?', apiKey: 'statusCancel' },
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
};
export function getStatusOptions() {
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
value,
label: AUDIT_STATUS_MAP[value],
}));
}
export { mapToSelectOptions } from '@/common/remoteSelect';
/** 匹数:后端 ×100 存储 */
export function formatRoll(value) {
const n = Number(value || 0) / 100;
return Number.isInteger(n) ? n : Number(n.toFixed(2));
}
/** 数量(公斤):后端 ×10000 存储 */
export function formatWeightKg(value) {
const n = Number(value || 0) / 10000;
return Number(n.toFixed(2));
}
/** 公斤展示值转后端存储(×10000) */
export function toWeightStorage(value) {
return Math.round(Number(value || 0) * 10000);
}
export function normalizeOrder(order) {
if (!order) return null;
return {
id: order.id,
order_no: order.order_no || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
process_unit_id: order.process_unit_id || '',
process_name: order.process_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
sale_system_id: order.sale_system_id || '',
sale_system_name: order.sale_system_name || '',
in_order_type: order.in_order_type || IN_ORDER_TYPE_PROCESS,
in_order_type_name: order.in_order_type_name
|| IN_ORDER_TYPE_MAP[order.in_order_type]
|| IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PROCESS],
paper_tube_weight: formatWeightKg(order.paper_tube_weight),
package_weight: formatWeightKg(order.package_weight),
remark: order.remark || '',
warehouse_in_time: (order.warehouse_in_time || '').slice(0, 10),
creator_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_time: order.audit_time || '',
total_roll: formatRoll(order.total_roll),
total_weight: formatWeightKg(order.total_weight),
total_length: formatRoll(order.total_length),
item_data: (order.item_data || []).map(normalizeItem),
_raw: order,
};
}
export function normalizeFineCode(fc) {
if (!fc) return null;
const weightRaw = fc.base_unit_weight != null
? fc.base_unit_weight
: (fc.settle_weight != null ? fc.settle_weight : fc.weight);
const qrCode = fc.qr_code || fc.long_code || '';
const barCode = fc.bar_code || fc.digital_code || fc.short_code || '';
return {
id: fc.id,
volume_number: fc.volume_number != null && fc.volume_number !== '' ? String(fc.volume_number) : '',
extern_volume_number: fc.extern_volume_number != null && fc.extern_volume_number !== ''
? String(fc.extern_volume_number)
: '',
roll: formatRoll(fc.roll),
weight: formatWeightKg(weightRaw),
bar_code: barCode,
qr_code: qrCode,
digital_code: fc.digital_code || '',
long_code: fc.long_code || '',
short_code: fc.short_code || '',
dye_factory_dyelot_number: fc.dye_factory_dyelot_number || fc.dyelot_number || '',
warehouse_bin_name: fc.warehouse_bin_name || '',
shelf_no: fc.shelf_no || '',
scan_code: qrCode || barCode || '',
paper_tube_weight: fc.paper_tube_weight != null && fc.paper_tube_weight !== ''
? formatWeightKg(fc.paper_tube_weight)
: null,
package_weight: fc.package_weight != null && fc.package_weight !== ''
? formatWeightKg(fc.package_weight)
: null,
};
}
export function normalizeItem(item) {
return {
id: item.id,
quote_order_no: item.quote_order_no || '',
product_code: item.product_code || '',
product_name: item.product_name || '',
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
dye_factory_color_code: item.dye_factory_color_code || '',
in_roll: formatRoll(item.in_roll),
in_weight: formatWeightKg(item.in_weight),
item_fc_data: (item.item_fc_data || []).map(normalizeFineCode).filter(Boolean),
};
}
/**
* 明细分组:成品编号 → 成品色号 → 细码
*/
export function buildItemGroups(items) {
const productMap = new Map();
(items || []).forEach((item) => {
const productKey = item.product_code || '-';
if (!productMap.has(productKey)) {
productMap.set(productKey, {
group_key: `p:${productKey}`,
product_code: item.product_code || '',
product_name: item.product_name || '',
in_roll: 0,
in_weight: 0,
colors: new Map(),
});
}
const productGroup = productMap.get(productKey);
if (!productGroup.product_name && item.product_name) {
productGroup.product_name = item.product_name;
}
const colorKey = item.product_color_code || item.product_color_name || '-';
if (!productGroup.colors.has(colorKey)) {
productGroup.colors.set(colorKey, {
group_key: `p:${productKey}|c:${colorKey}`,
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
quote_order_no: item.quote_order_no || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
in_roll: 0,
in_weight: 0,
fine_codes: [],
});
}
const colorGroup = productGroup.colors.get(colorKey);
productGroup.in_roll = Number((productGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
productGroup.in_weight = Number((productGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
colorGroup.in_roll = Number((colorGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
colorGroup.in_weight = Number((colorGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
if (item.quote_order_no) colorGroup.quote_order_no = item.quote_order_no;
if (item.dye_factory_dyelot_number) {
colorGroup.dye_factory_dyelot_number = item.dye_factory_dyelot_number;
}
if (!colorGroup.product_color_name && item.product_color_name) {
colorGroup.product_color_name = item.product_color_name;
}
colorGroup.fine_codes.push(...(item.item_fc_data || []));
});
return Array.from(productMap.values()).map((product) => ({
group_key: product.group_key,
product_code: product.product_code,
product_name: product.product_name,
in_roll: product.in_roll,
in_weight: product.in_weight,
colors: Array.from(product.colors.values()),
}));
}
export function getEmptyScanDetail() {
return {
quote_order_no: '',
dyelot_number: '',
volume_number: '',
extern_volume_number: '',
product_code: '',
product_color_code: '',
order_roll: 0,
item_roll: 0,
order_weight: 0,
item_weight: 0,
};
}
/** 刚扫细码的数量(公斤存储值):优先细码 weight */
function pickScannedFineWeight(res) {
if (!res) return 0;
if (res.weight != null && res.weight !== '') return res.weight;
if (res.base_unit_weight != null && res.base_unit_weight !== '') return res.base_unit_weight;
if (res.settle_weight != null && res.settle_weight !== '') return res.settle_weight;
if (res.actually_weight != null && res.actually_weight !== '') return res.actually_weight;
return res.item_weight;
}
/** 从扫码接口返回构建详情区(匹数÷100,数量÷10000) */
export function buildScanDetailFromScanResponse(res) {
if (!res) return getEmptyScanDetail();
return {
quote_order_no: res.quote_order_no || '',
dyelot_number: res.dyelot_number || '',
volume_number: res.volume_number != null && res.volume_number !== '' ? String(res.volume_number) : '',
extern_volume_number: res.extern_volume_number != null && res.extern_volume_number !== ''
? String(res.extern_volume_number)
: '',
product_code: res.product_code || '',
product_color_code: res.product_color_code || '',
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
// 本行数量:刚扫这条细码的重量(weight),不是明细行合计
item_weight: formatWeightKg(pickScannedFineWeight(res)),
};
}
/** 校验纸筒/包装重量(扫码时提交) */
export function validateScanWeights(paperTubeWeight, packageWeight) {
if (paperTubeWeight === '' || paperTubeWeight == null) {
return '请输入纸筒重量';
}
if (Number.isNaN(Number(paperTubeWeight))) return '纸筒重量格式不正确';
if (packageWeight === '' || packageWeight == null) {
return '请输入包装重量';
}
if (Number.isNaN(Number(packageWeight))) return '包装重量格式不正确';
return '';
}
/** 构建扫码请求参数(纸筒/包装重量在扫码时提交,公斤值需 ×10000) */
export function buildScanUpdateParams({
id,
scanCode,
arrangeType,
warehouseBinId,
paperTubeWeight,
packageWeight,
}) {
const code = (scanCode || '').trim();
const params = {
id: Number(id),
arrange_type: arrangeType,
paper_tube_weight: toWeightStorage(paperTubeWeight),
package_weight: toWeightStorage(packageWeight),
};
if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId);
}
// 长度大于25走二维码,否则走条码
if (code.length > 25) {
params.qr_code = code;
} else {
params.bar_code = code;
}
return params;
}
export function buildStatusParam(id) {
return { id: String(id) };
}
export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
if (!value) return '';
const parsed = dayjs(value);
return parsed.isValid() ? parsed.format(format) : String(value).slice(0, 10);
}
export function canScanAtStatus(status) {
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
}
export function isLockedOrderStatus(status) {
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
}
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
const pickBatch = (res) => {
if (Array.isArray(res)) return res;
if (!res || typeof res !== 'object') return [];
return res.list || res.records || res.items || [];
};
const loadPage = (page, acc) => listFn({ ...params, page, size: pageSize })
.then((res) => {
const batch = pickBatch(res);
if (!batch.length) return acc;
// 一次返回超过 pageSize:后端忽略分页,视为全量,避免死循环翻页
if (batch.length > pageSize) return acc.concat(batch);
// 翻页后与首页首条相同:后端忽略 page,避免死循环
if (
page > 1
&& acc.length
&& batch[0]
&& acc[0]
&& String(batch[0].id) === String(acc[0].id)
) {
return acc;
}
const merged = acc.concat(batch);
const total = !Array.isArray(res) && res != null ? Number(res.total) : NaN;
if (!Number.isNaN(total) && merged.length >= total) return merged;
if (batch.length < pageSize) return merged;
return loadPage(page + 1, merged);
});
return loadPage(1, []);
}
export function getFormStatusActionButtons(headerSaved, orderId, status) {
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
return [
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
export function getViewStatusActionButtons(status) {
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
return [
{ label: '编辑', action: 'edit' },
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
if (status === AUDIT_STATUS.APPROVED) {
return [{ label: '消审', action: 'unapprove' }];
}
return [];
}
export function orderToFormFields(order) {
return {
order_no: order.order_no,
process_unit_id: order.process_unit_id,
process_name: order.process_name,
warehouse_id: order.warehouse_id,
warehouse_name: order.warehouse_name,
sale_system_id: order.sale_system_id,
sale_system_name: order.sale_system_name,
in_order_type: order.in_order_type || IN_ORDER_TYPE_PROCESS,
in_order_type_name: order.in_order_type_name
|| IN_ORDER_TYPE_MAP[order.in_order_type]
|| IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PROCESS],
paper_tube_weight: String(DEFAULT_PAPER_TUBE_WEIGHT),
package_weight: String(DEFAULT_PACKAGE_WEIGHT),
remark: order.remark,
item_data: order.item_data,
};
}
/** 从仓库下拉中选出默认成品仓 */
export function pickDefaultWarehouse(options, loginWarehouseId, loginWarehouseName) {
const list = options || [];
const byName = list.find((item) => item.label === DEFAULT_WAREHOUSE_NAME);
if (byName) return byName;
if (loginWarehouseId) {
const byId = list.find((item) => String(item.value) === String(loginWarehouseId));
if (byId) return byId;
if (loginWarehouseName) {
return { value: loginWarehouseId, label: loginWarehouseName };
}
}
return list[0] || null;
}
/**
* 确认并执行审核状态变更
*/
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
const cfg = STATUS_ACTION_CONFIG[action];
if (!cfg || !orderId) return;
const api = vm.$u.api.fpmProcessInOrder;
const requestFn = api[cfg.apiKey];
if (typeof requestFn !== 'function') return;
uni.showModal({
title: '提示',
content: cfg.msg,
success: (res) => {
if (!res.confirm) return;
uni.showLoading({ title: '处理中...' });
requestFn(buildStatusParam(orderId))
.then(() => {
if (typeof onSuccess === 'function') return onSuccess();
uni.hideLoading();
})
.catch((e) => {
uni.hideLoading();
if (vm.showError) vm.showError(e.message || '操作失败');
});
},
});
}

View File

@ -0,0 +1,392 @@
/**
* 加工出仓单常量与数据工具
*
* 真实接口请求统一注册在 src/common/http.api.js 的 vm.$u.api.fpmProcessOutOrder 下。
*/
import dayjs from 'dayjs';
export const AUDIT_STATUS = {
PENDING: 1,
APPROVED: 2,
REJECTED: 3,
VOIDED: 4,
};
export const DRAFT_AUDIT_STATUS = 0;
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
export const AUDIT_STATUS_MAP = {
1: '待审核',
2: '已审核',
3: '已驳回',
4: '已作废',
};
/** 操作类型:1录入 3删除 */
export const ARRANGE_TYPE = {
IN: 1,
DEL: 3,
};
/** 出仓类型:正常加工出仓 WarehouseGoodOutTypeProcess = 5 */
export const OUT_ORDER_TYPE_PROCESS = 5;
export const OUT_ORDER_TYPE_PROCESS_NAME = '正常加工出仓';
/** 出仓类型:回修加工出仓 WarehouseGoodOutTypeProcessRepair = 8 */
export const OUT_ORDER_TYPE_REPAIR = 8;
export const OUT_ORDER_TYPE_REPAIR_NAME = '回修加工出仓';
/** 往来单位类型:加工单位 */
export const BUSINESS_UNIT_TYPE_PROCESS = 12;
/** 成品物理仓类型 */
export const WAREHOUSE_TYPE_FINISHED = 103;
/** 默认仓库名称 */
export const DEFAULT_WAREHOUSE_NAME = '成品仓';
export const LIST_PAGE_SIZE = 100;
export const STATUS_ACTION_CONFIG = {
approve: { status: AUDIT_STATUS.APPROVED, msg: '确认审核该单据?', apiKey: 'statusPass' },
void: { status: AUDIT_STATUS.VOIDED, msg: '确认作废该单据?', apiKey: 'statusCancel' },
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
};
export function getStatusOptions() {
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
value,
label: AUDIT_STATUS_MAP[value],
}));
}
export { mapToSelectOptions } from '@/common/remoteSelect';
/** 匹数:后端 ×100 存储 */
export function formatRoll(value) {
const n = Number(value || 0) / 100;
return Number.isInteger(n) ? n : Number(n.toFixed(2));
}
/** 数量(公斤):后端 ×10000 存储 */
export function formatWeightKg(value) {
const n = Number(value || 0) / 10000;
return Number(n.toFixed(2));
}
export function normalizeOrder(order) {
if (!order) return null;
return {
id: order.id,
order_no: order.order_no || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
process_unit_id: order.process_unit_id || '',
process_name: order.process_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
sale_system_id: order.sale_system_id || '',
sale_system_name: order.sale_system_name || '',
out_order_type: order.out_order_type || OUT_ORDER_TYPE_PROCESS,
out_order_type_name: order.out_order_type_name || OUT_ORDER_TYPE_PROCESS_NAME,
remark: order.remark || '',
warehouse_out_time: (order.warehouse_out_time || '').slice(0, 10),
creator_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_time: order.audit_time || '',
total_roll: formatRoll(order.total_roll),
total_weight: formatWeightKg(order.total_weight),
total_length: formatRoll(order.total_length),
item_data: (order.item_data || []).map(normalizeItem),
_raw: order,
};
}
export function normalizeFineCode(fc) {
if (!fc) return null;
// 出仓细码数量:优先基本单位公斤,其次结算数量
const weightRaw = fc.base_unit_weight != null
? fc.base_unit_weight
: (fc.settle_weight != null ? fc.settle_weight : fc.weight);
const qrCode = fc.qr_code || '';
const digitalCode = fc.digital_code || '';
const barCode = fc.bar_code || digitalCode || '';
return {
id: fc.id,
volume_number: fc.volume_number != null && fc.volume_number !== '' ? String(fc.volume_number) : '',
extern_volume_number: fc.extern_volume_number != null && fc.extern_volume_number !== ''
? String(fc.extern_volume_number)
: '',
roll: formatRoll(fc.roll),
weight: formatWeightKg(weightRaw),
bar_code: barCode,
qr_code: qrCode,
digital_code: digitalCode,
dye_factory_dyelot_number: fc.dye_factory_dyelot_number || fc.dyelot_number || '',
warehouse_bin_name: fc.warehouse_bin_name || '',
shelf_no: fc.shelf_no || '',
// 删除扫码优先二维码
scan_code: qrCode || barCode || digitalCode || '',
};
}
export function normalizeItem(item) {
// 明细数量字段:OpenAPI 为 total_weight / settle_weight(×10000),匹数为 out_roll(×100)
const weightRaw = item.total_weight != null
? item.total_weight
: (item.settle_weight != null ? item.settle_weight : item.out_weight);
return {
id: item.id,
quote_order_no: item.quote_order_no || '',
product_code: item.product_code || '',
product_name: item.product_name || '',
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
dye_factory_color_code: item.dye_factory_color_code || '',
out_roll: formatRoll(item.out_roll),
out_weight: formatWeightKg(weightRaw),
item_fc_data: (item.item_fc_data || []).map(normalizeFineCode).filter(Boolean),
};
}
/**
* 明细分组:成品编号 → 成品色号 → 细码
*/
export function buildItemGroups(items) {
const productMap = new Map();
(items || []).forEach((item) => {
const productKey = item.product_code || '-';
if (!productMap.has(productKey)) {
productMap.set(productKey, {
group_key: `p:${productKey}`,
product_code: item.product_code || '',
product_name: item.product_name || '',
out_roll: 0,
out_weight: 0,
colors: new Map(),
});
}
const productGroup = productMap.get(productKey);
if (!productGroup.product_name && item.product_name) {
productGroup.product_name = item.product_name;
}
const colorKey = item.product_color_code || item.product_color_name || '-';
if (!productGroup.colors.has(colorKey)) {
productGroup.colors.set(colorKey, {
group_key: `p:${productKey}|c:${colorKey}`,
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
quote_order_no: item.quote_order_no || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
out_roll: 0,
out_weight: 0,
fine_codes: [],
});
}
const colorGroup = productGroup.colors.get(colorKey);
productGroup.out_roll = Number((productGroup.out_roll + Number(item.out_roll || 0)).toFixed(2));
productGroup.out_weight = Number((productGroup.out_weight + Number(item.out_weight || 0)).toFixed(2));
colorGroup.out_roll = Number((colorGroup.out_roll + Number(item.out_roll || 0)).toFixed(2));
colorGroup.out_weight = Number((colorGroup.out_weight + Number(item.out_weight || 0)).toFixed(2));
if (item.quote_order_no) colorGroup.quote_order_no = item.quote_order_no;
if (item.dye_factory_dyelot_number) {
colorGroup.dye_factory_dyelot_number = item.dye_factory_dyelot_number;
}
if (!colorGroup.product_color_name && item.product_color_name) {
colorGroup.product_color_name = item.product_color_name;
}
colorGroup.fine_codes.push(...(item.item_fc_data || []));
});
return Array.from(productMap.values()).map((product) => ({
group_key: product.group_key,
product_code: product.product_code,
product_name: product.product_name,
out_roll: product.out_roll,
out_weight: product.out_weight,
colors: Array.from(product.colors.values()),
}));
}
export function getEmptyScanDetail() {
return {
quote_order_no: '',
dyelot_number: '',
volume_number: '',
extern_volume_number: '',
product_code: '',
product_color_code: '',
order_roll: 0,
item_roll: 0,
order_weight: 0,
item_weight: 0,
};
}
/** 从扫码接口返回构建详情区(匹数÷100,数量÷10000) */
export function buildScanDetailFromScanResponse(res) {
if (!res) return getEmptyScanDetail();
return {
quote_order_no: res.quote_order_no || '',
dyelot_number: res.dyelot_number || '',
volume_number: res.volume_number != null && res.volume_number !== '' ? String(res.volume_number) : '',
extern_volume_number: res.extern_volume_number != null && res.extern_volume_number !== ''
? String(res.extern_volume_number)
: '',
product_code: res.product_code || '',
product_color_code: res.product_color_code || '',
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
item_weight: formatWeightKg(res.item_weight != null ? res.item_weight : res.weight),
};
}
/** 构建扫码请求参数 */
export function buildScanUpdateParams({ id, scanCode, arrangeType, warehouseBinId }) {
const code = (scanCode || '').trim();
const params = {
id: Number(id),
arrange_type: arrangeType,
};
if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId);
}
// 长度大于25走二维码,否则走条码
if (code.length > 25) {
params.qr_code = code;
} else {
params.bar_code = code;
}
return params;
}
export function buildStatusParam(id) {
return { id: String(id) };
}
export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
if (!value) return '';
const parsed = dayjs(value);
return parsed.isValid() ? parsed.format(format) : String(value).slice(0, 10);
}
export function canScanAtStatus(status) {
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
}
export function isLockedOrderStatus(status) {
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
}
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
const pickBatch = (res) => {
if (Array.isArray(res)) return res;
if (!res || typeof res !== 'object') return [];
return res.list || res.records || res.items || [];
};
const loadPage = (page, acc) => listFn({ ...params, page, size: pageSize })
.then((res) => {
const batch = pickBatch(res);
if (!batch.length) return acc;
// 一次返回超过 pageSize:后端忽略分页,视为全量,避免死循环翻页
if (batch.length > pageSize) return acc.concat(batch);
// 翻页后与首页首条相同:后端忽略 page,避免死循环
if (
page > 1
&& acc.length
&& batch[0]
&& acc[0]
&& String(batch[0].id) === String(acc[0].id)
) {
return acc;
}
const merged = acc.concat(batch);
const total = !Array.isArray(res) && res != null ? Number(res.total) : NaN;
if (!Number.isNaN(total) && merged.length >= total) return merged;
if (batch.length < pageSize) return merged;
return loadPage(page + 1, merged);
});
return loadPage(1, []);
}
export function getFormStatusActionButtons(headerSaved, orderId, status) {
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
return [
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
export function getViewStatusActionButtons(status) {
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
return [
{ label: '编辑', action: 'edit' },
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
if (status === AUDIT_STATUS.APPROVED) {
return [{ label: '消审', action: 'unapprove' }];
}
return [];
}
export function orderToFormFields(order) {
return {
order_no: order.order_no,
out_order_type: order.out_order_type || OUT_ORDER_TYPE_PROCESS,
out_order_type_name: order.out_order_type_name || OUT_ORDER_TYPE_PROCESS_NAME,
process_unit_id: order.process_unit_id,
process_name: order.process_name,
warehouse_id: order.warehouse_id,
warehouse_name: order.warehouse_name,
remark: order.remark,
item_data: order.item_data,
};
}
/** 从仓库下拉中选出默认成品仓 */
export function pickDefaultWarehouse(options, loginWarehouseId, loginWarehouseName) {
const list = options || [];
const byName = list.find((item) => item.label === DEFAULT_WAREHOUSE_NAME);
if (byName) return byName;
if (loginWarehouseId) {
const byId = list.find((item) => String(item.value) === String(loginWarehouseId));
if (byId) return byId;
if (loginWarehouseName) {
return { value: loginWarehouseId, label: loginWarehouseName };
}
}
return list[0] || null;
}
/**
* 确认并执行审核状态变更
*/
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
const cfg = STATUS_ACTION_CONFIG[action];
if (!cfg || !orderId) return;
const api = vm.$u.api.fpmProcessOutOrder;
const requestFn = api[cfg.apiKey];
if (typeof requestFn !== 'function') return;
uni.showModal({
title: '提示',
content: cfg.msg,
success: (res) => {
if (!res.confirm) return;
uni.showLoading({ title: '处理中...' });
requestFn(buildStatusParam(orderId))
.then(() => {
if (typeof onSuccess === 'function') return onSuccess();
uni.hideLoading();
})
.catch((e) => {
uni.hideLoading();
if (vm.showError) vm.showError(e.message || '操作失败');
});
},
});
}

View File

@ -0,0 +1,386 @@
/**
* 加工退货进仓单常量与数据工具
*
* 真实接口请求统一注册在 src/common/http.api.js 的 vm.$u.api.fpmProcessReturnInOrder 下。
*/
import dayjs from 'dayjs';
export const AUDIT_STATUS = {
PENDING: 1,
APPROVED: 2,
REJECTED: 3,
VOIDED: 4,
};
export const DRAFT_AUDIT_STATUS = 0;
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
export const AUDIT_STATUS_MAP = {
1: '待审核',
2: '已审核',
3: '已驳回',
4: '已作废',
};
/** 操作类型:1录入 3删除 */
export const ARRANGE_TYPE = {
IN: 1,
DEL: 3,
};
/** 入仓类型:加工退货进仓单 */
export const IN_ORDER_TYPE_PROCESS_RETURN = 9;
/** 往来单位类型:加工单位 */
export const BUSINESS_UNIT_TYPE_PROCESS = 12;
/** 成品物理仓类型 */
export const WAREHOUSE_TYPE_FINISHED = 103;
/** 默认仓库名称 */
export const DEFAULT_WAREHOUSE_NAME = '成品仓';
export const LIST_PAGE_SIZE = 100;
export const STATUS_ACTION_CONFIG = {
approve: { status: AUDIT_STATUS.APPROVED, msg: '确认审核该单据?', apiKey: 'statusPass' },
void: { status: AUDIT_STATUS.VOIDED, msg: '确认作废该单据?', apiKey: 'statusCancel' },
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
};
export function getStatusOptions() {
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
value,
label: AUDIT_STATUS_MAP[value],
}));
}
export { mapToSelectOptions } from '@/common/remoteSelect';
/** 匹数:后端 ×100 存储 */
export function formatRoll(value) {
const n = Number(value || 0) / 100;
return Number.isInteger(n) ? n : Number(n.toFixed(2));
}
/** 数量(公斤):后端 ×10000 存储 */
export function formatWeightKg(value) {
const n = Number(value || 0) / 10000;
return Number(n.toFixed(2));
}
export function normalizeOrder(order) {
if (!order) return null;
return {
id: order.id,
order_no: order.order_no || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
process_unit_id: order.process_unit_id || order.biz_unit_id || '',
process_name: order.process_name || order.biz_unit_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
sale_system_id: order.sale_system_id || '',
sale_system_name: order.sale_system_name || '',
in_order_type: order.in_order_type || IN_ORDER_TYPE_PROCESS_RETURN,
in_order_type_name: order.in_order_type_name || '加工退货进仓单',
remark: order.remark || '',
warehouse_in_time: (order.warehouse_in_time || '').slice(0, 10),
creator_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_time: order.audit_time || '',
total_roll: formatRoll(order.total_roll),
total_weight: formatWeightKg(order.total_weight),
total_length: formatRoll(order.total_length),
item_data: (order.item_data || []).map(normalizeItem),
_raw: order,
};
}
export function normalizeFineCode(fc) {
if (!fc) return null;
const weightRaw = fc.base_unit_weight != null
? fc.base_unit_weight
: (fc.settle_weight != null ? fc.settle_weight : fc.weight);
return {
id: fc.id,
volume_number: fc.volume_number != null && fc.volume_number !== '' ? String(fc.volume_number) : '',
extern_volume_number: fc.extern_volume_number != null && fc.extern_volume_number !== ''
? String(fc.extern_volume_number)
: '',
roll: formatRoll(fc.roll),
weight: formatWeightKg(weightRaw),
bar_code: fc.bar_code || '',
qr_code: fc.qr_code || '',
dye_factory_dyelot_number: fc.dye_factory_dyelot_number || fc.dyelot_number || '',
warehouse_bin_name: fc.warehouse_bin_name || '',
shelf_no: fc.shelf_no || '',
scan_code: fc.qr_code || fc.bar_code || '',
};
}
export function normalizeItem(item) {
return {
id: item.id,
quote_order_no: item.quote_order_no || '',
product_code: item.product_code || '',
product_name: item.product_name || '',
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
dye_factory_color_code: item.dye_factory_color_code || '',
in_roll: formatRoll(item.in_roll),
in_weight: formatWeightKg(item.in_weight),
item_fc_data: (item.item_fc_data || []).map(normalizeFineCode).filter(Boolean),
};
}
/**
* 明细分组:成品编号 → 成品色号 → 细码
*/
export function buildItemGroups(items) {
const productMap = new Map();
(items || []).forEach((item) => {
const productKey = item.product_code || '-';
if (!productMap.has(productKey)) {
productMap.set(productKey, {
group_key: `p:${productKey}`,
product_code: item.product_code || '',
product_name: item.product_name || '',
in_roll: 0,
in_weight: 0,
colors: new Map(),
});
}
const productGroup = productMap.get(productKey);
if (!productGroup.product_name && item.product_name) {
productGroup.product_name = item.product_name;
}
const colorKey = item.product_color_code || item.product_color_name || '-';
if (!productGroup.colors.has(colorKey)) {
productGroup.colors.set(colorKey, {
group_key: `p:${productKey}|c:${colorKey}`,
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
quote_order_no: item.quote_order_no || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
in_roll: 0,
in_weight: 0,
fine_codes: [],
});
}
const colorGroup = productGroup.colors.get(colorKey);
productGroup.in_roll = Number((productGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
productGroup.in_weight = Number((productGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
colorGroup.in_roll = Number((colorGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
colorGroup.in_weight = Number((colorGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
if (item.quote_order_no) colorGroup.quote_order_no = item.quote_order_no;
if (item.dye_factory_dyelot_number) {
colorGroup.dye_factory_dyelot_number = item.dye_factory_dyelot_number;
}
if (!colorGroup.product_color_name && item.product_color_name) {
colorGroup.product_color_name = item.product_color_name;
}
colorGroup.fine_codes.push(...(item.item_fc_data || []));
});
return Array.from(productMap.values()).map((product) => ({
group_key: product.group_key,
product_code: product.product_code,
product_name: product.product_name,
in_roll: product.in_roll,
in_weight: product.in_weight,
colors: Array.from(product.colors.values()),
}));
}
export function getEmptyScanDetail() {
return {
quote_order_no: '',
dyelot_number: '',
volume_number: '',
extern_volume_number: '',
product_code: '',
product_color_code: '',
order_roll: 0,
item_roll: 0,
order_weight: 0,
item_weight: 0,
};
}
/** 刚扫细码的数量(公斤存储值):优先细码 weight */
function pickScannedFineWeight(res) {
if (!res) return 0;
if (res.weight != null && res.weight !== '') return res.weight;
if (res.base_unit_weight != null && res.base_unit_weight !== '') return res.base_unit_weight;
if (res.settle_weight != null && res.settle_weight !== '') return res.settle_weight;
if (res.actually_weight != null && res.actually_weight !== '') return res.actually_weight;
return res.item_weight;
}
/** 从扫码接口返回构建详情区(匹数÷100,数量÷10000) */
export function buildScanDetailFromScanResponse(res) {
if (!res) return getEmptyScanDetail();
return {
quote_order_no: res.quote_order_no || '',
dyelot_number: res.dyelot_number || '',
volume_number: res.volume_number != null && res.volume_number !== '' ? String(res.volume_number) : '',
extern_volume_number: res.extern_volume_number != null && res.extern_volume_number !== ''
? String(res.extern_volume_number)
: '',
product_code: res.product_code || '',
product_color_code: res.product_color_code || '',
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
item_weight: formatWeightKg(pickScannedFineWeight(res)),
};
}
/** 构建扫码请求参数 */
export function buildScanUpdateParams({ id, scanCode, arrangeType, warehouseBinId }) {
const code = (scanCode || '').trim();
const params = {
id: Number(id),
arrange_type: arrangeType,
};
if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId);
}
// 长度大于25走二维码,否则走条码
if (code.length > 25) {
params.qr_code = code;
} else {
params.bar_code = code;
}
return params;
}
export function buildStatusParam(id) {
return { id: String(id) };
}
export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
if (!value) return '';
const parsed = dayjs(value);
return parsed.isValid() ? parsed.format(format) : String(value).slice(0, 10);
}
export function canScanAtStatus(status) {
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
}
export function isLockedOrderStatus(status) {
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
}
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
const pickBatch = (res) => {
if (Array.isArray(res)) return res;
if (!res || typeof res !== 'object') return [];
return res.list || res.records || res.items || [];
};
const loadPage = (page, acc) => listFn({ ...params, page, size: pageSize })
.then((res) => {
const batch = pickBatch(res);
if (!batch.length) return acc;
// 一次返回超过 pageSize:后端忽略分页,视为全量,避免死循环翻页
if (batch.length > pageSize) return acc.concat(batch);
// 翻页后与首页首条相同:后端忽略 page,避免死循环
if (
page > 1
&& acc.length
&& batch[0]
&& acc[0]
&& String(batch[0].id) === String(acc[0].id)
) {
return acc;
}
const merged = acc.concat(batch);
const total = !Array.isArray(res) && res != null ? Number(res.total) : NaN;
if (!Number.isNaN(total) && merged.length >= total) return merged;
if (batch.length < pageSize) return merged;
return loadPage(page + 1, merged);
});
return loadPage(1, []);
}
export function getFormStatusActionButtons(headerSaved, orderId, status) {
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
return [
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
export function getViewStatusActionButtons(status) {
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
return [
{ label: '编辑', action: 'edit' },
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
if (status === AUDIT_STATUS.APPROVED) {
return [{ label: '消审', action: 'unapprove' }];
}
return [];
}
export function orderToFormFields(order) {
return {
order_no: order.order_no,
process_unit_id: order.process_unit_id,
process_name: order.process_name,
warehouse_id: order.warehouse_id,
warehouse_name: order.warehouse_name,
remark: order.remark,
item_data: order.item_data,
};
}
/** 从仓库下拉中选出默认成品仓 */
export function pickDefaultWarehouse(options, loginWarehouseId, loginWarehouseName) {
const list = options || [];
const byName = list.find((item) => item.label === DEFAULT_WAREHOUSE_NAME);
if (byName) return byName;
if (loginWarehouseId) {
const byId = list.find((item) => String(item.value) === String(loginWarehouseId));
if (byId) return byId;
if (loginWarehouseName) {
return { value: loginWarehouseId, label: loginWarehouseName };
}
}
return list[0] || null;
}
/**
* 确认并执行审核状态变更
*/
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
const cfg = STATUS_ACTION_CONFIG[action];
if (!cfg || !orderId) return;
const api = vm.$u.api.fpmProcessReturnInOrder;
const requestFn = api[cfg.apiKey];
if (typeof requestFn !== 'function') return;
uni.showModal({
title: '提示',
content: cfg.msg,
success: (res) => {
if (!res.confirm) return;
uni.showLoading({ title: '处理中...' });
requestFn(buildStatusParam(orderId))
.then(() => {
if (typeof onSuccess === 'function') return onSuccess();
uni.hideLoading();
})
.catch((e) => {
uni.hideLoading();
if (vm.showError) vm.showError(e.message || '操作失败');
});
},
});
}

View File

@ -0,0 +1,474 @@
/**
* 成品采购进仓单常量与数据工具
*
* 真实接口请求统一注册在 src/common/http.api.js 的 vm.$u.api.fpmPrcInOrder 下。
*/
import dayjs from 'dayjs';
export const AUDIT_STATUS = {
PENDING: 1,
APPROVED: 2,
REJECTED: 3,
VOIDED: 4,
};
export const DRAFT_AUDIT_STATUS = 0;
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
export const AUDIT_STATUS_MAP = {
1: '待审核',
2: '已审核',
3: '已驳回',
4: '已作废',
};
/** 操作类型:1录入 3删除 */
export const ARRANGE_TYPE = {
IN: 1,
DEL: 3,
};
/** 入仓类型:采购进仓单 */
export const IN_ORDER_TYPE_PURCHASE = 4;
export const IN_ORDER_TYPE_MAP = {
[IN_ORDER_TYPE_PURCHASE]: '采购进仓单',
};
/** 订单类型:1大货 2剪板 3客订大货 4客订剪板 */
export const SALE_MODE = {
BULK: 1,
SHEAR: 2,
CUSTOMER_BULK: 3,
CUSTOMER_SHEAR: 4,
};
export const SALE_MODE_MAP = {
[SALE_MODE.BULK]: '大货',
[SALE_MODE.SHEAR]: '剪板',
[SALE_MODE.CUSTOMER_BULK]: '客订大货',
[SALE_MODE.CUSTOMER_SHEAR]: '客订剪板',
};
export const SALE_MODE_OPTIONS = [
{ value: SALE_MODE.BULK, label: SALE_MODE_MAP[SALE_MODE.BULK] },
{ value: SALE_MODE.SHEAR, label: SALE_MODE_MAP[SALE_MODE.SHEAR] },
{ value: SALE_MODE.CUSTOMER_BULK, label: SALE_MODE_MAP[SALE_MODE.CUSTOMER_BULK] },
{ value: SALE_MODE.CUSTOMER_SHEAR, label: SALE_MODE_MAP[SALE_MODE.CUSTOMER_SHEAR] },
];
/** 往来单位类型:成品供应商 */
export const BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER = 15;
/** 成品物理仓类型 */
export const WAREHOUSE_TYPE_FINISHED = 103;
/** 默认仓库名称 */
export const DEFAULT_WAREHOUSE_NAME = '成品仓';
/** 默认纸筒重量(公斤,表单展示值) */
export const DEFAULT_PAPER_TUBE_WEIGHT = 0.3;
/** 默认包装重量(公斤,表单展示值) */
export const DEFAULT_PACKAGE_WEIGHT = 0.15;
export const LIST_PAGE_SIZE = 100;
export const STATUS_ACTION_CONFIG = {
approve: { status: AUDIT_STATUS.APPROVED, msg: '确认审核该单据?', apiKey: 'statusPass' },
void: { status: AUDIT_STATUS.VOIDED, msg: '确认作废该单据?', apiKey: 'statusCancel' },
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
};
export function getStatusOptions() {
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
value,
label: AUDIT_STATUS_MAP[value],
}));
}
export { mapToSelectOptions } from '@/common/remoteSelect';
/** 匹数:后端 ×100 存储 */
export function formatRoll(value) {
const n = Number(value || 0) / 100;
return Number.isInteger(n) ? n : Number(n.toFixed(2));
}
/** 数量(公斤):后端 ×10000 存储 */
export function formatWeightKg(value) {
const n = Number(value || 0) / 10000;
return Number(n.toFixed(2));
}
/** 公斤展示值转后端存储(×10000) */
export function toWeightStorage(value) {
return Math.round(Number(value || 0) * 10000);
}
export function normalizeOrder(order) {
if (!order) return null;
return {
id: order.id,
order_no: order.order_no || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
biz_unit_id: order.biz_unit_id || '',
biz_unit_name: order.biz_unit_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
sale_system_id: order.sale_system_id || '',
sale_system_name: order.sale_system_name || '',
sale_mode: order.sale_mode || '',
sale_mode_name: order.sale_mode_name || SALE_MODE_MAP[order.sale_mode] || '',
in_order_type: order.in_order_type || IN_ORDER_TYPE_PURCHASE,
in_order_type_name: order.in_order_type_name
|| IN_ORDER_TYPE_MAP[order.in_order_type]
|| IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PURCHASE],
paper_tube_weight: formatWeightKg(order.paper_tube_weight),
package_weight: formatWeightKg(order.package_weight),
remark: order.remark || '',
warehouse_in_time: (order.warehouse_in_time || '').slice(0, 10),
creator_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_time: order.audit_time || '',
total_roll: formatRoll(order.total_roll),
total_weight: formatWeightKg(order.total_weight),
total_length: formatRoll(order.total_length),
item_data: (order.item_data || []).map(normalizeItem),
_raw: order,
};
}
export function normalizeFineCode(fc) {
if (!fc) return null;
const weightRaw = fc.base_unit_weight != null
? fc.base_unit_weight
: (fc.settle_weight != null ? fc.settle_weight : fc.weight);
const qrCode = fc.qr_code || fc.long_code || '';
const barCode = fc.bar_code || fc.digital_code || fc.short_code || '';
return {
id: fc.id,
volume_number: fc.volume_number != null && fc.volume_number !== '' ? String(fc.volume_number) : '',
extern_volume_number: fc.extern_volume_number != null && fc.extern_volume_number !== ''
? String(fc.extern_volume_number)
: '',
roll: formatRoll(fc.roll),
weight: formatWeightKg(weightRaw),
bar_code: barCode,
qr_code: qrCode,
digital_code: fc.digital_code || '',
long_code: fc.long_code || '',
short_code: fc.short_code || '',
dye_factory_dyelot_number: fc.dye_factory_dyelot_number || fc.dyelot_number || '',
warehouse_bin_name: fc.warehouse_bin_name || '',
shelf_no: fc.shelf_no || '',
scan_code: qrCode || barCode || '',
paper_tube_weight: fc.paper_tube_weight != null && fc.paper_tube_weight !== ''
? formatWeightKg(fc.paper_tube_weight)
: null,
package_weight: fc.package_weight != null && fc.package_weight !== ''
? formatWeightKg(fc.package_weight)
: null,
};
}
export function normalizeItem(item) {
const weightRaw = item.in_weight != null ? item.in_weight : item.total_weight;
return {
id: item.id,
quote_order_no: item.quote_order_no || '',
product_code: item.product_code || '',
product_name: item.product_name || '',
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
dye_factory_color_code: item.dye_factory_color_code || '',
in_roll: formatRoll(item.in_roll),
in_weight: formatWeightKg(weightRaw),
item_fc_data: (item.item_fc_data || []).map(normalizeFineCode).filter(Boolean),
};
}
/**
* 明细分组:成品编号 → 成品色号 → 细码
*/
export function buildItemGroups(items) {
const productMap = new Map();
(items || []).forEach((item) => {
const productKey = item.product_code || '-';
if (!productMap.has(productKey)) {
productMap.set(productKey, {
group_key: `p:${productKey}`,
product_code: item.product_code || '',
product_name: item.product_name || '',
in_roll: 0,
in_weight: 0,
colors: new Map(),
});
}
const productGroup = productMap.get(productKey);
if (!productGroup.product_name && item.product_name) {
productGroup.product_name = item.product_name;
}
const colorKey = item.product_color_code || item.product_color_name || '-';
if (!productGroup.colors.has(colorKey)) {
productGroup.colors.set(colorKey, {
group_key: `p:${productKey}|c:${colorKey}`,
product_color_code: item.product_color_code || '',
product_color_name: item.product_color_name || '',
quote_order_no: item.quote_order_no || '',
dye_factory_dyelot_number: item.dye_factory_dyelot_number || '',
in_roll: 0,
in_weight: 0,
fine_codes: [],
});
}
const colorGroup = productGroup.colors.get(colorKey);
productGroup.in_roll = Number((productGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
productGroup.in_weight = Number((productGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
colorGroup.in_roll = Number((colorGroup.in_roll + Number(item.in_roll || 0)).toFixed(2));
colorGroup.in_weight = Number((colorGroup.in_weight + Number(item.in_weight || 0)).toFixed(2));
if (item.quote_order_no) colorGroup.quote_order_no = item.quote_order_no;
if (item.dye_factory_dyelot_number) {
colorGroup.dye_factory_dyelot_number = item.dye_factory_dyelot_number;
}
if (!colorGroup.product_color_name && item.product_color_name) {
colorGroup.product_color_name = item.product_color_name;
}
colorGroup.fine_codes.push(...(item.item_fc_data || []));
});
return Array.from(productMap.values()).map((product) => ({
group_key: product.group_key,
product_code: product.product_code,
product_name: product.product_name,
in_roll: product.in_roll,
in_weight: product.in_weight,
colors: Array.from(product.colors.values()),
}));
}
export function getEmptyScanDetail() {
return {
quote_order_no: '',
dyelot_number: '',
volume_number: '',
extern_volume_number: '',
product_code: '',
product_color_code: '',
order_roll: 0,
item_roll: 0,
order_weight: 0,
item_weight: 0,
};
}
/** 刚扫细码的数量(公斤存储值):优先细码 weight */
function pickScannedFineWeight(res) {
if (!res) return 0;
if (res.weight != null && res.weight !== '') return res.weight;
if (res.base_unit_weight != null && res.base_unit_weight !== '') return res.base_unit_weight;
if (res.settle_weight != null && res.settle_weight !== '') return res.settle_weight;
if (res.actually_weight != null && res.actually_weight !== '') return res.actually_weight;
return res.item_weight;
}
/** 从扫码接口返回构建详情区(匹数÷100,数量÷10000) */
export function buildScanDetailFromScanResponse(res) {
if (!res) return getEmptyScanDetail();
return {
quote_order_no: res.quote_order_no || '',
dyelot_number: res.dyelot_number || '',
volume_number: res.volume_number != null && res.volume_number !== '' ? String(res.volume_number) : '',
extern_volume_number: res.extern_volume_number != null && res.extern_volume_number !== ''
? String(res.extern_volume_number)
: '',
product_code: res.product_code || '',
product_color_code: res.product_color_code || '',
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
// 本行数量:刚扫这条细码的重量(weight),不是明细行合计
item_weight: formatWeightKg(pickScannedFineWeight(res)),
};
}
/** 校验纸筒/包装重量(扫码时提交) */
export function validateScanWeights(paperTubeWeight, packageWeight) {
if (paperTubeWeight === '' || paperTubeWeight == null) {
return '请输入纸筒重量';
}
if (Number.isNaN(Number(paperTubeWeight))) return '纸筒重量格式不正确';
if (packageWeight === '' || packageWeight == null) {
return '请输入包装重量';
}
if (Number.isNaN(Number(packageWeight))) return '包装重量格式不正确';
return '';
}
/** 构建扫码请求参数(纸筒/包装重量在扫码时提交,公斤值需 ×10000) */
export function buildScanUpdateParams({
id,
scanCode,
arrangeType,
warehouseBinId,
paperTubeWeight,
packageWeight,
}) {
const code = (scanCode || '').trim();
const params = {
id: Number(id),
arrange_type: arrangeType,
paper_tube_weight: toWeightStorage(paperTubeWeight),
package_weight: toWeightStorage(packageWeight),
};
if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId);
}
// 长度大于25走二维码,否则走条码
if (code.length > 25) {
params.qr_code = code;
} else {
params.bar_code = code;
}
return params;
}
export function buildStatusParam(id) {
return { id: String(id) };
}
export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
if (!value) return '';
const parsed = dayjs(value);
return parsed.isValid() ? parsed.format(format) : String(value).slice(0, 10);
}
export function canScanAtStatus(status) {
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
}
export function isLockedOrderStatus(status) {
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
}
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
const pickBatch = (res) => {
if (Array.isArray(res)) return res;
if (!res || typeof res !== 'object') return [];
return res.list || res.records || res.items || [];
};
const loadPage = (page, acc) => listFn({ ...params, page, size: pageSize })
.then((res) => {
const batch = pickBatch(res);
if (!batch.length) return acc;
// 一次返回超过 pageSize:后端忽略分页,视为全量,避免死循环翻页
if (batch.length > pageSize) return acc.concat(batch);
// 翻页后与首页首条相同:后端忽略 page,避免死循环
if (
page > 1
&& acc.length
&& batch[0]
&& acc[0]
&& String(batch[0].id) === String(acc[0].id)
) {
return acc;
}
const merged = acc.concat(batch);
const total = !Array.isArray(res) && res != null ? Number(res.total) : NaN;
if (!Number.isNaN(total) && merged.length >= total) return merged;
if (batch.length < pageSize) return merged;
return loadPage(page + 1, merged);
});
return loadPage(1, []);
}
export function getFormStatusActionButtons(headerSaved, orderId, status) {
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
return [
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
export function getViewStatusActionButtons(status) {
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
return [
{ label: '编辑', action: 'edit' },
{ label: '审核', action: 'approve' },
{ label: '作废', action: 'void' },
];
}
if (status === AUDIT_STATUS.APPROVED) {
return [{ label: '消审', action: 'unapprove' }];
}
return [];
}
export function orderToFormFields(order) {
return {
order_no: order.order_no,
biz_unit_id: order.biz_unit_id,
biz_unit_name: order.biz_unit_name,
warehouse_id: order.warehouse_id,
warehouse_name: order.warehouse_name,
sale_system_id: order.sale_system_id,
sale_system_name: order.sale_system_name,
sale_mode: order.sale_mode || '',
sale_mode_name: order.sale_mode_name || SALE_MODE_MAP[order.sale_mode] || '',
in_order_type: order.in_order_type || IN_ORDER_TYPE_PURCHASE,
in_order_type_name: order.in_order_type_name
|| IN_ORDER_TYPE_MAP[order.in_order_type]
|| IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PURCHASE],
paper_tube_weight: String(DEFAULT_PAPER_TUBE_WEIGHT),
package_weight: String(DEFAULT_PACKAGE_WEIGHT),
remark: order.remark,
item_data: order.item_data,
};
}
/** 从仓库下拉中选出默认成品仓 */
export function pickDefaultWarehouse(options, loginWarehouseId, loginWarehouseName) {
const list = options || [];
const byName = list.find((item) => item.label === DEFAULT_WAREHOUSE_NAME);
if (byName) return byName;
if (loginWarehouseId) {
const byId = list.find((item) => String(item.value) === String(loginWarehouseId));
if (byId) return byId;
if (loginWarehouseName) {
return { value: loginWarehouseId, label: loginWarehouseName };
}
}
return list[0] || null;
}
/**
* 确认并执行审核状态变更
*/
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
const cfg = STATUS_ACTION_CONFIG[action];
if (!cfg || !orderId) return;
const api = vm.$u.api.fpmPrcInOrder;
const requestFn = api[cfg.apiKey];
if (typeof requestFn !== 'function') return;
uni.showModal({
title: '提示',
content: cfg.msg,
success: (res) => {
if (!res.confirm) return;
uni.showLoading({ title: '处理中...' });
requestFn(buildStatusParam(orderId))
.then(() => {
if (typeof onSuccess === 'function') return onSuccess();
uni.hideLoading();
})
.catch((e) => {
uni.hideLoading();
if (vm.showError) vm.showError(e.message || '操作失败');
});
},
});
}

94
src/common/tts.js Normal file
View File

@ -0,0 +1,94 @@
/**
* Android PDA 语音播报(系统 TextToSpeech)
* App 端可用;非 App 环境静默跳过。
*/
let ttsInstance = null;
let ttsReady = false;
let ttsInitStarted = false;
const pendingQueue = [];
function flushPending() {
if (!ttsReady || !ttsInstance) return;
while (pendingQueue.length) {
const text = pendingQueue.shift();
doSpeak(text);
}
}
function doSpeak(text) {
if (!ttsInstance || !text) return;
try {
const TextToSpeech = plus.android.importClass('android.speech.tts.TextToSpeech');
// QUEUE_FLUSH:打断当前播报,立即播新内容
ttsInstance.speak(String(text), TextToSpeech.QUEUE_FLUSH, null);
} catch (e) {
console.warn('[tts] speak failed', e);
}
}
export function initTts() {
// #ifdef APP-PLUS
if (ttsInitStarted || typeof plus === 'undefined') return;
if (plus.os.name !== 'Android') return;
ttsInitStarted = true;
try {
const main = plus.android.runtimeMainActivity();
const TextToSpeech = plus.android.importClass('android.speech.tts.TextToSpeech');
const Locale = plus.android.importClass('java.util.Locale');
ttsInstance = new TextToSpeech(
main,
plus.android.implements('android.speech.tts.TextToSpeech$OnInitListener', {
onInit(status) {
if (status === TextToSpeech.SUCCESS) {
try {
ttsInstance.setLanguage(Locale.CHINA);
ttsInstance.setSpeechRate(1.0);
} catch (e) {
console.warn('[tts] setLanguage failed', e);
}
ttsReady = true;
flushPending();
} else {
console.warn('[tts] init status not SUCCESS', status);
ttsReady = false;
}
},
})
);
} catch (e) {
console.warn('[tts] init failed', e);
ttsInitStarted = false;
}
// #endif
}
/**
* 播报中文文本;TTS 未就绪时先入队,初始化成功后补播。
* @param {string} text
*/
export function speak(text) {
const content = (text || '').trim();
if (!content) return;
// #ifdef APP-PLUS
if (typeof plus === 'undefined' || plus.os.name !== 'Android') return;
if (!ttsInitStarted) initTts();
if (ttsReady && ttsInstance) {
doSpeak(content);
return;
}
pendingQueue.push(content);
// 避免异常堆积
if (pendingQueue.length > 5) pendingQueue.splice(0, pendingQueue.length - 5);
// #endif
}
export function stopSpeak() {
// #ifdef APP-PLUS
if (!ttsInstance) return;
try {
ttsInstance.stop();
} catch (e) {
/* ignore */
}
// #endif
}

155
src/common/userSession.js Normal file
View File

@ -0,0 +1,155 @@
/**
* 登录会话:token、用户信息、菜单/按钮权限
*/
import store from '@/store/index.js';
const TOKEN_KEY = 'RemoteTokenData';
const USER_TOKEN_KEY = 'userToken';
const INFORMATION_KEY = 'PdaUserInformation';
function commitVuex(name, value) {
store.commit('$uStore', { name, value });
}
function applyGlobalData(patch) {
try {
const app = getApp();
if (!app || !app.globalData) {
return;
}
Object.keys(patch).forEach((key) => {
app.globalData[key] = patch[key];
});
} catch (e) {
console.log('applyGlobalData error', e);
}
}
export function getLoginData() {
return uni.getStorageSync(TOKEN_KEY) || null;
}
export function getUserInformation() {
return uni.getStorageSync(INFORMATION_KEY) || null;
}
export function applyLoginData(loginData) {
if (!loginData) {
return;
}
uni.setStorageSync(TOKEN_KEY, loginData);
uni.setStorageSync(USER_TOKEN_KEY, { Token: loginData.token });
if (loginData.token) {
commitVuex('vuex_token', loginData.token);
}
applyGlobalData({
Token: loginData.token || '',
EmployeeID: loginData.employee_id != null ? loginData.employee_id : (loginData.user_id || 0),
LoginID: loginData.user_id || 0,
LoginName: loginData.user_name || '',
UserName: loginData.user_name || '',
PlanDepartmentID: loginData.default_sale_system_id || 0,
PlanDepartmentName: loginData.default_sale_system_name || '',
StoreNameID: loginData.default_physical_warehouse_id || 0,
StoreName: loginData.default_physical_warehouse_name || '',
IsSaleUserStatus: 0,
UserGroup: '',
StoreTypeNo: ''
});
}
export function applyUserInformation(info) {
if (!info) {
return;
}
uni.setStorageSync(INFORMATION_KEY, info);
const profile = {
userName: info.user_name || '',
user_id: info.user_id,
user_name: info.user_name || '',
avatar: info.avatar_url || '',
avatar_url: info.avatar_url || '',
employee_id: info.employee_id,
department_id: info.department_id,
department_name: info.department_name || '',
phone: info.phone || '',
default_sale_system_id: info.default_sale_system_id,
default_sale_system_name: info.default_sale_system_name || '',
default_customer_id: info.default_customer_id,
default_customer_name: info.default_customer_name || '',
role_id: info.role_id || []
};
commitVuex('vuex_user', profile);
applyGlobalData({
EmployeeID: info.employee_id != null ? info.employee_id : (info.user_id || 0),
LoginID: info.user_id || 0,
LoginName: info.user_name || '',
UserName: info.user_name || '',
PlanDepartmentID: info.default_sale_system_id || 0,
PlanDepartmentName: info.default_sale_system_name || ''
});
}
export function restoreUserSession() {
const loginData = getLoginData();
if (loginData && loginData.token) {
applyLoginData(loginData);
}
const info = getUserInformation();
if (info) {
applyUserInformation(info);
}
}
export function clearUserSession() {
uni.removeStorageSync(TOKEN_KEY);
uni.removeStorageSync(USER_TOKEN_KEY);
uni.removeStorageSync(INFORMATION_KEY);
uni.removeStorageSync('token');
commitVuex('vuex_token', '');
commitVuex('vuex_user', {});
applyGlobalData({
Token: '',
EmployeeID: 0,
LoginID: 0,
LoginName: '',
UserName: '',
PlanDepartmentID: 0,
PlanDepartmentName: '',
StoreNameID: 0,
StoreName: '',
IsSaleUserStatus: 0,
UserGroup: '',
StoreTypeNo: ''
});
}
export function hasResourceRouter(name) {
if (!name) {
return true;
}
const info = getUserInformation();
if (!info) {
return true;
}
const names = info.resource_router_names;
if (!Array.isArray(names)) {
return true;
}
return names.indexOf(name) !== -1;
}
export function hasButtonCode(code) {
if (!code) {
return true;
}
const info = getUserInformation();
if (!info) {
return true;
}
const codes = info.button_codes;
if (!Array.isArray(codes)) {
return true;
}
return codes.indexOf(code) !== -1;
}

View File

@ -0,0 +1,66 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.order_no }}</text>
<text class="statusTag" :class="'status-' + item.audit_status">{{ item.audit_status_name }}</text>
</view>
<view class="cardRow">
<view>出仓日期:</view>
<view>{{ formatTime(item.out_date) }}</view>
</view>
<view class="cardRow">
<view>出仓类型:</view>
<view>{{ item.bill_type_name }}</view>
</view>
<view class="cardRow">
<view>染厂:</view>
<view>{{ item.business_unit_name || '-' }}</view>
</view>
<view class="cardRow">
<view>创 建 人:</view>
<view>{{ item.create_user_name }} {{ formatTime(item.create_time, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="item.auditor_name" class="cardRow">
<view>审 核 人:</view>
<view>{{ item.auditor_name }} {{ formatTime(item.audit_date, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="!isDetail && !isSelect" class="lookDetail">
<text>查看详情</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
import { formatDisplayTime } from '@/common/storeFabricBusinessOut';
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isSelect: { type: Boolean, default: false },
isDetail: { type: Boolean, default: false },
},
methods: {
formatTime: formatDisplayTime,
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,50 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.grey_fabric_code || '-' }}</text>
<text class="stockTag">{{ item.stock_roll_display }} 匹</text>
</view>
<view class="cardRow">
<view>坯布名称:</view>
<view>{{ item.grey_fabric_name || '-' }}</view>
</view>
<view class="cardRow">
<view>仓  库:</view>
<view>{{ item.warehouse_name || item.receiver_name || '-' }}</view>
</view>
<view class="cardRow">
<view>库存数量:</view>
<view>{{ item.stock_weight_display }} KG{{ item.unit_label }}</view>
</view>
<view v-if="!isDetail" class="lookDetail">
<text>查看维度汇总</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isDetail: { type: Boolean, default: false },
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.stockTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
background: #e6f7ff;
color: #1890ff;
}
</style>

View File

@ -0,0 +1,62 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.gray_fabric_color_name || '未分色' }}</text>
<text class="stockTag">{{ item.stock_roll_display }} 匹</text>
</view>
<view class="cardRow">
<view>织  厂:</view>
<view>{{ item.supplier_name || '-' }}</view>
</view>
<view class="cardRow">
<view>机 台 号:</view>
<view>{{ item.machine_number || '-' }}</view>
</view>
<view class="cardRow">
<view>纱  批:</view>
<view>{{ item.yarn_batch || '-' }}</view>
</view>
<view class="cardRow">
<view>仓  库:</view>
<view>{{ item.warehouse_name || '-' }}</view>
</view>
<view class="cardRow">
<view>幅宽/克重:</view>
<view>{{ item.grey_fabric_width_and_unit_name || '-' }} / {{ item.grey_fabric_gram_weight_and_unit_name || '-' }}</view>
</view>
<view class="cardRow">
<view>库存数量:</view>
<view>{{ item.stock_weight_display }} KG{{ item.unit_label }}</view>
</view>
<view v-if="!isDetail" class="lookDetail">
<text>查看细码明细</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isDetail: { type: Boolean, default: false },
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.stockTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
background: #e6f7ff;
color: #1890ff;
}
</style>

View File

@ -0,0 +1,67 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.order_no }}</text>
<text class="statusTag" :class="'status-' + item.audit_status">{{ item.audit_status_name }}</text>
</view>
<view class="cardRow">
<view>加工单位:</view>
<view>{{ item.process_name || '-' }}</view>
</view>
<view class="cardRow">
<view>仓库名称:</view>
<view>{{ item.warehouse_name || '-' }}</view>
</view>
<view class="cardRow">
<view>匹数总计:</view>
<view>{{ item.total_roll != null ? item.total_roll : '-' }}</view>
</view>
<view class="cardRow">
<view>创 建 人:</view>
<view>{{ item.create_user_name }} {{ formatTime(item.create_time, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="item.auditor_name" class="cardRow">
<view>审 核 人:</view>
<view>{{ item.auditor_name }} {{ formatTime(item.audit_date, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="!isDetail && !isSelect" class="lookDetail">
<text>查看详情</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
import { formatDisplayTime } from '@/common/storeGoodsProcessIn';
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isSelect: { type: Boolean, default: false },
isDetail: { type: Boolean, default: false },
},
methods: {
formatTime: formatDisplayTime,
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,71 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.order_no }}</text>
<text class="statusTag" :class="'status-' + item.audit_status">{{ item.audit_status_name }}</text>
</view>
<view class="cardRow">
<view>出仓类型:</view>
<view>{{ item.out_order_type_name || '-' }}</view>
</view>
<view class="cardRow">
<view>加工单位:</view>
<view>{{ item.process_name || '-' }}</view>
</view>
<view class="cardRow">
<view>仓库名称:</view>
<view>{{ item.warehouse_name || '-' }}</view>
</view>
<view class="cardRow">
<view>匹数总计:</view>
<view>{{ item.total_roll != null ? item.total_roll : '-' }}</view>
</view>
<view class="cardRow">
<view>创 建 人:</view>
<view>{{ item.create_user_name }} {{ formatTime(item.create_time, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="item.auditor_name" class="cardRow">
<view>审 核 人:</view>
<view>{{ item.auditor_name }} {{ formatTime(item.audit_date, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="!isDetail && !isSelect" class="lookDetail">
<text>查看详情</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
import { formatDisplayTime } from '@/common/storeGoodsProcessOut';
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isSelect: { type: Boolean, default: false },
isDetail: { type: Boolean, default: false },
},
methods: {
formatTime: formatDisplayTime,
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,67 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.order_no }}</text>
<text class="statusTag" :class="'status-' + item.audit_status">{{ item.audit_status_name }}</text>
</view>
<view class="cardRow">
<view>加工单位:</view>
<view>{{ item.process_name || '-' }}</view>
</view>
<view class="cardRow">
<view>仓库名称:</view>
<view>{{ item.warehouse_name || '-' }}</view>
</view>
<view class="cardRow">
<view>匹数总计:</view>
<view>{{ item.total_roll != null ? item.total_roll : '-' }}</view>
</view>
<view class="cardRow">
<view>创 建 人:</view>
<view>{{ item.create_user_name }} {{ formatTime(item.create_time, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="item.auditor_name" class="cardRow">
<view>审 核 人:</view>
<view>{{ item.auditor_name }} {{ formatTime(item.audit_date, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="!isDetail && !isSelect" class="lookDetail">
<text>查看详情</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
import { formatDisplayTime } from '@/common/storeGoodsProcessReturnIn';
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isSelect: { type: Boolean, default: false },
isDetail: { type: Boolean, default: false },
},
methods: {
formatTime: formatDisplayTime,
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,67 @@
<template>
<view class="myCard">
<view class="cardTopName">
<text>{{ item.order_no }}</text>
<text class="statusTag" :class="'status-' + item.audit_status">{{ item.audit_status_name }}</text>
</view>
<view class="cardRow">
<view>供 应 商:</view>
<view>{{ item.biz_unit_name || '-' }}</view>
</view>
<view class="cardRow">
<view>仓库名称:</view>
<view>{{ item.warehouse_name || '-' }}</view>
</view>
<view class="cardRow">
<view>匹数总计:</view>
<view>{{ item.total_roll != null ? item.total_roll : '-' }}</view>
</view>
<view class="cardRow">
<view>创 建 人:</view>
<view>{{ item.create_user_name }} {{ formatTime(item.create_time, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="item.auditor_name" class="cardRow">
<view>审 核 人:</view>
<view>{{ item.auditor_name }} {{ formatTime(item.audit_date, 'YYYY-MM-DD') }}</view>
</view>
<view v-if="!isDetail && !isSelect" class="lookDetail">
<text>查看详情</text>
<u-icon name="arrow-right" size="36" />
</view>
</view>
</template>
<script>
import { formatDisplayTime } from '@/common/storeGoodsPurchaseIn';
export default {
props: {
item: { type: Object, default: () => ({}) },
index: { type: Number, default: 0 },
isSelect: { type: Boolean, default: false },
isDetail: { type: Boolean, default: false },
},
methods: {
formatTime: formatDisplayTime,
},
};
</script>
<style scoped>
.cardTopName {
display: flex;
align-items: center;
justify-content: space-between;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,73 @@
<template>
<u-popup v-model="visible" mode="center" width="680rpx" border-radius="14" :closeable="true">
<view class="popupWrap">
<view class="popupTitle">坯布资料</view>
<scroll-view scroll-y class="scrollBody">
<view class="infoRow" v-for="field in fields" :key="field.key">
<text class="label">{{ field.label }}</text>
<text class="value">{{ data[field.key] || '-' }}</text>
</view>
</scroll-view>
</view>
</u-popup>
</template>
<script>
import { FABRIC_INFO_FIELDS } from '@/common/storeFabricBusinessOut';
export default {
props: {
show: { type: Boolean, default: false },
data: { type: Object, default: () => ({}) },
},
computed: {
visible: {
get() { return this.show; },
set(val) { this.$emit('update:show', val); },
},
fields() {
return FABRIC_INFO_FIELDS;
},
},
};
</script>
<style scoped>
.popupWrap {
padding: 30rpx 30rpx 24rpx;
max-height: 80vh;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
.popupTitle {
font-size: 34rpx;
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
color: #333;
flex-shrink: 0;
}
.scrollBody {
flex: 1;
height: 62vh;
max-height: 62vh;
}
.infoRow {
display: flex;
padding: 16rpx 0;
border-bottom: 1rpx solid #f0f0f0;
font-size: 30rpx;
}
.label {
width: 180rpx;
color: #888;
flex-shrink: 0;
}
.value {
flex: 1;
color: #333;
word-break: break-all;
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<view>
<view class="fabric-out-sectionTitle">{{ title }}</view>
<slot name="before-list" />
<view class="fabric-out-detailList">
<view
v-for="row in list"
:key="row.group_key || row.id"
class="fabric-out-detailCard"
>
<view class="fabric-out-detailRow" @click="$emit('fabric-info', row)">
<text>{{ row.grey_fabric_code }}#{{ row.grey_fabric_name }}</text>
<u-icon name="arrow-right" size="32" color="#888" />
</view>
<view class="fabric-out-detailMeta">
<text>匹数:{{ row.roll }}</text>
<text>重量:{{ row.weight }}KG</text>
<u-button type="primary" size="mini" @click="$emit('fine-code', row)">细码</u-button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: { type: Array, default: () => [] },
title: { type: String, default: '出仓细码' },
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>

View File

@ -0,0 +1,27 @@
<template>
<view v-if="buttons.length" class="fabric-out-submitView">
<view v-for="btn in buttons" :key="btn.action" class="fabric-out-actionBtnWrap">
<u-button type="primary" :class="singleBtnClass" @click="$emit('action', btn.action)">
{{ btn.label }}
</u-button>
</view>
</view>
</template>
<script>
export default {
props: {
buttons: { type: Array, default: () => [] },
single: { type: Boolean, default: false },
},
computed: {
singleBtnClass() {
return this.single ? 'fabric-out-actionBtn' : '';
},
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>

View File

@ -0,0 +1,52 @@
<template>
<view>
<view v-if="canScan" class="flex-white-plr26 ptb20 bdb_f5 fabric-out-scanRow">
<text class="mr26">条码资料</text>
<input
type="text"
:value="value"
class="fabric-out-scanInput"
placeholder="扫描条码"
@input="$emit('input', $event.detail.value)"
@confirm="$emit('scan')"
/>
<u-icon
v-if="showPhoneScan"
class="fabric-out-phoneScanIcon"
name="scan"
size="44"
color="#2979ff"
@click="$emit('phone-scan')"
/>
<checkbox-group @change="$emit('delete-mode-change', $event)">
<label class="fabric-out-delCheck">
<checkbox :checked="deleteMode" />删除
</label>
</checkbox-group>
</view>
<view v-else class="fabric-out-scanTip">{{ disabledTip }}</view>
<view v-if="message" class="fabric-out-msgTip">{{ message }}</view>
</view>
</template>
<script>
export default {
props: {
canScan: { type: Boolean, default: false },
value: { type: String, default: '' },
deleteMode: { type: Boolean, default: false },
message: { type: String, default: '' },
disabledTip: { type: String, default: '当前状态不可扫码' },
showPhoneScan: { type: Boolean, default: false },
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
.fabric-out-phoneScanIcon {
margin-left: 16rpx;
flex-shrink: 0;
}
</style>

View File

@ -0,0 +1,161 @@
<template>
<view class="fabric-out-scanDetail">
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">已扫条数:{{ formatCount(detail.scanned_roll) }}条</text>
<text class="fabric-out-scanDetailCell">机台库存:{{ formatRoll(detail.machine_stock) }}条</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">合计条数:{{ formatRoll(detail.total_roll) }}条</text>
<text class="fabric-out-scanDetailCell">合计重量:{{ formatWeight(detail.total_weight) }}KG</text>
</view>
<view class="fabric-out-scanDetailRow">
<text class="fabric-out-scanDetailLabel">客户:</text>
<text class="fabric-out-scanDetailValue">{{ detail.customer_name || '' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('produce_order_no')">
<checkbox :checked="isGroupChecked('produce_order_no')" />
<text class="fabric-out-scanDetailLabel">生产通知单:</text>
<text class="fabric-out-scanDetailValue">{{ detail.produce_order_no || '' }}</text>
</view>
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_code')">
<checkbox :checked="isGroupChecked('grey_fabric_code')" />
<text class="fabric-out-scanDetailLabel">布编:</text>
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_code || '' }}</text>
</view>
</view>
<view class="fabric-out-scanDetailRow">
<text class="fabric-out-scanDetailLabel">布名:</text>
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_name || '' }}</text>
</view>
<view class="fabric-out-scanDetailRow">
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('yarn_batch')">
<checkbox :checked="isGroupChecked('yarn_batch')" />
<text class="fabric-out-scanDetailLabel">纱批:</text>
<text class="fabric-out-scanDetailValue">{{ detail.yarn_batch || '' }}</text>
</view>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('machine_number')">
<checkbox :checked="isGroupChecked('machine_number')" />
<text class="fabric-out-scanDetailLabel">机号:</text>
<text class="fabric-out-scanDetailValue">{{ detail.machine_number || '' }}</text>
</view>
<view class="fabric-out-scanDetailCell">
<text class="fabric-out-scanDetailLabel">布号:</text>
<text class="fabric-out-scanDetailValue">{{ detail.volume_number || '' }}</text>
</view>
</view>
<view class="fabric-out-scanDetailRow">
<text class="fabric-out-scanDetailLabel">外部卷号:</text>
<text class="fabric-out-scanDetailValue">{{ detail.extern_volume_number || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_level_name')">
<checkbox :checked="isGroupChecked('grey_fabric_level_name')" />
<text class="fabric-out-scanDetailLabel">等级:</text>
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_level_name || '' }}</text>
</view>
<view class="fabric-out-scanDetailCell">
<text class="fabric-out-scanDetailLabel">重量:</text>
<text class="fabric-out-scanDetailValue">{{ formatWeight(detail.weight) }}Kg</text>
</view>
</view>
<scroll-view scroll-x class="fabric-out-scanDetailTableScroll">
<view class="fabric-out-scanDetailTable" :style="{ width: tableWidth }">
<view class="fabric-out-scanDetailTableRow fabric-out-scanDetailTableHead">
<view
v-for="col in columns"
:key="col.key"
class="fabric-out-scanDetailTableCell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view v-if="!tableRows.length" class="fabric-out-scanDetailEmpty">暂无数据~~</view>
<view
v-for="(row, rowIndex) in tableRows"
:key="rowIndex"
class="fabric-out-scanDetailTableRow"
>
<view
v-for="col in columns"
:key="col.key"
class="fabric-out-scanDetailTableCell"
:style="cellStyle(col)"
>{{ formatCell(row, col.key) }}</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import {
SCAN_DETAIL_TABLE_COLUMNS,
SCAN_GROUP_OPTIONS,
getScanDetailTableWidth,
buildScanDetailTableRows,
} from '@/common/storeFabricBusinessOut';
const LOCKABLE_GROUP_KEYS = SCAN_GROUP_OPTIONS.map((item) => item.key);
export default {
props: {
detail: { type: Object, default: () => ({}) },
itemData: { type: Array, default: () => [] },
groupKeys: { type: Array, default: () => [] },
},
computed: {
columns() {
return SCAN_DETAIL_TABLE_COLUMNS;
},
tableWidth() {
return getScanDetailTableWidth(this.columns);
},
tableRows() {
return buildScanDetailTableRows(this.itemData, this.groupKeys);
},
},
methods: {
cellStyle(col) {
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
};
},
isGroupChecked(key) {
return (this.groupKeys || []).includes(key);
},
toggleGroup(key) {
if (!LOCKABLE_GROUP_KEYS.includes(key)) return;
const next = [...(this.groupKeys || [])];
const index = next.indexOf(key);
if (index >= 0) next.splice(index, 1);
else next.push(key);
this.$emit('group-change', next);
},
formatRoll(value) {
const n = Number(value || 0);
return Number.isInteger(n) ? n : Number(n.toFixed(2));
},
formatCount(value) {
return Number(value || 0);
},
formatWeight(value) {
const n = Number(value || 0);
return Number(n.toFixed(2));
},
formatCell(row, key) {
if (key === 'roll') return this.formatRoll(row.roll);
if (key === 'weight') return this.formatWeight(row.weight);
return row[key] || '';
},
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>

View File

@ -0,0 +1,160 @@
<template>
<u-popup v-model="visible" mode="center" width="94%" border-radius="14" :closeable="true">
<view class="popupWrap">
<view class="popupTitle">细码</view>
<view v-if="!list.length" class="emptyTip">暂无细码数据</view>
<scroll-view v-else scroll-x class="tableScroll">
<view class="fineTable" :style="{ width: tableWidth }">
<view class="tableRow tableHead">
<view
v-for="col in columns"
:key="col.key"
class="tableCell headCell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view v-for="(row, rowIndex) in tableRows" :key="rowIndex" class="tableRow">
<view
v-for="col in columns"
:key="col.key"
class="tableCell"
:class="{ actionCell: col.key === 'action' && !readonly }"
:style="cellStyle(col)"
@click="onCellTap(col.key, rowIndex)"
>{{ row[col.key] }}</view>
</view>
</view>
</scroll-view>
<view v-if="!readonly && list.length" class="tableTip">点击「操作」列删除,将调用扫码删除接口</view>
</view>
</u-popup>
</template>
<script>
import {
getFineCodeTableColumns,
getFineCodeTableWidth,
mapFineCodeTableRows,
} from '@/common/storeFabricBusinessOut';
export default {
props: {
show: { type: Boolean, default: false },
list: { type: Array, default: () => [] },
readonly: { type: Boolean, default: false },
},
computed: {
visible: {
get() { return this.show; },
set(val) { this.$emit('update:show', val); },
},
columns() {
return getFineCodeTableColumns(this.readonly);
},
tableRows() {
return mapFineCodeTableRows(this.list, this.readonly);
},
tableWidth() {
return getFineCodeTableWidth(this.columns);
},
tableScrollHeight() {
const rowHeight = 68;
const headerHeight = 68;
const total = headerHeight + this.list.length * rowHeight;
return `${Math.min(Math.max(total, 136), 520)}rpx`;
},
},
methods: {
cellStyle(col) {
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
};
},
onCellTap(key, rowIndex) {
if (this.readonly || key !== 'action') return;
const item = this.list[rowIndex];
if (item) this.$emit('delete', item);
},
},
};
</script>
<style scoped>
.popupWrap {
padding: 24rpx 16rpx 30rpx;
max-height: 80vh;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
.popupTitle {
font-size: 34rpx;
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
color: #333;
flex-shrink: 0;
}
.emptyTip {
text-align: center;
color: #999;
padding: 40rpx 0;
font-size: 30rpx;
}
.tableScroll {
width: 100%;
flex-shrink: 0;
}
.fineTable {
display: inline-block;
vertical-align: top;
border: 1rpx solid #e1e1e1;
box-sizing: border-box;
}
.tableRow {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
border-bottom: 1rpx solid #e1e1e1;
}
.tableRow:last-child {
border-bottom: none;
}
.tableHead {
background: #f1f1f1;
position: sticky;
top: 0;
z-index: 2;
}
.tableCell {
flex-shrink: 0;
padding: 16rpx 10rpx;
font-size: 28rpx;
color: #333;
text-align: center;
border-right: 1rpx solid #e1e1e1;
box-sizing: border-box;
word-break: break-all;
white-space: normal;
}
.tableCell:last-child {
border-right: none;
}
.headCell {
font-weight: bold;
color: #3e3e3e;
}
.actionCell {
color: #f5222d;
}
.tableTip {
margin-top: 16rpx;
font-size: 26rpx;
color: #999;
text-align: center;
flex-shrink: 0;
}
</style>

View File

@ -0,0 +1,49 @@
<template>
<view class="statusRow">
<text class="statusLabel">订单状态</text>
<text class="statusTag" :class="'status-' + status">{{ displayName }}</text>
</view>
</template>
<script>
import { AUDIT_STATUS_MAP, DRAFT_AUDIT_STATUS, DRAFT_AUDIT_STATUS_NAME } from '@/common/storeFabricBusinessOut';
export default {
props: {
status: { type: [Number, String], default: 0 },
name: { type: String, default: '' },
},
computed: {
displayName() {
if (Number(this.status) === DRAFT_AUDIT_STATUS) return DRAFT_AUDIT_STATUS_NAME;
return this.name || AUDIT_STATUS_MAP[Number(this.status)] || '-';
},
},
};
</script>
<style scoped>
.statusRow {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 26rpx;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
}
.statusLabel {
font-size: 28rpx;
color: #333;
}
.statusTag {
font-size: 24rpx;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-weight: normal;
}
.status-0 { background: #f0f0f0; color: #666; }
.status-1 { background: #fff7e6; color: #fa8c16; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #fff1f0; color: #f5222d; }
.status-4 { background: #f5f5f5; color: #999; }
</style>

View File

@ -0,0 +1,52 @@
<template>
<view class="warehouse-table-wrap">
<scroll-view scroll-x class="tableScrollX">
<wyb-table
ref="table"
:headers="headers"
:contents="contents"
:width="tableWidth"
:height="height"
:first-line-fixed="firstLineFixed"
@onCellClick="onCellClick"
/>
</scroll-view>
</view>
</template>
<script>
import wybTable from '@/components/wyb-table/wyb-table.vue';
export default {
components: { wybTable },
props: {
headers: { type: Array, default: () => [] },
contents: { type: Array, default: () => [] },
height: { type: String, default: 'auto' },
firstLineFixed: { type: Boolean, default: true },
},
computed: {
tableWidth() {
const total = (this.headers || []).reduce((sum, col) => sum + (col.width || 160), 0);
return `${total}rpx`;
},
},
methods: {
onCellClick(event) {
if (event && event.lineData) {
this.$emit('row-click', event.lineData, event);
}
},
},
};
</script>
<style scoped>
.warehouse-table-wrap {
width: 100%;
background: #fff;
}
.tableScrollX {
width: 100%;
}
</style>

View File

@ -0,0 +1,71 @@
<template>
<view>
<view v-if="canScan" class="flex-white-plr26 ptb20 bdb_f5 fabric-out-scanRow process-in-binRow">
<text class="mr26 process-in-binLabel">仓位<text class="redXingh">*</text></text>
<input
type="text"
:value="code"
class="fabric-out-scanInput"
placeholder="请先扫描仓位"
@input="$emit('code-input', $event.detail.value)"
@confirm="$emit('confirm')"
/>
<text v-if="name" class="process-in-binName">{{ name }}</text>
<u-icon
v-if="showPhoneScan"
class="fabric-out-phoneScanIcon"
name="scan"
size="44"
color="#2979ff"
@click="$emit('phone-scan')"
/>
<text v-if="binId" class="process-in-binClear" @click="$emit('clear')">更换</text>
</view>
<view v-else-if="showDisabledTip" class="fabric-out-scanTip">{{ disabledTip }}</view>
<view v-if="canScan && !binId" class="fabric-out-scanTip">请先扫描仓位,再扫描布匹二维码</view>
</view>
</template>
<script>
export default {
props: {
canScan: { type: Boolean, default: false },
binId: { type: [Number, String], default: 0 },
code: { type: String, default: '' },
name: { type: String, default: '' },
showPhoneScan: { type: Boolean, default: false },
showDisabledTip: { type: Boolean, default: true },
disabledTip: { type: String, default: '请先提交保存后再扫仓位' },
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
.process-in-binRow {
background: #fff;
}
.process-in-binLabel {
flex-shrink: 0;
}
.fabric-out-phoneScanIcon {
margin-left: 16rpx;
flex-shrink: 0;
}
.process-in-binName {
margin-left: 12rpx;
font-size: 28rpx;
color: #333;
max-width: 200rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.process-in-binClear {
margin-left: 16rpx;
font-size: 28rpx;
color: #2979ff;
flex-shrink: 0;
}
</style>

View File

@ -0,0 +1,261 @@
<template>
<view>
<view class="fabric-out-sectionTitle">{{ title }}</view>
<slot name="before-list" />
<view class="fabric-out-detailList">
<dataNull
v-if="!groups.length"
src="/src/static/img/chahua/gjNull.png"
title="暂无进仓明细"
title1="扫码后将在此展示"
/>
<view
v-for="product in groups"
:key="product.group_key"
class="fabric-out-detailCard process-in-productCard"
>
<view class="process-in-productHead">
<text class="process-in-productTitle">
{{ product.product_code || '-' }}<text v-if="product.product_name" class="process-in-subText">{{ ' ' + product.product_name }}</text>
</text>
<text class="process-in-productSum">
匹数 {{ product.in_roll }} / 数量 {{ product.in_weight }}
</text>
</view>
<view
v-for="color in product.colors"
:key="color.group_key"
class="process-in-colorBlock"
>
<view class="process-in-colorHead">
<text class="process-in-colorTitle">
色号 {{ color.product_color_code || '-' }}<text v-if="color.product_color_name" class="process-in-subText">{{ ' ' + color.product_color_name }}</text>
</text>
<text class="process-in-colorSum">
匹数 {{ color.in_roll }} / 数量 {{ color.in_weight }}
</text>
</view>
<view class="process-in-colorMeta">
<text>染整单:{{ color.quote_order_no || '-' }}</text>
<text>缸号:{{ color.dye_factory_dyelot_number || '-' }}</text>
</view>
<view class="process-in-fcTitle">细码({{ color.fine_codes.length }})</view>
<view v-if="!color.fine_codes.length" class="process-in-fcEmpty">暂无细码</view>
<scroll-view v-else scroll-x class="process-in-fcScroll">
<view class="process-in-fcTable" :style="{ width: fineTableWidth }">
<view class="process-in-fcRow process-in-fcHead">
<view
v-for="col in fineColumns"
:key="col.key"
class="process-in-fcCell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view
v-for="(fc, fcIndex) in color.fine_codes"
:key="fc.id || fcIndex"
class="process-in-fcRow"
>
<view
v-for="col in fineColumns"
:key="col.key"
class="process-in-fcCell"
:class="{ 'process-in-fcAction': col.key === 'action' }"
:style="cellStyle(col)"
@click="onCellTap(col.key, fc)"
>{{ formatFineCell(fc, col.key) }}</view>
</view>
</view>
</scroll-view>
<view v-if="deletable && color.fine_codes.length" class="process-in-fcTip">
勾选上方「删除」后扫码,或点击「删除」列移除细码
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { buildItemGroups } from '@/common/storeGoodsProcessIn';
const FINE_COLUMNS = [
{ label: '卷号', key: 'volume_number', width: 110 },
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
{ label: '匹数', key: 'roll', width: 100 },
{ label: '数量', key: 'weight', width: 130 },
{ label: '仓位', key: 'warehouse_bin_name', width: 140 },
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 160 },
];
const TARE_COLUMNS = [
{ label: '纸筒重量', key: 'paper_tube_weight', width: 140 },
{ label: '包装重量', key: 'package_weight', width: 140 },
];
export default {
props: {
list: { type: Array, default: () => [] },
title: { type: String, default: '进仓明细' },
deletable: { type: Boolean, default: false },
/** 加工/采购进仓:细码行展示扫码时提交的纸筒、包装重量 */
showTareColumns: { type: Boolean, default: false },
},
computed: {
groups() {
return buildItemGroups(this.list);
},
fineColumns() {
const cols = [...FINE_COLUMNS];
if (this.showTareColumns) {
const idx = cols.findIndex((col) => col.key === 'weight');
cols.splice(idx + 1, 0, ...TARE_COLUMNS);
}
if (this.deletable) {
cols.push({ label: '操作', key: 'action', width: 100 });
}
return cols;
},
fineTableWidth() {
const total = this.fineColumns.reduce((sum, col) => sum + (col.width || 100), 0);
return `${total}rpx`;
},
},
methods: {
cellStyle(col) {
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
};
},
formatFineCell(fc, key) {
if (key === 'action') return '删除';
const val = fc[key];
if (val === 0) return '0';
return val != null && val !== '' ? val : '-';
},
onCellTap(key, fc) {
if (!this.deletable || key !== 'action') return;
this.$emit('delete', fc);
},
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
.process-in-productCard {
padding: 0;
overflow: hidden;
}
.process-in-productHead {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
background: #f0f7ff;
border-bottom: 1rpx solid #e6f0ff;
}
.process-in-productTitle {
font-size: 32rpx;
font-weight: bold;
color: #1a1a1a;
flex: 1;
padding-right: 16rpx;
}
.process-in-productSum,
.process-in-colorSum {
font-size: 28rpx;
color: #666;
flex-shrink: 0;
}
.process-in-subText {
font-weight: normal;
color: #666;
font-size: 28rpx;
}
.process-in-colorBlock {
padding: 16rpx 20rpx 20rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.process-in-colorBlock:last-child {
border-bottom: none;
}
.process-in-colorHead {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
}
.process-in-colorTitle {
font-size: 30rpx;
font-weight: bold;
color: #333;
flex: 1;
padding-right: 12rpx;
}
.process-in-colorMeta {
display: flex;
flex-wrap: wrap;
gap: 16rpx 24rpx;
font-size: 28rpx;
color: #888;
margin-bottom: 12rpx;
}
.process-in-fcTitle {
font-size: 28rpx;
color: #2979ff;
margin-bottom: 8rpx;
}
.process-in-fcEmpty {
font-size: 28rpx;
color: #bbb;
padding: 8rpx 0;
}
.process-in-fcScroll {
width: 100%;
}
.process-in-fcTable {
border: 1rpx solid #eee;
border-radius: 8rpx;
overflow: hidden;
}
.process-in-fcRow {
display: flex;
align-items: stretch;
border-bottom: 1rpx solid #f0f0f0;
}
.process-in-fcRow:last-child {
border-bottom: none;
}
.process-in-fcHead {
background: #fafafa;
}
.process-in-fcCell {
box-sizing: border-box;
padding: 14rpx 10rpx;
font-size: 28rpx;
color: #333;
border-right: 1rpx solid #f0f0f0;
word-break: break-all;
}
.process-in-fcHead .process-in-fcCell {
font-weight: bold;
color: #666;
}
.process-in-fcCell:last-child {
border-right: none;
}
.process-in-fcAction {
color: #f5222d;
}
.process-in-fcTip {
margin-top: 8rpx;
font-size: 26rpx;
color: #999;
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<view class="fabric-out-scanDetail">
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">染整单号:{{ detail.quote_order_no || '-' }}</text>
<text class="fabric-out-scanDetailCell">缸号:{{ detail.dyelot_number || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">卷号:{{ detail.volume_number || '-' }}</text>
<text class="fabric-out-scanDetailCell">外部卷号:{{ detail.extern_volume_number || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">成品编号:{{ detail.product_code || '-' }}</text>
<text class="fabric-out-scanDetailCell">成品色号:{{ detail.product_color_code || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">本行数量:{{ detail.item_weight != null ? detail.item_weight : '-' }}</text>
<text class="fabric-out-scanDetailCell">本单匹数:{{ detail.order_roll != null ? detail.order_roll : '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow">
<text class="fabric-out-scanDetailLabel">本单数量:</text>
<text class="fabric-out-scanDetailValue">{{ detail.order_weight != null ? detail.order_weight : '-' }}</text>
</view>
</view>
</template>
<script>
export default {
props: {
detail: { type: Object, default: () => ({}) },
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>

View File

@ -0,0 +1,248 @@
<template>
<view>
<view class="fabric-out-sectionTitle">{{ title }}</view>
<slot name="before-list" />
<view class="fabric-out-detailList">
<dataNull
v-if="!groups.length"
src="/src/static/img/chahua/gjNull.png"
title="暂无出仓明细"
title1="扫码后将在此展示"
/>
<view
v-for="product in groups"
:key="product.group_key"
class="fabric-out-detailCard process-in-productCard"
>
<view class="process-in-productHead">
<text class="process-in-productTitle">
{{ product.product_code || '-' }}<text v-if="product.product_name" class="process-in-subText">{{ ' ' + product.product_name }}</text>
</text>
<text class="process-in-productSum">
匹数 {{ product.out_roll }} / 数量 {{ product.out_weight }}
</text>
</view>
<view
v-for="color in product.colors"
:key="color.group_key"
class="process-in-colorBlock"
>
<view class="process-in-colorHead">
<text class="process-in-colorTitle">
色号 {{ color.product_color_code || '-' }}<text v-if="color.product_color_name" class="process-in-subText">{{ ' ' + color.product_color_name }}</text>
</text>
<text class="process-in-colorSum">
匹数 {{ color.out_roll }} / 数量 {{ color.out_weight }}
</text>
</view>
<view class="process-in-colorMeta">
<text>染整单:{{ color.quote_order_no || '-' }}</text>
<text>缸号:{{ color.dye_factory_dyelot_number || '-' }}</text>
</view>
<view class="process-in-fcTitle">细码({{ color.fine_codes.length }})</view>
<view v-if="!color.fine_codes.length" class="process-in-fcEmpty">暂无细码</view>
<scroll-view v-else scroll-x class="process-in-fcScroll">
<view class="process-in-fcTable" :style="{ width: fineTableWidth }">
<view class="process-in-fcRow process-in-fcHead">
<view
v-for="col in fineColumns"
:key="col.key"
class="process-in-fcCell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view
v-for="(fc, fcIndex) in color.fine_codes"
:key="fc.id || fcIndex"
class="process-in-fcRow"
>
<view
v-for="col in fineColumns"
:key="col.key"
class="process-in-fcCell"
:class="{ 'process-in-fcAction': col.key === 'action' }"
:style="cellStyle(col)"
@click="onCellTap(col.key, fc)"
>{{ formatFineCell(fc, col.key) }}</view>
</view>
</view>
</scroll-view>
<view v-if="deletable && color.fine_codes.length" class="process-in-fcTip">
勾选上方「删除」后扫码,或点击「删除」列移除细码
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { buildItemGroups } from '@/common/storeGoodsProcessOut';
const FINE_COLUMNS = [
{ label: '卷号', key: 'volume_number', width: 110 },
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
{ label: '匹数', key: 'roll', width: 100 },
{ label: '数量', key: 'weight', width: 130 },
{ label: '条码', key: 'bar_code', width: 260 },
{ label: '仓位', key: 'warehouse_bin_name', width: 140 },
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 160 },
];
export default {
props: {
list: { type: Array, default: () => [] },
title: { type: String, default: '出仓明细' },
deletable: { type: Boolean, default: false },
},
computed: {
groups() {
return buildItemGroups(this.list);
},
fineColumns() {
if (!this.deletable) return FINE_COLUMNS;
return [...FINE_COLUMNS, { label: '操作', key: 'action', width: 100 }];
},
fineTableWidth() {
const total = this.fineColumns.reduce((sum, col) => sum + (col.width || 100), 0);
return `${total}rpx`;
},
},
methods: {
cellStyle(col) {
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
};
},
formatFineCell(fc, key) {
if (key === 'action') return '删除';
const val = fc[key];
if (val === 0) return '0';
return val != null && val !== '' ? val : '-';
},
onCellTap(key, fc) {
if (!this.deletable || key !== 'action') return;
this.$emit('delete', fc);
},
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
.process-in-productCard {
padding: 0;
overflow: hidden;
}
.process-in-productHead {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
background: #f0f7ff;
border-bottom: 1rpx solid #e6f0ff;
}
.process-in-productTitle {
font-size: 32rpx;
font-weight: bold;
color: #1a1a1a;
flex: 1;
padding-right: 16rpx;
}
.process-in-productSum,
.process-in-colorSum {
font-size: 28rpx;
color: #666;
flex-shrink: 0;
}
.process-in-subText {
font-weight: normal;
color: #666;
font-size: 28rpx;
}
.process-in-colorBlock {
padding: 16rpx 20rpx 20rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.process-in-colorBlock:last-child {
border-bottom: none;
}
.process-in-colorHead {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
}
.process-in-colorTitle {
font-size: 30rpx;
font-weight: bold;
color: #333;
flex: 1;
padding-right: 12rpx;
}
.process-in-colorMeta {
display: flex;
flex-wrap: wrap;
gap: 16rpx 24rpx;
font-size: 28rpx;
color: #888;
margin-bottom: 12rpx;
}
.process-in-fcTitle {
font-size: 28rpx;
color: #2979ff;
margin-bottom: 8rpx;
}
.process-in-fcEmpty {
font-size: 28rpx;
color: #bbb;
padding: 8rpx 0;
}
.process-in-fcScroll {
width: 100%;
}
.process-in-fcTable {
border: 1rpx solid #eee;
border-radius: 8rpx;
overflow: hidden;
}
.process-in-fcRow {
display: flex;
align-items: stretch;
border-bottom: 1rpx solid #f0f0f0;
}
.process-in-fcRow:last-child {
border-bottom: none;
}
.process-in-fcHead {
background: #fafafa;
}
.process-in-fcCell {
box-sizing: border-box;
padding: 14rpx 10rpx;
font-size: 28rpx;
color: #333;
border-right: 1rpx solid #f0f0f0;
word-break: break-all;
}
.process-in-fcHead .process-in-fcCell {
font-weight: bold;
color: #666;
}
.process-in-fcCell:last-child {
border-right: none;
}
.process-in-fcAction {
color: #f5222d;
}
.process-in-fcTip {
margin-top: 8rpx;
font-size: 26rpx;
color: #999;
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<view class="fabric-out-scanDetail">
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">染整单号:{{ detail.quote_order_no || '-' }}</text>
<text class="fabric-out-scanDetailCell">缸号:{{ detail.dyelot_number || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">卷号:{{ detail.volume_number || '-' }}</text>
<text class="fabric-out-scanDetailCell">外部卷号:{{ detail.extern_volume_number || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">成品编号:{{ detail.product_code || '-' }}</text>
<text class="fabric-out-scanDetailCell">成品色号:{{ detail.product_color_code || '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">本行匹数:{{ detail.item_roll != null ? detail.item_roll : '-' }}</text>
<text class="fabric-out-scanDetailCell">本行数量:{{ detail.item_weight != null ? detail.item_weight : '-' }}</text>
</view>
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
<text class="fabric-out-scanDetailCell">本单匹数:{{ detail.order_roll != null ? detail.order_roll : '-' }}</text>
<text class="fabric-out-scanDetailCell">本单数量:{{ detail.order_weight != null ? detail.order_weight : '-' }}</text>
</view>
</view>
</template>
<script>
export default {
props: {
detail: { type: Object, default: () => ({}) },
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>

View File

@ -0,0 +1,247 @@
<template>
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
{{tips.text}}
</view>
<view class="u-action-sheet-search" v-if="showSearch" @tap.stop>
<u-icon name="search" size="32" color="#909399"></u-icon>
<input
class="u-action-sheet-search__input"
:value="keyword"
:placeholder="searchPlaceholder"
confirm-type="search"
:adjust-position="true"
@input="onSearchInput"
/>
<u-icon
v-if="keyword"
name="close-circle-fill"
size="28"
color="#c0c4cc"
@tap.stop="clearSearch"
></u-icon>
</view>
<scroll-view scroll-y class="u-action-sheet-scroll">
<view
v-for="(item, index) in displayList"
:key="item._originIndex"
@touchmove.stop.prevent
@tap="itemClick(item._originIndex)"
:style="[itemStyle(item._originIndex)]"
class="u-action-sheet-item u-line-1"
:class="[index < displayList.length - 1 ? 'u-border-bottom' : '']"
:hover-stay-time="150"
>
<text>{{item.text}}</text>
<text class="u-action-sheet-item__subtext u-line-1" v-if="item.subText">{{item.subText}}</text>
</view>
<view v-if="!displayList.length" class="u-action-sheet-empty">无匹配选项</view>
</scroll-view>
<view class="u-gab" v-if="cancelBtn">
</view>
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
</u-popup>
</template>
<script>
/**
* actionSheet 操作菜单(本地覆盖:选项支持搜索)
* @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。
* @tutorial https://www.uviewui.com/components/actionSheet.html
* @property {Array<Object>} list 按钮的文字数组,见官方文档示例
* @property {Boolean} show-search 是否显示搜索框(默认true)
* @property {String} search-placeholder 搜索框占位文字
* @event {Function} click 点击ActionSheet列表项时触发,返回原始列表下标
* @example <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
*/
export default {
name: "u-action-sheet",
props: {
maskCloseAble: {
type: Boolean,
default: true
},
list: {
type: Array,
default () {
return [];
}
},
tips: {
type: Object,
default () {
return {
text: '',
color: '',
fontSize: '26'
}
}
},
cancelBtn: {
type: Boolean,
default: true
},
safeAreaInsetBottom: {
type: Boolean,
default: false
},
value: {
type: Boolean,
default: false
},
borderRadius: {
type: [String, Number],
default: 0
},
zIndex: {
type: [String, Number],
default: 0
},
cancelText: {
type: String,
default: '取消'
},
showSearch: {
type: Boolean,
default: true
},
searchPlaceholder: {
type: String,
default: '搜索'
}
},
data() {
return {
keyword: ''
};
},
watch: {
value(val) {
if (val) this.keyword = '';
}
},
computed: {
tipsStyle() {
let style = {};
if (this.tips.color) style.color = this.tips.color;
if (this.tips.fontSize) style.fontSize = this.tips.fontSize + 'rpx';
return style;
},
itemStyle() {
return (index) => {
let style = {};
const item = this.list[index];
if (!item) return style;
if (item.color) style.color = item.color;
if (item.fontSize) style.fontSize = item.fontSize + 'rpx';
if (item.disabled) style.color = '#c0c4cc';
return style;
}
},
uZIndex() {
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
},
displayList() {
const keyword = (this.keyword || '').trim().toLowerCase();
return (this.list || []).reduce((arr, item, index) => {
const text = String((item && item.text) || '');
const subText = String((item && item.subText) || '');
if (!keyword || text.toLowerCase().indexOf(keyword) !== -1 || subText.toLowerCase().indexOf(keyword) !== -1) {
arr.push(Object.assign({}, item, { _originIndex: index }));
}
return arr;
}, []);
}
},
methods: {
onSearchInput(e) {
this.keyword = e && e.detail && e.detail.value != null ? e.detail.value : '';
},
clearSearch() {
this.keyword = '';
},
close() {
this.popupClose();
this.$emit('close');
},
popupClose() {
this.keyword = '';
this.$emit('input', false);
},
itemClick(index) {
if(this.list[index] && this.list[index].disabled) return;
this.$emit('click', index);
this.$emit('input', false);
}
}
}
</script>
<style lang="scss" scoped>
@import "~uview-ui/libs/css/style.components.scss";
.u-tips {
font-size: 26rpx;
text-align: center;
padding: 34rpx 0;
line-height: 1;
color: $u-tips-color;
}
.u-action-sheet-search {
@include vue-flex;
align-items: center;
margin: 16rpx 24rpx;
padding: 0 24rpx;
height: 80rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
box-sizing: border-box;
&__input {
flex: 1;
height: 80rpx;
margin-left: 12rpx;
font-size: 30rpx;
color: #303133;
}
}
.u-action-sheet-scroll {
max-height: 600rpx;
}
.u-action-sheet-empty {
text-align: center;
padding: 60rpx 0;
font-size: 30rpx;
color: #909399;
}
.u-action-sheet-item {
@include vue-flex;
line-height: 1;
justify-content: center;
align-items: center;
font-size: 32rpx;
padding: 34rpx 0;
flex-direction: column;
}
.u-action-sheet-item__subtext {
font-size: 24rpx;
color: $u-tips-color;
margin-top: 20rpx;
}
.u-gab {
height: 12rpx;
background-color: rgb(234, 234, 236);
}
.u-actionsheet-cancel {
color: $u-main-color;
}
</style>

View File

@ -0,0 +1,186 @@
<template>
<view class="u-dropdown-item" v-if="active" @touchmove.stop.prevent="() => {}" @tap.stop.prevent="() => {}">
<block v-if="!$slots.default && !$slots.$default">
<view class="u-dropdown-item__search" v-if="showSearch" @tap.stop>
<u-icon name="search" size="28" color="#909399"></u-icon>
<input
class="u-dropdown-item__search__input"
:value="keyword"
:placeholder="searchPlaceholder"
confirm-type="search"
:adjust-position="true"
@input="onSearchInput"
/>
<u-icon
v-if="keyword"
name="close-circle-fill"
size="28"
color="#c0c4cc"
@tap.stop="clearSearch"
></u-icon>
</view>
<scroll-view scroll-y="true" :style="{
height: $u.addUnit(height)
}">
<view class="u-dropdown-item__options">
<u-cell-group>
<u-cell-item @click="cellClick(item.value)" :arrow="false" :title="item.label" v-for="(item, index) in filteredOptions"
:key="index" :title-style="{
color: value == item.value ? activeColor : inactiveColor
}">
<u-icon v-if="value == item.value" name="checkbox-mark" :color="activeColor" size="32"></u-icon>
</u-cell-item>
</u-cell-group>
<view v-if="!filteredOptions.length" class="u-dropdown-item__empty">无匹配选项</view>
</view>
</scroll-view>
</block>
<slot v-else />
</view>
</template>
<script>
/**
* dropdown-item 下拉菜单(本地覆盖:选项支持搜索)
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
* @tutorial http://uviewui.com/components/dropdown.html
* @property {String | Number} v-model 双向绑定选项卡选择值
* @property {String} title 菜单项标题
* @property {Array[Object]} options 选项数据,如果传入了默认slot,此参数无效
* @property {Boolean} show-search 是否显示搜索框(默认true)
* @property {String} search-placeholder 搜索框占位文字
* @example <u-dropdown-item title="标题"></u-dropdown-item>
*/
export default {
name: 'u-dropdown-item',
props: {
value: {
type: [Number, String, Array],
default: ''
},
title: {
type: [String, Number],
default: ''
},
options: {
type: Array,
default () {
return []
}
},
disabled: {
type: Boolean,
default: false
},
height: {
type: [Number, String],
default: 'auto'
},
showSearch: {
type: Boolean,
default: true
},
searchPlaceholder: {
type: String,
default: '搜索'
}
},
data() {
return {
active: false,
activeColor: '#2979ff',
inactiveColor: '#606266',
keyword: ''
}
},
computed: {
propsChange() {
return `${this.title}-${this.disabled}`;
},
filteredOptions() {
const keyword = (this.keyword || '').trim().toLowerCase();
const list = this.options || [];
if (!keyword) return list;
return list.filter(item => {
const label = String(item && item.label != null ? item.label : '');
const value = String(item && item.value != null ? item.value : '');
return label.toLowerCase().indexOf(keyword) !== -1 || value.toLowerCase().indexOf(keyword) !== -1;
});
}
},
watch: {
propsChange() {
if (this.parent) this.parent.init();
},
active(val) {
if (!val) this.keyword = '';
}
},
created() {
this.parent = false;
},
methods: {
onSearchInput(e) {
this.keyword = e && e.detail && e.detail.value != null ? e.detail.value : '';
},
clearSearch() {
this.keyword = '';
},
init() {
let parent = this.$u.$parent.call(this, 'u-dropdown');
if (parent) {
this.parent = parent;
this.activeColor = parent.activeColor;
this.inactiveColor = parent.inactiveColor;
let exist = parent.children.find(val => {
return this === val;
})
if (!exist) parent.children.push(this);
if (parent.children.length == 1) this.active = true;
parent.menuList.push({
title: this.title,
disabled: this.disabled
});
}
},
cellClick(value) {
this.$emit('input', value);
this.parent.close();
this.$emit('change', value);
}
},
mounted() {
this.init();
}
}
</script>
<style scoped lang="scss">
@import "~uview-ui/libs/css/style.components.scss";
.u-dropdown-item__search {
@include vue-flex;
align-items: center;
margin: 16rpx 24rpx 0;
padding: 0 24rpx;
height: 72rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
box-sizing: border-box;
&__input {
flex: 1;
height: 72rpx;
margin-left: 12rpx;
font-size: 28rpx;
color: #303133;
}
}
.u-dropdown-item__empty {
text-align: center;
padding: 40rpx 0;
font-size: 28rpx;
color: #909399;
}
</style>

View File

@ -0,0 +1,538 @@
<template>
<view class="u-select">
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<view class="u-select">
<view class="u-select__header" @touchmove.stop.prevent="">
<view
class="u-select__header__cancel u-select__header__btn"
:style="{ color: cancelColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@tap="getResult('cancel')"
>
{{cancelText}}
</view>
<view class="u-select__header__title">
{{title}}
</view>
<view
class="u-select__header__confirm u-select__header__btn"
:style="{ color: moving ? cancelColor : confirmColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@touchmove.stop=""
@tap.stop="getResult('confirm')"
>
{{confirmText}}
</view>
</view>
<view class="u-select__search" v-if="showSearch" @tap.stop>
<u-icon name="search" size="32" color="#909399"></u-icon>
<input
class="u-select__search__input"
:value="keyword"
:placeholder="searchPlaceholder"
confirm-type="search"
:adjust-position="true"
@input="onSearchInput"
@confirm="onSearchConfirm"
/>
<u-icon
v-if="keyword"
name="close-circle-fill"
size="28"
color="#c0c4cc"
@tap.stop="clearSearch"
></u-icon>
</view>
<view v-if="loading" class="u-select__loading">搜索中...</view>
<view class="u-select__body">
<view v-if="isColumnEmpty && !loading" class="u-select__empty">无匹配选项</view>
<picker-view
v-else-if="value && !isColumnEmpty"
:key="pickerKey"
@change="columnChange"
class="u-select__body__picker-view"
:value="defaultSelector"
@pickstart="pickstart"
@pickend="pickend"
>
<picker-view-column v-for="(item, index) in columnData" :key="'col-' + pickerKey + '-' + index">
<view class="u-select__body__picker-view__item" v-for="(item1, index1) in item" :key="item1[valueName] != null ? item1[valueName] : index1">
<view class="u-line-1">{{ item1[labelName] }}</view>
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
/**
* select 列选择器(本地覆盖:选项支持搜索)
* @description 此选择器用于单列,多列,多列联动的选择场景。
* @tutorial http://uviewui.com/components/select.html
* @property {String} mode 模式选择,"single-column"-单列模式,"mutil-column"-多列模式,"mutil-column-auto"-多列联动模式
* @property {Array} list 列数据,数组形式,见官网说明
* @property {Boolean} v-model 布尔值变量,用于控制选择器的弹出与收起
* @property {Boolean} show-search 是否显示搜索框(默认true)
* @property {String} search-placeholder 搜索框占位文字
* @event {Function} confirm 点击确定按钮,返回当前选择的值
* @example <u-select v-model="show" :list="list"></u-select>
*/
export default {
props: {
list: {
type: Array,
default() {
return [];
}
},
border: {
type: Boolean,
default: true
},
value: {
type: Boolean,
default: false
},
cancelColor: {
type: String,
default: '#606266'
},
confirmColor: {
type: String,
default: '#2979ff'
},
zIndex: {
type: [String, Number],
default: 0
},
safeAreaInsetBottom: {
type: Boolean,
default: false
},
maskCloseAble: {
type: Boolean,
default: true
},
defaultValue: {
type: Array,
default() {
return [0];
}
},
mode: {
type: String,
default: 'single-column'
},
valueName: {
type: String,
default: 'value'
},
labelName: {
type: String,
default: 'label'
},
childName: {
type: String,
default: 'children'
},
title: {
type: String,
default: ''
},
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确认'
},
showSearch: {
type: Boolean,
default: true
},
searchPlaceholder: {
type: String,
default: '搜索'
},
remote: {
type: Boolean,
default: false
},
loading: {
type: Boolean,
default: false
},
debounce: {
type: Number,
default: 400
}
},
data() {
return {
defaultSelector: [0],
columnData: [],
selectValue: [],
lastSelectIndex: [],
columnNum: 0,
moving: false,
keyword: '',
pickerKey: 0,
// 勿用 _ 前缀:Vue2 不会把 data 代理到 this
searchTimer: null,
lastSearchEmit: '',
lastSearchAt: 0
};
},
watch: {
value: {
immediate: true,
handler(val) {
if (val) {
this.keyword = '';
this.applyPickerData();
if (this.remote) this.emitRemoteSearch('');
} else {
this.clearSearchTimer();
this.lastSearchEmit = '';
this.lastSearchAt = 0;
}
}
},
list: {
handler() {
if (!this.value) return;
this.applyPickerData();
},
},
loading(val) {
// loading 从 true→false 时再刷一次滚轮,避免原生 picker-view 漏更
if (!val && this.value && this.remote) this.applyPickerData();
},
},
beforeDestroy() {
this.clearSearchTimer();
},
computed: {
uZIndex() {
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
},
isColumnEmpty() {
return !this.columnData || !this.columnData.length || !this.columnData[0] || !this.columnData[0].length;
}
},
methods: {
pickstart() {
// #ifdef MP-WEIXIN
this.moving = true;
// #endif
},
pickend() {
// #ifdef MP-WEIXIN
this.moving = false;
// #endif
},
readInputValue(e) {
if (typeof e === 'string' || typeof e === 'number') return String(e);
if (e && e.detail && e.detail.value != null) return String(e.detail.value);
if (e && e.target && e.target.value != null) return String(e.target.value);
return '';
},
clearSearchTimer() {
if (this.searchTimer) {
clearTimeout(this.searchTimer);
this.searchTimer = null;
}
},
emitRemoteSearch(keyword) {
this.clearSearchTimer();
const key = keyword == null ? '' : String(keyword).trim();
const now = Date.now();
if (key === this.lastSearchEmit && now - this.lastSearchAt < 80) return;
this.lastSearchEmit = key;
this.lastSearchAt = now;
this.$emit('search', key);
},
scheduleRemoteSearch() {
this.clearSearchTimer();
this.searchTimer = setTimeout(() => {
this.emitRemoteSearch(this.keyword);
}, this.debounce);
},
onSearchInput(e) {
this.keyword = this.readInputValue(e);
if (this.remote) this.scheduleRemoteSearch();
else this.applyFilter();
},
onSearchConfirm(e) {
this.keyword = this.readInputValue(e);
if (this.remote) this.emitRemoteSearch(this.keyword);
else this.applyFilter();
},
clearSearch() {
this.keyword = '';
if (this.remote) this.emitRemoteSearch('');
else this.applyFilter();
},
matchKeyword(text) {
const keyword = (this.keyword || '').trim().toLowerCase();
if (!keyword) return true;
return String(text == null ? '' : text).toLowerCase().indexOf(keyword) !== -1;
},
filterItems(list) {
if (!Array.isArray(list)) return [];
if (this.remote) return list.slice();
const keyword = (this.keyword || '').trim();
if (!keyword) return list.slice();
return list.filter(item => {
return this.matchKeyword(item && item[this.labelName]) || this.matchKeyword(item && item[this.valueName]);
});
},
applyPickerData() {
this.init();
this.pickerKey += 1;
},
applyFilter() {
this.applyPickerData();
},
init() {
this.setColumnNum();
this.setDefaultSelector();
this.setColumnData();
this.setSelectValue();
},
setDefaultSelector() {
this.defaultSelector = Array(this.columnNum || 1).fill(0);
this.lastSelectIndex = this.defaultSelector.slice();
},
setColumnNum() {
if(this.mode == 'single-column') this.columnNum = 1;
else if(this.mode == 'mutil-column') this.columnNum = this.list.length;
else if(this.mode == 'mutil-column-auto') {
let num = 1;
let column = this.list;
while(column[0] && column[0][this.childName]) {
column = column[0] ? column[0][this.childName] : {};
num ++;
}
this.columnNum = num;
}
},
setColumnData() {
let data = [];
this.selectValue = [];
if(this.mode == 'mutil-column-auto') {
const sourceList = this.filterItems(this.list);
if (!sourceList.length) {
this.columnData = [[]];
return;
}
let selector = this.defaultSelector.length ? this.defaultSelector[0] : 0;
if (selector >= sourceList.length) selector = 0;
let column = sourceList[selector];
for (let i = 0; i < this.columnNum; i++) {
if (i == 0) {
data[i] = sourceList;
column = column ? column[this.childName] : [];
} else {
data[i] = column || [];
const nextIndex = this.defaultSelector[i] || 0;
column = (column && column[nextIndex]) ? column[nextIndex][this.childName] : [];
}
}
} else if(this.mode == 'single-column') {
data[0] = this.filterItems(this.list);
} else {
data = (this.list || []).map(col => this.filterItems(Array.isArray(col) ? col : []));
}
this.columnData = data.slice();
},
setSelectValue() {
let tmp = null;
for(let i = 0; i < this.columnNum; i++) {
const col = this.columnData[i] || [];
tmp = col[this.defaultSelector[i]];
let data = {
value: tmp ? tmp[this.valueName] : null,
label: tmp ? tmp[this.labelName] : null
};
if(tmp && tmp.extra !== undefined) data.extra = tmp.extra;
this.selectValue.push(data)
}
},
columnChange(e) {
let index = null;
let columnIndex = e.detail.value;
this.selectValue = [];
this.defaultSelector = columnIndex;
if(this.mode == 'mutil-column-auto') {
this.lastSelectIndex.map((val, idx) => {
if (val != columnIndex[idx]) index = idx;
});
for (let i = index + 1; i < this.columnNum; i++) {
this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName];
this.defaultSelector[i] = 0;
}
columnIndex.map((item, idx) => {
let data = this.columnData[idx][columnIndex[idx]];
let tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
})
this.lastSelectIndex = columnIndex;
} else if(this.mode == 'single-column') {
let data = this.columnData[0][columnIndex[0]];
let tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
} else if(this.mode == 'mutil-column') {
columnIndex.map((item, idx) => {
let data = this.columnData[idx][columnIndex[idx]];
let tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
})
}
},
close() {
this.$emit('input', false);
this.$set(this, 'defaultSelector', [0]);
this.keyword = '';
this.lastSearchEmit = '';
this.lastSearchAt = 0;
},
getResult(event = null) {
// #ifdef MP-WEIXIN
if (this.moving) return;
// #endif
if (event === 'confirm' && this.isColumnEmpty) {
this.$u.toast && this.$u.toast('无匹配选项');
return;
}
if (event) this.$emit(event, this.selectValue);
this.close();
},
selectHandler() {
this.$emit('click');
}
}
};
</script>
<style scoped lang="scss">
@import "~uview-ui/libs/css/style.components.scss";
.u-select {
&__action {
position: relative;
line-height: $u-form-item-height;
height: $u-form-item-height;
&__icon {
position: absolute;
right: 20rpx;
top: 50%;
transition: transform .4s;
transform: translateY(-50%);
z-index: 1;
&--reverse {
transform: rotate(-180deg) translateY(50%);
}
}
}
&__hader {
&__title {
color: $u-content-color;
}
}
&--border {
border-radius: 6rpx;
border-radius: 4px;
border: 1px solid $u-form-item-border-color;
}
&__header {
@include vue-flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
padding: 0 40rpx;
}
&__search {
@include vue-flex;
align-items: center;
margin: 0 24rpx 16rpx;
padding: 0 24rpx;
height: 80rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
box-sizing: border-box;
&__input {
flex: 1;
height: 80rpx;
margin-left: 12rpx;
font-size: 30rpx;
color: #303133;
}
}
&__loading {
padding: 0 24rpx 8rpx;
font-size: 26rpx;
color: #909399;
}
&__empty {
@include vue-flex;
align-items: center;
justify-content: center;
height: 100%;
font-size: 30rpx;
color: #909399;
}
&__body {
width: 100%;
height: 500rpx;
overflow: hidden;
background-color: #fff;
&__picker-view {
height: 100%;
box-sizing: border-box;
&__item {
@include vue-flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: $u-main-color;
padding: 0 8rpx;
}
}
}
}
</style>

View File

@ -534,7 +534,7 @@
fontSize: {
type: Array,
default() {
return [20]
return [28]
}
},
defaultColWidth: {
@ -548,7 +548,7 @@
minHeight: {
type: Array,
default() {
return [70]
return [84]
}
},
headerBgColor: {

View File

@ -1,9 +1,9 @@
{
"name" : "浩拓技术",
"name" : "浩拓ERP",
"appid" : "__UNI__F79F300",
"description" : "浩拓纺织平台",
"versionName" : "1.1.4",
"versionCode" : 104,
"description" : "浩拓ERP",
"versionName" : "1.1.5",
"versionCode" : 105,
"transformPx" : false,
"app-plus" : {
"optimization" : {
@ -31,6 +31,7 @@
},
"distribute" : {
"android" : {
"packagename" : "uni.UNIF79F300",
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",

View File

@ -1,5 +1,8 @@
{
"easycom": {
"^u-select$": "@/components/u-select/u-select.vue",
"^u-action-sheet$": "@/components/u-action-sheet/u-action-sheet.vue",
"^u-dropdown-item$": "@/components/u-dropdown-item/u-dropdown-item.vue",
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [
@ -148,6 +151,13 @@
"navigationBarTitleText": "清除缓存"
}
},
{
"path": "pages/sys/user/scan-settings",
"style": {
"navigationBarTitleText": "扫描设置",
"navigationStyle": "custom"
}
},
{
"path": "pages/sys/workbench/index",
"style": {
@ -414,14 +424,126 @@
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessInList",
"style" :
{
"navigationBarTitleText": "加工进仓列表",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessInAdd",
"style" :
{
"navigationBarTitleText": "新增加工进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessInEdit",
"style" :
{
"navigationBarTitleText": "编辑加工进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessInView",
"style" :
{
"navigationBarTitleText": "查看加工进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsPurchaseInList",
"style" :
{
"navigationBarTitleText": "成品采购进仓",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsPurchaseInAdd",
"style" :
{
"navigationBarTitleText": "新增采购进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsPurchaseInEdit",
"style" :
{
"navigationBarTitleText": "编辑采购进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsPurchaseInView",
"style" :
{
"navigationBarTitleText": "采购进仓单详情",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessReturnInList",
"style" :
{
"navigationBarTitleText": "加工退货进仓列表",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessReturnInAdd",
"style" :
{
"navigationBarTitleText": "新增加工退货进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessReturnInEdit",
"style" :
{
"navigationBarTitleText": "编辑加工退货进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessReturnInView",
"style" :
{
"navigationBarTitleText": "查看加工退货进仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessOutList",
"style" :
{
"navigationBarTitleText": "加工出仓列表",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessOutAdd",
"style" :
{
"navigationBarTitleText": "新增加工出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessOutEdit",
"style" :
{
"navigationBarTitleText": "编辑加工出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsProcessOutView",
"style" :
{
"navigationBarTitleText": "查看加工出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsBusinessIn",
"style" :
"style" :
{
"navigationBarTitleText": "成品进仓",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storegoods/storeGoodsBusinessInAdd",
"style" :
@ -562,6 +684,55 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricBusinessOutList",
"style" :
{
"navigationBarTitleText": "坯布出库列表",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricBusinessOutAdd",
"style" :
{
"navigationBarTitleText": "新增坯布出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricBusinessOutEdit",
"style" :
{
"navigationBarTitleText": "编辑坯布出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricBusinessOutView",
"style" :
{
"navigationBarTitleText": "查看坯布出仓单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricWarehouseGroupList",
"style" :
{
"navigationBarTitleText": "坯布库存",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricWarehouseStockList",
"style" :
{
"navigationBarTitleText": "坯布库存汇总",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storeFabricWarehouseDetail",
"style" :
{
"navigationBarTitleText": "细码明细",
"enablePullDownRefresh": false
}
},{
"path" : "pages/storefabric/storefabricstoresearch",
"style" :

View File

@ -17,6 +17,14 @@
</u-form-item>
<u-form-item label-width="130" label="条码资料:">
<input type="text" v-model="QRBarCode" maxlength="-1" style="width: 170px" @confirm="SalePickBillDetailScan" />
<u-icon
v-if="usePhoneScanFallback"
name="scan"
size="44"
color="#2979ff"
style="margin-left: 8px;"
@click="handlePhoneScan"
/>
<checkbox-group @change="handleAllCrockNoChange">
<checkbox :checked="AllCrockNoScanStatus">整缸</checkbox>
</checkbox-group>
@ -36,6 +44,9 @@
<text class="title" style="width: 200px">成品缸号:{{ CrockNo }}</text>
<text class="title" style="width: 200px">成品卷号:{{ GoodsBillNo }}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width: 200px">外部卷号:{{ ExternVolumeNumber }}</text>
</u-form-item>
<u-form-item>
<text class="title">{{ BillDataMessage }}</text>
</u-form-item>
@ -102,6 +113,7 @@ export default {
GoodsCodeName: "",
CrockNo: "",
GoodsBillNo: "",
ExternVolumeNumber: "",
BillSumRoll: 0,
BillSumQty: 0,
BillSumMQty: 0,
@ -182,21 +194,16 @@ export default {
onUnload() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onHide() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onShow() {
this.isPageActive = true;
// #ifdef APP-PLUS
this.registerScanBroadcast((scanResult) => {
console.log("配布单详情-扫码结果:", scanResult);
this.QRBarCode = scanResult;
@ -204,10 +211,13 @@ export default {
this.handleScans();
});
});
// #endif
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
playSuccess() {
util.playSuccessAudio();
},
@ -361,6 +371,7 @@ export default {
this.GoodsCodeName = aResultData.product_color_name;
this.CrockNo = aResultData.dyelot_number;
this.GoodsBillNo = aResultData.volume_number;
this.ExternVolumeNumber = aResultData.extern_volume_number || '';
this.QRBarCode = "";
if (aBarCodeDelStatus == 1) {

View File

@ -0,0 +1,206 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型</text>
<view>{{ getBillTypeName() }}</view>
</view>
<view @click="pickerSelectFun('染厂')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">染厂<text class="redXingh">*</text></text>
<view :class="form.business_unit_name ? '' : 'cBlack'">
{{ form.business_unit_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">{{ dateLabel }}<text class="redXingh">*</text></text>
<picker mode="date" :value="form.delivery_time" :disabled="!headerEditable" @change="bindDateChange">
<view>{{ form.delivery_time }}</view>
</picker>
</view>
<view class="flex-white-plr26-column ptb20 mt32">
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
</view>
<FabricOutDetailList
:list="form.item_data"
@fabric-info="openFabricInfo"
@fine-code="openFineCode"
>
<FabricOutScanBar
slot="before-list"
:can-scan="canScan"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
disabled-tip="请先提交保存后再扫码"
:show-phone-scan="usePhoneScanFallback"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<FabricOutScanDetail
slot="before-list"
:detail="scanDetail"
:item-data="form.item_data"
:group-keys="scanGroupKeys"
@group-change="scanGroupKeys = $event"
/>
</FabricOutDetailList>
<FabricOutFooter
v-if="!headerSaved"
:buttons="[{ label: '提交保存', action: 'save' }]"
single
@action="submitSave"
/>
<FabricOutFooter
v-else
:buttons="statusActionButtons"
@action="handleStatusAction"
/>
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="false" @delete="onDeleteFineCode" />
</view>
</template>
<script>
import formMixin from './storeFabricBusinessOutMixin.js';
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
export default {
components: {
FabricInfoPopup,
FineCodePopup,
OrderStatusBar,
FabricOutDetailList,
FabricOutScanBar,
FabricOutScanDetail,
FabricOutFooter,
},
mixins: [formMixin],
onLoad() {
uni.setNavigationBarTitle({ title: '新增坯布出仓单' });
this.pageMode = 'add';
this.loadBaseDropdowns();
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,97 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<text>{{ form.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型</text>
<text>{{ getBillTypeName() }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">染厂</text>
<text>{{ form.business_unit_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">{{ dateLabel }}</text>
<text>{{ form.delivery_time }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ form.remark || '-' }}</text>
</view>
<FabricOutDetailList
:list="form.item_data"
@fabric-info="openFabricInfo"
@fine-code="openFineCode"
>
<FabricOutScanBar
slot="before-list"
:can-scan="canScan"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:show-phone-scan="usePhoneScanFallback"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<FabricOutScanDetail
slot="before-list"
:detail="scanDetail"
:item-data="form.item_data"
:group-keys="scanGroupKeys"
@group-change="scanGroupKeys = $event"
/>
</FabricOutDetailList>
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="false" @delete="onDeleteFineCode" />
</view>
</template>
<script>
import formMixin from './storeFabricBusinessOutMixin.js';
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
export default {
components: {
FabricInfoPopup,
FineCodePopup,
OrderStatusBar,
FabricOutDetailList,
FabricOutScanBar,
FabricOutScanDetail,
FabricOutFooter,
},
mixins: [formMixin],
onLoad(e) {
uni.setNavigationBarTitle({ title: '编辑坯布出仓单' });
this.pageMode = 'edit';
if (e.id) {
this.loadOrder(Number(e.id), { rejectIfLocked: true });
}
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,304 @@
<template>
<view>
<view class="filterBar">
<u-search v-model="filters.order_no" placeholder="出仓单号" :show-action="false" @search="loadList" @custom="loadList" />
<view class="filterBtn" @click="filterShow = true">
<u-icon name="list" size="40" color="#666"></u-icon>
<text>筛选</text>
</view>
</view>
<scroll-view scroll-y :style="{ height: scrollHeight }" refresher-enabled
:refresher-triggered="triggered" @refresherrefresh="onRefresh">
<dataNull v-if="list.length === 0" src="/src/static/img/chahua/gjNull.png"
title="暂无坯布出仓单" title1="请点击右下角按钮新增">
</dataNull>
<view v-for="(item, index) in list" :key="item.id" @click="goView(item)">
<FabricOutItem :item="item" :index="index" />
</view>
</scroll-view>
<addBtn url="./storeFabricBusinessOutAdd"></addBtn>
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
<view class="filterPanel">
<view class="filterTitle">筛选条件</view>
<view class="filterItem">
<text class="filterLabel">出仓单号</text>
<u-input v-model="filters.order_no" placeholder="请输入出仓单号" />
</view>
<view class="filterItem">
<text class="filterLabel">出仓日期</text>
<view class="dateRow">
<picker mode="date" :value="filters.start_date" @change="e => filters.start_date = e.detail.value">
<view class="dateInput">{{ filters.start_date || '开始日期' }}</view>
</picker>
<text>~</text>
<picker mode="date" :value="filters.end_date" @change="e => filters.end_date = e.detail.value">
<view class="dateInput">{{ filters.end_date || '结束日期' }}</view>
</picker>
</view>
</view>
<!-- <view class="filterItem" @click="openDeliveryUnitSelect">-->
<!-- <text class="filterLabel">出仓单位</text>-->
<!-- <view class="filterValue">{{ deliveryUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>-->
<!-- </view>-->
<view class="filterItem" @click="openBusinessUnitSelect">
<text class="filterLabel">染厂</text>
<view class="filterValue">{{ businessUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openStatusSelect">
<text class="filterLabel">订单状态</text>
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterActions">
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
<u-button type="primary" size="medium" @click="applyFilter">确定</u-button>
</view>
</view>
</u-popup>
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
<u-select v-model="unitSelectShow" :list="unitSelectList" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
</view>
</template>
<script>
import addBtn from '@/components/addBtn/addBtn.vue';
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
import {
getStatusOptions,
AUDIT_STATUS_MAP,
BILL_TYPES,
BUSINESS_UNIT_TYPE_DYE_FACTORY,
formatRoll,
mapToSelectOptions,
fetchAllOrderList,
} from '@/common/storeFabricBusinessOut';
import { withNameParam } from '@/common/remoteSelect';
export default {
components: { addBtn, FabricOutItem },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
filterShow: false,
statusSelectShow: false,
unitSelectShow: false,
unitSelectType: '',
deliveryUnitOptions: [],
businessUnitOptions: [],
unitOptionsLoading: false,
selectSearching: false,
unitSearchSeq: 0,
unitSelectList: [{ value: '', label: '全部' }],
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
filters: {
order_no: '',
start_date: '',
end_date: '',
delivery_unit_id: '',
delivery_unit_name: '',
business_unit_id: '',
business_unit_name: '',
audit_status: '',
},
statusSelectList: [
{ value: '', label: '全部' },
...getStatusOptions(),
],
};
},
computed: {
statusLabel() {
if (this.filters.audit_status === '' || this.filters.audit_status === null) return '';
return AUDIT_STATUS_MAP[Number(this.filters.audit_status)] || '';
},
deliveryUnitLabel() {
return this.filters.delivery_unit_name || '';
},
businessUnitLabel() {
return this.filters.business_unit_name || '';
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '坯布出库列表' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 50}px`;
},
});
this.loadList();
},
onShow() {
this.loadList();
},
methods: {
loadDeliveryUnitOptions() {
if (this.deliveryUnitOptions.length) return Promise.resolve(this.deliveryUnitOptions);
return this.$u.api.businessUnit.list({})
.then((res) => {
this.deliveryUnitOptions = mapToSelectOptions(res);
return this.deliveryUnitOptions;
})
.catch(() => {
this.deliveryUnitOptions = [];
return this.deliveryUnitOptions;
});
},
loadBusinessUnitOptions() {
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY })
.then((res) => {
this.businessUnitOptions = mapToSelectOptions(res);
return this.businessUnitOptions;
})
.catch(() => {
this.businessUnitOptions = [];
return this.businessUnitOptions;
});
},
applyUnitSelectList(list) {
const rows = Array.isArray(list) ? list.slice() : [];
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
},
openUnitSelect(type) {
this.unitSelectType = type;
const cache = type === 'delivery' ? this.deliveryUnitOptions : this.businessUnitOptions;
this.applyUnitSelectList(cache);
this.unitSelectShow = true;
},
onUnitSearch(keyword) {
const seq = ++this.unitSearchSeq;
const isDelivery = this.unitSelectType === 'delivery';
const empty = !String(keyword || '').trim();
this.selectSearching = true;
const params = isDelivery ? {} : { unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY };
this.$u.api.businessUnit.list(withNameParam(params, keyword))
.then((res) => {
if (seq !== this.unitSearchSeq) return;
const list = mapToSelectOptions(res);
if (empty) {
if (isDelivery) this.deliveryUnitOptions = list;
else this.businessUnitOptions = list;
}
this.applyUnitSelectList(list);
})
.catch((e) => {
if (seq !== this.unitSearchSeq) return;
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
})
.then(() => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
}, () => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
});
},
openDeliveryUnitSelect() {
this.openUnitSelect('delivery');
},
openBusinessUnitSelect() {
this.openUnitSelect('business');
},
onUnitConfirm(e) {
const item = e[0] || {};
if (this.unitSelectType === 'delivery') {
this.filters.delivery_unit_id = item.value;
this.filters.delivery_unit_name = item.value ? item.label : '';
} else {
this.filters.business_unit_id = item.value;
this.filters.business_unit_name = item.value ? item.label : '';
}
},
loadList() {
const params = {};
if (this.filters.order_no) params.order_no = this.filters.order_no;
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
params.audit_status = this.filters.audit_status;
}
fetchAllOrderList((p) => this.$u.api.gfmOtherDeliveryOrder.list(p), params)
.then((rows) => {
this.triggered = false;
this.list = rows.map(this.mapToCard).filter(this.matchClientFilter);
})
.catch((err) => {
this.triggered = false;
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
});
},
mapToCard(order) {
return {
id: order.id,
order_no: order.order_no || '',
out_date: (order.delivery_time || '').slice(0, 10),
bill_type_name: this.billTypeName,
delivery_unit_id: order.delivery_unit_id || '',
delivery_unit_name: order.delivery_unit_name || '',
business_unit_id: order.business_unit_id || '',
business_unit_name: order.business_unit_name || '',
create_user_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditer_name || '',
audit_date: order.audit_time || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
total_roll: formatRoll(order.total_roll),
};
},
// 后端列表仅支持 单号/状态 过滤,出仓日期与单位在前端做本地过滤
matchClientFilter(item) {
if (this.filters.start_date && item.out_date < this.filters.start_date) return false;
if (this.filters.end_date && item.out_date > this.filters.end_date) return false;
if (this.filters.delivery_unit_id && String(item.delivery_unit_id) !== String(this.filters.delivery_unit_id)) {
return false;
}
if (this.filters.business_unit_id && String(item.business_unit_id) !== String(this.filters.business_unit_id)) {
return false;
}
return true;
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goView(item) {
uni.navigateTo({ url: `./storeFabricBusinessOutView?id=${item.id}` });
},
openStatusSelect() { this.statusSelectShow = true; },
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
resetFilter() {
this.filters = {
order_no: '',
start_date: '',
end_date: '',
delivery_unit_id: '',
delivery_unit_name: '',
business_unit_id: '',
business_unit_name: '',
audit_status: '',
};
},
applyFilter() {
this.filterShow = false;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
.filterPanel { padding: 30rpx; }
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
.filterItem { margin-bottom: 24rpx; }
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
.dateRow { display: flex; align-items: center; gap: 12rpx; }
.dateInput { padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 26rpx; min-width: 200rpx; text-align: center; }
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
</style>

View File

@ -0,0 +1,409 @@
/**
* 坯布出仓单(其他出货单)表单 mixin(新增/编辑共用)
*
* 业务说明:
* 1. 后端当前仅提供「坯布其他出货单」一种类型的接口,故出仓类型固定为 other,
* 表头保留染厂(business_unit) / 出货日期 / 备注 等字段。
* 2. 用户先填写表头并「提交保存」(addGfmOtherDeliveryOrder),拿到出仓单 id 后即可扫码;
* 扫码新增/删除细码走 updateGfmOtherDeliveryOrder;勾选锁定维度时附带 *_lock 字段,操作后用返回的最新详情刷新。
* 3. 后端没有「修改表头」接口,保存成功或编辑进入后表头变为只读,仅可扫码维护细码。
*/
import util from '@/common/util';
import scanMixin from '@/common/scanMixin.js';
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
import { withNameParam } from '@/common/remoteSelect';
import { initTts, speak } from '@/common/tts.js';
import {
AUDIT_STATUS_MAP,
BILL_TYPES,
BUSINESS_UNIT_TYPE_DYE_FACTORY,
normalizeOrder,
mapToSelectOptions,
getFineCodeScanCode,
canScanAtStatus,
isLockedOrderStatus,
getFormStatusActionButtons,
orderToFormFields,
confirmOrderStatusAction,
DRAFT_AUDIT_STATUS,
DRAFT_AUDIT_STATUS_NAME,
getEmptyScanDetail,
findScanContext,
buildScanDetailFromContext,
buildScanDetailFromOrderResponse,
buildScanUpdateParams,
getOrderDisplayWeight,
getFineCodeDisplayWeight,
resolveScanMismatchVoice,
} from '@/common/storeFabricBusinessOut';
export default {
mixins: [scanMixin, remoteSelectMixin],
data() {
return {
pageMode: 'add',
orderId: 0,
form: this.getEmptyForm(),
headerSaved: false,
selectShow: false,
selectList: [],
selectType: '',
canScan: false,
QRBarCode: '',
BarCodeDelStatus: false,
BillDataMessage: '',
currentScanItem: null,
fabricInfoShow: false,
fineCodeShow: false,
currentFabricInfo: {},
currentFineCodes: [],
currentGroupKey: '',
scanDetail: getEmptyScanDetail(),
scanGroupKeys: [],
lastScanCode: '',
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
auditStatus: 0,
businessUnitOptions: [],
dropdownLoading: false,
};
},
computed: {
isReadonly() {
return this.pageMode === 'view';
},
isEditable() {
return this.pageMode === 'add' || this.pageMode === 'edit';
},
// 表头是否可编辑:仅新增且未保存时可编辑(后端无修改表头接口)
headerEditable() {
return this.pageMode === 'add' && !this.headerSaved;
},
dateLabel() {
return '出货日期';
},
/** 表头保存后,待审核/已驳回状态下显示审核、作废 */
statusActionButtons() {
return getFormStatusActionButtons(this.headerSaved, this.orderId, this.auditStatus);
},
displayAuditStatus() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS;
return this.auditStatus;
},
displayAuditStatusName() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS_NAME;
return AUDIT_STATUS_MAP[this.auditStatus] || '';
},
},
onShow() {
this.isPageActive = true;
initTts();
if (this.canScan && this.isEditable) {
this.registerScanBroadcast((scanResult) => {
this.QRBarCode = scanResult.trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan());
});
}
},
onHide() {
this.isPageActive = false;
this.unregisterScanBroadcast();
},
onUnload() {
this.isPageActive = false;
this.unregisterScanBroadcast();
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
registerOrderScanBroadcast() {
this.registerScanBroadcast((scanResult) => {
this.QRBarCode = scanResult.trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan());
});
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
this.unregisterScanBroadcast();
}
this.canScan = nextCanScan;
},
loadBaseDropdowns() {
if (this.dropdownLoading) return Promise.resolve();
if (this.businessUnitOptions.length) {
return Promise.resolve();
}
this.dropdownLoading = true;
return this.ensureBusinessUnitOptions().finally(() => {
this.dropdownLoading = false;
});
},
ensureBusinessUnitOptions() {
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY })
.then((res) => {
this.businessUnitOptions = mapToSelectOptions(res);
return this.businessUnitOptions;
});
},
fetchRemoteSelectOptions(type, keyword) {
if (type !== '染厂') return Promise.resolve([]);
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (!String(keyword || '').trim()) this.businessUnitOptions = list;
return list;
});
},
getEmptyForm() {
return {
order_no: '',
business_unit_id: '',
business_unit_name: '',
delivery_time: this.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
remark: '',
item_data: [],
};
},
loadOrder(id, options = {}) {
const { rejectIfLocked = false } = options;
return this.$u.api.gfmOtherDeliveryOrder.detail({ id })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return null;
}
if (rejectIfLocked && isLockedOrderStatus(order.audit_status)) {
this.showError('当前状态不可编辑');
setTimeout(() => uni.navigateBack(), 1500);
return null;
}
this.orderId = order.id;
this.auditStatus = order.audit_status;
this.headerSaved = true;
this.form = orderToFormFields(order);
this.refreshScanDetailTotals(order);
this.syncCanScanFromStatus(order.audit_status);
if (this.canScan) this.registerOrderScanBroadcast();
return order;
})
.catch((e) => {
this.showError(e.message || '加载单据失败');
return null;
});
},
pickerSelectFun(type) {
if (!this.headerEditable) return;
if (type === '染厂') {
this.openSelectPicker(type, this.businessUnitOptions);
return;
}
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '染厂') {
this.form.business_unit_id = item.value;
this.form.business_unit_name = item.label;
}
},
bindDateChange(e) {
this.form.delivery_time = e.detail.value;
},
validateForm() {
if (!this.form.business_unit_id) return '请选择染厂';
if (!this.form.delivery_time) return '请选择出货日期';
return '';
},
buildAddParam() {
return {
business_unit_id: Number(this.form.business_unit_id),
delivery_time: this.form.delivery_time,
remark: this.form.remark || '',
};
},
submitSave() {
if (this.headerSaved) {
this.showError('表头已保存,请直接扫码维护细码');
return;
}
const err = this.validateForm();
if (err) {
this.showError(err);
return;
}
uni.showLoading({ title: '保存中...' });
this.$u.api.gfmOtherDeliveryOrder.add(this.buildAddParam())
.then((res) => {
this.orderId = (res && res.id) || 0;
if (!this.orderId) {
throw new Error('保存失败,未返回单据ID');
}
return this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId });
})
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.applyOrder(order);
this.headerSaved = true;
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('保存成功,可以扫码');
this.registerOrderScanBroadcast();
})
.catch((e) => {
uni.hideLoading();
this.showError(e.message || '保存失败');
});
},
applyOrder(order) {
if (!order) return;
this.auditStatus = order.audit_status;
Object.assign(this.form, orderToFormFields(order));
this.refreshScanDetailTotals(order);
},
refreshScanDetailTotals(order) {
this.scanDetail = {
...this.scanDetail,
total_roll: order.total_roll ?? 0,
total_weight: getOrderDisplayWeight(order),
};
},
applyScanDetail(scanCode, order, scanType) {
const fromResponse = buildScanDetailFromOrderResponse(order);
if (fromResponse) {
const context = findScanContext(order.item_data, scanCode);
if (context) {
fromResponse.weight = getFineCodeDisplayWeight(context.fineCode);
}
this.scanDetail = fromResponse;
if (scanType !== 2) this.lastScanCode = scanCode;
else if (this.lastScanCode === scanCode) this.lastScanCode = '';
return;
}
const context = findScanContext(order.item_data, scanCode);
if (context) {
this.scanDetail = buildScanDetailFromContext(context, order);
this.lastScanCode = scanCode;
return;
}
if (scanType === 2 && this.lastScanCode === scanCode) {
this.scanDetail = {
...getEmptyScanDetail(),
total_roll: order.total_roll ?? 0,
total_weight: getOrderDisplayWeight(order),
};
this.lastScanCode = '';
return;
}
this.refreshScanDetailTotals(order);
},
handleScan() {
const code = (this.QRBarCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
this.QRBarCode = '';
return;
}
if (!code) {
this.QRBarCode = '';
return;
}
const scanType = this.BarCodeDelStatus ? 2 : 1;
this.doScanUpdate(code, scanType);
},
BarCodeDelChange(e) {
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
},
/** 扫码新增/删除细码,统一走 scanUpdate 接口 */
doScanUpdate(scanCode, scanType, options = {}) {
const { refreshFineCodes = false } = options;
uni.showLoading({ title: scanType === 2 ? '删除中...' : '处理中...' });
return this.$u.api.gfmOtherDeliveryOrder.scanUpdate(buildScanUpdateParams({
id: this.orderId,
scanCode,
scanType,
groupKeys: this.scanGroupKeys,
detail: this.scanDetail,
}))
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.form.item_data = order.item_data;
this.auditStatus = order.audit_status;
this.applyScanDetail(scanCode, order, scanType);
if (refreshFineCodes) {
const row = order.item_data.find((i) => (i.group_key || String(i.id)) === this.currentGroupKey);
this.currentFineCodes = row ? [...row.fine_codes] : [];
}
this.BillDataMessage = scanType === 2 ? '删除成功' : '扫描成功';
this.QRBarCode = '';
if (scanType === 2) {
speak('已删除出仓');
uni.showToast({ title: '删除成功', icon: 'success' });
} else {
speak('成功');
}
})
.catch((e) => {
uni.hideLoading();
const message = e.message || (scanType === 2 ? '删除失败' : '扫码失败');
const mismatchVoice = resolveScanMismatchVoice(message);
if (mismatchVoice) speak(mismatchVoice);
this.showError(message, { skipErrorAudio: !!mismatchVoice });
this.QRBarCode = '';
});
},
openFabricInfo(row) {
this.currentFabricInfo = { ...row };
this.fabricInfoShow = true;
},
openFineCode(row) {
this.currentGroupKey = row.group_key || String(row.id);
this.currentFineCodes = [...(row.fine_codes || [])];
this.fineCodeShow = true;
},
onDeleteFineCode(fineCode) {
if (this.isReadonly || !this.canScan) return;
const scanCode = getFineCodeScanCode(fineCode);
if (!scanCode) {
this.showError('该细码缺少条码,无法删除');
return;
}
uni.showModal({
title: '提示',
content: `确认删除细码 ${scanCode}?`,
success: (res) => {
if (!res.confirm) return;
this.doScanUpdate(scanCode, 2, { refreshFineCodes: true });
},
});
},
handleStatusAction(action) {
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId })
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
if (!order) return;
this.applyOrder(order);
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('操作成功');
}),
});
},
showError(message, options = {}) {
if (!options.skipErrorAudio) util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
showSuccess(message) {
util.playSuccessAudio();
uni.showToast({ title: message, icon: 'success' });
},
getBillTypeName() {
return this.billTypeName;
},
},
};

View File

@ -0,0 +1,160 @@
/* 坯布出仓单页面共用样式(新增/编辑/查看) */
.fabric-out-page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.fabric-out-mt32 {
margin-top: 32rpx;
}
.fabric-out-sectionTitle {
font-size: 32rpx;
font-weight: bold;
padding: 24rpx 26rpx 12rpx;
border-left: 6rpx solid #007AFF;
margin: 20rpx 26rpx 0;
}
.fabric-out-scanTip {
padding: 20rpx 26rpx;
color: #fa8c16;
font-size: 28rpx;
background: #fff7e6;
margin: 16rpx 26rpx;
border-radius: 8rpx;
}
.fabric-out-msgTip {
padding: 12rpx 26rpx;
color: #52c41a;
font-size: 28rpx;
}
.fabric-out-detailList {
padding: 0 26rpx;
}
.fabric-out-detailCard {
background: #fff;
border-radius: 12rpx;
padding: 20rpx;
margin-bottom: 16rpx;
}
.fabric-out-detailRow {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 30rpx;
font-weight: bold;
padding-bottom: 12rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.fabric-out-detailMeta {
display: flex;
align-items: center;
gap: 20rpx;
padding-top: 12rpx;
font-size: 28rpx;
color: #666;
}
.fabric-out-scanRow {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16rpx;
}
.fabric-out-scanInput {
width: 200px;
flex: 1;
min-width: 160px;
}
.fabric-out-delCheck {
display: flex;
align-items: center;
font-size: 28rpx;
color: #666;
white-space: nowrap;
}
.fabric-out-scanDetail {
background: #fff;
margin: 0 26rpx 16rpx;
border-radius: 8rpx;
overflow: hidden;
}
.fabric-out-scanDetailRow {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 16rpx 20rpx;
border-bottom: 1rpx solid #f0f0f0;
font-size: 28rpx;
color: #333;
}
.fabric-out-scanDetailRow--2col {
justify-content: space-between;
gap: 12rpx;
}
.fabric-out-scanDetailCell {
flex: 1;
min-width: 0;
}
.fabric-out-scanDetailCheck {
display: flex;
align-items: center;
flex: 1;
min-width: 0;
gap: 4rpx;
}
.fabric-out-scanDetailLabel {
color: #333;
flex-shrink: 0;
}
.fabric-out-scanDetailValue {
color: #333;
word-break: break-all;
}
.fabric-out-scanDetailTableScroll {
width: 100%;
}
.fabric-out-scanDetailTable {
min-width: 100%;
}
.fabric-out-scanDetailTableRow {
display: flex;
border-bottom: 1rpx solid #f0f0f0;
}
.fabric-out-scanDetailTableHead {
background: #f5f5f5;
font-weight: bold;
}
.fabric-out-scanDetailTableCell {
padding: 16rpx 10rpx;
font-size: 28rpx;
color: #333;
text-align: center;
box-sizing: border-box;
word-break: break-all;
}
.fabric-out-scanDetailEmpty {
padding: 24rpx;
text-align: center;
font-size: 28rpx;
color: #999;
}
.fabric-out-submitView {
width: 100%;
padding: 16rpx 26rpx 26rpx;
background: #fff;
position: fixed;
bottom: 0;
left: 0;
border-top: 1rpx solid #f1f1f1;
display: flex;
z-index: 100;
box-sizing: border-box;
}
.fabric-out-actionBtnWrap {
flex: 1;
min-width: 0;
}
.fabric-out-actionBtnWrap + .fabric-out-actionBtnWrap {
margin-left: 20rpx;
}
.fabric-out-actionBtn {
flex: 1;
}

View File

@ -0,0 +1,145 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型</text>
<text>{{ billTypeName }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">染厂</text><text>{{ order.business_unit_name }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出货日期</text><text>{{ formatTime(order.delivery_time) }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text><text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text><text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditer_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text><text>{{ order.auditer_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<FabricOutDetailList
:title="detailTitle"
:list="order.item_data"
@fabric-info="openFabricInfo"
@fine-code="openFineCode"
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="true" />
</view>
</template>
<script>
import util from '@/common/util';
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import {
BILL_TYPES,
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeFabricBusinessOut';
export default {
components: { FabricInfoPopup, FineCodePopup, OrderStatusBar, FabricOutDetailList, FabricOutFooter },
data() {
return {
orderId: 0,
order: {},
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
fabricInfoShow: false,
fineCodeShow: false,
currentFabricInfo: {},
currentFineCodes: [],
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `出仓细码(共 ${this.order.total_roll || 0} 匹 / ${this.order.total_weight || 0} KG)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '查看坯布出仓单' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
openFabricInfo(row) {
this.currentFabricInfo = { ...row };
this.fabricInfoShow = true;
},
openFineCode(row) {
this.currentFineCodes = [...(row.fine_codes || [])];
this.fineCodeShow = true;
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeFabricBusinessOutEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,260 @@
<template>
<view class="warehouse-detail-page">
<view class="infoCard">
<view class="infoTitle">坯布资料</view>
<view class="infoRow">
<text class="infoLabel">坯布编号</text>
<text class="infoValue">{{ header.grey_fabric_code || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">坯布名称</text>
<text class="infoValue">{{ header.grey_fabric_name || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">颜  色</text>
<text class="infoValue">{{ header.gray_fabric_color_name || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">织  厂</text>
<text class="infoValue">{{ header.supplier_name || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">机 台 号</text>
<text class="infoValue">{{ header.machine_number || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">纱  批</text>
<text class="infoValue">{{ header.yarn_batch || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">仓  库</text>
<text class="infoValue">{{ header.warehouse_name || '-' }}</text>
</view>
<view class="infoRow">
<text class="infoLabel">汇总库存</text>
<text class="infoValue">{{ header.stock_roll || '-' }} 匹 / {{ header.stock_weight || '-' }} KG</text>
</view>
</view>
<view class="summaryBar">
<text>细码:{{ totals.count }} 条 / {{ totals.roll }} 匹 / {{ totals.weight }} KG</text>
</view>
<scroll-view
scroll-y
:style="{ height: scrollHeight }"
refresher-enabled
:refresher-triggered="triggered"
@refresherrefresh="onRefresh"
>
<dataNull
v-if="tableRows.length === 0"
src="/src/static/img/chahua/gjNull.png"
title="暂无细码明细"
title1="请返回上一级调整筛选条件"
/>
<scroll-view v-else scroll-x class="tableScroll">
<view class="fineTable" :style="{ width: tableWidth }">
<view class="tableRow tableHead">
<view
v-for="col in columns"
:key="col.key"
class="tableCell headCell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view v-for="(row, rowIndex) in tableRows" :key="rowIndex" class="tableRow">
<view
v-for="col in columns"
:key="col.key"
class="tableCell"
:style="cellStyle(col)"
>{{ row[col.key] }}</view>
</view>
</view>
</scroll-view>
</scroll-view>
</view>
</template>
<script>
import {
WAREHOUSE_DETAIL_COLUMNS,
buildDetailQuery,
fetchAllWarehouseList,
getWarehouseDetailTableWidth,
mapWarehouseDetailRows,
parsePageQuery,
sumDetailTotals,
} from '@/common/storeFabricWarehouse';
export default {
data() {
return {
rawList: [],
scrollHeight: '667px',
triggered: false,
columns: WAREHOUSE_DETAIL_COLUMNS,
header: {
grey_fabric_id: '',
grey_fabric_code: '',
grey_fabric_name: '',
gray_fabric_color_name: '',
supplier_name: '',
machine_number: '',
yarn_batch: '',
warehouse_name: '',
stock_roll: '',
stock_weight: '',
},
queryParams: {},
};
},
computed: {
tableRows() {
return mapWarehouseDetailRows(this.rawList);
},
tableWidth() {
return getWarehouseDetailTableWidth(this.columns);
},
totals() {
return sumDetailTotals(this.rawList);
},
},
onLoad(options) {
const parsed = parsePageQuery(options || {});
this.header = {
grey_fabric_id: parsed.grey_fabric_id || '',
grey_fabric_code: parsed.grey_fabric_code || '',
grey_fabric_name: parsed.grey_fabric_name || '',
gray_fabric_color_name: parsed.gray_fabric_color_name || '',
supplier_name: parsed.supplier_name || '',
machine_number: parsed.machine_number || '',
yarn_batch: parsed.yarn_batch || '',
warehouse_name: parsed.warehouse_name || '',
stock_roll: parsed.stock_roll || '',
stock_weight: parsed.stock_weight || '',
};
this.queryParams = buildDetailQuery(parsed, parsed);
uni.setNavigationBarTitle({ title: '细码明细' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 360}px`;
},
});
if (!this.queryParams.grey_fabric_id) {
uni.showToast({ title: '缺少坯布参数', icon: 'none' });
return;
}
this.loadList();
},
methods: {
cellStyle(col) {
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
};
},
loadList() {
fetchAllWarehouseList((p) => this.$u.api.gfmWarehouse.detailList(p), this.queryParams)
.then((rows) => {
this.triggered = false;
this.rawList = rows || [];
})
.catch((err) => {
this.triggered = false;
this.rawList = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
});
},
onRefresh() {
this.triggered = true;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.warehouse-detail-page { min-height: 100%; padding-bottom: 24rpx; }
.infoCard {
margin: 20rpx 24rpx 0;
padding: 20rpx 24rpx;
background: #fff;
border-radius: 12rpx;
}
.infoTitle {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 16rpx;
color: #333;
}
.infoRow {
display: flex;
font-size: 28rpx;
padding: 10rpx 0;
}
.infoLabel {
width: 160rpx;
color: #999;
flex-shrink: 0;
}
.infoValue {
flex: 1;
color: #333;
word-break: break-all;
}
.summaryBar {
margin: 16rpx 24rpx 0;
padding: 14rpx 16rpx;
font-size: 28rpx;
color: #666;
background: #fff;
border-radius: 8rpx;
}
.tableScroll {
width: 100%;
margin: 16rpx 24rpx 0;
background: #fff;
border-radius: 8rpx;
box-sizing: border-box;
}
.fineTable {
display: inline-block;
vertical-align: top;
border: 1rpx solid #e1e1e1;
box-sizing: border-box;
}
.tableRow {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
border-bottom: 1rpx solid #e1e1e1;
}
.tableRow:last-child {
border-bottom: none;
}
.tableHead {
background: #f1f1f1;
}
.tableCell {
flex-shrink: 0;
padding: 16rpx 10rpx;
font-size: 28rpx;
color: #333;
text-align: center;
border-right: 1rpx solid #e1e1e1;
box-sizing: border-box;
word-break: break-all;
white-space: normal;
}
.tableCell:last-child {
border-right: none;
}
.headCell {
font-weight: bold;
color: #3e3e3e;
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<view class="warehouse-page">
<view class="filterBar">
<u-search
v-model="filters.grey_fabric_code"
placeholder="坯布编号"
shape="square"
:show-action="false"
height="64"
@search="loadList"
@custom="loadList"
/>
<u-search
v-model="filters.grey_fabric_name"
placeholder="坯布名称"
shape="square"
:show-action="false"
height="64"
@search="loadList"
@custom="loadList"
/>
</view>
<view class="summaryBar">
<text>合计:{{ totals.roll }} 匹 / {{ totals.weight }} KG({{ totals.count }} 条)</text>
</view>
<scroll-view
scroll-y
:style="{ height: scrollHeight }"
refresher-enabled
:refresher-triggered="triggered"
@refresherrefresh="onRefresh"
>
<dataNull
v-if="!loading && tableContents.length === 0"
src="/src/static/img/chahua/gjNull.png"
title="暂无库存汇总"
title1="请输入坯布编号或名称查询"
/>
<view v-else-if="tableContents.length" class="tableBox">
<WarehouseDataTable
:headers="tableHeaders"
:contents="tableContents"
:height="tableHeight"
@row-click="goStockList"
/>
</view>
</scroll-view>
</view>
</template>
<script>
import WarehouseDataTable from '@/components/storefabric/WarehouseDataTable.vue';
import {
GROUP_TABLE_COLUMNS,
buildGroupListQuery,
buildStockListNavigateQuery,
calcTableHeight,
fetchAllWarehouseList,
mapGroupTableRow,
sumStockTotals,
toQueryString,
} from '@/common/storeFabricWarehouse';
export default {
components: { WarehouseDataTable },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
loading: false,
tableHeaders: GROUP_TABLE_COLUMNS,
filters: {
grey_fabric_code: '',
grey_fabric_name: '',
},
};
},
computed: {
tableContents() {
return this.list.map(mapGroupTableRow);
},
totals() {
return sumStockTotals(this.list);
},
tableHeight() {
return calcTableHeight(this.tableContents.length);
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '坯布库存' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 108}px`;
},
});
this.loadList();
},
methods: {
loadList() {
if (this.loading) return;
this.loading = true;
const params = buildGroupListQuery(this.filters);
fetchAllWarehouseList((p) => this.$u.api.gfmWarehouse.groupSummaryList(p), params)
.then((rows) => {
this.triggered = false;
this.list = rows || [];
})
.catch((err) => {
this.triggered = false;
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
})
.finally(() => {
this.loading = false;
});
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goStockList(row) {
const query = buildStockListNavigateQuery(row);
uni.navigateTo({
url: `./storeFabricWarehouseStockList?${toQueryString(query)}`,
});
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.warehouse-page { min-height: 100%; }
.filterBar {
display: flex;
flex-direction: column;
gap: 8rpx;
padding: 12rpx 20rpx;
background: #fff;
}
.summaryBar {
padding: 10rpx 24rpx;
font-size: 24rpx;
color: #666;
background: #fff;
border-top: 1rpx solid #f0f0f0;
}
.tableBox {
padding: 12rpx;
}
</style>

View File

@ -0,0 +1,157 @@
<template>
<view class="warehouse-page">
<view class="fabricHeader">
<view class="fabricCode">{{ context.grey_fabric_code || '-' }}</view>
<view class="fabricName">{{ context.grey_fabric_name || '-' }}</view>
</view>
<view class="filterBar">
<u-search
v-model="filters.machine_number"
placeholder="机台号"
:show-action="false"
@search="loadList"
@custom="loadList"
/>
</view>
<view class="summaryBar">
<text>合计:{{ totals.roll }} 匹 / {{ totals.weight }} KG({{ totals.count }} 条)</text>
</view>
<scroll-view
scroll-y
:style="{ height: scrollHeight }"
refresher-enabled
:refresher-triggered="triggered"
@refresherrefresh="onRefresh"
>
<dataNull
v-if="tableContents.length === 0"
src="/src/static/img/chahua/gjNull.png"
title="暂无维度汇总"
title1="请调整机台号筛选后重试"
/>
<view v-else class="tableBox">
<WarehouseDataTable
:headers="tableHeaders"
:contents="tableContents"
:height="tableHeight"
@row-click="goDetail"
/>
</view>
</scroll-view>
</view>
</template>
<script>
import WarehouseDataTable from '@/components/storefabric/WarehouseDataTable.vue';
import {
STOCK_TABLE_COLUMNS,
buildDetailNavigateQuery,
buildStockListQuery,
calcTableHeight,
fetchAllWarehouseList,
mapStockTableRow,
parsePageQuery,
sumStockTotals,
toQueryString,
} from '@/common/storeFabricWarehouse';
export default {
components: { WarehouseDataTable },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
tableHeaders: STOCK_TABLE_COLUMNS,
context: {
grey_fabric_id: '',
grey_fabric_code: '',
grey_fabric_name: '',
warehouse_id: '',
},
filters: {
machine_number: '',
},
};
},
computed: {
tableContents() {
return this.list.map(mapStockTableRow);
},
totals() {
return sumStockTotals(this.list);
},
tableHeight() {
return calcTableHeight(this.tableContents.length, { maxPx: 9999 });
},
},
onLoad(options) {
const parsed = parsePageQuery(options || {});
this.context = {
grey_fabric_id: parsed.grey_fabric_id || '',
grey_fabric_code: parsed.grey_fabric_code || '',
grey_fabric_name: parsed.grey_fabric_name || '',
warehouse_id: parsed.warehouse_id || '',
};
const title = this.context.grey_fabric_name
? `${this.context.grey_fabric_name} 库存汇总`
: '坯布库存汇总';
uni.setNavigationBarTitle({ title });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 120}px`;
},
});
if (!this.context.grey_fabric_id) {
uni.showToast({ title: '缺少坯布参数', icon: 'none' });
return;
}
this.loadList();
},
methods: {
loadList() {
const params = buildStockListQuery(this.filters, this.context);
fetchAllWarehouseList((p) => this.$u.api.gfmWarehouse.stockSummaryList(p), params)
.then((rows) => {
this.triggered = false;
this.list = rows || [];
})
.catch((err) => {
this.triggered = false;
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
});
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goDetail(row) {
const query = buildDetailNavigateQuery(row, this.context);
uni.navigateTo({
url: `./storeFabricWarehouseDetail?${toQueryString(query)}`,
});
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.warehouse-page { min-height: 100%; }
.fabricHeader { padding: 20rpx 24rpx; background: #fff; border-bottom: 1rpx solid #f0f0f0; }
.fabricCode { font-size: 30rpx; font-weight: bold; color: #333; }
.fabricName { margin-top: 8rpx; font-size: 26rpx; color: #666; }
.filterBar { padding: 16rpx 20rpx; background: #fff; }
.summaryBar {
padding: 12rpx 24rpx;
font-size: 26rpx;
color: #666;
background: #fff;
border-top: 1rpx solid #f0f0f0;
}
.tableBox { padding: 16rpx 12rpx; }
</style>

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
@ -113,6 +114,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
testFocus0: false,
testFocus1: true,
@ -281,6 +283,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
this.BillSumQty = parseFloat(aResultData.BillSumQty);

View File

@ -31,6 +31,14 @@
</view>
<u-form-item label-width="150" label="条码资料:">
<input type="text" maxlength="-1" v-model="QRBarCode" style="width:200px;" @confirm="GoodsCheckBillDetailScan" />
<u-icon
v-if="usePhoneScanFallback"
name="scan"
size="44"
color="#2979ff"
style="margin-left: 8px;"
@click="handlePhoneScan"
/>
<checkbox-group @change="BarCodeDelChange">
<checkbox ref="checkBoxRef" :checked="BarCodeDelStatus">删除</checkbox>
</checkbox-group>
@ -49,6 +57,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width:200px;">本架盘前:{{BillSumOldRoll}}条</text>
@ -138,6 +147,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
BillSumOldRoll: 0,
BillSumNewRoll: 0,
@ -193,28 +203,20 @@
},
onUnload() {
// #ifdef APP-PLUS
this.isPageActive = false;
this.unregisterScanBroadcast();
// #endif
},
onHide() {
// 页面隐藏时
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onShow() {
// 页面显示时
this.isPageActive = true;
// #ifdef APP-PLUS
this.registerScanBroadcast((scanResult) => {
console.log("扫码结果:", scanResult);
// 处理扫描结果,按照原有逻辑
if(!this.StoreName){
this.showError('请先选择仓库');
return;
@ -240,9 +242,11 @@
return;
}
});
// #endif
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
// 添加通用错误提示方法
showError(message) {
@ -592,6 +596,7 @@
this.GoodsCodeName = aResultData.product_color_name;
this.CrockNo = aResultData.dyelot_number;
this.GoodsBillNo = aResultData.volume_number;
this.ExternVolumeNumber = aResultData.extern_volume_number || '';
this.GoodsQty = aResultData.weight / 10000;
this.BillSumOldRoll = aResultData.warehouse_bin_check_before_roll/100;
this.BillSumNewRoll = aResultData.warehouse_bin_check_roll/100;

View File

@ -12,6 +12,14 @@
<u-form-item label-width="150" label="条码资料:">
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:200px;"
@confirm="GoodsCheckBillDetailScan" />
<u-icon
v-if="usePhoneScanFallback"
name="scan"
size="44"
color="#2979ff"
style="margin-left: 8px;"
@click="handlePhoneScan"
/>
<checkbox-group @change="BarCodeDelChange">
<checkbox ref="checkBoxRef" :checked="BarCodeDelStatus">删除</checkbox>
</checkbox-group>
@ -30,6 +38,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{ CrockNo }}</text>
<text class="title" style="width:200px;">缸号卷号:{{ GoodsBillNo }}</text>
<text class="title" style="width:200px;">外部卷号:{{ ExternVolumeNumber }}</text>
</u-form-item>
<u-form-item>
@ -98,6 +107,7 @@ export default {
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
StoreStationNameFocus: false,
BillSumOldRoll: 0,
@ -147,36 +157,30 @@ export default {
},
onShow() {
// 设置页面激活状态
this.isPageActive = true;
// #ifdef APP-PLUS
this.registerScanBroadcast((scanResult) => {
console.log("扫码结果:", scanResult);
// 处理扫描结果
this.QRBarCode = scanResult;
this.$nextTick(() => {
this.GoodsCheckBillDetailScan();
});
});
// #endif
},
onHide() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onUnload() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
// 添加通用错误提示方法
showError(message) {
this.playError();
@ -249,6 +253,7 @@ export default {
this.GoodsCodeName = aResultData.product_color_name;
this.CrockNo = aResultData.dyelot_number;
this.GoodsBillNo = aResultData.volume_number;
this.ExternVolumeNumber = aResultData.extern_volume_number || '';
this.GoodsQty = aResultData.weight / 10000;
this.BillSumOldRoll = aResultData.warehouse_bin_check_before_roll / 100;
this.BillSumNewRoll = aResultData.warehouse_bin_check_roll / 100;

View File

@ -75,6 +75,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width:200px;">本单条数:{{BillSumRoll}}条</text>
@ -161,6 +162,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
testFocus0: false,
testFocus1: true,
@ -903,6 +905,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
this.BillSumQty = parseFloat(aResultData.BillSumQty);

View File

@ -40,6 +40,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
@ -115,6 +116,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
testFocus0: false,
testFocus1: true,
@ -283,6 +285,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
this.BillSumQty = parseFloat(aResultData.BillSumQty);

View File

@ -78,6 +78,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width:200px;">本单条数:{{BillSumRoll}}条</text>
@ -164,6 +165,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
testFocus0: false,
testFocus1: true,
@ -816,6 +818,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
this.BillSumQty = parseFloat(aResultData.BillSumQty);

View File

@ -40,6 +40,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
@ -113,6 +114,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
testFocus0: false,
testFocus1: true,
@ -281,6 +283,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
this.BillSumQty = parseFloat(aResultData.BillSumQty);

View File

@ -66,6 +66,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width:200px;">本单条数:{{BillSumRoll}}条</text>
@ -155,6 +156,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
FromStoreStationFocus: false,
ToStoreStationFocus: true,
@ -711,6 +713,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.GoodsCodeSumRoll = parseFloat(aResultData.GoodsCodeSumRoll);
this.GoodsCodeSumQty = parseFloat(aResultData.GoodsCodeSumQty);

View File

@ -48,6 +48,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
<text class="title" style="width:200px;">外部卷号:{{ExternVolumeNumber}}</text>
</u-form-item>
<u-form-item>
<text class="title" style="width:200px;">本单条数:{{BillSumRoll}}条</text>
@ -119,6 +120,7 @@
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
FromStoreStationFocus: false,
ToStoreStationFocus: true,
@ -360,6 +362,7 @@
this.GoodsCodeName = aResultData.GoodsCodeName;
this.CrockNo = aResultData.CrockNo;
this.GoodsBillNo = aResultData.GoodsBillNo;
this.ExternVolumeNumber = aResultData.extern_volume_number || aResultData.ExternVolumeNumber || '';
this.GoodsQty = aResultData.GoodsQty;
this.GoodsCodeSumRoll = parseFloat(aResultData.GoodsCodeSumRoll);
this.GoodsCodeSumQty = parseFloat(aResultData.GoodsCodeSumQty);

View File

@ -26,6 +26,14 @@
<u-form-item label-width="150" label="条码资料:" :class="{ 'input-highlight': shouldHighlightQR }">
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:150px;"
@confirm="GoodsStoreStationMoveScan" />
<u-icon
v-if="usePhoneScanFallback"
name="scan"
size="44"
color="#2979ff"
style="margin-left: 8px;"
@click="handlePhoneScan"
/>
</u-form-item>
<u-form-item>
<text class="title">{{ BillDataMessage }}</text>
@ -41,6 +49,7 @@
<u-form-item>
<text class="title" style="width:200px;">成品缸号:{{ CrockNo }}</text>
<text class="title" style="width:200px;">缸号卷号:{{ GoodsBillNo }}</text>
<text class="title" style="width:200px;">外部卷号:{{ ExternVolumeNumber }}</text>
</u-form-item>
<u-form-item>
@ -102,6 +111,7 @@ export default {
GoodsCodeName: '',
CrockNo: '',
GoodsBillNo: '',
ExternVolumeNumber: '',
GoodsQty: 0,
FromStoreStationFocus: false,
QRBarCodeFocus: false,
@ -150,10 +160,8 @@ export default {
this.StoreNameID = getApp().globalData.StoreNameID;
this.StoreName = getApp().globalData.StoreName;
};
// #ifdef APP-PLUS
// 使用 scanMixin 的方法注册扫码广播,传入自定义回调
this.registerScanBroadcast(this.handleScanCode);
// #endif
},
// onUnload, onHide, onShow 已由 scanMixin 自动处理
/* onBackPress() {
@ -174,6 +182,10 @@ export default {
}
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
playSuccess() {
util.playSuccessAudio();
},
@ -436,6 +448,7 @@ export default {
this.GoodsCodeName = aResultData.product_color_name;
this.CrockNo = aResultData.dyelot_number;
this.GoodsBillNo = aResultData.volume_number;
this.ExternVolumeNumber = aResultData.extern_volume_number || '';
this.GoodsQty = aResultData.weight / 10000;
this.StoreStationSumRoll = aResultData.warehouse_bin_roll / 100;
this.StoreStationSumQty = aResultData.warehouse_bin_weight / 10000;

View File

@ -0,0 +1,167 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
</view>
<view @click="pickerSelectFun('进仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型<text class="redXingh">*</text></text>
<view :class="form.in_order_type_name ? '' : 'cBlack'">
{{ form.in_order_type_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('加工单位')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位<text class="redXingh">*</text></text>
<view :class="form.process_name ? '' : 'cBlack'">
{{ form.process_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('仓库名称')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称<text class="redXingh">*</text></text>
<view :class="form.warehouse_name ? '' : 'cBlack'">
{{ form.warehouse_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26 ptb10 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<u-input
v-model="form.paper_tube_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="1.5"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<u-input
v-model="form.package_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="0.3"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
</view>
<view @click="pickerSelectFun('营销体系')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系<text class="redXingh">*</text></text>
<view :class="form.sale_system_name ? '' : 'cBlack'">
{{ form.sale_system_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26-column ptb20 mt32">
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
show-tare-columns
@delete="onDeleteFineCode"
/>
<FabricOutFooter
v-if="!headerSaved"
:buttons="[{ label: '提交保存', action: 'save' }]"
single
@action="submitSave"
/>
<FabricOutFooter
v-else
:buttons="statusActionButtons"
@action="handleStatusAction"
/>
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
data() {
return {
weightInputStyle: {
fontSize: '36rpx',
},
};
},
onLoad() {
uni.setNavigationBarTitle({ title: '新增加工进仓单' });
this.pageMode = 'add';
this.loadBaseDropdowns();
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
::v-deep .u-input__input {
font-size: 36rpx !important;
}
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ form.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<text>{{ form.in_order_type_name || '加工进仓单' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ form.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ form.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb10 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<u-input
v-model="form.paper_tube_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="1.5"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<u-input
v-model="form.package_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="0.3"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系</text>
<text>{{ form.sale_system_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ form.remark || '-' }}</text>
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
show-tare-columns
@delete="onDeleteFineCode"
/>
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
data() {
return {
weightInputStyle: {
fontSize: '36rpx',
},
};
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '编辑加工进仓单' });
this.pageMode = 'edit';
if (e.id) {
this.loadOrder(Number(e.id), { rejectIfLocked: true });
}
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
::v-deep .u-input__input {
font-size: 36rpx !important;
}
}
</style>

View File

@ -0,0 +1,281 @@
<template>
<view>
<view class="filterBar">
<u-search v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="loadList" @custom="loadList" />
<view class="filterBtn" @click="filterShow = true">
<u-icon name="list" size="40" color="#666"></u-icon>
<text>筛选</text>
</view>
</view>
<scroll-view scroll-y :style="{ height: scrollHeight }" refresher-enabled
:refresher-triggered="triggered" @refresherrefresh="onRefresh">
<dataNull v-if="list.length === 0" src="/src/static/img/chahua/gjNull.png"
title="暂无加工进仓单" title1="请点击右下角按钮新增">
</dataNull>
<view v-for="(item, index) in list" :key="item.id" @click="goView(item)">
<ProcessInItem :item="item" :index="index" />
</view>
</scroll-view>
<addBtn url="./storeGoodsProcessInAdd"></addBtn>
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
<view class="filterPanel">
<view class="filterTitle">筛选条件</view>
<view class="filterItem">
<text class="filterLabel">进仓单号</text>
<u-input v-model="filters.order_no" placeholder="请输入进仓单号" />
</view>
<view class="filterItem" @click="openProcessUnitSelect">
<text class="filterLabel">加工单位</text>
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openWarehouseSelect">
<text class="filterLabel">仓库</text>
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openStatusSelect">
<text class="filterLabel">订单状态</text>
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterActions">
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
<u-button type="primary" size="medium" @click="applyFilter">确定</u-button>
</view>
</view>
</u-popup>
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
<u-select v-model="unitSelectShow" :list="unitSelectList" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
</view>
</template>
<script>
import addBtn from '@/components/addBtn/addBtn.vue';
import ProcessInItem from '@/components/card/storeGoodsProcessInItem.vue';
import {
getStatusOptions,
AUDIT_STATUS_MAP,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
formatRoll,
mapToSelectOptions,
fetchAllOrderList,
} from '@/common/storeGoodsProcessIn';
import { withNameParam } from '@/common/remoteSelect';
export default {
components: { addBtn, ProcessInItem },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
listLoading: false,
filterShow: false,
statusSelectShow: false,
unitSelectShow: false,
unitSelectType: '',
processUnitOptions: [],
warehouseOptions: [],
unitOptionsLoading: false,
selectSearching: false,
unitSearchSeq: 0,
unitSelectList: [{ value: '', label: '全部' }],
filters: {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
},
statusSelectList: [
{ value: '', label: '全部' },
...getStatusOptions(),
],
};
},
computed: {
statusLabel() {
if (this.filters.audit_status === '' || this.filters.audit_status === null) return '';
return AUDIT_STATUS_MAP[Number(this.filters.audit_status)] || '';
},
processUnitLabel() {
return this.filters.process_name || '';
},
warehouseLabel() {
return this.filters.warehouse_name || '';
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '加工进仓列表' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 50}px`;
},
});
},
onShow() {
this.loadList();
},
methods: {
loadProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
})
.catch(() => {
this.processUnitOptions = [];
return this.processUnitOptions;
});
},
loadWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
return this.warehouseOptions;
})
.catch(() => {
this.warehouseOptions = [];
return this.warehouseOptions;
});
},
applyUnitSelectList(list) {
const rows = Array.isArray(list) ? list.slice() : [];
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
},
openUnitSelect(type) {
this.unitSelectType = type;
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
this.applyUnitSelectList(cache);
this.unitSelectShow = true;
},
onUnitSearch(keyword) {
const seq = ++this.unitSearchSeq;
const type = this.unitSelectType;
const empty = !String(keyword || '').trim();
this.selectSearching = true;
const req = type === 'warehouse'
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
req.then((res) => {
if (seq !== this.unitSearchSeq) return;
const list = mapToSelectOptions(res);
if (empty) {
if (type === 'warehouse') this.warehouseOptions = list;
else this.processUnitOptions = list;
}
this.applyUnitSelectList(list);
}).catch((e) => {
if (seq !== this.unitSearchSeq) return;
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
}).then(() => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
}, () => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
});
},
openProcessUnitSelect() {
this.openUnitSelect('process');
},
openWarehouseSelect() {
this.openUnitSelect('warehouse');
},
onUnitConfirm(e) {
const item = e[0] || {};
if (this.unitSelectType === 'warehouse') {
this.filters.warehouse_id = item.value;
this.filters.warehouse_name = item.value ? item.label : '';
} else {
this.filters.process_unit_id = item.value;
this.filters.process_name = item.value ? item.label : '';
}
},
loadList() {
if (this.listLoading) return;
this.listLoading = true;
const params = {};
if (this.filters.order_no) params.order_no = this.filters.order_no;
if (this.filters.process_unit_id) params.process_unit_id = this.filters.process_unit_id;
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
params.audit_status = this.filters.audit_status;
}
fetchAllOrderList((p) => this.$u.api.fpmProcessInOrder.list(p), params)
.then((rows) => {
this.list = rows.map(this.mapToCard);
})
.catch((err) => {
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
})
.finally(() => {
this.listLoading = false;
this.triggered = false;
// 避免并发请求下 uView 全局 loading 遮罩关不掉
uni.hideLoading();
});
},
mapToCard(order) {
return {
id: order.id,
order_no: order.order_no || '',
process_unit_id: order.process_unit_id || '',
process_name: order.process_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
create_user_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_date: order.audit_time || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
total_roll: formatRoll(order.total_roll),
};
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goView(item) {
const page = Number(item.audit_status) === 1
? 'storeGoodsProcessInEdit'
: 'storeGoodsProcessInView';
uni.navigateTo({ url: `./${page}?id=${item.id}` });
},
openStatusSelect() { this.statusSelectShow = true; },
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
resetFilter() {
this.filters = {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
};
},
applyFilter() {
this.filterShow = false;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
.filterPanel { padding: 30rpx; }
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
.filterItem { margin-bottom: 24rpx; }
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
</style>

View File

@ -0,0 +1,653 @@
/**
* 加工进仓单表单 mixin(新增/编辑共用)
*
* 1. 先填表头(进仓类型 / 加工单位 / 仓库 / 营销体系 / 备注)提交 add,拿到 id 后可扫码
* 2. 先扫仓位(getWarehouseBin:传 qr_code + warehouse_id),校验后扫布匹二维码
* 3. 扫码走 updateFpmProcessInOrder(arrange_type: 1 录入 / 3 删除,带 warehouse_bin_id、纸筒/包装重量)
* 4. 手机扫码成功展示详情后自动再次调起扫码,形成连续扫
*/
import util from '@/common/util';
import scanMixin from '@/common/scanMixin.js';
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
import { withNameParam } from '@/common/remoteSelect';
import { initTts, speak } from '@/common/tts.js';
import {
AUDIT_STATUS_MAP,
ARRANGE_TYPE,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
IN_ORDER_TYPE_PROCESS,
IN_ORDER_TYPE_MAP,
IN_ORDER_TYPE_OPTIONS,
DEFAULT_PAPER_TUBE_WEIGHT,
DEFAULT_PACKAGE_WEIGHT,
normalizeOrder,
mapToSelectOptions,
canScanAtStatus,
isLockedOrderStatus,
getFormStatusActionButtons,
orderToFormFields,
confirmOrderStatusAction,
DRAFT_AUDIT_STATUS,
DRAFT_AUDIT_STATUS_NAME,
getEmptyScanDetail,
buildScanDetailFromScanResponse,
buildScanUpdateParams,
pickDefaultWarehouse,
validateScanWeights,
} from '@/common/storeGoodsProcessIn';
export default {
mixins: [scanMixin, remoteSelectMixin],
data() {
return {
pageMode: 'add',
orderId: 0,
form: this.getEmptyForm(),
headerSaved: false,
selectShow: false,
selectList: [],
selectType: '',
canScan: false,
QRBarCode: '',
BarCodeDelStatus: false,
BillDataMessage: '',
scanDetail: getEmptyScanDetail(),
auditStatus: 0,
processUnitOptions: [],
warehouseOptions: [],
saleSystemOptions: [],
inOrderTypeOptions: IN_ORDER_TYPE_OPTIONS,
dropdownLoading: false,
/** 仓位 */
warehouseBinId: 0,
warehouseBinCode: '',
warehouseBinName: '',
/** 手机连续扫码开关:成功后自动再调起;取消/失败则关闭 */
phoneContinuousScan: false,
/** 手机扫当前目标:bin | qr */
phoneScanTarget: 'bin',
};
},
computed: {
isReadonly() {
return this.pageMode === 'view';
},
isEditable() {
return this.pageMode === 'add' || this.pageMode === 'edit';
},
headerEditable() {
return this.pageMode === 'add' && !this.headerSaved;
},
/** 纸筒/包装重量随扫码提交,保存前后及可扫编辑态均可改 */
canEditWeights() {
return this.isEditable && (this.headerEditable || this.canScan);
},
statusActionButtons() {
return getFormStatusActionButtons(this.headerSaved, this.orderId, this.auditStatus);
},
displayAuditStatus() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS;
return this.auditStatus;
},
displayAuditStatusName() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS_NAME;
return AUDIT_STATUS_MAP[this.auditStatus] || '';
},
/** 录入需先选仓位;删除模式仅需单据可扫 */
canScanQr() {
if (!this.canScan) return false;
if (this.BarCodeDelStatus) return true;
return !!this.warehouseBinId;
},
/** 扫码栏在可扫状态下始终展示(含删除勾选) */
showQrScanBar() {
return this.canScan;
},
qrDisabledTip() {
if (!this.canScan) return '请先提交保存后再扫码';
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
return '当前状态不可扫码';
},
},
onShow() {
this.isPageActive = true;
initTts();
if (this.canScan && this.isEditable) {
this.registerOrderScanBroadcast();
}
},
onHide() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
onUnload() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
methods: {
clearWarehouseBin() {
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.phoneContinuousScan = false;
},
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
applyWarehouseBinScan(scanResult) {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
this.warehouseBinCode = '';
this.$nextTick(() => {
this.warehouseBinCode = code;
this.$nextTick(() => this.resolveWarehouseBin());
});
},
handleBinPhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
this.phoneContinuousScan = false;
this.phoneScanTarget = 'bin';
this.openPhoneScan({
callback: (scanResult) => {
this.applyWarehouseBinScan(scanResult);
},
fail: () => {},
});
},
handlePhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
// 删除模式可直接扫布匹码;录入模式无仓位时先扫仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.handleBinPhoneScan();
return;
}
this.phoneScanTarget = 'qr';
this.phoneContinuousScan = true;
this.openContinuousPhoneScan();
},
openContinuousPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
this.openPhoneScan({
callback: (scanResult) => {
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan({ fromPhone: true }));
},
fail: () => {
this.phoneContinuousScan = false;
},
});
},
scheduleNextPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
setTimeout(() => {
this.openContinuousPhoneScan();
}, 400);
},
registerOrderScanBroadcast() {
this.registerScanBroadcast((scanResult) => {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.applyWarehouseBinScan(code);
return;
}
this.QRBarCode = code;
this.$nextTick(() => this.handleScan());
});
},
resolveWarehouseBin() {
const code = (this.warehouseBinCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
if (!code) return;
if (!this.form.warehouse_id) {
this.showError('单据缺少仓库信息');
return;
}
uni.showLoading({ title: '识别仓位...' });
return this.$u.api.warehouseBin.getByQrCode({
qr_code: code,
warehouse_id: Number(this.form.warehouse_id),
})
.then((data) => {
uni.hideLoading();
if (!data || !data.id) {
throw new Error('未识别到仓位');
}
// 返回 physical_warehouse_id,与单据仓库校验
if (
data.physical_warehouse_id
&& String(data.physical_warehouse_id) !== String(this.form.warehouse_id)
) {
this.warehouseBinId = 0;
this.warehouseBinName = '';
throw new Error('该仓位不属于当前仓库');
}
this.warehouseBinId = data.id;
this.warehouseBinCode = data.code || data.qr_code || code;
this.warehouseBinName = data.name || '';
this.BillDataMessage = '';
speak('仓位成功');
uni.showToast({ title: '仓位识别成功', icon: 'success' });
})
.catch((e) => {
uni.hideLoading();
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.showError(e.message || '仓位识别失败');
});
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
}
this.canScan = nextCanScan;
},
loadBaseDropdowns() {
if (this.dropdownLoading) return Promise.resolve();
this.dropdownLoading = true;
if (this.headerEditable) this.applyDefaultSaleSystem();
return Promise.all([
this.ensureProcessUnitOptions().catch((e) => {
console.error('加载加工单位失败', e);
return [];
}),
this.ensureWarehouseOptions().catch((e) => {
console.error('加载仓库失败', e);
return [];
}),
this.ensureSaleSystemOptions().catch((e) => {
console.error('加载营销体系失败', e);
return [];
}),
]).finally(() => {
this.dropdownLoading = false;
});
},
ensureProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
});
},
ensureWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
if (this.headerEditable && !this.form.warehouse_id) {
this.applyDefaultWarehouse();
}
return this.warehouseOptions;
});
},
ensureSaleSystemOptions() {
if (this.saleSystemOptions.length) return Promise.resolve(this.saleSystemOptions);
return this.$u.api.saleSystem.getDropdownList()
.then((res) => {
this.saleSystemOptions = mapToSelectOptions(res);
if (this.headerEditable) this.applyDefaultSaleSystem();
return this.saleSystemOptions;
});
},
fetchRemoteSelectOptions(type, keyword) {
const empty = !String(keyword || '').trim();
if (type === '加工单位') {
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.processUnitOptions = list;
return list;
});
}
if (type === '仓库名称') {
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.warehouseOptions = list;
return list;
});
}
if (type === '营销体系') {
return this.$u.api.saleSystem.getDropdownList(withNameParam({}, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.saleSystemOptions = list;
return list;
});
}
return Promise.resolve([]);
},
applyDefaultWarehouse() {
const app = getApp();
const picked = pickDefaultWarehouse(
this.warehouseOptions,
app && app.globalData ? app.globalData.StoreNameID : '',
app && app.globalData ? app.globalData.StoreName : '',
);
if (!picked) return;
this.form.warehouse_id = picked.value;
this.form.warehouse_name = picked.label;
},
applyDefaultSaleSystem() {
if (this.form.sale_system_id) {
if (!this.form.sale_system_name && this.saleSystemOptions.length) {
const found = this.saleSystemOptions.find(
(item) => String(item.value) === String(this.form.sale_system_id),
);
if (found) this.form.sale_system_name = found.label;
}
return;
}
const app = getApp();
const gd = app && app.globalData ? app.globalData : {};
const id = gd.PlanDepartmentID;
if (!id) return;
this.form.sale_system_id = id;
this.form.sale_system_name = gd.PlanDepartmentName || '';
if (!this.form.sale_system_name && this.saleSystemOptions.length) {
const found = this.saleSystemOptions.find((item) => String(item.value) === String(id));
if (found) this.form.sale_system_name = found.label;
}
},
getEmptyForm() {
const app = getApp();
const gd = app && app.globalData ? app.globalData : {};
return {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
sale_system_id: gd.PlanDepartmentID || '',
sale_system_name: gd.PlanDepartmentName || '',
in_order_type: IN_ORDER_TYPE_PROCESS,
in_order_type_name: IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PROCESS],
paper_tube_weight: String(DEFAULT_PAPER_TUBE_WEIGHT),
package_weight: String(DEFAULT_PACKAGE_WEIGHT),
remark: '',
item_data: [],
};
},
loadOrder(id, options = {}) {
const { rejectIfLocked = false } = options;
return this.$u.api.fpmProcessInOrder.detail({ id })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return null;
}
if (rejectIfLocked && isLockedOrderStatus(order.audit_status)) {
this.showError('当前状态不可编辑');
setTimeout(() => uni.navigateBack(), 1500);
return null;
}
this.orderId = order.id;
this.auditStatus = order.audit_status;
this.headerSaved = true;
this.form = orderToFormFields(order);
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
if (this.canScan) this.registerOrderScanBroadcast();
return order;
})
.catch((e) => {
this.showError(e.message || '加载单据失败');
return null;
});
},
pickerSelectFun(type) {
if (!this.headerEditable) return;
if (type === '进仓类型') {
this.selectType = type;
if (!this.inOrderTypeOptions.length) {
this.showError('暂无可选数据');
return;
}
this.selectList = this.inOrderTypeOptions;
this.selectShow = true;
return;
}
const cache = {
'加工单位': this.processUnitOptions,
'仓库名称': this.warehouseOptions,
'营销体系': this.saleSystemOptions,
};
if (cache[type]) this.openSelectPicker(type, cache[type]);
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '进仓类型') {
this.form.in_order_type = item.value;
this.form.in_order_type_name = item.label;
} else if (this.selectType === '加工单位') {
this.form.process_unit_id = item.value;
this.form.process_name = item.label;
} else if (this.selectType === '仓库名称') {
this.form.warehouse_id = item.value;
this.form.warehouse_name = item.label;
} else if (this.selectType === '营销体系') {
this.form.sale_system_id = item.value;
this.form.sale_system_name = item.label;
}
},
validateForm() {
if (!this.form.in_order_type) return '请选择进仓类型';
if (!this.form.process_unit_id) return '请选择加工单位';
if (!this.form.warehouse_id) return '请选择仓库名称';
if (!this.form.sale_system_id) return '请选择营销体系';
return '';
},
buildAddParam() {
return {
inOrderType: Number(this.form.in_order_type),
process_unit_id: Number(this.form.process_unit_id),
warehouse_id: Number(this.form.warehouse_id),
sale_system_id: Number(this.form.sale_system_id),
remark: this.form.remark || '',
item_data: [],
};
},
submitSave() {
if (this.headerSaved) {
this.showError('表头已保存,请直接扫码');
return;
}
const err = this.validateForm();
if (err) {
this.showError(err);
return;
}
uni.showLoading({ title: '保存中...' });
this.$u.api.fpmProcessInOrder.add(this.buildAddParam())
.then((res) => {
this.orderId = (res && res.id) || 0;
if (!this.orderId) {
throw new Error('保存失败,未返回单据ID');
}
return this.$u.api.fpmProcessInOrder.detail({ id: this.orderId });
})
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.applyOrder(order, { keepWeights: true });
this.headerSaved = true;
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('保存成功,请先扫描仓位');
this.registerOrderScanBroadcast();
})
.catch((e) => {
uni.hideLoading();
this.showError(e.message || '保存失败');
});
},
applyOrder(order, options = {}) {
if (!order) return;
this.auditStatus = order.audit_status;
const paperTubeWeight = this.form.paper_tube_weight;
const packageWeight = this.form.package_weight;
Object.assign(this.form, orderToFormFields(order));
if (options.keepWeights) {
this.form.paper_tube_weight = paperTubeWeight;
this.form.package_weight = packageWeight;
}
},
handleScan(options = {}) {
const fromPhone = !!options.fromPhone;
const code = (this.QRBarCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
const isDelete = this.BarCodeDelStatus;
if (!isDelete && !this.warehouseBinId) {
this.showError('请先扫描仓位');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
if (!code) {
this.QRBarCode = '';
if (fromPhone) this.scheduleNextPhoneScan();
return;
}
const arrangeType = isDelete ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN;
this.doScanUpdate(code, arrangeType, { fromPhone });
},
BarCodeDelChange(e) {
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
this.BillDataMessage = this.BarCodeDelStatus ? '删除模式:扫描细码即可删除' : '';
},
getFineCodeScanCode(fineCode) {
if (!fineCode) return '';
return fineCode.qr_code
|| fineCode.long_code
|| fineCode.scan_code
|| fineCode.digital_code
|| fineCode.bar_code
|| fineCode.short_code
|| '';
},
onDeleteFineCode(fineCode) {
if (!this.canScan || !this.orderId) {
this.showError('当前状态不可删除');
return;
}
const scanCode = this.getFineCodeScanCode(fineCode);
if (!scanCode) {
this.showError('该细码缺少条码,无法删除');
return;
}
uni.showModal({
title: '提示',
content: `确认删除细码 ${scanCode}?`,
success: (res) => {
if (!res.confirm) return;
this.doScanUpdate(scanCode, ARRANGE_TYPE.DEL);
},
});
},
doScanUpdate(scanCode, arrangeType, options = {}) {
const { fromPhone = false } = options;
const isDelete = arrangeType === ARRANGE_TYPE.DEL;
if (!isDelete) {
const weightErr = validateScanWeights(this.form.paper_tube_weight, this.form.package_weight);
if (weightErr) {
this.showError(weightErr);
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
}
uni.showLoading({ title: isDelete ? '删除中...' : '处理中...' });
return this.$u.api.fpmProcessInOrder.scanUpdate(buildScanUpdateParams({
id: this.orderId,
scanCode,
arrangeType,
// 删除不强制仓位;录入带当前仓位
warehouseBinId: isDelete ? 0 : this.warehouseBinId,
paperTubeWeight: this.form.paper_tube_weight,
packageWeight: this.form.package_weight,
}))
.then((scanRes) => {
this.scanDetail = buildScanDetailFromScanResponse(scanRes);
this.BillDataMessage = isDelete ? '删除成功' : '扫描成功';
this.QRBarCode = '';
if (isDelete) {
speak('已删除');
uni.showToast({ title: '删除成功', icon: 'success' });
} else {
speak('成功');
}
return this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((detail) => {
const order = normalizeOrder(detail);
if (order) {
this.form.item_data = order.item_data;
this.auditStatus = order.audit_status;
}
})
.catch(() => null);
})
.then(() => {
uni.hideLoading();
if (fromPhone) this.scheduleNextPhoneScan();
})
.catch((e) => {
uni.hideLoading();
this.phoneContinuousScan = false;
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
this.showError(message);
this.QRBarCode = '';
});
},
handleStatusAction(action) {
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
if (!order) return;
this.applyOrder(order);
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('操作成功');
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
showSuccess(message) {
util.playSuccessAudio();
uni.showToast({ title: message, icon: 'success' });
},
},
};

View File

@ -0,0 +1,153 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<text>{{ order.in_order_type_name || '加工进仓单' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ order.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ order.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<text>{{ order.paper_tube_weight != null ? order.paper_tube_weight : '-' }}</text>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<text>{{ order.package_weight != null ? order.package_weight : '-' }}</text>
</view>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系</text>
<text>{{ order.sale_system_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text>
<text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditor_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text>
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<ProcessInDetailList
:title="detailTitle"
:list="order.item_data"
show-tare-columns
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
</view>
</template>
<script>
import util from '@/common/util';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import {
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeGoodsProcessIn';
export default {
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
data() {
return {
orderId: 0,
order: { item_data: [] },
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `进仓明细(共 ${this.order.total_roll || 0} 匹)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '查看加工进仓单' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeGoodsProcessInEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
}
</style>

View File

@ -0,0 +1,102 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
</view>
<view @click="pickerSelectFun('出仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型<text class="redXingh">*</text></text>
<view :class="form.out_order_type_name ? '' : 'cBlack'">
{{ form.out_order_type_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('加工单位')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位<text class="redXingh">*</text></text>
<view :class="form.process_name ? '' : 'cBlack'">
{{ form.process_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('仓库名称')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称<text class="redXingh">*</text></text>
<view :class="form.warehouse_name ? '' : 'cBlack'">
{{ form.warehouse_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26-column ptb20 mt32">
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
</view>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessOutScanDetail :detail="scanDetail" />
<ProcessOutDetailList
:list="form.item_data"
:deletable="canScan"
@delete="onDeleteFineCode"
/>
<FabricOutFooter
v-if="!headerSaved"
:buttons="[{ label: '提交保存', action: 'save' }]"
single
@action="submitSave"
/>
<FabricOutFooter
v-else
:buttons="statusActionButtons"
@action="handleStatusAction"
/>
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessOutMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessOutScanDetail,
ProcessOutDetailList,
},
mixins: [formMixin],
onLoad() {
uni.setNavigationBarTitle({ title: '新增加工出仓单' });
this.pageMode = 'add';
this.loadBaseDropdowns();
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,85 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<text>{{ form.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型</text>
<text>{{ form.out_order_type_name || '正常加工出仓' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ form.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ form.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ form.remark || '-' }}</text>
</view>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessOutScanDetail :detail="scanDetail" />
<ProcessOutDetailList
:list="form.item_data"
:deletable="canScan"
@delete="onDeleteFineCode"
/>
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessOutMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessOutScanDetail,
ProcessOutDetailList,
},
mixins: [formMixin],
onLoad(e) {
uni.setNavigationBarTitle({ title: '编辑加工出仓单' });
this.pageMode = 'edit';
if (e.id) {
this.loadOrder(Number(e.id), { rejectIfLocked: true });
}
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,283 @@
<template>
<view>
<view class="filterBar">
<u-search v-model="filters.order_no" placeholder="出仓单号" :show-action="false" @search="loadList" @custom="loadList" />
<view class="filterBtn" @click="filterShow = true">
<u-icon name="list" size="40" color="#666"></u-icon>
<text>筛选</text>
</view>
</view>
<scroll-view scroll-y :style="{ height: scrollHeight }" refresher-enabled
:refresher-triggered="triggered" @refresherrefresh="onRefresh">
<dataNull v-if="list.length === 0" src="/src/static/img/chahua/gjNull.png"
title="暂无加工出仓单" title1="请点击右下角按钮新增">
</dataNull>
<view v-for="(item, index) in list" :key="item.id" @click="goView(item)">
<ProcessOutItem :item="item" :index="index" />
</view>
</scroll-view>
<addBtn url="./storeGoodsProcessOutAdd"></addBtn>
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
<view class="filterPanel">
<view class="filterTitle">筛选条件</view>
<view class="filterItem">
<text class="filterLabel">出仓单号</text>
<u-input v-model="filters.order_no" placeholder="请输入出仓单号" />
</view>
<view class="filterItem" @click="openProcessUnitSelect">
<text class="filterLabel">加工单位</text>
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openWarehouseSelect">
<text class="filterLabel">仓库</text>
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openStatusSelect">
<text class="filterLabel">订单状态</text>
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterActions">
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
<u-button type="primary" size="medium" @click="applyFilter">确定</u-button>
</view>
</view>
</u-popup>
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
<u-select v-model="unitSelectShow" :list="unitSelectList" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
</view>
</template>
<script>
import addBtn from '@/components/addBtn/addBtn.vue';
import ProcessOutItem from '@/components/card/storeGoodsProcessOutItem.vue';
import {
getStatusOptions,
AUDIT_STATUS_MAP,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
formatRoll,
mapToSelectOptions,
fetchAllOrderList,
} from '@/common/storeGoodsProcessOut';
import { withNameParam } from '@/common/remoteSelect';
export default {
components: { addBtn, ProcessOutItem },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
listLoading: false,
filterShow: false,
statusSelectShow: false,
unitSelectShow: false,
unitSelectType: '',
processUnitOptions: [],
warehouseOptions: [],
unitOptionsLoading: false,
selectSearching: false,
unitSearchSeq: 0,
unitSelectList: [{ value: '', label: '全部' }],
filters: {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
},
statusSelectList: [
{ value: '', label: '全部' },
...getStatusOptions(),
],
};
},
computed: {
statusLabel() {
if (this.filters.audit_status === '' || this.filters.audit_status === null) return '';
return AUDIT_STATUS_MAP[Number(this.filters.audit_status)] || '';
},
processUnitLabel() {
return this.filters.process_name || '';
},
warehouseLabel() {
return this.filters.warehouse_name || '';
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '加工出仓列表' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 50}px`;
},
});
},
onShow() {
this.loadList();
},
methods: {
loadProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
})
.catch(() => {
this.processUnitOptions = [];
return this.processUnitOptions;
});
},
loadWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
return this.warehouseOptions;
})
.catch(() => {
this.warehouseOptions = [];
return this.warehouseOptions;
});
},
applyUnitSelectList(list) {
const rows = Array.isArray(list) ? list.slice() : [];
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
},
openUnitSelect(type) {
this.unitSelectType = type;
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
this.applyUnitSelectList(cache);
this.unitSelectShow = true;
},
onUnitSearch(keyword) {
const seq = ++this.unitSearchSeq;
const type = this.unitSelectType;
const empty = !String(keyword || '').trim();
this.selectSearching = true;
const req = type === 'warehouse'
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
req.then((res) => {
if (seq !== this.unitSearchSeq) return;
const list = mapToSelectOptions(res);
if (empty) {
if (type === 'warehouse') this.warehouseOptions = list;
else this.processUnitOptions = list;
}
this.applyUnitSelectList(list);
}).catch((e) => {
if (seq !== this.unitSearchSeq) return;
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
}).then(() => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
}, () => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
});
},
openProcessUnitSelect() {
this.openUnitSelect('process');
},
openWarehouseSelect() {
this.openUnitSelect('warehouse');
},
onUnitConfirm(e) {
const item = e[0] || {};
if (this.unitSelectType === 'warehouse') {
this.filters.warehouse_id = item.value;
this.filters.warehouse_name = item.value ? item.label : '';
} else {
this.filters.process_unit_id = item.value;
this.filters.process_name = item.value ? item.label : '';
}
},
loadList() {
if (this.listLoading) return;
this.listLoading = true;
const params = {};
if (this.filters.order_no) params.order_no = this.filters.order_no;
if (this.filters.process_unit_id) params.process_unit_id = this.filters.process_unit_id;
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
params.audit_status = this.filters.audit_status;
}
fetchAllOrderList((p) => this.$u.api.fpmProcessOutOrder.list(p), params)
.then((rows) => {
this.list = rows.map(this.mapToCard);
})
.catch((err) => {
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
})
.finally(() => {
this.listLoading = false;
this.triggered = false;
// 避免并发请求下 uView 全局 loading 遮罩关不掉
uni.hideLoading();
});
},
mapToCard(order) {
return {
id: order.id,
order_no: order.order_no || '',
out_order_type: order.out_order_type || '',
out_order_type_name: order.out_order_type_name || '',
process_unit_id: order.process_unit_id || '',
process_name: order.process_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
create_user_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_date: order.audit_time || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
total_roll: formatRoll(order.total_roll),
};
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goView(item) {
const page = Number(item.audit_status) === 1
? 'storeGoodsProcessOutEdit'
: 'storeGoodsProcessOutView';
uni.navigateTo({ url: `./${page}?id=${item.id}` });
},
openStatusSelect() { this.statusSelectShow = true; },
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
resetFilter() {
this.filters = {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
};
},
applyFilter() {
this.filterShow = false;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
.filterPanel { padding: 30rpx; }
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
.filterItem { margin-bottom: 24rpx; }
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
</style>

View File

@ -0,0 +1,496 @@
/**
* 加工出仓单表单 mixin(新增/编辑共用)
*
* 1. 先填表头(加工单位 / 仓库 / 备注)提交 add,拿到 id 后可扫码
* 2. 扫码走 updateFpmProcessOutOrder(arrange_type: 1 录入 / 3 删除),不扫仓位
* 3. 手机扫码成功展示详情后自动再次调起扫码,形成连续扫
*/
import util from '@/common/util';
import scanMixin from '@/common/scanMixin.js';
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
import { withNameParam } from '@/common/remoteSelect';
import { initTts, speak } from '@/common/tts.js';
import {
AUDIT_STATUS_MAP,
ARRANGE_TYPE,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
OUT_ORDER_TYPE_PROCESS,
OUT_ORDER_TYPE_PROCESS_NAME,
normalizeOrder,
mapToSelectOptions,
canScanAtStatus,
isLockedOrderStatus,
getFormStatusActionButtons,
orderToFormFields,
confirmOrderStatusAction,
DRAFT_AUDIT_STATUS,
DRAFT_AUDIT_STATUS_NAME,
getEmptyScanDetail,
buildScanDetailFromScanResponse,
buildScanUpdateParams,
pickDefaultWarehouse,
formatDisplayTime,
} from '@/common/storeGoodsProcessOut';
export default {
mixins: [scanMixin, remoteSelectMixin],
data() {
return {
pageMode: 'add',
orderId: 0,
form: this.getEmptyForm(),
headerSaved: false,
selectShow: false,
selectList: [],
selectType: '',
canScan: false,
QRBarCode: '',
BarCodeDelStatus: false,
BillDataMessage: '',
scanDetail: getEmptyScanDetail(),
auditStatus: 0,
processUnitOptions: [],
warehouseOptions: [],
outOrderTypeOptions: [],
dropdownLoading: false,
/** 手机连续扫码开关:成功后自动再调起;取消/失败则关闭 */
phoneContinuousScan: false,
};
},
computed: {
isReadonly() {
return this.pageMode === 'view';
},
isEditable() {
return this.pageMode === 'add' || this.pageMode === 'edit';
},
headerEditable() {
return this.pageMode === 'add' && !this.headerSaved;
},
statusActionButtons() {
return getFormStatusActionButtons(this.headerSaved, this.orderId, this.auditStatus);
},
displayAuditStatus() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS;
return this.auditStatus;
},
displayAuditStatusName() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS_NAME;
return AUDIT_STATUS_MAP[this.auditStatus] || '';
},
canScanQr() {
return this.canScan;
},
showQrScanBar() {
return this.canScan;
},
qrDisabledTip() {
if (!this.canScan) return '请先提交保存后再扫码';
return '当前状态不可扫码';
},
},
onShow() {
this.isPageActive = true;
initTts();
if (this.canScan && this.isEditable) {
this.registerOrderScanBroadcast();
}
},
onHide() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
onUnload() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
methods: {
handlePhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
this.phoneContinuousScan = true;
this.openContinuousPhoneScan();
},
openContinuousPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
this.openPhoneScan({
callback: (scanResult) => {
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan({ fromPhone: true }));
},
fail: () => {
this.phoneContinuousScan = false;
},
});
},
scheduleNextPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
setTimeout(() => {
this.openContinuousPhoneScan();
}, 400);
},
registerOrderScanBroadcast() {
this.registerScanBroadcast((scanResult) => {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
this.QRBarCode = code;
this.$nextTick(() => this.handleScan());
});
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
}
this.canScan = nextCanScan;
},
loadBaseDropdowns() {
if (this.dropdownLoading) return Promise.resolve();
this.dropdownLoading = true;
return Promise.all([
this.ensureOutOrderTypeOptions().catch((e) => {
console.error('加载出仓类型失败', e);
return [];
}),
this.ensureProcessUnitOptions().catch((e) => {
console.error('加载加工单位失败', e);
return [];
}),
this.ensureWarehouseOptions().catch((e) => {
console.error('加载仓库失败', e);
return [];
}),
]).finally(() => {
this.dropdownLoading = false;
});
},
ensureOutOrderTypeOptions() {
if (this.outOrderTypeOptions.length) return Promise.resolve(this.outOrderTypeOptions);
return this.$u.api.fpmProcessOutOrder.getOutTypeEnum()
.then((res) => {
this.outOrderTypeOptions = mapToSelectOptions(res);
if (this.headerEditable && !this.form.out_order_type) {
this.applyDefaultOutOrderType();
}
return this.outOrderTypeOptions;
});
},
applyDefaultOutOrderType() {
const list = this.outOrderTypeOptions || [];
const preferred = list.find((item) => Number(item.value) === OUT_ORDER_TYPE_PROCESS) || list[0];
if (!preferred) return;
this.form.out_order_type = preferred.value;
this.form.out_order_type_name = preferred.label;
},
ensureProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
});
},
ensureWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
if (this.headerEditable && !this.form.warehouse_id) {
this.applyDefaultWarehouse();
}
return this.warehouseOptions;
});
},
fetchRemoteSelectOptions(type, keyword) {
const empty = !String(keyword || '').trim();
if (type === '加工单位') {
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.processUnitOptions = list;
return list;
});
}
if (type === '仓库名称') {
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.warehouseOptions = list;
return list;
});
}
return Promise.resolve([]);
},
applyDefaultWarehouse() {
const app = getApp();
const picked = pickDefaultWarehouse(
this.warehouseOptions,
app && app.globalData ? app.globalData.StoreNameID : '',
app && app.globalData ? app.globalData.StoreName : '',
);
if (!picked) return;
this.form.warehouse_id = picked.value;
this.form.warehouse_name = picked.label;
},
getEmptyForm() {
return {
order_no: '',
out_order_type: OUT_ORDER_TYPE_PROCESS,
out_order_type_name: OUT_ORDER_TYPE_PROCESS_NAME,
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
remark: '',
item_data: [],
};
},
loadOrder(id, options = {}) {
const { rejectIfLocked = false } = options;
return this.$u.api.fpmProcessOutOrder.detail({ id })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return null;
}
if (rejectIfLocked && isLockedOrderStatus(order.audit_status)) {
this.showError('当前状态不可编辑');
setTimeout(() => uni.navigateBack(), 1500);
return null;
}
this.orderId = order.id;
this.auditStatus = order.audit_status;
this.headerSaved = true;
this.form = orderToFormFields(order);
this.syncCanScanFromStatus(order.audit_status);
if (this.canScan) this.registerOrderScanBroadcast();
return order;
})
.catch((e) => {
this.showError(e.message || '加载单据失败');
return null;
});
},
pickerSelectFun(type) {
if (!this.headerEditable) return;
if (type === '出仓类型') {
this.selectType = type;
const openPicker = (list) => {
if (!list.length) {
this.showError('暂无可选数据');
return;
}
this.selectList = list;
this.selectShow = true;
};
this.ensureOutOrderTypeOptions()
.then(openPicker)
.catch((e) => this.showError(e.message || '加载出仓类型失败'));
return;
}
const cache = {
'加工单位': this.processUnitOptions,
'仓库名称': this.warehouseOptions,
};
if (cache[type]) this.openSelectPicker(type, cache[type]);
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '出仓类型') {
this.form.out_order_type = item.value;
this.form.out_order_type_name = item.label;
} else if (this.selectType === '加工单位') {
this.form.process_unit_id = item.value;
this.form.process_name = item.label;
} else if (this.selectType === '仓库名称') {
this.form.warehouse_id = item.value;
this.form.warehouse_name = item.label;
}
},
validateForm() {
if (!this.form.out_order_type) return '请选择出仓类型';
if (!this.form.process_unit_id) return '请选择加工单位';
if (!this.form.warehouse_id) return '请选择仓库名称';
const app = getApp();
const saleSystemId = app && app.globalData ? app.globalData.PlanDepartmentID : '';
if (!saleSystemId) return '缺少营销体系,请重新登录';
return '';
},
buildAddParam() {
const app = getApp();
return {
// OpenAPI: product.AddFpmProcessOutOrderParam
out_order_type: Number(this.form.out_order_type),
process_unit_id: Number(this.form.process_unit_id),
warehouse_id: Number(this.form.warehouse_id),
sale_system_id: Number(app.globalData.PlanDepartmentID),
warehouse_out_time: formatDisplayTime(new Date(), 'YYYY-MM-DD'),
remark: this.form.remark || '',
item_data: [],
};
},
submitSave() {
if (this.headerSaved) {
this.showError('表头已保存,请直接扫码');
return;
}
const err = this.validateForm();
if (err) {
this.showError(err);
return;
}
uni.showLoading({ title: '保存中...' });
this.$u.api.fpmProcessOutOrder.add(this.buildAddParam())
.then((res) => {
this.orderId = (res && res.id) || 0;
if (!this.orderId) {
throw new Error('保存失败,未返回单据ID');
}
return this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId });
})
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.applyOrder(order);
this.headerSaved = true;
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('保存成功,请开始扫码');
this.registerOrderScanBroadcast();
})
.catch((e) => {
uni.hideLoading();
this.showError(e.message || '保存失败');
});
},
applyOrder(order) {
if (!order) return;
this.auditStatus = order.audit_status;
Object.assign(this.form, orderToFormFields(order));
},
handleScan(options = {}) {
const fromPhone = !!options.fromPhone;
const code = (this.QRBarCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
if (!code) {
this.QRBarCode = '';
if (fromPhone) this.scheduleNextPhoneScan();
return;
}
const arrangeType = this.BarCodeDelStatus ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN;
this.doScanUpdate(code, arrangeType, { fromPhone });
},
BarCodeDelChange(e) {
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
this.BillDataMessage = this.BarCodeDelStatus ? '删除模式:扫描细码即可删除' : '';
},
getFineCodeScanCode(fineCode) {
if (!fineCode) return '';
return fineCode.qr_code
|| fineCode.scan_code
|| fineCode.digital_code
|| fineCode.bar_code
|| '';
},
onDeleteFineCode(fineCode) {
if (!this.canScan || !this.orderId) {
this.showError('当前状态不可删除');
return;
}
const scanCode = this.getFineCodeScanCode(fineCode);
if (!scanCode) {
this.showError('该细码缺少条码,无法删除');
return;
}
uni.showModal({
title: '提示',
content: `确认删除细码 ${scanCode}?`,
success: (res) => {
if (!res.confirm) return;
this.doScanUpdate(scanCode, ARRANGE_TYPE.DEL);
},
});
},
doScanUpdate(scanCode, arrangeType, options = {}) {
const { fromPhone = false } = options;
const isDelete = arrangeType === ARRANGE_TYPE.DEL;
uni.showLoading({ title: isDelete ? '删除中...' : '处理中...' });
return this.$u.api.fpmProcessOutOrder.scanUpdate(buildScanUpdateParams({
id: this.orderId,
scanCode,
arrangeType,
}))
.then((scanRes) => {
this.scanDetail = buildScanDetailFromScanResponse(scanRes);
this.BillDataMessage = isDelete ? '删除成功' : '扫描成功';
this.QRBarCode = '';
if (isDelete) {
speak('已删除');
uni.showToast({ title: '删除成功', icon: 'success' });
} else {
speak('成功');
}
return this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
.then((detail) => {
const order = normalizeOrder(detail);
if (order) {
this.form.item_data = order.item_data;
this.auditStatus = order.audit_status;
}
})
.catch(() => null);
})
.then(() => {
uni.hideLoading();
if (fromPhone) this.scheduleNextPhoneScan();
})
.catch((e) => {
uni.hideLoading();
this.phoneContinuousScan = false;
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
this.showError(message);
this.QRBarCode = '';
});
},
handleStatusAction(action) {
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
if (!order) return;
this.applyOrder(order);
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('操作成功');
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
showSuccess(message) {
util.playSuccessAudio();
uni.showToast({ title: message, icon: 'success' });
},
},
};

View File

@ -0,0 +1,129 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">出仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">出仓类型</text>
<text>{{ order.out_order_type_name || '正常加工出仓' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ order.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ order.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text>
<text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditor_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text>
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<ProcessOutDetailList
:title="detailTitle"
:list="order.item_data"
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
</view>
</template>
<script>
import util from '@/common/util';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
import {
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeGoodsProcessOut';
export default {
components: { OrderStatusBar, FabricOutFooter, ProcessOutDetailList },
data() {
return {
orderId: 0,
order: { item_data: [] },
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `出仓明细(共 ${this.order.total_roll || 0} 匹)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '查看加工出仓单' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeGoodsProcessOutEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,112 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<view>加工退货进仓单</view>
</view>
<view @click="pickerSelectFun('加工单位')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位<text class="redXingh">*</text></text>
<view :class="form.process_name ? '' : 'cBlack'">
{{ form.process_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('仓库名称')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称<text class="redXingh">*</text></text>
<view :class="form.warehouse_name ? '' : 'cBlack'">
{{ form.warehouse_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26-column ptb20 mt32">
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
@delete="onDeleteFineCode"
/>
<FabricOutFooter
v-if="!headerSaved"
:buttons="[{ label: '提交保存', action: 'save' }]"
single
@action="submitSave"
/>
<FabricOutFooter
v-else
:buttons="statusActionButtons"
@action="handleStatusAction"
/>
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessReturnInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
onLoad() {
uni.setNavigationBarTitle({ title: '新增加工退货进仓单' });
this.pageMode = 'add';
this.loadBaseDropdowns();
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,98 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ form.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<text>加工退货进仓单</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ form.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ form.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ form.remark || '-' }}</text>
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
@delete="onDeleteFineCode"
/>
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsProcessReturnInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
onLoad(e) {
uni.setNavigationBarTitle({ title: '编辑加工退货进仓单' });
this.pageMode = 'edit';
if (e.id) {
this.loadOrder(Number(e.id), { rejectIfLocked: true });
}
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,281 @@
<template>
<view>
<view class="filterBar">
<u-search v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="loadList" @custom="loadList" />
<view class="filterBtn" @click="filterShow = true">
<u-icon name="list" size="40" color="#666"></u-icon>
<text>筛选</text>
</view>
</view>
<scroll-view scroll-y :style="{ height: scrollHeight }" refresher-enabled
:refresher-triggered="triggered" @refresherrefresh="onRefresh">
<dataNull v-if="list.length === 0" src="/src/static/img/chahua/gjNull.png"
title="暂无加工退货进仓单" title1="请点击右下角按钮新增">
</dataNull>
<view v-for="(item, index) in list" :key="item.id" @click="goView(item)">
<ProcessReturnInItem :item="item" :index="index" />
</view>
</scroll-view>
<addBtn url="./storeGoodsProcessReturnInAdd"></addBtn>
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
<view class="filterPanel">
<view class="filterTitle">筛选条件</view>
<view class="filterItem">
<text class="filterLabel">进仓单号</text>
<u-input v-model="filters.order_no" placeholder="请输入进仓单号" />
</view>
<view class="filterItem" @click="openProcessUnitSelect">
<text class="filterLabel">加工单位</text>
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openWarehouseSelect">
<text class="filterLabel">仓库</text>
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openStatusSelect">
<text class="filterLabel">订单状态</text>
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterActions">
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
<u-button type="primary" size="medium" @click="applyFilter">确定</u-button>
</view>
</view>
</u-popup>
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
<u-select v-model="unitSelectShow" :list="unitSelectList" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
</view>
</template>
<script>
import addBtn from '@/components/addBtn/addBtn.vue';
import ProcessReturnInItem from '@/components/card/storeGoodsProcessReturnInItem.vue';
import {
getStatusOptions,
AUDIT_STATUS_MAP,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
formatRoll,
mapToSelectOptions,
fetchAllOrderList,
} from '@/common/storeGoodsProcessReturnIn';
import { withNameParam } from '@/common/remoteSelect';
export default {
components: { addBtn, ProcessReturnInItem },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
listLoading: false,
filterShow: false,
statusSelectShow: false,
unitSelectShow: false,
unitSelectType: '',
processUnitOptions: [],
warehouseOptions: [],
unitOptionsLoading: false,
selectSearching: false,
unitSearchSeq: 0,
unitSelectList: [{ value: '', label: '全部' }],
filters: {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
},
statusSelectList: [
{ value: '', label: '全部' },
...getStatusOptions(),
],
};
},
computed: {
statusLabel() {
if (this.filters.audit_status === '' || this.filters.audit_status === null) return '';
return AUDIT_STATUS_MAP[Number(this.filters.audit_status)] || '';
},
processUnitLabel() {
return this.filters.process_name || '';
},
warehouseLabel() {
return this.filters.warehouse_name || '';
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '加工退货进仓列表' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 50}px`;
},
});
},
onShow() {
this.loadList();
},
methods: {
loadProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
})
.catch(() => {
this.processUnitOptions = [];
return this.processUnitOptions;
});
},
loadWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
return this.warehouseOptions;
})
.catch(() => {
this.warehouseOptions = [];
return this.warehouseOptions;
});
},
applyUnitSelectList(list) {
const rows = Array.isArray(list) ? list.slice() : [];
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
},
openUnitSelect(type) {
this.unitSelectType = type;
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
this.applyUnitSelectList(cache);
this.unitSelectShow = true;
},
onUnitSearch(keyword) {
const seq = ++this.unitSearchSeq;
const type = this.unitSelectType;
const empty = !String(keyword || '').trim();
this.selectSearching = true;
const req = type === 'warehouse'
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
req.then((res) => {
if (seq !== this.unitSearchSeq) return;
const list = mapToSelectOptions(res);
if (empty) {
if (type === 'warehouse') this.warehouseOptions = list;
else this.processUnitOptions = list;
}
this.applyUnitSelectList(list);
}).catch((e) => {
if (seq !== this.unitSearchSeq) return;
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
}).then(() => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
}, () => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
});
},
openProcessUnitSelect() {
this.openUnitSelect('process');
},
openWarehouseSelect() {
this.openUnitSelect('warehouse');
},
onUnitConfirm(e) {
const item = e[0] || {};
if (this.unitSelectType === 'warehouse') {
this.filters.warehouse_id = item.value;
this.filters.warehouse_name = item.value ? item.label : '';
} else {
this.filters.process_unit_id = item.value;
this.filters.process_name = item.value ? item.label : '';
}
},
loadList() {
if (this.listLoading) return;
this.listLoading = true;
const params = {};
if (this.filters.order_no) params.order_no = this.filters.order_no;
if (this.filters.process_unit_id) params.supplier_id = this.filters.process_unit_id;
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
params.audit_status = this.filters.audit_status;
}
fetchAllOrderList((p) => this.$u.api.fpmProcessReturnInOrder.list(p), params)
.then((rows) => {
this.list = rows.map(this.mapToCard);
})
.catch((err) => {
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
})
.finally(() => {
this.listLoading = false;
this.triggered = false;
// 避免并发请求下 uView 全局 loading 遮罩关不掉
uni.hideLoading();
});
},
mapToCard(order) {
return {
id: order.id,
order_no: order.order_no || '',
process_unit_id: order.process_unit_id || order.biz_unit_id || '',
process_name: order.process_name || order.biz_unit_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
create_user_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_date: order.audit_time || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
total_roll: formatRoll(order.total_roll),
};
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goView(item) {
const page = Number(item.audit_status) === 1
? 'storeGoodsProcessReturnInEdit'
: 'storeGoodsProcessReturnInView';
uni.navigateTo({ url: `./${page}?id=${item.id}` });
},
openStatusSelect() { this.statusSelectShow = true; },
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
resetFilter() {
this.filters = {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
};
},
applyFilter() {
this.filterShow = false;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
.filterPanel { padding: 30rpx; }
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
.filterItem { margin-bottom: 24rpx; }
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
</style>

View File

@ -0,0 +1,553 @@
/**
* 加工退货进仓单表单 mixin(新增/编辑共用)
*
* 1. 先填表头(加工单位 / 仓库 / 备注)提交 add,拿到 id 后可扫码
* 2. 先扫仓位(getWarehouseBin:传 qr_code + warehouse_id),校验后扫布匹二维码
* 3. 扫码走 updateFpmProcessReturnInOrder(arrange_type: 1 录入 / 3 删除,带 warehouse_bin_id)
* 4. 手机扫码成功展示详情后自动再次调起扫码,形成连续扫
*/
import util from '@/common/util';
import scanMixin from '@/common/scanMixin.js';
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
import { withNameParam } from '@/common/remoteSelect';
import { initTts, speak } from '@/common/tts.js';
import {
AUDIT_STATUS_MAP,
ARRANGE_TYPE,
BUSINESS_UNIT_TYPE_PROCESS,
WAREHOUSE_TYPE_FINISHED,
IN_ORDER_TYPE_PROCESS_RETURN,
normalizeOrder,
mapToSelectOptions,
canScanAtStatus,
isLockedOrderStatus,
getFormStatusActionButtons,
orderToFormFields,
confirmOrderStatusAction,
DRAFT_AUDIT_STATUS,
DRAFT_AUDIT_STATUS_NAME,
getEmptyScanDetail,
buildScanDetailFromScanResponse,
buildScanUpdateParams,
pickDefaultWarehouse,
} from '@/common/storeGoodsProcessReturnIn';
export default {
mixins: [scanMixin, remoteSelectMixin],
data() {
return {
pageMode: 'add',
orderId: 0,
form: this.getEmptyForm(),
headerSaved: false,
selectShow: false,
selectList: [],
selectType: '',
canScan: false,
QRBarCode: '',
BarCodeDelStatus: false,
BillDataMessage: '',
scanDetail: getEmptyScanDetail(),
auditStatus: 0,
processUnitOptions: [],
warehouseOptions: [],
dropdownLoading: false,
/** 仓位 */
warehouseBinId: 0,
warehouseBinCode: '',
warehouseBinName: '',
/** 手机连续扫码开关:成功后自动再调起;取消/失败则关闭 */
phoneContinuousScan: false,
/** 手机扫当前目标:bin | qr */
phoneScanTarget: 'bin',
};
},
computed: {
isReadonly() {
return this.pageMode === 'view';
},
isEditable() {
return this.pageMode === 'add' || this.pageMode === 'edit';
},
headerEditable() {
return this.pageMode === 'add' && !this.headerSaved;
},
statusActionButtons() {
return getFormStatusActionButtons(this.headerSaved, this.orderId, this.auditStatus);
},
displayAuditStatus() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS;
return this.auditStatus;
},
displayAuditStatusName() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS_NAME;
return AUDIT_STATUS_MAP[this.auditStatus] || '';
},
/** 录入需先选仓位;删除模式仅需单据可扫 */
canScanQr() {
if (!this.canScan) return false;
if (this.BarCodeDelStatus) return true;
return !!this.warehouseBinId;
},
/** 扫码栏在可扫状态下始终展示(含删除勾选) */
showQrScanBar() {
return this.canScan;
},
qrDisabledTip() {
if (!this.canScan) return '请先提交保存后再扫码';
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
return '当前状态不可扫码';
},
},
onShow() {
this.isPageActive = true;
initTts();
if (this.canScan && this.isEditable) {
this.registerOrderScanBroadcast();
}
},
onHide() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
onUnload() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
methods: {
clearWarehouseBin() {
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.phoneContinuousScan = false;
},
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
applyWarehouseBinScan(scanResult) {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
this.warehouseBinCode = '';
this.$nextTick(() => {
this.warehouseBinCode = code;
this.$nextTick(() => this.resolveWarehouseBin());
});
},
handleBinPhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
this.phoneContinuousScan = false;
this.phoneScanTarget = 'bin';
this.openPhoneScan({
callback: (scanResult) => {
this.applyWarehouseBinScan(scanResult);
},
fail: () => {},
});
},
handlePhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
// 删除模式可直接扫布匹码;录入模式无仓位时先扫仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.handleBinPhoneScan();
return;
}
this.phoneScanTarget = 'qr';
this.phoneContinuousScan = true;
this.openContinuousPhoneScan();
},
openContinuousPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
this.openPhoneScan({
callback: (scanResult) => {
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan({ fromPhone: true }));
},
fail: () => {
this.phoneContinuousScan = false;
},
});
},
scheduleNextPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
setTimeout(() => {
this.openContinuousPhoneScan();
}, 400);
},
registerOrderScanBroadcast() {
this.registerScanBroadcast((scanResult) => {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.applyWarehouseBinScan(code);
return;
}
this.QRBarCode = code;
this.$nextTick(() => this.handleScan());
});
},
resolveWarehouseBin() {
const code = (this.warehouseBinCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
if (!code) return;
if (!this.form.warehouse_id) {
this.showError('单据缺少仓库信息');
return;
}
uni.showLoading({ title: '识别仓位...' });
return this.$u.api.warehouseBin.getByQrCode({
qr_code: code,
warehouse_id: Number(this.form.warehouse_id),
})
.then((data) => {
uni.hideLoading();
if (!data || !data.id) {
throw new Error('未识别到仓位');
}
// 返回 physical_warehouse_id,与单据仓库校验
if (
data.physical_warehouse_id
&& String(data.physical_warehouse_id) !== String(this.form.warehouse_id)
) {
this.warehouseBinId = 0;
this.warehouseBinName = '';
throw new Error('该仓位不属于当前仓库');
}
this.warehouseBinId = data.id;
this.warehouseBinCode = data.code || data.qr_code || code;
this.warehouseBinName = data.name || '';
this.BillDataMessage = '';
speak('仓位成功');
uni.showToast({ title: '仓位识别成功', icon: 'success' });
})
.catch((e) => {
uni.hideLoading();
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.showError(e.message || '仓位识别失败');
});
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
}
this.canScan = nextCanScan;
},
loadBaseDropdowns() {
if (this.dropdownLoading) return Promise.resolve();
this.dropdownLoading = true;
return Promise.all([
this.ensureProcessUnitOptions().catch((e) => {
console.error('加载加工单位失败', e);
return [];
}),
this.ensureWarehouseOptions().catch((e) => {
console.error('加载仓库失败', e);
return [];
}),
]).finally(() => {
this.dropdownLoading = false;
});
},
ensureProcessUnitOptions() {
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
.then((res) => {
this.processUnitOptions = mapToSelectOptions(res);
return this.processUnitOptions;
});
},
ensureWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
if (this.headerEditable && !this.form.warehouse_id) {
this.applyDefaultWarehouse();
}
return this.warehouseOptions;
});
},
fetchRemoteSelectOptions(type, keyword) {
const empty = !String(keyword || '').trim();
if (type === '加工单位') {
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.processUnitOptions = list;
return list;
});
}
if (type === '仓库名称') {
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.warehouseOptions = list;
return list;
});
}
return Promise.resolve([]);
},
applyDefaultWarehouse() {
const app = getApp();
const picked = pickDefaultWarehouse(
this.warehouseOptions,
app && app.globalData ? app.globalData.StoreNameID : '',
app && app.globalData ? app.globalData.StoreName : '',
);
if (!picked) return;
this.form.warehouse_id = picked.value;
this.form.warehouse_name = picked.label;
},
getEmptyForm() {
return {
order_no: '',
process_unit_id: '',
process_name: '',
warehouse_id: '',
warehouse_name: '',
remark: '',
item_data: [],
};
},
loadOrder(id, options = {}) {
const { rejectIfLocked = false } = options;
return this.$u.api.fpmProcessReturnInOrder.detail({ id })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return null;
}
if (rejectIfLocked && isLockedOrderStatus(order.audit_status)) {
this.showError('当前状态不可编辑');
setTimeout(() => uni.navigateBack(), 1500);
return null;
}
this.orderId = order.id;
this.auditStatus = order.audit_status;
this.headerSaved = true;
this.form = orderToFormFields(order);
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
if (this.canScan) this.registerOrderScanBroadcast();
return order;
})
.catch((e) => {
this.showError(e.message || '加载单据失败');
return null;
});
},
pickerSelectFun(type) {
if (!this.headerEditable) return;
const cache = {
'加工单位': this.processUnitOptions,
'仓库名称': this.warehouseOptions,
};
if (cache[type]) this.openSelectPicker(type, cache[type]);
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '加工单位') {
this.form.process_unit_id = item.value;
this.form.process_name = item.label;
} else if (this.selectType === '仓库名称') {
this.form.warehouse_id = item.value;
this.form.warehouse_name = item.label;
}
},
validateForm() {
if (!this.form.process_unit_id) return '请选择加工单位';
if (!this.form.warehouse_id) return '请选择仓库名称';
const app = getApp();
const saleSystemId = app && app.globalData ? app.globalData.PlanDepartmentID : '';
if (!saleSystemId) return '缺少营销体系,请重新登录';
return '';
},
buildAddParam() {
const app = getApp();
return {
inOrderType: IN_ORDER_TYPE_PROCESS_RETURN,
biz_unit_id: Number(this.form.process_unit_id),
warehouse_id: Number(this.form.warehouse_id),
sale_system_id: Number(app.globalData.PlanDepartmentID),
remark: this.form.remark || '',
item_data: [],
};
},
submitSave() {
if (this.headerSaved) {
this.showError('表头已保存,请直接扫码');
return;
}
const err = this.validateForm();
if (err) {
this.showError(err);
return;
}
uni.showLoading({ title: '保存中...' });
this.$u.api.fpmProcessReturnInOrder.add(this.buildAddParam())
.then((res) => {
this.orderId = (res && res.id) || 0;
if (!this.orderId) {
throw new Error('保存失败,未返回单据ID');
}
return this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId });
})
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.applyOrder(order);
this.headerSaved = true;
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('保存成功,请先扫描仓位');
this.registerOrderScanBroadcast();
})
.catch((e) => {
uni.hideLoading();
this.showError(e.message || '保存失败');
});
},
applyOrder(order) {
if (!order) return;
this.auditStatus = order.audit_status;
Object.assign(this.form, orderToFormFields(order));
},
handleScan(options = {}) {
const fromPhone = !!options.fromPhone;
const code = (this.QRBarCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
const isDelete = this.BarCodeDelStatus;
if (!isDelete && !this.warehouseBinId) {
this.showError('请先扫描仓位');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
if (!code) {
this.QRBarCode = '';
if (fromPhone) this.scheduleNextPhoneScan();
return;
}
const arrangeType = isDelete ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN;
this.doScanUpdate(code, arrangeType, { fromPhone });
},
BarCodeDelChange(e) {
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
this.BillDataMessage = this.BarCodeDelStatus ? '删除模式:扫描细码即可删除' : '';
},
getFineCodeScanCode(fineCode) {
if (!fineCode) return '';
return fineCode.qr_code || fineCode.scan_code || fineCode.bar_code || '';
},
onDeleteFineCode(fineCode) {
if (!this.canScan || !this.orderId) {
this.showError('当前状态不可删除');
return;
}
const scanCode = this.getFineCodeScanCode(fineCode);
if (!scanCode) {
this.showError('该细码缺少条码,无法删除');
return;
}
uni.showModal({
title: '提示',
content: `确认删除细码 ${scanCode}?`,
success: (res) => {
if (!res.confirm) return;
this.doScanUpdate(scanCode, ARRANGE_TYPE.DEL);
},
});
},
doScanUpdate(scanCode, arrangeType, options = {}) {
const { fromPhone = false } = options;
const isDelete = arrangeType === ARRANGE_TYPE.DEL;
uni.showLoading({ title: isDelete ? '删除中...' : '处理中...' });
return this.$u.api.fpmProcessReturnInOrder.scanUpdate(buildScanUpdateParams({
id: this.orderId,
scanCode,
arrangeType,
// 删除不强制仓位;录入带当前仓位
warehouseBinId: isDelete ? 0 : this.warehouseBinId,
}))
.then((scanRes) => {
this.scanDetail = buildScanDetailFromScanResponse(scanRes);
this.BillDataMessage = isDelete ? '删除成功' : '扫描成功';
this.QRBarCode = '';
if (isDelete) {
speak('已删除');
uni.showToast({ title: '删除成功', icon: 'success' });
} else {
speak('成功');
}
return this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
.then((detail) => {
const order = normalizeOrder(detail);
if (order) {
this.form.item_data = order.item_data;
this.auditStatus = order.audit_status;
}
})
.catch(() => null);
})
.then(() => {
uni.hideLoading();
if (fromPhone) this.scheduleNextPhoneScan();
})
.catch((e) => {
uni.hideLoading();
this.phoneContinuousScan = false;
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
this.showError(message);
this.QRBarCode = '';
});
},
handleStatusAction(action) {
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
if (!order) return;
this.applyOrder(order);
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('操作成功');
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
showSuccess(message) {
util.playSuccessAudio();
uni.showToast({ title: message, icon: 'success' });
},
},
};

View File

@ -0,0 +1,129 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<text>{{ order.in_order_type_name || '加工退货进仓单' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ order.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ order.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text>
<text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditor_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text>
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<ProcessInDetailList
:title="detailTitle"
:list="order.item_data"
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
</view>
</template>
<script>
import util from '@/common/util';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import {
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeGoodsProcessReturnIn';
export default {
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
data() {
return {
orderId: 0,
order: { item_data: [] },
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `进仓明细(共 ${this.order.total_roll || 0} 匹)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '查看加工退货进仓单' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeGoodsProcessReturnInEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>

View File

@ -0,0 +1,167 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
</view>
<view @click="pickerSelectFun('供应商')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">供应商<text class="redXingh">*</text></text>
<view :class="form.biz_unit_name ? '' : 'cBlack'">
{{ form.biz_unit_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('仓库名称')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称<text class="redXingh">*</text></text>
<view :class="form.warehouse_name ? '' : 'cBlack'">
{{ form.warehouse_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26 ptb10 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<u-input
v-model="form.paper_tube_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="1.5"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<u-input
v-model="form.package_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="0.3"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
</view>
<view @click="pickerSelectFun('营销体系')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系<text class="redXingh">*</text></text>
<view :class="form.sale_system_name ? '' : 'cBlack'">
{{ form.sale_system_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view @click="pickerSelectFun('订单类型')" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">订单类型<text class="redXingh">*</text></text>
<view :class="form.sale_mode_name ? '' : 'cBlack'">
{{ form.sale_mode_name || '请选择' }}
<u-icon v-if="headerEditable" class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
</view>
</view>
<view class="flex-white-plr26-column ptb20 mt32">
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
show-tare-columns
@delete="onDeleteFineCode"
/>
<FabricOutFooter
v-if="!headerSaved"
:buttons="[{ label: '提交保存', action: 'save' }]"
single
@action="submitSave"
/>
<FabricOutFooter
v-else
:buttons="statusActionButtons"
@action="handleStatusAction"
/>
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsPurchaseInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
data() {
return {
weightInputStyle: {
fontSize: '36rpx',
},
};
},
onLoad() {
uni.setNavigationBarTitle({ title: '新增采购进仓单' });
this.pageMode = 'add';
this.loadBaseDropdowns();
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
::v-deep .u-input__input {
font-size: 36rpx !important;
}
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ form.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">供应商</text>
<text>{{ form.biz_unit_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ form.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb10 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<u-input
v-model="form.paper_tube_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="1.5"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<u-input
v-model="form.package_weight"
type="digit"
:disabled="!canEditWeights"
placeholder="0.3"
:custom-style="weightInputStyle"
placeholder-style="color: #c0c4cc; font-size: 36rpx;"
/>
</view>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系</text>
<text>{{ form.sale_system_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">订单类型</text>
<text>{{ form.sale_mode_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ form.remark || '-' }}</text>
</view>
<ProcessInBinBar
:can-scan="canScan"
:bin-id="warehouseBinId"
:code="warehouseBinCode"
:name="warehouseBinName"
:show-phone-scan="canScan"
@code-input="warehouseBinCode = $event"
@confirm="resolveWarehouseBin"
@phone-scan="handleBinPhoneScan"
@clear="clearWarehouseBin"
/>
<FabricOutScanBar
:can-scan="showQrScanBar"
:value="QRBarCode"
:delete-mode="BarCodeDelStatus"
:message="BillDataMessage"
:disabled-tip="qrDisabledTip"
:show-phone-scan="canScanQr"
@input="QRBarCode = $event"
@scan="handleScan"
@phone-scan="handlePhoneScan"
@delete-mode-change="BarCodeDelChange"
/>
<ProcessInScanDetail :detail="scanDetail" />
<ProcessInDetailList
:list="form.item_data"
:deletable="canScan"
show-tare-columns
@delete="onDeleteFineCode"
/>
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
</view>
</template>
<script>
import formMixin from './storeGoodsPurchaseInMixin.js';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
export default {
components: {
OrderStatusBar,
FabricOutScanBar,
FabricOutFooter,
ProcessInScanDetail,
ProcessInDetailList,
ProcessInBinBar,
},
mixins: [formMixin],
data() {
return {
weightInputStyle: {
fontSize: '36rpx',
},
};
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '编辑采购进仓单' });
this.pageMode = 'edit';
if (e.id) {
this.loadOrder(Number(e.id), { rejectIfLocked: true });
}
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
::v-deep .u-input__input {
font-size: 36rpx !important;
}
}
</style>

View File

@ -0,0 +1,281 @@
<template>
<view>
<view class="filterBar">
<u-search v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="loadList" @custom="loadList" />
<view class="filterBtn" @click="filterShow = true">
<u-icon name="list" size="40" color="#666"></u-icon>
<text>筛选</text>
</view>
</view>
<scroll-view scroll-y :style="{ height: scrollHeight }" refresher-enabled
:refresher-triggered="triggered" @refresherrefresh="onRefresh">
<dataNull v-if="list.length === 0" src="/src/static/img/chahua/gjNull.png"
title="暂无采购进仓单" title1="请点击右下角按钮新增">
</dataNull>
<view v-for="(item, index) in list" :key="item.id" @click="goView(item)">
<PurchaseInItem :item="item" :index="index" />
</view>
</scroll-view>
<addBtn url="./storeGoodsPurchaseInAdd"></addBtn>
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
<view class="filterPanel">
<view class="filterTitle">筛选条件</view>
<view class="filterItem">
<text class="filterLabel">进仓单号</text>
<u-input v-model="filters.order_no" placeholder="请输入进仓单号" />
</view>
<view class="filterItem" @click="openSupplierSelect">
<text class="filterLabel">供应商</text>
<view class="filterValue">{{ supplierLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openWarehouseSelect">
<text class="filterLabel">仓库</text>
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterItem" @click="openStatusSelect">
<text class="filterLabel">订单状态</text>
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
</view>
<view class="filterActions">
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
<u-button type="primary" size="medium" @click="applyFilter">确定</u-button>
</view>
</view>
</u-popup>
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
<u-select v-model="unitSelectShow" :list="unitSelectList" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
</view>
</template>
<script>
import addBtn from '@/components/addBtn/addBtn.vue';
import PurchaseInItem from '@/components/card/storeGoodsPurchaseInItem.vue';
import {
getStatusOptions,
AUDIT_STATUS_MAP,
BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER,
WAREHOUSE_TYPE_FINISHED,
formatRoll,
mapToSelectOptions,
fetchAllOrderList,
} from '@/common/storeGoodsPurchaseIn';
import { withNameParam } from '@/common/remoteSelect';
export default {
components: { addBtn, PurchaseInItem },
data() {
return {
list: [],
scrollHeight: '667px',
triggered: false,
listLoading: false,
filterShow: false,
statusSelectShow: false,
unitSelectShow: false,
unitSelectType: '',
supplierOptions: [],
warehouseOptions: [],
unitOptionsLoading: false,
selectSearching: false,
unitSearchSeq: 0,
unitSelectList: [{ value: '', label: '全部' }],
filters: {
order_no: '',
supplier_id: '',
supplier_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
},
statusSelectList: [
{ value: '', label: '全部' },
...getStatusOptions(),
],
};
},
computed: {
statusLabel() {
if (this.filters.audit_status === '' || this.filters.audit_status === null) return '';
return AUDIT_STATUS_MAP[Number(this.filters.audit_status)] || '';
},
supplierLabel() {
return this.filters.supplier_name || '';
},
warehouseLabel() {
return this.filters.warehouse_name || '';
},
},
onLoad() {
uni.setNavigationBarTitle({ title: '成品采购进仓' });
uni.getSystemInfo({
success: (res) => {
this.scrollHeight = `${res.windowHeight - 50}px`;
},
});
},
onShow() {
this.loadList();
},
methods: {
loadSupplierOptions() {
if (this.supplierOptions.length) return Promise.resolve(this.supplierOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER })
.then((res) => {
this.supplierOptions = mapToSelectOptions(res);
return this.supplierOptions;
})
.catch(() => {
this.supplierOptions = [];
return this.supplierOptions;
});
},
loadWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
return this.warehouseOptions;
})
.catch(() => {
this.warehouseOptions = [];
return this.warehouseOptions;
});
},
applyUnitSelectList(list) {
const rows = Array.isArray(list) ? list.slice() : [];
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
},
openUnitSelect(type) {
this.unitSelectType = type;
const cache = type === 'warehouse' ? this.warehouseOptions : this.supplierOptions;
this.applyUnitSelectList(cache);
this.unitSelectShow = true;
},
onUnitSearch(keyword) {
const seq = ++this.unitSearchSeq;
const type = this.unitSelectType;
const empty = !String(keyword || '').trim();
this.selectSearching = true;
const req = type === 'warehouse'
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER }, keyword));
req.then((res) => {
if (seq !== this.unitSearchSeq) return;
const list = mapToSelectOptions(res);
if (empty) {
if (type === 'warehouse') this.warehouseOptions = list;
else this.supplierOptions = list;
}
this.applyUnitSelectList(list);
}).catch((e) => {
if (seq !== this.unitSearchSeq) return;
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
}).then(() => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
}, () => {
if (seq === this.unitSearchSeq) this.selectSearching = false;
});
},
openSupplierSelect() {
this.openUnitSelect('supplier');
},
openWarehouseSelect() {
this.openUnitSelect('warehouse');
},
onUnitConfirm(e) {
const item = e[0] || {};
if (this.unitSelectType === 'warehouse') {
this.filters.warehouse_id = item.value;
this.filters.warehouse_name = item.value ? item.label : '';
} else {
this.filters.supplier_id = item.value;
this.filters.supplier_name = item.value ? item.label : '';
}
},
loadList() {
if (this.listLoading) return;
this.listLoading = true;
const params = {};
if (this.filters.order_no) params.order_no = this.filters.order_no;
if (this.filters.supplier_id) params.supplier_id = this.filters.supplier_id;
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
params.audit_status = this.filters.audit_status;
}
fetchAllOrderList((p) => this.$u.api.fpmPrcInOrder.list(p), params)
.then((rows) => {
this.list = rows.map(this.mapToCard);
})
.catch((err) => {
this.list = [];
uni.showToast({ title: err.message || '加载失败', icon: 'none' });
})
.finally(() => {
this.listLoading = false;
this.triggered = false;
// 避免并发请求下 uView 全局 loading 遮罩关不掉
uni.hideLoading();
});
},
mapToCard(order) {
return {
id: order.id,
order_no: order.order_no || '',
biz_unit_id: order.biz_unit_id || '',
biz_unit_name: order.biz_unit_name || '',
warehouse_id: order.warehouse_id || '',
warehouse_name: order.warehouse_name || '',
create_user_name: order.creator_name || '',
create_time: order.create_time || '',
auditor_name: order.auditor_name || '',
audit_date: order.audit_time || '',
audit_status: order.audit_status,
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
total_roll: formatRoll(order.total_roll),
};
},
onRefresh() {
this.triggered = true;
this.loadList();
},
goView(item) {
const page = Number(item.audit_status) === 1
? 'storeGoodsPurchaseInEdit'
: 'storeGoodsPurchaseInView';
uni.navigateTo({ url: `./${page}?id=${item.id}` });
},
openStatusSelect() { this.statusSelectShow = true; },
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
resetFilter() {
this.filters = {
order_no: '',
supplier_id: '',
supplier_name: '',
warehouse_id: '',
warehouse_name: '',
audit_status: '',
};
},
applyFilter() {
this.filterShow = false;
this.loadList();
},
},
};
</script>
<style>
page { background-color: #F8F8F8; }
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
.filterPanel { padding: 30rpx; }
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
.filterItem { margin-bottom: 24rpx; }
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
</style>

View File

@ -0,0 +1,658 @@
/**
* 成品采购进仓单表单 mixin(新增/编辑共用)
*
* 1. 先填表头(供应商 / 仓库 / 营销体系 / 订单类型 / 备注)提交 add,拿到 id 后可扫码
* 2. 先扫仓位(getWarehouseBin:传 qr_code + warehouse_id),校验后扫布匹二维码
* 3. 扫码走 updateFpmPrcInOrder(arrange_type: 1 录入 / 3 删除,带 warehouse_bin_id、纸筒/包装重量)
* 4. 手机扫码成功展示详情后自动再次调起扫码,形成连续扫
*/
import util from '@/common/util';
import scanMixin from '@/common/scanMixin.js';
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
import { withNameParam } from '@/common/remoteSelect';
import { initTts, speak } from '@/common/tts.js';
import {
AUDIT_STATUS_MAP,
ARRANGE_TYPE,
BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER,
WAREHOUSE_TYPE_FINISHED,
IN_ORDER_TYPE_PURCHASE,
IN_ORDER_TYPE_MAP,
SALE_MODE,
SALE_MODE_MAP,
SALE_MODE_OPTIONS,
DEFAULT_PAPER_TUBE_WEIGHT,
DEFAULT_PACKAGE_WEIGHT,
normalizeOrder,
mapToSelectOptions,
canScanAtStatus,
isLockedOrderStatus,
getFormStatusActionButtons,
orderToFormFields,
confirmOrderStatusAction,
DRAFT_AUDIT_STATUS,
DRAFT_AUDIT_STATUS_NAME,
getEmptyScanDetail,
buildScanDetailFromScanResponse,
buildScanUpdateParams,
pickDefaultWarehouse,
validateScanWeights,
} from '@/common/storeGoodsPurchaseIn';
export default {
mixins: [scanMixin, remoteSelectMixin],
data() {
return {
pageMode: 'add',
orderId: 0,
form: this.getEmptyForm(),
headerSaved: false,
selectShow: false,
selectList: [],
selectType: '',
canScan: false,
QRBarCode: '',
BarCodeDelStatus: false,
BillDataMessage: '',
scanDetail: getEmptyScanDetail(),
auditStatus: 0,
supplierOptions: [],
warehouseOptions: [],
saleSystemOptions: [],
saleModeOptions: SALE_MODE_OPTIONS,
dropdownLoading: false,
/** 仓位 */
warehouseBinId: 0,
warehouseBinCode: '',
warehouseBinName: '',
/** 手机连续扫码开关:成功后自动再调起;取消/失败则关闭 */
phoneContinuousScan: false,
/** 手机扫当前目标:bin | qr */
phoneScanTarget: 'bin',
};
},
computed: {
isReadonly() {
return this.pageMode === 'view';
},
isEditable() {
return this.pageMode === 'add' || this.pageMode === 'edit';
},
headerEditable() {
return this.pageMode === 'add' && !this.headerSaved;
},
/** 纸筒/包装重量随扫码提交,保存前后及可扫编辑态均可改 */
canEditWeights() {
return this.isEditable && (this.headerEditable || this.canScan);
},
statusActionButtons() {
return getFormStatusActionButtons(this.headerSaved, this.orderId, this.auditStatus);
},
displayAuditStatus() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS;
return this.auditStatus;
},
displayAuditStatusName() {
if (this.pageMode === 'add' && !this.headerSaved) return DRAFT_AUDIT_STATUS_NAME;
return AUDIT_STATUS_MAP[this.auditStatus] || '';
},
/** 录入需先选仓位;删除模式仅需单据可扫 */
canScanQr() {
if (!this.canScan) return false;
if (this.BarCodeDelStatus) return true;
return !!this.warehouseBinId;
},
/** 扫码栏在可扫状态下始终展示(含删除勾选) */
showQrScanBar() {
return this.canScan;
},
qrDisabledTip() {
if (!this.canScan) return '请先提交保存后再扫码';
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
return '当前状态不可扫码';
},
},
onShow() {
this.isPageActive = true;
initTts();
if (this.canScan && this.isEditable) {
this.registerOrderScanBroadcast();
}
},
onHide() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
onUnload() {
this.isPageActive = false;
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
},
methods: {
clearWarehouseBin() {
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.phoneContinuousScan = false;
},
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
applyWarehouseBinScan(scanResult) {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
this.warehouseBinCode = '';
this.$nextTick(() => {
this.warehouseBinCode = code;
this.$nextTick(() => this.resolveWarehouseBin());
});
},
handleBinPhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
this.phoneContinuousScan = false;
this.phoneScanTarget = 'bin';
this.openPhoneScan({
callback: (scanResult) => {
this.applyWarehouseBinScan(scanResult);
},
fail: () => {},
});
},
handlePhoneScan() {
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
// 删除模式可直接扫布匹码;录入模式无仓位时先扫仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.handleBinPhoneScan();
return;
}
this.phoneScanTarget = 'qr';
this.phoneContinuousScan = true;
this.openContinuousPhoneScan();
},
openContinuousPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
this.openPhoneScan({
callback: (scanResult) => {
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan({ fromPhone: true }));
},
fail: () => {
this.phoneContinuousScan = false;
},
});
},
scheduleNextPhoneScan() {
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
this.phoneContinuousScan = false;
return;
}
setTimeout(() => {
this.openContinuousPhoneScan();
}, 400);
},
registerOrderScanBroadcast() {
this.registerScanBroadcast((scanResult) => {
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
if (!code) return;
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
this.applyWarehouseBinScan(code);
return;
}
this.QRBarCode = code;
this.$nextTick(() => this.handleScan());
});
},
resolveWarehouseBin() {
const code = (this.warehouseBinCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
return;
}
if (!code) return;
if (!this.form.warehouse_id) {
this.showError('单据缺少仓库信息');
return;
}
uni.showLoading({ title: '识别仓位...' });
return this.$u.api.warehouseBin.getByQrCode({
qr_code: code,
warehouse_id: Number(this.form.warehouse_id),
})
.then((data) => {
uni.hideLoading();
if (!data || !data.id) {
throw new Error('未识别到仓位');
}
// 返回 physical_warehouse_id,与单据仓库校验
if (
data.physical_warehouse_id
&& String(data.physical_warehouse_id) !== String(this.form.warehouse_id)
) {
this.warehouseBinId = 0;
this.warehouseBinName = '';
throw new Error('该仓位不属于当前仓库');
}
this.warehouseBinId = data.id;
this.warehouseBinCode = data.code || data.qr_code || code;
this.warehouseBinName = data.name || '';
this.BillDataMessage = '';
speak('仓位成功');
uni.showToast({ title: '仓位识别成功', icon: 'success' });
})
.catch((e) => {
uni.hideLoading();
this.warehouseBinId = 0;
this.warehouseBinCode = '';
this.warehouseBinName = '';
this.showError(e.message || '仓位识别失败');
});
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
this.phoneContinuousScan = false;
this.unregisterScanBroadcast();
}
this.canScan = nextCanScan;
},
loadBaseDropdowns() {
if (this.dropdownLoading) return Promise.resolve();
this.dropdownLoading = true;
if (this.headerEditable) this.applyDefaultSaleSystem();
return Promise.all([
this.ensureSupplierOptions().catch((e) => {
console.error('加载供应商失败', e);
return [];
}),
this.ensureWarehouseOptions().catch((e) => {
console.error('加载仓库失败', e);
return [];
}),
this.ensureSaleSystemOptions().catch((e) => {
console.error('加载营销体系失败', e);
return [];
}),
]).finally(() => {
this.dropdownLoading = false;
});
},
ensureSupplierOptions() {
if (this.supplierOptions.length) return Promise.resolve(this.supplierOptions);
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER })
.then((res) => {
this.supplierOptions = mapToSelectOptions(res);
return this.supplierOptions;
});
},
ensureWarehouseOptions() {
if (this.warehouseOptions.length) return Promise.resolve(this.warehouseOptions);
return this.$u.api.physicalWarehouse.getDropdownList({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED })
.then((res) => {
this.warehouseOptions = mapToSelectOptions(res);
if (this.headerEditable && !this.form.warehouse_id) {
this.applyDefaultWarehouse();
}
return this.warehouseOptions;
});
},
ensureSaleSystemOptions() {
if (this.saleSystemOptions.length) return Promise.resolve(this.saleSystemOptions);
return this.$u.api.saleSystem.getDropdownList()
.then((res) => {
this.saleSystemOptions = mapToSelectOptions(res);
if (this.headerEditable) this.applyDefaultSaleSystem();
return this.saleSystemOptions;
});
},
fetchRemoteSelectOptions(type, keyword) {
const empty = !String(keyword || '').trim();
if (type === '供应商') {
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.supplierOptions = list;
return list;
});
}
if (type === '仓库名称') {
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.warehouseOptions = list;
return list;
});
}
if (type === '营销体系') {
return this.$u.api.saleSystem.getDropdownList(withNameParam({}, keyword))
.then((res) => {
const list = mapToSelectOptions(res);
if (empty) this.saleSystemOptions = list;
return list;
});
}
return Promise.resolve([]);
},
applyDefaultWarehouse() {
const app = getApp();
const picked = pickDefaultWarehouse(
this.warehouseOptions,
app && app.globalData ? app.globalData.StoreNameID : '',
app && app.globalData ? app.globalData.StoreName : '',
);
if (!picked) return;
this.form.warehouse_id = picked.value;
this.form.warehouse_name = picked.label;
},
applyDefaultSaleSystem() {
if (this.form.sale_system_id) {
if (!this.form.sale_system_name && this.saleSystemOptions.length) {
const found = this.saleSystemOptions.find(
(item) => String(item.value) === String(this.form.sale_system_id),
);
if (found) this.form.sale_system_name = found.label;
}
return;
}
const app = getApp();
const gd = app && app.globalData ? app.globalData : {};
const id = gd.PlanDepartmentID;
if (!id) return;
this.form.sale_system_id = id;
this.form.sale_system_name = gd.PlanDepartmentName || '';
if (!this.form.sale_system_name && this.saleSystemOptions.length) {
const found = this.saleSystemOptions.find((item) => String(item.value) === String(id));
if (found) this.form.sale_system_name = found.label;
}
},
getEmptyForm() {
const app = getApp();
const gd = app && app.globalData ? app.globalData : {};
return {
order_no: '',
biz_unit_id: '',
biz_unit_name: '',
warehouse_id: '',
warehouse_name: '',
sale_system_id: gd.PlanDepartmentID || '',
sale_system_name: gd.PlanDepartmentName || '',
sale_mode: SALE_MODE.BULK,
sale_mode_name: SALE_MODE_MAP[SALE_MODE.BULK],
in_order_type: IN_ORDER_TYPE_PURCHASE,
in_order_type_name: IN_ORDER_TYPE_MAP[IN_ORDER_TYPE_PURCHASE],
paper_tube_weight: String(DEFAULT_PAPER_TUBE_WEIGHT),
package_weight: String(DEFAULT_PACKAGE_WEIGHT),
remark: '',
item_data: [],
};
},
loadOrder(id, options = {}) {
const { rejectIfLocked = false } = options;
return this.$u.api.fpmPrcInOrder.detail({ id })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return null;
}
if (rejectIfLocked && isLockedOrderStatus(order.audit_status)) {
this.showError('当前状态不可编辑');
setTimeout(() => uni.navigateBack(), 1500);
return null;
}
this.orderId = order.id;
this.auditStatus = order.audit_status;
this.headerSaved = true;
this.form = orderToFormFields(order);
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
if (this.canScan) this.registerOrderScanBroadcast();
return order;
})
.catch((e) => {
this.showError(e.message || '加载单据失败');
return null;
});
},
pickerSelectFun(type) {
if (!this.headerEditable) return;
if (type === '订单类型') {
this.selectType = type;
if (!this.saleModeOptions.length) {
this.showError('暂无可选数据');
return;
}
this.selectList = this.saleModeOptions;
this.selectShow = true;
return;
}
const cache = {
'供应商': this.supplierOptions,
'仓库名称': this.warehouseOptions,
'营销体系': this.saleSystemOptions,
};
if (cache[type]) this.openSelectPicker(type, cache[type]);
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '供应商') {
this.form.biz_unit_id = item.value;
this.form.biz_unit_name = item.label;
} else if (this.selectType === '仓库名称') {
this.form.warehouse_id = item.value;
this.form.warehouse_name = item.label;
} else if (this.selectType === '营销体系') {
this.form.sale_system_id = item.value;
this.form.sale_system_name = item.label;
} else if (this.selectType === '订单类型') {
this.form.sale_mode = item.value;
this.form.sale_mode_name = item.label;
}
},
validateForm() {
if (!this.form.biz_unit_id) return '请选择供应商';
if (!this.form.warehouse_id) return '请选择仓库名称';
if (!this.form.sale_system_id) return '请选择营销体系';
if (!this.form.sale_mode) return '请选择订单类型';
return '';
},
buildAddParam() {
return {
inOrderType: IN_ORDER_TYPE_PURCHASE,
biz_unit_id: Number(this.form.biz_unit_id),
warehouse_id: Number(this.form.warehouse_id),
sale_system_id: Number(this.form.sale_system_id),
sale_mode: Number(this.form.sale_mode),
remark: this.form.remark || '',
item_data: [],
};
},
submitSave() {
if (this.headerSaved) {
this.showError('表头已保存,请直接扫码');
return;
}
const err = this.validateForm();
if (err) {
this.showError(err);
return;
}
uni.showLoading({ title: '保存中...' });
this.$u.api.fpmPrcInOrder.add(this.buildAddParam())
.then((res) => {
this.orderId = (res && res.id) || 0;
if (!this.orderId) {
throw new Error('保存失败,未返回单据ID');
}
return this.$u.api.fpmPrcInOrder.detail({ id: this.orderId });
})
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
this.applyOrder(order, { keepWeights: true });
this.headerSaved = true;
this.clearWarehouseBin();
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('保存成功,请先扫描仓位');
this.registerOrderScanBroadcast();
})
.catch((e) => {
uni.hideLoading();
this.showError(e.message || '保存失败');
});
},
applyOrder(order, options = {}) {
if (!order) return;
this.auditStatus = order.audit_status;
const paperTubeWeight = this.form.paper_tube_weight;
const packageWeight = this.form.package_weight;
Object.assign(this.form, orderToFormFields(order));
if (options.keepWeights) {
this.form.paper_tube_weight = paperTubeWeight;
this.form.package_weight = packageWeight;
}
},
handleScan(options = {}) {
const fromPhone = !!options.fromPhone;
const code = (this.QRBarCode || '').trim();
if (!this.canScan || !this.orderId) {
this.showError('请先提交保存后再扫码');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
const isDelete = this.BarCodeDelStatus;
if (!isDelete && !this.warehouseBinId) {
this.showError('请先扫描仓位');
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
if (!code) {
this.QRBarCode = '';
if (fromPhone) this.scheduleNextPhoneScan();
return;
}
const arrangeType = isDelete ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN;
this.doScanUpdate(code, arrangeType, { fromPhone });
},
BarCodeDelChange(e) {
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
this.BillDataMessage = this.BarCodeDelStatus ? '删除模式:扫描细码即可删除' : '';
},
getFineCodeScanCode(fineCode) {
if (!fineCode) return '';
return fineCode.qr_code
|| fineCode.long_code
|| fineCode.scan_code
|| fineCode.digital_code
|| fineCode.bar_code
|| fineCode.short_code
|| '';
},
onDeleteFineCode(fineCode) {
if (!this.canScan || !this.orderId) {
this.showError('当前状态不可删除');
return;
}
const scanCode = this.getFineCodeScanCode(fineCode);
if (!scanCode) {
this.showError('该细码缺少条码,无法删除');
return;
}
uni.showModal({
title: '提示',
content: `确认删除细码 ${scanCode}?`,
success: (res) => {
if (!res.confirm) return;
this.doScanUpdate(scanCode, ARRANGE_TYPE.DEL);
},
});
},
doScanUpdate(scanCode, arrangeType, options = {}) {
const { fromPhone = false } = options;
const isDelete = arrangeType === ARRANGE_TYPE.DEL;
if (!isDelete) {
const weightErr = validateScanWeights(this.form.paper_tube_weight, this.form.package_weight);
if (weightErr) {
this.showError(weightErr);
this.QRBarCode = '';
this.phoneContinuousScan = false;
return;
}
}
uni.showLoading({ title: isDelete ? '删除中...' : '处理中...' });
return this.$u.api.fpmPrcInOrder.scanUpdate(buildScanUpdateParams({
id: this.orderId,
scanCode,
arrangeType,
// 删除不强制仓位;录入带当前仓位
warehouseBinId: isDelete ? 0 : this.warehouseBinId,
paperTubeWeight: this.form.paper_tube_weight,
packageWeight: this.form.package_weight,
}))
.then((scanRes) => {
this.scanDetail = buildScanDetailFromScanResponse(scanRes);
this.BillDataMessage = isDelete ? '删除成功' : '扫描成功';
this.QRBarCode = '';
if (isDelete) {
speak('已删除');
uni.showToast({ title: '删除成功', icon: 'success' });
} else {
speak('成功');
}
return this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
.then((detail) => {
const order = normalizeOrder(detail);
if (order) {
this.form.item_data = order.item_data;
this.auditStatus = order.audit_status;
}
})
.catch(() => null);
})
.then(() => {
uni.hideLoading();
if (fromPhone) this.scheduleNextPhoneScan();
})
.catch((e) => {
uni.hideLoading();
this.phoneContinuousScan = false;
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
this.showError(message);
this.QRBarCode = '';
});
},
handleStatusAction(action) {
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
.then((detail) => {
uni.hideLoading();
const order = normalizeOrder(detail);
if (!order) return;
this.applyOrder(order);
this.syncCanScanFromStatus(order.audit_status);
this.showSuccess('操作成功');
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
showSuccess(message) {
util.playSuccessAudio();
uni.showToast({ title: message, icon: 'success' });
},
},
};

View File

@ -0,0 +1,153 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">供应商</text>
<text>{{ order.biz_unit_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ order.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5 process-in-weight-row">
<view class="process-in-weight-col">
<text class="mr16">纸筒重量</text>
<text>{{ order.paper_tube_weight != null ? order.paper_tube_weight : '-' }}</text>
</view>
<view class="process-in-weight-col">
<text class="mr16">包装重量</text>
<text>{{ order.package_weight != null ? order.package_weight : '-' }}</text>
</view>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">营销体系</text>
<text>{{ order.sale_system_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">订单类型</text>
<text>{{ order.sale_mode_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text>
<text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditor_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text>
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<ProcessInDetailList
:title="detailTitle"
:list="order.item_data"
show-tare-columns
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
</view>
</template>
<script>
import util from '@/common/util';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import {
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeGoodsPurchaseIn';
export default {
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
data() {
return {
orderId: 0,
order: { item_data: [] },
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `进仓明细(共 ${this.order.total_roll || 0} 匹)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '采购进仓单详情' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeGoodsPurchaseInEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
.process-in-weight-row {
gap: 20rpx;
}
.process-in-weight-col {
flex: 1;
display: flex;
align-items: center;
min-width: 0;
}
</style>

View File

@ -105,8 +105,8 @@
<!-- </view>-->
<!-- </view>-->
<!-- </div>-->
<u-picker v-model="showApiUrlPicker" mode="selector" :range="apiUrlList" range-key="label"
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-picker>
<u-select v-model="showApiUrlPicker" :list="apiUrlList" title="选择服务器"
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-select>
<!-- 版本信息显示 -->
<view class="version-info">
<text class="version-text">版本: {{ appVersion }}</text>
@ -125,6 +125,7 @@ import md5 from '@/common/md5.js';
import manifest from '@/manifest.json';
import { mapState } from 'vuex'
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
import { applyLoginData, applyUserInformation } from '@/common/userSession.js'
export default {
data() {
return {
@ -218,9 +219,8 @@ export default {
},
onApiUrlConfirm(e) {
console.log('e', JSON.stringify(e));
const selectedValue = this.apiUrlList[e[0]].value;
console.log('selectedValue', selectedValue)
const selectedValue = e && e[0] && e[0].value;
if (selectedValue == null) return;
this.selectedApiUrl = selectedValue;
this.showApiUrlPicker = false;
@ -334,11 +334,10 @@ export default {
this.$u.api.pdaLogin({
'phone': this.login.username,
'password': this.login.password,
}).then((res) => {
}).then(async (res) => {
console.log('login res', res)
var aLoginUserData = res;
//console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
// 只在开发环境保存 apiurl 到本地存储
if (config.isDevelopment) {
uni.setStorage({
@ -347,27 +346,17 @@ export default {
});
util.updateApiUrl(currentApiUrl);
}
// 保存 token 到本地存储
uni.setStorageSync('RemoteTokenData', aLoginUserData);
uni.setStorage({
key: 'userToken',
data: {
Token: aLoginUserData.token,
}
});
applyLoginData(aLoginUserData);
try {
const userInfo = await this.$u.api.pdaGetInformation();
console.log('information res', userInfo);
applyUserInformation(userInfo);
} catch (infoError) {
console.log('information error', infoError);
}
getApp().globalData.Token = aLoginUserData.token;
getApp().globalData.EmployeeID = aLoginUserData.user_id;
getApp().globalData.IsSaleUserStatus = 0;
getApp().globalData.LoginID = aLoginUserData.user_id;
getApp().globalData.LoginName = aLoginUserData.user_name;
getApp().globalData.PlanDepartmentID = aLoginUserData.default_sale_system_id;
getApp().globalData.PlanDepartmentName = aLoginUserData.default_sale_system_name;
getApp().globalData.UserGroup = '';
getApp().globalData.StoreNameID = aLoginUserData.default_physical_warehouse_id;
getApp().globalData.StoreName = aLoginUserData.default_physical_warehouse_name;
getApp().globalData.StoreTypeNo = '';
setTimeout(() => {
uni.reLaunch({
url: '/pages/sys/workbench/index'

View File

@ -42,6 +42,7 @@
<u-cell-item icon="question-circle" :iconStyle="{ color: '#ff8d06' }" title="常见问题" @click="navTo('problem')"></u-cell-item>
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#5f8dff' }" title="意见反馈" @click="navTo('comment')"></u-cell-item>
<u-cell-item icon="map" :iconStyle="{ color: '#316ede' }" title="账号安全" @click="navTo('pwd')"></u-cell-item>
<u-cell-item icon="scan" :iconStyle="{ color: '#36cfc9' }" title="扫描设置" @click="navTo('scan-settings')"></u-cell-item>
<u-cell-item icon="order" :iconStyle="{ color: '#59bdf9' }" title="清除缓存" @click="navTo('clear-cache')"></u-cell-item>
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#ff8a00' }" title="联系客服" @click="navTo('service')"></u-cell-item>!-->
@ -68,7 +69,7 @@ export default {
};
},
onLoad(e) {
this.loginUserName = getApp().globalData.UserName;
this.loginUserName = getApp().globalData.UserName || (this.vuex_user && this.vuex_user.user_name) || '';
},
computed: {

View File

@ -0,0 +1,218 @@
<template>
<view class="wrap">
<common-navbar title="扫描设置"></common-navbar>
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
<u-cell-group :border="false">
<u-cell-item title="扫码方式" :value="form.name || '请选择'" @click="brandSelectShow = true"></u-cell-item>
<template v-if="!form.isPhoneScan">
<u-cell-item title="广播动作" :arrow="false">
<u-input
slot="right-icon"
v-model="form.action"
placeholder="请输入广播动作"
input-align="right"
:clearable="false"
></u-input>
</u-cell-item>
<u-cell-item title="数据标签" :arrow="false">
<u-input
slot="right-icon"
v-model="form.dataKey"
placeholder="请输入数据标签"
input-align="right"
:clearable="false"
></u-input>
</u-cell-item>
</template>
</u-cell-group>
<view class="form-footer">
<u-button type="primary" :loading="submitting" @click="submit">确定</u-button>
</view>
<u-select v-model="brandSelectShow" :list="brandSelectList" @confirm="onBrandConfirm"></u-select>
</view>
</template>
<script>
import CommonNavbar from '@/components/common-navbar/index';
import scanMixin from '@/common/scanMixin.js';
import {
getScanConfig,
DICTIONARY_TYPE_SCANNER,
isPhoneScanConfig,
mapDictionaryToScannerConfig,
PHONE_SCAN_BRAND,
saveScanConfig,
} from '@/common/scanConfig.js';
export default {
components: {
CommonNavbar,
},
mixins: [scanMixin],
data() {
return {
brandSelectShow: false,
submitting: false,
configList: [],
form: {
brand: '',
name: '',
action: '',
dataKey: '',
isPhoneScan: false,
needSetup: false,
setupAction: '',
setupParams: null,
},
};
},
computed: {
brandSelectList() {
return this.configList.map((item) => ({
value: item.brand,
label: item.name,
}));
},
},
onLoad() {
this.loadConfigList();
},
methods: {
async loadConfigList() {
try {
const res = await this.$u.api.dictionary.getDetailEnumList({
dictionary_id: DICTIONARY_TYPE_SCANNER,
});
const list = Array.isArray(res) ? res : [];
const builtinConfigs = this.getScannerConfigs();
if (list.length) {
this.configList = list
.map((item) => mapDictionaryToScannerConfig(item, builtinConfigs))
.filter(Boolean);
this.remoteScannerConfigs = this.configList.filter((item) => !isPhoneScanConfig(item));
} else {
this.useFallbackConfigList();
}
} catch (error) {
console.log('获取扫码枪字典配置失败,使用内置配置', error);
this.useFallbackConfigList();
}
this.ensurePhoneScanOption();
this.initFormFromSaved();
},
useFallbackConfigList() {
this.configList = this.getScannerConfigs();
this.remoteScannerConfigs = [];
},
ensurePhoneScanOption() {
const phoneConfig = this.getPhoneScanConfig();
if (!this.configList.find((item) => item.brand === PHONE_SCAN_BRAND)) {
this.configList.push(phoneConfig);
}
},
initFormFromSaved() {
const savedConfig = getScanConfig(this.getScannerConfigs());
if (savedConfig) {
this.applyConfig(savedConfig);
return;
}
if (!this.isPdaDevice()) {
this.applyConfig(this.getPhoneScanConfig());
return;
}
const pdaConfigs = this.configList.filter((item) => !isPhoneScanConfig(item));
if (pdaConfigs.length) {
this.applyConfig(pdaConfigs[0]);
}
},
applyConfig(config) {
const isPhoneScan = isPhoneScanConfig(config);
this.form = {
brand: config.brand || '',
name: config.name || '',
action: config.action || '',
dataKey: config.dataKey || '',
isPhoneScan,
needSetup: !!config.needSetup,
setupAction: config.setupAction || '',
setupParams: config.setupParams || null,
};
},
onBrandConfirm(selected) {
const brand = selected[0]?.value;
const config = this.configList.find((item) => item.brand === brand);
if (config) {
this.applyConfig(config);
}
},
submit() {
if (!this.form.brand) {
this.$u.toast('请选择扫码方式');
return;
}
let payload;
if (this.form.isPhoneScan) {
payload = this.getPhoneScanConfig();
} else {
const action = (this.form.action || '').trim();
const dataKey = (this.form.dataKey || '').trim();
if (!action) {
this.$u.toast('请输入广播动作');
return;
}
if (!dataKey) {
this.$u.toast('请输入数据标签');
return;
}
payload = {
...this.form,
action,
dataKey,
};
}
this.submitting = true;
if (!saveScanConfig(payload)) {
this.submitting = false;
this.$u.toast('保存失败');
return;
}
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
const registered = this.registerScanBroadcastByConfig(payload, null);
if (!registered) {
this.submitting = false;
this.$u.toast('保存成功,但广播注册失败');
return;
}
// #endif
this.submitting = false;
this.$u.toast('保存成功');
setTimeout(() => {
uni.navigateBack();
}, 500);
},
},
};
</script>
<style lang="scss">
page {
background-color: #f5f5f5;
}
.form-footer {
padding: 40rpx 30rpx;
}
::v-deep .u-cell_title {
color: #202328;
}
::v-deep .u-input__input {
min-width: 360rpx;
}
</style>

View File

@ -21,6 +21,7 @@
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
import util from '@/common/util.js';
import config from '../../../common/config';
import { clearUserSession } from '@/common/userSession.js';
export default {
data() {
@ -84,27 +85,17 @@ export default {
// #endif
},
logout() {
this.$u.api.pdaLogout().then(res => {
console.log('res',res)
if (res.code != 0) {
// this.$u.toast('退出登录失败');
uni.reLaunch({
url: '/pages/sys/login/index'
});
return
}
// 清除token和用户信息
uni.removeStorageSync('token');
this.$store.dispatch('updateUserInfo', null);
const goLogin = () => {
clearUserSession();
uni.reLaunch({
url: '/pages/sys/login/index'
});
};
this.$u.api.pdaLogout().then(() => {
goLogin();
}).catch(error => {
console.log('error',error)
// 即使退出登录失败,也要清除本地token和用户信息
uni.removeStorageSync('token');
this.$store.dispatch('updateUserInfo', null);
// this.$u.toast('退出登录失败');
goLogin();
});
}
}

View File

@ -7,130 +7,31 @@
</view>
</template>
</common-navbar>
<view class="workbench-title">销售管理</view>
<view class="toolbar">
<u-grid class="grid" :col="4" :border="false">
<u-grid-item :index="0" @click="navTo('/pages/saleship/salepickscan')">
<view class="home-icon icon-color05">
<i class="iconfont icon-hetongguanli"></i>
</view>
<view class="grid-text">成品配布</view>
</u-grid-item>
<u-grid-item :index="1" @click="navTo('/pages/storegoods/QRBarCodeReview')">
<view class="home-icon icon-color02">
<i class="iconfont icon-mall-bag"></i>
</view>
<view class="grid-text">标签检测</view>
</u-grid-item>
</u-grid>
<view v-for="group in visibleMenuGroups" :key="group.title">
<view class="workbench-title">{{ group.title }}</view>
<view class="toolbar">
<u-grid class="grid" :col="4" :border="false">
<u-grid-item
v-for="(item, index) in group.items"
:key="item.router"
:index="index"
@click="navTo(item.url)"
>
<view class="home-icon" :class="item.color">
<i class="iconfont" :class="item.icon"></i>
</view>
<view class="grid-text">{{ item.name }}</view>
</u-grid-item>
</u-grid>
</view>
</view>
<view class="workbench-title">成品管理</view>
<view class="toolbar">
<u-grid class="grid" :col="4" :border="false">
<u-grid-item :index="0" @click="navTo('/pages/storegoods/dyeworksDyeback')">
<view class="home-icon icon-color04">
<i class="iconfont icon-finance"></i>
</view>
<view class="grid-text">染整进仓</view>
</u-grid-item>
<u-grid-item :index="1" @click="navTo('/pages/storegoods/storeGoodsBusinessIn')">
<view class="home-icon icon-color03">
<i class="iconfont icon-mall-bag"></i>
</view>
<view class="grid-text">成品进仓</view>
</u-grid-item>
<u-grid-item :index="2" @click="navTo('/pages/storegoods/storeGoodsBusinessOut')">
<view class="home-icon icon-color12">
<i class="iconfont icon-baoxiaodan"></i>
</view>
<view class="grid-text">成品出仓</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storegoods/storeGoodsBusinessCheck')">
<view class="home-icon icon-color04">
<i class="iconfont icon-shenpi"></i>
</view>
<view class="grid-text">成品盘点</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storegoods/storeGoodsBusinessStationMoveOnly')">
<view class="home-icon icon-color04">
<i class="iconfont icon-shenpi"></i>
</view>
<view class="grid-text">成品移架</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storegoods/storegoodsstoresearch')">
<view class="home-icon icon-color04">
<i class="iconfont icon-shenpi"></i>
</view>
<view class="grid-text">成品库存</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storegoods/storegoodsstoreallin')">
<view class="home-icon icon-color04">
<i class="iconfont icon-shenpi"></i>
</view>
<view class="grid-text">进仓查询</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storegoods/storegoodsstoreallout')">
<view class="home-icon icon-color04">
<i class="iconfont icon-shenpi"></i>
</view>
<view class="grid-text">出仓查询</view>
</u-grid-item>
</u-grid>
</view>
<!--
<view class="workbench-title">坯布管理</view>
<view class="toolbar">
<u-grid class="grid" :col="4" :border="false">
<u-grid-item :index="0" @click="navTo('/pages/storefabric/storefabricInStore')">
<view class="home-icon icon-color04">
<i class="iconfont icon-hetongguanli"></i>
</view>
<view class="grid-text">坯布进仓</view>
</u-grid-item>
<u-grid-item :index="1" @click="navTo('/pages/storefabric/storefabricOutStore')">
<view class="home-icon icon-color03">
<i class="iconfont icon-chucha"></i>
</view>
<view class="grid-text">坯布出仓</view>
</u-grid-item>
<u-grid-item :index="2" @click="navTo('')">
<view class="home-icon icon-color12">
<i class="iconfont icon-ribao"></i>
</view>
<view class="grid-text">坯布盘点</view>
</u-grid-item>
<u-grid-item @click="navTo('')">
<view class="home-icon icon-color04">
<i class="iconfont icon-tongzhi"></i>
</view>
<view class="grid-text">坯布移架</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storefabric/storefabricstoresearch')">
<view class="home-icon icon-color05">
<i class="iconfont icon-huiyishi"></i>
</view>
<view class="grid-text">坯布库存</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storefabric/storefabricstoreallin')">
<view class="home-icon icon-color05">
<i class="iconfont icon-huiyishi"></i>
</view>
<view class="grid-text">进仓查询</view>
</u-grid-item>
<u-grid-item @click="navTo('/pages/storefabric/storefabricstoreallout')">
<view class="home-icon icon-color05">
<i class="iconfont icon-huiyishi"></i>
</view>
<view class="grid-text">出仓查询</view>
</u-grid-item>
</u-grid>
</view>
-->
<view v-if="!visibleMenuGroups.length" class="textCenter">暂无可用功能</view>
</view>
</template>
<script>
import CommonNavbar from "@/components/common-navbar/index";
import scanMixin from '@/common/scanMixin.js';
import { hasResourceRouter } from '@/common/userSession.js';
/**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
@ -149,15 +50,58 @@ export default {
//{image: '/static/aidex/banner/banner03.png'}
],
todoCount: 3,
// scanReceiver 和 isPageActive 已由 scanMixin 提供
menuGroups: [
{
title: '销售管理',
items: [
{
name: '成品配布',
url: '/pages/saleship/salepickscan',
router: 'CashCommodityClothOrder',
icon: 'icon-hetongguanli',
color: 'icon-color05'
}
]
},
{
title: '成品管理',
items: [
{
name: '加工进仓',
url: '/pages/storegoods/storeGoodsProcessInList',
router: 'FpProcessingEntryOrder',
icon: 'icon-hetongguanli',
color: 'icon-color04'
},
{
name: '加工出仓',
url: '/pages/storegoods/storeGoodsProcessOutList',
router: 'FpProcessingDeliverFromGodownOrder',
icon: 'icon-hetongguanli',
color: 'icon-color05'
},
{
name: '加工退货进仓',
url: '/pages/storegoods/storeGoodsProcessReturnInList',
router: 'FpProcessingReturnEntryOrder',
icon: 'icon-hetongguanli',
color: 'icon-color02'
},
{
name: '采购进仓',
url: '/pages/storegoods/storeGoodsPurchaseInList',
router: 'FinishPurchaseWarehouseEntry',
icon: 'icon-hetongguanli',
color: 'icon-color03'
}
]
}
]
};
},
onLoad() {
// #ifdef APP-PLUS
// 使用 scanMixin 的方法注册扫码广播,传入自定义回调
this.registerScanBroadcast(this.handleScanCode);
// #endif
},
// onUnload, onHide, onShow 已由 scanMixin 自动处理
@ -168,6 +112,14 @@ export default {
height: `${navHeight}px`,
};
},
visibleMenuGroups() {
return this.menuGroups
.map((group) => ({
...group,
items: group.items.filter((item) => hasResourceRouter(item.router))
}))
.filter((group) => group.items.length > 0);
}
},
methods: {
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
@ -192,10 +144,10 @@ export default {
},
// 处理扫码(手动点击扫码按钮)
handleScan() {
// uni.navigateTo({
// url: '/pages/saleship/salepickscandetail?order_no=FPD-PB-202412270196'
// })
// return
if (this.usePhoneScanFallback) {
this.openPhoneScan();
return;
}
// #ifdef APP-PLUS || MP-WEIXIN
uni.scanCode({
scanType: ['qrCode', 'barCode'], // 同时支持二维码和条形码

View File

@ -19,20 +19,29 @@ try{
}
// 本分支统一使用 hcscm 服务前缀
function normalizeApiUrl(url) {
return String(url || '').replace(/hcscm_weave/g, 'hcscm');
}
// 初始化API URL
function initApiUrl() {
if (config.isDevelopment) {
// 开发环境:从存储读取,如果没有则使用测试环境
try {
const savedApiUrl = uni.getStorageSync('ApiUrl');
return savedApiUrl || config.devApiUrlOptions[0].value;
const url = normalizeApiUrl(savedApiUrl || config.devApiUrlOptions[0].value);
if (savedApiUrl && url !== savedApiUrl) {
uni.setStorageSync('ApiUrl', url);
}
return url;
} catch (e) {
console.log('读取存储的 apiurl 失败', e);
return config.devApiUrlOptions[0].value;
}
} else {
// 生产环境:使用固定的生产URL
return config.productionApiUrl;
return normalizeApiUrl(config.productionApiUrl);
}
}
@ -110,9 +119,10 @@ const store = new Vuex.Store({
console.warn('生产环境不允许修改API URL');
return;
}
state.apiurl = url
const nextUrl = normalizeApiUrl(url);
state.apiurl = nextUrl
// 同时保存到本地存储
uni.setStorageSync('ApiUrl', url)
uni.setStorageSync('ApiUrl', nextUrl)
}
},
@ -245,7 +255,19 @@ const store = new Vuex.Store({
},
updateApiUrl({ commit }, url) {
commit('SET_API_URL', url)
}
},
updateUserInfo({ commit }, info) {
commit('$uStore', {
name: 'vuex_user',
value: info || {}
});
if (!info) {
commit('$uStore', {
name: 'vuex_token',
value: ''
});
}
}
},
getters: {
apiurl: state => state.apiurl

View File

@ -1,3 +1,4 @@
const path = require('path');
const dotenv = require('dotenv');
// // Load environment variables from .env file
@ -5,6 +6,10 @@ dotenv.config();
module.exports = {
chainWebpack: (config) => {
config.resolve.alias
.set('uview-ui/components/u-select/u-select.vue', path.resolve(__dirname, 'src/components/u-select/u-select.vue'))
.set('uview-ui/components/u-action-sheet/u-action-sheet.vue', path.resolve(__dirname, 'src/components/u-action-sheet/u-action-sheet.vue'))
.set('uview-ui/components/u-dropdown-item/u-dropdown-item.vue', path.resolve(__dirname, 'src/components/u-dropdown-item/u-dropdown-item.vue'));
config.plugin('define').tap((definitions) => {
console.log('VUE_APP_UPGRADE_NAME',JSON.stringify(process.env.VUE_APP_UPGRADE_NAME))
console.log('VUE_APP_PRODUCTION_API_URL',JSON.stringify(process.env.VUE_APP_PRODUCTION_API_URL))

400
yarn.lock
View File

@ -189,11 +189,21 @@
resolved "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687"
integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==
"@babel/helper-string-parser@^7.29.7":
version "7.29.7"
resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz#7f0871d99824d23137d60f86fcf6130fd5a1b51f"
integrity sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==
"@babel/helper-validator-identifier@^7.27.1":
version "7.27.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8"
integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==
"@babel/helper-validator-identifier@^7.29.7":
version "7.29.7"
resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz#bd87084ced0c796ec46bda492de6e83d29e89fc2"
integrity sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==
"@babel/helper-validator-option@^7.27.1":
version "7.27.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f"
@ -223,6 +233,13 @@
dependencies:
"@babel/types" "^7.28.0"
"@babel/parser@^7.23.5":
version "7.29.7"
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.7.tgz#837b87387cbf5ec5530cb634b3c622f68edb9334"
integrity sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==
dependencies:
"@babel/types" "^7.29.7"
"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.27.1":
version "7.27.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.27.1.tgz#61dd8a8e61f7eb568268d1b5f129da3eee364bf9"
@ -944,6 +961,14 @@
"@babel/helper-string-parser" "^7.27.1"
"@babel/helper-validator-identifier" "^7.27.1"
"@babel/types@^7.29.7":
version "7.29.7"
resolved "https://registry.npmmirror.com/@babel/types/-/types-7.29.7.tgz#8005e31d82712ee7adaef6e23c63b71a62770a92"
integrity sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==
dependencies:
"@babel/helper-string-parser" "^7.29.7"
"@babel/helper-validator-identifier" "^7.29.7"
"@bcoe/v8-coverage@^0.2.3":
version "0.2.3"
resolved "https://mirrors.huaweicloud.com/repository/npm/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
@ -957,24 +982,24 @@
exec-sh "^0.3.2"
minimist "^1.2.0"
"@dcloudio/types@^3.3.2":
version "3.4.19"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/types/-/types-3.4.19.tgz#cf4b23cac1df4ba1ad7871a2a0658b57435f2ba3"
integrity sha512-1foayOFEAQ+jnQLt3ACsovCNjer3/fXn1I2VBpmDOzs2nk/n4UHwRLAxZV/RpxRqaGOPEvKrO/Pq+VI6sAmuRw==
"@dcloudio/types@^3.4.19":
version "3.4.31"
resolved "https://registry.npmmirror.com/@dcloudio/types/-/types-3.4.31.tgz#8dca3ff579044beb11dcf3d22c522734882a47e2"
integrity sha512-YAqOfJpcAwMs4Fagv2oP+iRHSCJOJoN8JUYyoRD6gwfANhsI9QaYj4/j22FzSopfHkqjX50B7YkG/VRAyz9OnA==
"@dcloudio/uni-app-plus@^2.0.2-4070520250711001":
"@dcloudio/uni-app-plus@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-app-plus/-/uni-app-plus-2.0.2-4070520250711001.tgz#ca95a9cbe077922d07c2d277184e57a85f8259e0"
resolved "https://registry.npmmirror.com/@dcloudio/uni-app-plus/-/uni-app-plus-2.0.2-4070520250711001.tgz#ca95a9cbe077922d07c2d277184e57a85f8259e0"
integrity sha512-InoNBw6nDzrUhct6OCKNXe/i2mMWp724Y5b/QSxSKzS5PdODRqWEX30LAke3EPDr292c9EI+JINQLmXVBedFXg==
"@dcloudio/uni-app@^2.0.2-4070520250711001":
"@dcloudio/uni-app@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-app/-/uni-app-2.0.2-4070520250711001.tgz#71b234d5a43ca1822e0375b053385c954cde5cab"
resolved "https://registry.npmmirror.com/@dcloudio/uni-app/-/uni-app-2.0.2-4070520250711001.tgz#71b234d5a43ca1822e0375b053385c954cde5cab"
integrity sha512-LNSEC+bRIUOIpWMCGyp+lLa05dnFOdSJ6V70I7IDy/Cs0LlxX84LGvCUctyol9vTLvsPS793hIK9lIOo65RuEQ==
"@dcloudio/uni-automator@^2.0.2-4070520250711001":
"@dcloudio/uni-automator@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-automator/-/uni-automator-2.0.2-4070520250711001.tgz#9b51f2d1ca719a8b12a03a65a95baa695bd81d5b"
resolved "https://registry.npmmirror.com/@dcloudio/uni-automator/-/uni-automator-2.0.2-4070520250711001.tgz#9b51f2d1ca719a8b12a03a65a95baa695bd81d5b"
integrity sha512-9JFBQCywhYt+WwAdHT4/CEEw38hPSaqXLRmURQpujtGnyE9L5248fXKxvy5Q4+4U/vB6Q9Svk7ctJk/c5qoc8w==
dependencies:
address "^1.1.2"
@ -989,17 +1014,17 @@
qrcode-terminal "^0.12.0"
ws "^7.2.3"
"@dcloudio/uni-cli-i18n@^2.0.2-4070520250711001":
"@dcloudio/uni-cli-i18n@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-cli-i18n/-/uni-cli-i18n-2.0.2-4070520250711001.tgz#583de80ff78c556d5038c62f90117dbf95e3ab85"
resolved "https://registry.npmmirror.com/@dcloudio/uni-cli-i18n/-/uni-cli-i18n-2.0.2-4070520250711001.tgz#583de80ff78c556d5038c62f90117dbf95e3ab85"
integrity sha512-10Rjb2+EbMHLUGYXUMLiZn9Gk3rp7iKANuFfrXKvNlUz5kdW1VNCpaA728ZIblib/JudNLa1k3ETTA34sWlF+Q==
dependencies:
i18n "^0.13.3"
os-locale-s-fix "^1.0.8-fix-1"
"@dcloudio/uni-cli-shared@^2.0.2-4070520250711001":
"@dcloudio/uni-cli-shared@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-cli-shared/-/uni-cli-shared-2.0.2-4070520250711001.tgz#6b8365649c72b73e36fb03d6877cd5bb2b77ecdf"
resolved "https://registry.npmmirror.com/@dcloudio/uni-cli-shared/-/uni-cli-shared-2.0.2-4070520250711001.tgz#6b8365649c72b73e36fb03d6877cd5bb2b77ecdf"
integrity sha512-K3t8a+sBsjWRtYM9T2jWEUdO+qvYUBNvQOr5HHDHZRN7XOu7u6MK40uddzILj8+oQum6OJMTSaAYFgkXiEPFcg==
dependencies:
escape-string-regexp "^4.0.0"
@ -1010,9 +1035,9 @@
postcss-urlrewrite "^0.2.2"
strip-json-comments "^2.0.1"
"@dcloudio/uni-h5@^2.0.2-4070520250711001":
"@dcloudio/uni-h5@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-h5/-/uni-h5-2.0.2-4070520250711001.tgz#5379836be3d562a31814ae8bdeccaeddf667f601"
resolved "https://registry.npmmirror.com/@dcloudio/uni-h5/-/uni-h5-2.0.2-4070520250711001.tgz#5379836be3d562a31814ae8bdeccaeddf667f601"
integrity sha512-8SIuPIV1ziI8v4s8zqqGrBzSbPF6U9SNIMkqLPrLERZ7uD1zfPozxB4Vgp0zsSqduNfO0LqbFOQuyegt6T2SMA==
dependencies:
base64-arraybuffer "^0.2.0"
@ -1021,19 +1046,19 @@
postcss-urlrewrite "^0.3.0"
safe-area-insets "^1.4.1"
"@dcloudio/uni-helper-json@*":
"@dcloudio/uni-helper-json@^1.0.13":
version "1.0.13"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-helper-json/-/uni-helper-json-1.0.13.tgz#4e8aa062daaefb30d98973c035a7b0ab628329c7"
resolved "https://registry.npmmirror.com/@dcloudio/uni-helper-json/-/uni-helper-json-1.0.13.tgz#4e8aa062daaefb30d98973c035a7b0ab628329c7"
integrity sha512-FO9Iu4zW4td3Tr+eiCDWuele2ehkJ4qxQ/UhpAMLjso+ZdWz6NagK5Syh6cdy1hoDqbxpNoqnLynuJXe81Ereg==
"@dcloudio/uni-i18n@^2.0.2-4070520250711001":
"@dcloudio/uni-i18n@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-i18n/-/uni-i18n-2.0.2-4070520250711001.tgz#8149cff342b3844aa1b81426bdb50f48a9b5c058"
resolved "https://registry.npmmirror.com/@dcloudio/uni-i18n/-/uni-i18n-2.0.2-4070520250711001.tgz#8149cff342b3844aa1b81426bdb50f48a9b5c058"
integrity sha512-AvhlDf8AenEqJPHvRgSRd4JXQj5ur20qISrettE33jTCseA5L1PAF59hpxgjyuhXeBlNjssAsv/F2qzgwZnBDw==
"@dcloudio/uni-migration@^2.0.2-4070520250711001":
"@dcloudio/uni-migration@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-migration/-/uni-migration-2.0.2-4070520250711001.tgz#d4d71c79dc044a8fd0606f3dc9ecba21464d2806"
resolved "https://registry.npmmirror.com/@dcloudio/uni-migration/-/uni-migration-2.0.2-4070520250711001.tgz#d4d71c79dc044a8fd0606f3dc9ecba21464d2806"
integrity sha512-V+07p5ehNMtbaW3xZcmcBksof7vtFRKgolmEuMAaJJeHCAwUlNbbjUB14LpBayjN2CSCqUqnvupNuxZ114/rFA==
dependencies:
commander "^4.0.1"
@ -1042,69 +1067,69 @@
recast "*"
stricter-htmlparser2 "^3.9.6"
"@dcloudio/uni-mp-360@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-360@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-360/-/uni-mp-360-2.0.2-4070520250711001.tgz#edc458f0ad94d1c35b34af8011c6bf5bd9a004cd"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-360/-/uni-mp-360-2.0.2-4070520250711001.tgz#edc458f0ad94d1c35b34af8011c6bf5bd9a004cd"
integrity sha512-l74u/++BwQm/2X/6ZKLB1zfqdQejsya5Kj0Uf9K2ZCHnYA2lVt/8FN+pOWSrL/Ui2AabzKDsFRA5He23//3r9Q==
"@dcloudio/uni-mp-alipay@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-alipay@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-alipay/-/uni-mp-alipay-2.0.2-4070520250711001.tgz#02b59499d802789d7fc31fa952366b8d6732044d"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-alipay/-/uni-mp-alipay-2.0.2-4070520250711001.tgz#02b59499d802789d7fc31fa952366b8d6732044d"
integrity sha512-tP/ljYRi60RwS3x/U3JvRDl7tN39o7trrHxqPAcQnLqfN7CyO4uxGcUX+2uBgDoAUJm6gBOaqaPIuO9kAIC0Aw==
"@dcloudio/uni-mp-baidu@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-baidu@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-baidu/-/uni-mp-baidu-2.0.2-4070520250711001.tgz#cfc8afee9c9277ece325c6669f84ead81bddef0c"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-baidu/-/uni-mp-baidu-2.0.2-4070520250711001.tgz#cfc8afee9c9277ece325c6669f84ead81bddef0c"
integrity sha512-8HnPCU77uEm3GaJgG+uesjwOadRTTxDU0PETduCIIVIBMp/d+qeaYQL6zLLuITx9+DsLNC59eq0rCX92v4cijQ==
"@dcloudio/uni-mp-harmony@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-harmony@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-harmony/-/uni-mp-harmony-2.0.2-4070520250711001.tgz#9e784a2d3ffd8df24fb96c29d65ff604ec36d97c"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-harmony/-/uni-mp-harmony-2.0.2-4070520250711001.tgz#9e784a2d3ffd8df24fb96c29d65ff604ec36d97c"
integrity sha512-RnxYUX9+A17CU/5sdHnq7/W2lAfdw0vU4DLaACUvgaPXrsduuYWeqGKDRM2IB6Xmu8QMvfhVkMel43DSGIT6/g==
"@dcloudio/uni-mp-jd@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-jd@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-jd/-/uni-mp-jd-2.0.2-4070520250711001.tgz#0ef070fe187207be11cb6d55a97164a8499672b3"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-jd/-/uni-mp-jd-2.0.2-4070520250711001.tgz#0ef070fe187207be11cb6d55a97164a8499672b3"
integrity sha512-nQoSdM9P74yvZvMD6eqXmCZbUTcmIvO535KCN327SA3h1CCub7mF+HMK9xV++LGlrnt0XpJM/l4u+Begj5eJTw==
"@dcloudio/uni-mp-kuaishou@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-kuaishou@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-kuaishou/-/uni-mp-kuaishou-2.0.2-4070520250711001.tgz#4d295a58b4027034a920e7b71eb8842fb1160e2a"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-kuaishou/-/uni-mp-kuaishou-2.0.2-4070520250711001.tgz#4d295a58b4027034a920e7b71eb8842fb1160e2a"
integrity sha512-tk8SFytrkepNHEJu4yEs8EbmAPq90Kd7K8105xMNLQYpJqupwsvj25k2jjlwfWB46TK2Vj5mbavHpOyR0CrnWA==
"@dcloudio/uni-mp-lark@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-lark@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-lark/-/uni-mp-lark-2.0.2-4070520250711001.tgz#24dabbec3f8d6a02a88c4bddc0aab0444974f383"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-lark/-/uni-mp-lark-2.0.2-4070520250711001.tgz#24dabbec3f8d6a02a88c4bddc0aab0444974f383"
integrity sha512-J8wzephK9uzB6fDK+AV2TEnLospw6J7OLNlwDMboaXJ8/+k9pVUGX1Qyr1tbIt1Jk0YhO/fxmE+GGkgfL8/l6Q==
"@dcloudio/uni-mp-qq@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-qq@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-qq/-/uni-mp-qq-2.0.2-4070520250711001.tgz#c301a7cbb2a3c70b22afb7bea05a3a6bfbde2a8e"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-qq/-/uni-mp-qq-2.0.2-4070520250711001.tgz#c301a7cbb2a3c70b22afb7bea05a3a6bfbde2a8e"
integrity sha512-3TfkI2tteg+EveNu5Lk5fO39ohBdel2gYlz8SmGXJTElOCnsejJDzS7wYBHnrVXSW0Ldv2P8NB1N6rwOu7uTgA==
"@dcloudio/uni-mp-toutiao@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-toutiao@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-toutiao/-/uni-mp-toutiao-2.0.2-4070520250711001.tgz#163055ddae974771777cf5c190b177c33b967c67"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-toutiao/-/uni-mp-toutiao-2.0.2-4070520250711001.tgz#163055ddae974771777cf5c190b177c33b967c67"
integrity sha512-oOSeeyImPHykyF6esi7m2kFTuxXc8UUAq2qyz8X0EiKI+XtEbMNPW16/m4dLSzhOLVBE7RxPmyExhzWSi+1GEg==
"@dcloudio/uni-mp-vue@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-vue@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-vue/-/uni-mp-vue-2.0.2-4070520250711001.tgz#879adfd4ceed9617b08122583b22c3c61f7d2262"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-vue/-/uni-mp-vue-2.0.2-4070520250711001.tgz#879adfd4ceed9617b08122583b22c3c61f7d2262"
integrity sha512-BV04qXBfCWF+HLPzYXBYjMSPPJM7MPkFiiKnExgvBNkVyT35VmzeqL2zSUR1R7789G50z0qiop/wGtZRQHocFw==
"@dcloudio/uni-mp-weixin@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-weixin@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-weixin/-/uni-mp-weixin-2.0.2-4070520250711001.tgz#9c2c86e0e2c64a44721e2e45d3d24d1bfaec7707"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-weixin/-/uni-mp-weixin-2.0.2-4070520250711001.tgz#9c2c86e0e2c64a44721e2e45d3d24d1bfaec7707"
integrity sha512-a/MTqhhMKM7NGHasM/6qqQjTubSkDiDt6PLPyTHoExG5i+UEd9MzNufwzdot96qDduw1b59Jt8wAn9ZOUa6xhQ==
"@dcloudio/uni-mp-xhs@^2.0.2-4070520250711001":
"@dcloudio/uni-mp-xhs@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-mp-xhs/-/uni-mp-xhs-2.0.2-4070520250711001.tgz#ae321f8ffb520dc8c11706ac0f0bf03c7ca4b52c"
resolved "https://registry.npmmirror.com/@dcloudio/uni-mp-xhs/-/uni-mp-xhs-2.0.2-4070520250711001.tgz#ae321f8ffb520dc8c11706ac0f0bf03c7ca4b52c"
integrity sha512-/X2/jhwlBprCleJ07S0xUNF2ULANhnehXRIN8zZ6yd6BTkd+fc2An/brfw4dkPvr5YDfcnLc9AsQc45ka+pQuw==
"@dcloudio/uni-quickapp-native@^2.0.2-4070520250711001":
"@dcloudio/uni-quickapp-native@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-quickapp-native/-/uni-quickapp-native-2.0.2-4070520250711001.tgz#0ceab7b7d01e62dd58039e90569318443e800483"
resolved "https://registry.npmmirror.com/@dcloudio/uni-quickapp-native/-/uni-quickapp-native-2.0.2-4070520250711001.tgz#0ceab7b7d01e62dd58039e90569318443e800483"
integrity sha512-EZtZ8kAz40fOU396fQVWgAG+yZJJRviANcU9/ASfwEcGdqeYFmGUa8MIm4sYRZHKWPVC2k/drfBfzXy4vuhjCQ==
dependencies:
"@hap-toolkit/dsl-vue" "0.6.13"
@ -1112,24 +1137,24 @@
"@hap-toolkit/server" "0.6.13"
module-alias "^2.1.0"
"@dcloudio/uni-quickapp-webview@^2.0.2-4070520250711001":
"@dcloudio/uni-quickapp-webview@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-quickapp-webview/-/uni-quickapp-webview-2.0.2-4070520250711001.tgz#847b2512b95980eb3b434635d4d7460fc0244f2b"
resolved "https://registry.npmmirror.com/@dcloudio/uni-quickapp-webview/-/uni-quickapp-webview-2.0.2-4070520250711001.tgz#847b2512b95980eb3b434635d4d7460fc0244f2b"
integrity sha512-4ZpgIygoX4XFkiv8UCgXXrg/HEIEHBTtBpKqnATYOPYU9Uo+ThjUDDUWmAg4ya5Vm962hzuR5/RE+oZJtjx0yg==
"@dcloudio/uni-stacktracey@^2.0.2-4070520250711001":
"@dcloudio/uni-stacktracey@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-stacktracey/-/uni-stacktracey-2.0.2-4070520250711001.tgz#0bd845c52fc9cd41b536dca55f749390aff63703"
resolved "https://registry.npmmirror.com/@dcloudio/uni-stacktracey/-/uni-stacktracey-2.0.2-4070520250711001.tgz#0bd845c52fc9cd41b536dca55f749390aff63703"
integrity sha512-ST3rLYbMN3cOABC+Oq4vJgF2RigBsZ7uiPrVYa7PBzWGTsilyFO/V77KX3tLwghxAmDHi+FrpdRUCX34Fu1ygQ==
"@dcloudio/uni-stat@^2.0.2-4070520250711001":
"@dcloudio/uni-stat@2.0.2-4070520250711001", "@dcloudio/uni-stat@^2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-stat/-/uni-stat-2.0.2-4070520250711001.tgz#508a456b073add5d0a0fe9d560a04003bc013c4c"
resolved "https://registry.npmmirror.com/@dcloudio/uni-stat/-/uni-stat-2.0.2-4070520250711001.tgz#508a456b073add5d0a0fe9d560a04003bc013c4c"
integrity sha512-1zRo9EgZrXjmyGK1Tn6l2g93nzVVHvHFEm3VRjDAyg66SAXk3nxkZFxpZd+5jOvDUfe1KyMg6RNcsfP8PB3N4Q==
"@dcloudio/uni-template-compiler@^2.0.2-4070520250711001":
"@dcloudio/uni-template-compiler@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/uni-template-compiler/-/uni-template-compiler-2.0.2-4070520250711001.tgz#260d47d3d82d2a24236e9e22b599d73a31be8a07"
resolved "https://registry.npmmirror.com/@dcloudio/uni-template-compiler/-/uni-template-compiler-2.0.2-4070520250711001.tgz#260d47d3d82d2a24236e9e22b599d73a31be8a07"
integrity sha512-vtHmRk13U0e2V8JjkAk5pjSWuX/5wXx8qBTdzwwm/foQNxndBoUQim3AQ1+D2mD7YuEOHnz3OWyWbdndIhd5og==
dependencies:
"@babel/parser" "^7.3.3"
@ -1138,23 +1163,23 @@
"@babel/types" "^7.3.3"
vue-template-compiler "^2.6.10"
"@dcloudio/vue-cli-plugin-hbuilderx@^2.0.2-4070520250711001":
"@dcloudio/vue-cli-plugin-hbuilderx@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/vue-cli-plugin-hbuilderx/-/vue-cli-plugin-hbuilderx-2.0.2-4070520250711001.tgz#71d6ac3fc7c654b816e5b9b37337b485d8680e71"
resolved "https://registry.npmmirror.com/@dcloudio/vue-cli-plugin-hbuilderx/-/vue-cli-plugin-hbuilderx-2.0.2-4070520250711001.tgz#71d6ac3fc7c654b816e5b9b37337b485d8680e71"
integrity sha512-VSH1CBkdf/wXcxDP4pbDs5lIsTUYe0PCa7tEIaurygGuatrvER2MW6v1oKI2lL5382iOEJCkJM6pubA0UIqxIw==
dependencies:
acorn "^5.2.1"
css "~2.2.1"
escodegen "^1.8.1"
"@dcloudio/vue-cli-plugin-uni-optimize@^2.0.2-4070520250711001":
"@dcloudio/vue-cli-plugin-uni-optimize@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/vue-cli-plugin-uni-optimize/-/vue-cli-plugin-uni-optimize-2.0.2-4070520250711001.tgz#72db4fabae07110f9e140eb426c6c023204c1705"
resolved "https://registry.npmmirror.com/@dcloudio/vue-cli-plugin-uni-optimize/-/vue-cli-plugin-uni-optimize-2.0.2-4070520250711001.tgz#72db4fabae07110f9e140eb426c6c023204c1705"
integrity sha512-3FHIPEPYoXPJNjwautP2p0sIosfKPzuSWbyUm7Ddxi7BAoJyNq60Q84nUMnqPbN7vnUlT2e97HxCtNP+E6+u+A==
"@dcloudio/vue-cli-plugin-uni@^2.0.2-4070520250711001":
"@dcloudio/vue-cli-plugin-uni@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/vue-cli-plugin-uni/-/vue-cli-plugin-uni-2.0.2-4070520250711001.tgz#57881ce0552f5811428fa5f1f9ca39574c58d222"
resolved "https://registry.npmmirror.com/@dcloudio/vue-cli-plugin-uni/-/vue-cli-plugin-uni-2.0.2-4070520250711001.tgz#57881ce0552f5811428fa5f1f9ca39574c58d222"
integrity sha512-dCtI4tmVi+QfhS/PprfzIdEBzwGKtgRYKRfZ6ZKtABQSeyh60Sd64sg4qEnehYQ2kgqZo9RWDmoOF9Vk9/R+Qg==
dependencies:
"@dcloudio/uni-stat" "^2.0.2-4070520250711001"
@ -1177,14 +1202,14 @@
wrap-loader "^0.2.0"
xregexp "4.0.0"
"@dcloudio/webpack-uni-mp-loader@^2.0.2-4070520250711001":
"@dcloudio/webpack-uni-mp-loader@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/webpack-uni-mp-loader/-/webpack-uni-mp-loader-2.0.2-4070520250711001.tgz#227214c40b518814f0b1fe9c0f39260768c99632"
resolved "https://registry.npmmirror.com/@dcloudio/webpack-uni-mp-loader/-/webpack-uni-mp-loader-2.0.2-4070520250711001.tgz#227214c40b518814f0b1fe9c0f39260768c99632"
integrity sha512-ro40ylznQ7Ty1+NiCn6dzZfP7oAO08L9KKO/qwJXXsWZyg7cqLzhx5pZpHzBZtUwRRgrbnLKg5hznGf26ZZF1w==
"@dcloudio/webpack-uni-pages-loader@^2.0.2-4070520250711001":
"@dcloudio/webpack-uni-pages-loader@2.0.2-4070520250711001":
version "2.0.2-4070520250711001"
resolved "https://mirrors.huaweicloud.com/repository/npm/@dcloudio/webpack-uni-pages-loader/-/webpack-uni-pages-loader-2.0.2-4070520250711001.tgz#1a6be6a402c7f391e43c85668802e0a238ecc32b"
resolved "https://registry.npmmirror.com/@dcloudio/webpack-uni-pages-loader/-/webpack-uni-pages-loader-2.0.2-4070520250711001.tgz#1a6be6a402c7f391e43c85668802e0a238ecc32b"
integrity sha512-ZbULh56PPvOPEJN7cPfgljwLsAh8hkxZO4ZA16D4fpqxMZzaZm66skOuLs6xfHx426/Di+Ipj/J9bz2DtTL9VQ==
dependencies:
merge "^2.1.1"
@ -1345,6 +1370,14 @@
dependencies:
"@hapi/hoek" "^9.0.0"
"@icon-park/vue@^1.4.2":
version "1.4.2"
resolved "https://registry.npmmirror.com/@icon-park/vue/-/vue-1.4.2.tgz#bc3811d79fc7cfa0be3be62475d6ea9c3c4af169"
integrity sha512-YXXC53R0hjM76B2M4ANRI0m2bQB1cifUW+YXxQfGofITP6gr+pSMafBz/vzECYSkW3zZklm2mVuqQj4RAZGR2Q==
dependencies:
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0"
csstype "^3.0.3"
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://mirrors.huaweicloud.com/repository/npm/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
@ -2253,9 +2286,9 @@
dependencies:
"@types/yargs-parser" "*"
"@vue/babel-helper-vue-jsx-merge-props@^1.4.0":
"@vue/babel-helper-vue-jsx-merge-props@^1.0.0", "@vue/babel-helper-vue-jsx-merge-props@^1.4.0":
version "1.4.0"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz#8d53a1e21347db8edbe54d339902583176de09f2"
resolved "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz#8d53a1e21347db8edbe54d339902583176de09f2"
integrity sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==
"@vue/babel-helper-vue-transform-on@1.5.0":
@ -2301,10 +2334,10 @@
lodash.kebabcase "^4.1.1"
svg-tags "^1.0.0"
"@vue/babel-preset-app@^5.0.8":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/babel-preset-app/-/babel-preset-app-5.0.8.tgz#ce38f76314f5265d62a89756ef264c21f1d351a1"
integrity sha512-yl+5qhpjd8e1G4cMXfORkkBlvtPCIgmRf3IYCWYDKIQ7m+PPa5iTm4feiNmCMD6yGqQWMhhK/7M3oWGL9boKwg==
"@vue/babel-preset-app@^5.0.9":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/babel-preset-app/-/babel-preset-app-5.0.9.tgz#5a604e4911f63bbd92f438f305eb93a052ae2c68"
integrity sha512-0rKOF4s/AhaRMJLybxOCgXfwtYhO3pwDSL/q/W8wRs1LzmHAc77FyTXWlun6VyKiSKwSdtH7CvOiWqq+DfofdA==
dependencies:
"@babel/core" "^7.12.16"
"@babel/helper-compilation-targets" "^7.12.16"
@ -2386,48 +2419,48 @@
"@vue/babel-plugin-transform-vue-jsx" "^1.4.0"
camelcase "^5.0.0"
"@vue/cli-overlay@^5.0.8":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-overlay/-/cli-overlay-5.0.8.tgz#b61477acdc43bbd42fce6326d228471201ecdcdd"
integrity sha512-KmtievE/B4kcXp6SuM2gzsnSd8WebkQpg3XaB6GmFh1BJGRqa1UiW9up7L/Q67uOdTigHxr5Ar2lZms4RcDjwQ==
"@vue/cli-overlay@^5.0.9":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-overlay/-/cli-overlay-5.0.9.tgz#ada72d4832ba3f82dcf8afecc19ba3c4f2bb3c9b"
integrity sha512-aBdZWrYKxLuFz1FDsk/muFD7GycrsW73Gi11yRc7R2W7Bm8mDRc9HKAI790gdg4NV+chkDFmfkegjg5iMDEpAA==
"@vue/cli-plugin-babel@~5.0.0":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-plugin-babel/-/cli-plugin-babel-5.0.8.tgz#54f9a07900f29baff54803dcfa916c602894feb7"
integrity sha512-a4qqkml3FAJ3auqB2kN2EMPocb/iu0ykeELwed+9B1c1nQ1HKgslKMHMPavYx3Cd/QAx2mBD4hwKBqZXEI/CsQ==
"@vue/cli-plugin-babel@~5.0.8":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-plugin-babel/-/cli-plugin-babel-5.0.9.tgz#ad6d52631687c7c34e843978a707ffa23a14d1b8"
integrity sha512-oDZt1Kfe4KGNtig3/3zFo2pIeDJij2uS0M6S+tAqQno4Zpla2D8Hk/AR5PrstUd/HmhHZYJoGyF78MOfj3SbWg==
dependencies:
"@babel/core" "^7.12.16"
"@vue/babel-preset-app" "^5.0.8"
"@vue/cli-shared-utils" "^5.0.8"
"@vue/babel-preset-app" "^5.0.9"
"@vue/cli-shared-utils" "^5.0.9"
babel-loader "^8.2.2"
thread-loader "^3.0.0"
webpack "^5.54.0"
"@vue/cli-plugin-router@^5.0.8":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-plugin-router/-/cli-plugin-router-5.0.8.tgz#a113ec626f3d4216d20496c42d35533bce9e889f"
integrity sha512-Gmv4dsGdAsWPqVijz3Ux2OS2HkMrWi1ENj2cYL75nUeL+Xj5HEstSqdtfZ0b1q9NCce+BFB6QnHfTBXc/fCvMg==
"@vue/cli-plugin-router@^5.0.9":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-plugin-router/-/cli-plugin-router-5.0.9.tgz#8ca4210c549d78abff8f2431357fcf6c81f84a02"
integrity sha512-kopbO/8kIl5CAffwgptXEwV509i+M0FfwW4sSkgQ2RzpxOYBjQZvp+096mjZfFcWKSmryNP/ri/Mnu78vmhlhw==
dependencies:
"@vue/cli-shared-utils" "^5.0.8"
"@vue/cli-shared-utils" "^5.0.9"
"@vue/cli-plugin-vuex@^5.0.8":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-plugin-vuex/-/cli-plugin-vuex-5.0.8.tgz#0d4cb3020f9102bea9288d750729dde176c66ccd"
integrity sha512-HSYWPqrunRE5ZZs8kVwiY6oWcn95qf/OQabwLfprhdpFWAGtLStShjsGED2aDpSSeGAskQETrtR/5h7VqgIlBA==
"@vue/cli-plugin-vuex@^5.0.9":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-plugin-vuex/-/cli-plugin-vuex-5.0.9.tgz#29830a46f075c9bb35a00cd37e8c0d133a5c41a8"
integrity sha512-AQhgGNFVd4Pu2crvS0a+hRckgrJv07gzOASdbLd3I72wkT43dd01MLRp8IBRRsu92t3MXenW86AZUCbQBz3//A==
"@vue/cli-service@~5.0.0":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-service/-/cli-service-5.0.8.tgz#cf3f6f1b7bf0fba9cdab86b6bec4f9897f982dac"
integrity sha512-nV7tYQLe7YsTtzFrfOMIHc5N2hp5lHG2rpYr0aNja9rNljdgcPZLyQRb2YRivTHqTv7lI962UXFURcpStHgyFw==
"@vue/cli-service@~5.0.8":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-service/-/cli-service-5.0.9.tgz#e5ec465aca058299e9e2f092b6557b4464f2e539"
integrity sha512-yTX7GVyM19tEbd+y5/gA6MkVKA6K61nVYHYAivD61Hx6odVFmQsaC3/R3cWAHM1P5oVKCevBbumPljbT+tFG2w==
dependencies:
"@babel/helper-compilation-targets" "^7.12.16"
"@soda/friendly-errors-webpack-plugin" "^1.8.0"
"@soda/get-current-script" "^1.0.2"
"@types/minimist" "^1.2.0"
"@vue/cli-overlay" "^5.0.8"
"@vue/cli-plugin-router" "^5.0.8"
"@vue/cli-plugin-vuex" "^5.0.8"
"@vue/cli-shared-utils" "^5.0.8"
"@vue/cli-overlay" "^5.0.9"
"@vue/cli-plugin-router" "^5.0.9"
"@vue/cli-plugin-vuex" "^5.0.9"
"@vue/cli-shared-utils" "^5.0.9"
"@vue/component-compiler-utils" "^3.3.0"
"@vue/vue-loader-v15" "npm:vue-loader@^15.9.7"
"@vue/web-component-wrapper" "^1.3.0"
@ -2476,10 +2509,10 @@
webpack-virtual-modules "^0.4.2"
whatwg-fetch "^3.6.2"
"@vue/cli-shared-utils@^5.0.8":
version "5.0.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/cli-shared-utils/-/cli-shared-utils-5.0.8.tgz#75fc96528eba2b1c7e33cb7e989a984ddef99c8a"
integrity sha512-uK2YB7bBVuQhjOJF+O52P9yFMXeJVj7ozqJkwYE9PlMHL1LMHjtCYm4cSdOebuPzyP+/9p0BimM/OqxsevIopQ==
"@vue/cli-shared-utils@^5.0.9":
version "5.0.9"
resolved "https://registry.npmmirror.com/@vue/cli-shared-utils/-/cli-shared-utils-5.0.9.tgz#dbb62953e953757773e89e69f369559fced135cf"
integrity sha512-lf4KykiG8j9KwvNVi7fKtASmHuLsxCcCsflVU2b2CHMRuR4weOIV3zuuCrjWKjk0APn/MHJhgCjJGzHMbTtd5w==
dependencies:
"@achrinza/node-ipc" "^9.2.5"
chalk "^4.1.2"
@ -2513,6 +2546,17 @@
"@vue/compiler-core" "3.5.18"
"@vue/shared" "3.5.18"
"@vue/compiler-sfc@2.7.16":
version "2.7.16"
resolved "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz#ff81711a0fac9c68683d8bb00b63f857de77dc83"
integrity sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==
dependencies:
"@babel/parser" "^7.23.5"
postcss "^8.4.14"
source-map "^0.6.1"
optionalDependencies:
prettier "^1.18.2 || ^2.0.0"
"@vue/compiler-sfc@^3.5.18":
version "3.5.18"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/compiler-sfc/-/compiler-sfc-3.5.18.tgz#ba1e849561337d809937994cdaf900539542eeca"
@ -2552,12 +2596,12 @@
optionalDependencies:
prettier "^1.18.2 || ^2.0.0"
"@vue/shared@3.5.18", "@vue/shared@^3.0.0", "@vue/shared@^3.5.18":
"@vue/shared@3.5.18", "@vue/shared@^3.5.18":
version "3.5.18"
resolved "https://mirrors.huaweicloud.com/repository/npm/@vue/shared/-/shared-3.5.18.tgz#529f24a88d3ed678d50fd5c07455841fbe8ac95e"
integrity sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA==
"@vue/vue-loader-v15@npm:vue-loader@^15.9.7":
"@vue/vue-loader-v15@npm:vue-loader@^15.9.7", vue-loader@^15.6.4:
version "15.11.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-loader/-/vue-loader-15.11.1.tgz#dee91169211276ed43c5715caef88a56b1f497b0"
integrity sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==
@ -3249,9 +3293,9 @@ babel-plugin-dynamic-import-node@^2.3.3:
dependencies:
object.assign "^4.1.0"
babel-plugin-import@^1.11.0:
babel-plugin-import@^1.13.8:
version "1.13.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/babel-plugin-import/-/babel-plugin-import-1.13.8.tgz#782c517f6bbf2de3b1f75aaafd6d20a491c4878c"
resolved "https://registry.npmmirror.com/babel-plugin-import/-/babel-plugin-import-1.13.8.tgz#782c517f6bbf2de3b1f75aaafd6d20a491c4878c"
integrity sha512-36babpjra5m3gca44V6tSTomeBlPA7cHUynrE2WiQIm3rEGD9xy28MKsx5IdO45EbnpJY7Jrgd00C6Dwt/l/2Q==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
@ -3799,6 +3843,21 @@ charenc@0.0.2:
resolved "https://mirrors.huaweicloud.com/repository/npm/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==
"chokidar@>=2.0.0 <4.0.0", chokidar@^3.4.1, chokidar@^3.5.3:
version "3.6.0"
resolved "https://mirrors.huaweicloud.com/repository/npm/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b"
integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
chokidar@^2.1.8:
version "2.1.8"
resolved "https://mirrors.huaweicloud.com/repository/npm/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917"
@ -3818,21 +3877,6 @@ chokidar@^2.1.8:
optionalDependencies:
fsevents "^1.2.7"
chokidar@^3.4.1, chokidar@^3.5.3:
version "3.6.0"
resolved "https://mirrors.huaweicloud.com/repository/npm/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b"
integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
chownr@^1.1.1:
version "1.1.4"
resolved "https://mirrors.huaweicloud.com/repository/npm/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
@ -4223,6 +4267,11 @@ core-js@^3.4.1, core-js@^3.8.3:
resolved "https://mirrors.huaweicloud.com/repository/npm/core-js/-/core-js-3.45.0.tgz#556c2af44a2d9c73ea7b49504392474a9f7c947e"
integrity sha512-c2KZL9lP4DjkN3hk/an4pWn5b5ZefhRJnAc42n6LJ19kSnbeRbdQZE5dSeE2LBol1OwJD3X1BQvFTAsa8ReeDA==
core-js@^3.45.0:
version "3.49.0"
resolved "https://registry.npmmirror.com/core-js/-/core-js-3.49.0.tgz#8b4d520ac034311fa21aa616f017ada0e0dbbddd"
integrity sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==
core-util-is@1.0.2:
version "1.0.2"
resolved "https://mirrors.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@ -4292,9 +4341,9 @@ cross-env@^5.2.0:
dependencies:
cross-spawn "^6.0.5"
cross-env@^7.0.2:
cross-env@^7.0.3:
version "7.0.3"
resolved "https://mirrors.huaweicloud.com/repository/npm/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
resolved "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"
@ -4512,6 +4561,11 @@ cssstyle@^2.0.0:
dependencies:
cssom "~0.3.6"
csstype@^3.0.3, csstype@^3.1.0:
version "3.2.3"
resolved "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a"
integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==
cyclist@^1.0.1:
version "1.0.2"
resolved "https://mirrors.huaweicloud.com/repository/npm/cyclist/-/cyclist-1.0.2.tgz#673b5f233bf34d8e602b949429f8171d9121bea3"
@ -4533,6 +4587,11 @@ data-urls@^1.1.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"
dayjs@^1.11.13:
version "1.11.21"
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.21.tgz#57f87562e62de76f3c704bd2b8d522fc33068eb2"
integrity sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==
de-indent@^1.0.2:
version "1.0.2"
resolved "https://mirrors.huaweicloud.com/repository/npm/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
@ -4836,6 +4895,11 @@ dotenv@^10.0.0:
resolved "https://mirrors.huaweicloud.com/repository/npm/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
dotenv@^17.2.1:
version "17.4.2"
resolved "https://registry.npmmirror.com/dotenv/-/dotenv-17.4.2.tgz#c07e54a746e11eba021dd9e1047ced5afdc1c034"
integrity sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==
dunder-proto@^1.0.1:
version "1.0.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a"
@ -5471,9 +5535,9 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"
flyio@^0.6.2:
flyio@^0.6.14:
version "0.6.14"
resolved "https://mirrors.huaweicloud.com/repository/npm/flyio/-/flyio-0.6.14.tgz#c5d83eb7a9b4fc1c915a463d2ea6dfce755c2d6f"
resolved "https://registry.npmmirror.com/flyio/-/flyio-0.6.14.tgz#c5d83eb7a9b4fc1c915a463d2ea6dfce755c2d6f"
integrity sha512-RE2OXE1ZZmcXOKb0jCtGyquHDxpAqHg17CZ8lmQKRfl3x1kP+NBpaQDx4WgN7DNpLJjFnspTzTEQpwRGg6/xaA==
dependencies:
request "^2.85.0"
@ -5919,7 +5983,7 @@ hasown@^2.0.0, hasown@^2.0.2:
dependencies:
function-bind "^1.1.2"
he@^1.1.0, he@^1.2.0:
he@^1.2.0:
version "1.2.0"
resolved "https://mirrors.huaweicloud.com/repository/npm/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
@ -6945,9 +7009,9 @@ jest-worker@^27.0.2, jest-worker@^27.4.5:
merge-stream "^2.0.0"
supports-color "^8.0.0"
jest@^25.4.0:
jest@^25.5.4:
version "25.5.4"
resolved "https://mirrors.huaweicloud.com/repository/npm/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db"
resolved "https://registry.npmmirror.com/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db"
integrity sha512-hHFJROBTqZahnO+X+PMtT6G2/ztqAZJveGqz//FnWWHurizkD05PQGzRZOhF3XP6z7SJmL+5tCfW8qV06JypwQ==
dependencies:
"@jest/core" "^25.5.4"
@ -7892,6 +7956,11 @@ nanoid@^3.3.11:
resolved "https://mirrors.huaweicloud.com/repository/npm/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b"
integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==
nanoid@^3.3.12:
version "3.3.15"
resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.15.tgz#36c490fad8c6e86c824c940dfdde999b69ed4316"
integrity sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==
nanomatch@^1.2.9:
version "1.2.13"
resolved "https://mirrors.huaweicloud.com/repository/npm/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@ -8935,6 +9004,15 @@ postcss@^8.2.6, postcss@^8.3.5, postcss@^8.4.33, postcss@^8.5.6:
picocolors "^1.1.1"
source-map-js "^1.2.1"
postcss@^8.4.14:
version "8.5.16"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.5.16.tgz#1230ce0b5df354c24c0ea45f99ce5f6a88279d28"
integrity sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==
dependencies:
nanoid "^3.3.12"
picocolors "^1.1.1"
source-map-js "^1.2.1"
prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://mirrors.huaweicloud.com/repository/npm/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
@ -9575,6 +9653,24 @@ sane@^4.0.3:
minimist "^1.1.1"
walker "~1.0.5"
sass-loader@8.0.2:
version "8.0.2"
resolved "https://registry.npmmirror.com/sass-loader/-/sass-loader-8.0.2.tgz#debecd8c3ce243c76454f2e8290482150380090d"
integrity sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==
dependencies:
clone-deep "^4.0.1"
loader-utils "^1.2.3"
neo-async "^2.6.1"
schema-utils "^2.6.1"
semver "^6.3.0"
sass@1.26.2:
version "1.26.2"
resolved "https://registry.npmmirror.com/sass/-/sass-1.26.2.tgz#4e17c5c2394e2ee7ffd653ac1d862314a6a5767b"
integrity sha512-9TRp1d1NH0mWH8rqaR/jCS05f/TFD1ykPF2zSYviprMhLb0EmXVqtKMUHsvDt3YIT/jbSK6qAvUlfCW/HJkdCw==
dependencies:
chokidar ">=2.0.0 <4.0.0"
sax@>=0.6.0:
version "1.4.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f"
@ -9596,7 +9692,7 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
schema-utils@^2.5.0, schema-utils@^2.6.5:
schema-utils@^2.5.0, schema-utils@^2.6.1, schema-utils@^2.6.5:
version "2.7.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7"
integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==
@ -10843,6 +10939,11 @@ uuid@^8.3.2:
resolved "https://mirrors.huaweicloud.com/repository/npm/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
uview-ui@1.8.8:
version "1.8.8"
resolved "https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz#2db41f5b5d59452eb2a17e4aa0b684a004ed0265"
integrity sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg==
v8-to-istanbul@^4.1.3:
version "4.1.4"
resolved "https://mirrors.huaweicloud.com/repository/npm/v8-to-istanbul/-/v8-to-istanbul-4.1.4.tgz#b97936f21c0e2d9996d4985e5c5156e9d4e49cd6"
@ -10884,16 +10985,10 @@ vue-hot-reload-api@^2.3.0:
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2"
integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==
vue-loader@^15.6.4:
version "15.11.1"
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-loader/-/vue-loader-15.11.1.tgz#dee91169211276ed43c5715caef88a56b1f497b0"
integrity sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==
dependencies:
"@vue/component-compiler-utils" "^3.1.0"
hash-sum "^1.0.2"
loader-utils "^1.1.0"
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
vue-i18n@^8.28.2:
version "8.28.2"
resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-8.28.2.tgz#913558066e274395c0a9f40b2f3393d5c2636840"
integrity sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA==
vue-loader@^17.0.0:
version "17.4.2"
@ -10912,15 +11007,7 @@ vue-style-loader@^4.1.0, vue-style-loader@^4.1.3:
hash-sum "^1.0.2"
loader-utils "^1.0.2"
"vue-template-compiler@>= 2.6.14 < 2.7":
version "2.6.14"
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz#a2f0e7d985670d42c9c9ee0d044fed7690f4f763"
integrity sha512-ODQS1SyMbjKoO1JBJZojSw6FE4qnh9rIpUZn2EUT86FKizx9uH5z6uXiIrm4/Nb/gwxTi/o17ZDEGWAXHvtC7g==
dependencies:
de-indent "^1.0.2"
he "^1.1.0"
vue-template-compiler@^2.6.10, vue-template-compiler@^2.6.7:
vue-template-compiler@^2.6.10, vue-template-compiler@^2.6.14, vue-template-compiler@^2.6.7:
version "2.7.16"
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz#c81b2d47753264c77ac03b9966a46637482bb03b"
integrity sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==
@ -10933,14 +11020,17 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://mirrors.huaweicloud.com/repository/npm/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
"vue@>= 2.6.14 < 2.7":
version "2.6.14"
resolved "https://mirrors.huaweicloud.com/repository/npm/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
vue@^2.6.14:
version "2.7.16"
resolved "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9"
integrity sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==
dependencies:
"@vue/compiler-sfc" "2.7.16"
csstype "^3.1.0"
vuex@^3.2.0:
vuex@^3.6.2:
version "3.6.2"
resolved "https://mirrors.huaweicloud.com/repository/npm/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
resolved "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
integrity sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==
w3c-hr-time@^1.0.1: