From a435466c4a80d67f2a0f59971a0985e2b8f687b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Tue, 14 Oct 2025 19:34:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AF=9B=E5=9D=AF=E5=85=A5=E5=BA=93):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=AF=9B=E5=9D=AF=E5=85=A5=E5=BA=93=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=8F=8A=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实现毛坯入库功能,包括: 1. 新增毛坯入库页面及路由配置 2. 添加毛坯相关API接口 3. 实现入库通用工具方法 4. 扩展PDA扫码组件支持毛坯扫码 5. 新增毛坯入库主页面及交互逻辑 6. 实现数量修改弹窗功能 --- api/blank/blank.js | 20 + components/pda-scan-input/index.vue | 448 +++++++------ manifest.json | 4 +- pages.json | 7 + .../blankWarehousing/blankWarehousing.vue | 614 ++++++++++++++++++ pages/blank/blankWarehousing/utils.js | 118 ++++ pages/index/index.vue | 2 +- 7 files changed, 1004 insertions(+), 209 deletions(-) create mode 100644 api/blank/blank.js create mode 100644 pages/blank/blankWarehousing/blankWarehousing.vue create mode 100644 pages/blank/blankWarehousing/utils.js diff --git a/api/blank/blank.js b/api/blank/blank.js new file mode 100644 index 0000000..7802089 --- /dev/null +++ b/api/blank/blank.js @@ -0,0 +1,20 @@ +import upload from '@/utils/upload' +import request from '@/utils/request' +// 毛坯相关接口 ======== +// PDA-毛坯标签解析 +export function PDABlankWarehousing(data) { + return request({ + url: '/mes/wm/WmBlankInventory/PDABlankWarehousing', + method: 'post', + data + }) +} +// PDA-毛坯入库 +export function PDABlankResolutionPackage(params) { + return request({ + url: '/mes/wm/WmBlankInventory/PDABlankResolutionPackage', + method: 'get', + params + }) +} + diff --git a/components/pda-scan-input/index.vue b/components/pda-scan-input/index.vue index 2aff037..a33c51f 100644 --- a/components/pda-scan-input/index.vue +++ b/components/pda-scan-input/index.vue @@ -1,176 +1,186 @@ \ No newline at end of file + /* height: 0px; */ + /* opacity: 0; */ + /* visibility: hidden; */ + /* display:none; */ +} +.input-box input { + width: 100%; + background-color: #e6e6e6; + border: 1px solid #d3d3d3; + font-size: 18px; + height: 18px; +} + diff --git a/manifest.json b/manifest.json index 013d1de..5fabae2 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "上海干巷涂装PDA", "appid" : "__UNI__A67E78B", "description" : "", - "versionName" : "2.6.0", - "versionCode" : 260, + "versionName" : "2.7.0", + "versionCode" : 270, "transformPx" : false, "sassImplementationName" : "node-sass", "app-plus" : { diff --git a/pages.json b/pages.json index 9edd7d6..74ebd0f 100644 --- a/pages.json +++ b/pages.json @@ -278,6 +278,13 @@ { "navigationBarTitleText" : "退货到成品库" } + }, + { + "path" : "pages/blank/blankWarehousing/blankWarehousing", + "style" : + { + "navigationBarTitleText" : "毛坯入库" + } } ] diff --git a/pages/blank/blankWarehousing/blankWarehousing.vue b/pages/blank/blankWarehousing/blankWarehousing.vue new file mode 100644 index 0000000..d2a1902 --- /dev/null +++ b/pages/blank/blankWarehousing/blankWarehousing.vue @@ -0,0 +1,614 @@ + + + + + \ No newline at end of file diff --git a/pages/blank/blankWarehousing/utils.js b/pages/blank/blankWarehousing/utils.js new file mode 100644 index 0000000..9172775 --- /dev/null +++ b/pages/blank/blankWarehousing/utils.js @@ -0,0 +1,118 @@ +/** + * 入库通用工具方法 + */ + +/** + * 显示操作确认模态框 + * @param {string} title - 标题 + * @param {string} content - 内容 + * @param {boolean} showCancel - 是否显示取消按钮 + * @returns {Promise} Promise对象 + */ +export function showOperationConfirm(title, content, showCancel = true) { + return new Promise((resolve) => { + uni.showModal({ + title: title || '提示', + content: content || '', + showCancel: showCancel, + cancelText: '取消', + confirmText: '确定', + success: function(res) { + resolve(res); + } + }); + }); +} + +/** + * 检查是否为重复箱 + * @param {Array} list - 箱子列表 + * @param {string} patchCode - 批次号 + * @returns {boolean} 是否重复 + */ +export function isRepeatPackage(list, patchCode) { + if (!list || list.length === 0) return false; + + for (let item of list) { + if (item.patchCode === patchCode) { + return true; + } + } + return false; +} + +/** + * 检查是否更换了批次 + * @param {Array} list - 箱子列表 + * @param {string} productionTime - 批次时间 + * @returns {boolean} 是否更换批次 + */ +export function isChangeBatch(list, productionTime) { + if (!list || list.length === 0) return false; + + const lastItem = list[list.length - 1]; + return lastItem.productionTime !== productionTime; +} + +/** + * 检查是否为重复箱(基于originalCode) + * @param {Array} list - 箱子列表 + * @param {string} originalCode - 原始编码 + * @returns {boolean} 是否重复 + */ +export function isRepeatPackageByCode(list, originalCode) { + if (!list || list.length === 0) return false; + + for (let item of list) { + if (item.originalCode === originalCode) { + return true; + } + } + return false; +} + +/** + * 清除重复箱 + * @param {Array} list - 箱子列表 + * @returns {Array} 清除重复后的列表和重复箱信息 + */ +export function clearRepeatPackages(list) { + let newArray = []; + let seen = new Map(); + let repeatPackage = []; + + list.forEach((item) => { + if (!seen.has(item.originalCode)) { + seen.set(item.originalCode, true); + newArray.push(item); + } else { + repeatPackage.push(item.patchCode); + } + }); + + return { + clearedList: newArray, + repeatPackages: repeatPackage + }; +} + +/** + * 防抖函数 + * @param {Function} func - 要防抖的函数 + * @param {number} delay - 延迟时间(ms) + * @returns {Function} 防抖后的函数 + */ +export function debounce(func, delay) { + let timeoutId; + return function (...args) { + // 清除之前的定时器 + if (timeoutId) { + clearTimeout(timeoutId); + } + + // 设置新的定时器 + timeoutId = setTimeout(() => { + func.apply(this, args); + }, delay); + }; +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index cca0fbb..ae52a3f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -45,7 +45,7 @@ export default { { name: '毛坯入库', icon: 'inbound/rough-casting-inbound', - url: '', + url: '/pages/blank/blankWarehousing/blankWarehousing?isStrict=false', type: 1, index: 3 },