From 305a135735151c47eff3d2f34906d9399d0f47bd Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 9 Sep 2024 09:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E5=A4=8D=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E6=B2=A1=E6=9C=89=E6=8F=90=E7=A4=BA=202024/7/12=2013:?= =?UTF-8?q?56:17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycomponents/detail/comDetailCard.vue | 2 +- .../package/record/overPackageRecord.vue | 4 +- .../package/record/splitPackageRecord.vue | 776 ++++++++---------- .../job/productPutawayDetail.vue | 23 +- .../purchaseReturn/coms/comReturnJobCard.vue | 31 +- src/pages/purchaseReturn/job/returnDetail.vue | 4 + src/pages/purchaseReturn/job/returnJob.vue | 2 +- .../record/directRepleinshRecord.vue | 5 +- src/uni_modules/wz-select-popup/changelog.md | 8 + .../wz-select-popup/util/defaultConfig.js | 22 + .../components/wz-select-popup/util/index.js | 74 ++ .../components/wz-select-popup/wz-list.vue | 130 +++ .../components/wz-select-popup/wz-search.vue | 90 ++ .../wz-select-popup/wz-select-popup.vue | 357 ++++++++ src/uni_modules/wz-select-popup/package.json | 82 ++ 15 files changed, 1175 insertions(+), 435 deletions(-) create mode 100644 src/uni_modules/wz-select-popup/changelog.md create mode 100644 src/uni_modules/wz-select-popup/components/wz-select-popup/util/defaultConfig.js create mode 100644 src/uni_modules/wz-select-popup/components/wz-select-popup/util/index.js create mode 100644 src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue create mode 100644 src/uni_modules/wz-select-popup/components/wz-select-popup/wz-search.vue create mode 100644 src/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue create mode 100644 src/uni_modules/wz-select-popup/package.json diff --git a/src/mycomponents/detail/comDetailCard.vue b/src/mycomponents/detail/comDetailCard.vue index 567543d4..6f82ed2b 100644 --- a/src/mycomponents/detail/comDetailCard.vue +++ b/src/mycomponents/detail/comDetailCard.vue @@ -94,7 +94,7 @@ onMounted(() => { detailOptions.value = getDetailOption() } if (scanOptions.value.length == 0) { - scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, props.settingParam.allowModifyLocation) + scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false) } nextTick((res) => { collapse.value.init() diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 6064a0b4..767ecc26 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -215,7 +215,7 @@ const setData = (result) => { scanPopupGetFocus() } else { const detail = item.subList.find((r) => { - if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { + if (r.packingNumber == pack.number && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { return r } }) @@ -228,7 +228,7 @@ const setData = (result) => { item.subList.push(newDetail) scanPopupGetFocus() } else if (detail.scaned == true) { - showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) + showErrorMessage(`箱码[${detail.packingNumber}批次[${balance.batch}]已经在列表中`) } } calcHandleQty1() diff --git a/src/pages/package/record/splitPackageRecord.vue b/src/pages/package/record/splitPackageRecord.vue index 3ff4110c..c088a2dc 100644 --- a/src/pages/package/record/splitPackageRecord.vue +++ b/src/pages/package/record/splitPackageRecord.vue @@ -1,418 +1,370 @@ - \ No newline at end of file + diff --git a/src/pages/productPutaway/job/productPutawayDetail.vue b/src/pages/productPutaway/job/productPutawayDetail.vue index 4239f1d3..92072687 100644 --- a/src/pages/productPutaway/job/productPutawayDetail.vue +++ b/src/pages/productPutaway/job/productPutawayDetail.vue @@ -274,9 +274,26 @@ const getScanResult = (result) => { } else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`) } else { - itemDetail.cancleScanedHiht = false - addDetail(itemDetail, result) - return + // itemDetail.cancleScanedHiht = false + // addDetail(itemDetail, result) + // return + // 暂时先不判断状态 + const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) + const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) + if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { + // if (this.jobContent.allowModifyInventoryStatus == "TRUE") { + showQuestionMessage(`实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续上架?`, (res) => { + if (res) { + itemDetail.cancleScanedHiht = false + addDetail(itemDetail, result) + } else { + scanPopupGetFocus() + } + }) + } else { + itemDetail.cancleScanedHiht = false + addDetail(itemDetail, result) + } } } } catch (e) { diff --git a/src/pages/purchaseReturn/coms/comReturnJobCard.vue b/src/pages/purchaseReturn/coms/comReturnJobCard.vue index 4b25962f..50e018ce 100644 --- a/src/pages/purchaseReturn/coms/comReturnJobCard.vue +++ b/src/pages/purchaseReturn/coms/comReturnJobCard.vue @@ -1,20 +1,23 @@ +import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' +import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' - + diff --git a/src/pages/purchaseReturn/job/returnDetail.vue b/src/pages/purchaseReturn/job/returnDetail.vue index db6d17f9..7916aa02 100644 --- a/src/pages/purchaseReturn/job/returnDetail.vue +++ b/src/pages/purchaseReturn/job/returnDetail.vue @@ -210,6 +210,10 @@ const getScanResult = (result) => { itemDetail.scaned = true itemDetail.handleQty = Number(result.label.qty) itemDetail.toInventoryStatus = itemDetail.inventoryStatus + itemDetail.balance = { + packQty: Number(result.package.packQty), + uom: result.package.uom + } calcHandleQty1() } scanPopupGetFocus() diff --git a/src/pages/purchaseReturn/job/returnJob.vue b/src/pages/purchaseReturn/job/returnJob.vue index d4c22c5b..37ff72eb 100644 --- a/src/pages/purchaseReturn/job/returnJob.vue +++ b/src/pages/purchaseReturn/job/returnJob.vue @@ -4,7 +4,7 @@ - + diff --git a/src/pages/repleinsh/record/directRepleinshRecord.vue b/src/pages/repleinsh/record/directRepleinshRecord.vue index 9372c07e..1690ba1d 100644 --- a/src/pages/repleinsh/record/directRepleinshRecord.vue +++ b/src/pages/repleinsh/record/directRepleinshRecord.vue @@ -206,7 +206,7 @@ const setData = (result) => { fromLocationCode.value = balance.locationCode.scanPopupGetFocus() } else { const detail = item.subList.find((r) => { - if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { + if (r.packingNumber == pack.number && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { return r } }) @@ -222,7 +222,7 @@ const setData = (result) => { item.subList.push(newDetail) scanPopupGetFocus() } else if (detail.scaned == true) { - showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) + showErrorMessage(`箱码[${detail.packingNumber}批次[${balance.batch}]已经在列表中`) } } calcHandleQty(detailSource.value) @@ -379,6 +379,7 @@ const showMessage = (message) => { const showErrorMessage = (message) => { comMessageRef.value.showErrorMessage(message, (res) => { if (res) { + scanPopupGetFocus() } }) } diff --git a/src/uni_modules/wz-select-popup/changelog.md b/src/uni_modules/wz-select-popup/changelog.md new file mode 100644 index 00000000..8a5f41c0 --- /dev/null +++ b/src/uni_modules/wz-select-popup/changelog.md @@ -0,0 +1,8 @@ +## 1.0.11(2023-11-15) +reqFun只允许传入Promise +## 1.0.10(2023-11-13) +去除默认值 +## 1.0.1(2023-11-13) +更新插件依赖 +## 1.0.0(2023-11-13) +第一次发布 diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/util/defaultConfig.js b/src/uni_modules/wz-select-popup/components/wz-select-popup/util/defaultConfig.js new file mode 100644 index 00000000..76b74eaf --- /dev/null +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/util/defaultConfig.js @@ -0,0 +1,22 @@ +export default { + mode: 'radio', //radio checkbox 单选、多选 + showType: 'text', //暂时不用 text image 纯文字、图文 + selected: '', //已选中的 + dataList: null, //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig + proxyConfig: { //组件内部代理请求数据配置 + reqFun: Promise.resolve(), //请求方法 + localPaging: false //前端本地分页,如果使用的是dataList默认是本地分页 + }, + page: { //如果是组件内部代理请求会把page的值加入到请求参数里 + pageIndex: 1, //当前页 + pageSize: 20 //页大小 + }, + search: { + type: 'local', //搜索的类型,local本地搜索, remote向服务器请求。只有使用proxyConfig.reqFun请求才能配置为remote + }, + fields: { //显示的key,value + label: 'name', + value: 'code', + image: 'image', //暂时不用 + } +} \ No newline at end of file diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/util/index.js b/src/uni_modules/wz-select-popup/components/wz-select-popup/util/index.js new file mode 100644 index 00000000..d10ab80c --- /dev/null +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/util/index.js @@ -0,0 +1,74 @@ +/**深度合并对象*/ +export const deepMerge = function(target = {}, source = {}) { + target = deepClone(target); //深度克隆 + if (typeof target !== 'object' || typeof source !== 'object') return false; //判断类型 + for (let prop in source) { + if (!source.hasOwnProperty(prop)) continue; //检测属性是否为对象的自有属性 + if (prop in target) { //prop 中是否有 target 属性 + if (typeof target[prop] !== 'object') { + target[prop] = source[prop]; + } else { + if (typeof source[prop] !== 'object') { + target[prop] = source[prop]; + } else { + if (target[prop].concat && source[prop].concat) { + target[prop] = target[prop].concat(source[prop]); //合并 + } else { + target[prop] = deepMerge(target[prop], source[prop]); //递归 + } + } + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +const isArray = function(arr) { + return Object.prototype.toString.call(arr) === '[object Array]'; +} + +/**深度合并对象*/ +export const deepClone = function(obj) { + // 对常见的“非”值,直接返回原来值 + if ([null, undefined, NaN, false].includes(obj)) return obj; + if (typeof obj !== "object" && typeof obj !== 'function') { + //原始类型直接返回 + return obj; + } + let o = isArray(obj) ? [] : {}; + for (let i in obj) { + if (obj.hasOwnProperty(i)) { + o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i]; + } + } + return o; +}; + +let timeout = null +/** + * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数 + * + * @param {Function} func 要执行的回调函数 + * @param {Number} wait 延时的时间 + * @param {Boolean} immediate 是否立即执行 + * @return null + */ +export const debounce = function(func, wait = 500, immediate = false) { + // 清除定时器 + if (timeout !== null) clearTimeout(timeout) + // 立即执行,此类情况一般用不到 + if (immediate) { + const callNow = !timeout + timeout = setTimeout(() => { + timeout = null + }, wait) + if (callNow) typeof func === 'function' && func() + } else { + // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法 + timeout = setTimeout(() => { + typeof func === 'function' && func() + }, wait) + } +} \ No newline at end of file diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue new file mode 100644 index 00000000..fe1ae074 --- /dev/null +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue @@ -0,0 +1,130 @@ + + + + + \ No newline at end of file diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-search.vue b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-search.vue new file mode 100644 index 00000000..6977a7fd --- /dev/null +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-search.vue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue new file mode 100644 index 00000000..7e3b04f9 --- /dev/null +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue @@ -0,0 +1,357 @@ + + + + + \ No newline at end of file diff --git a/src/uni_modules/wz-select-popup/package.json b/src/uni_modules/wz-select-popup/package.json new file mode 100644 index 00000000..3176f71f --- /dev/null +++ b/src/uni_modules/wz-select-popup/package.json @@ -0,0 +1,82 @@ +{ + "id": "wz-select-popup", + "displayName": "popup弹窗选择器", + "version": "1.0.11", + "description": "popup弹窗选择器支持单选,多选,组件内部代理请求,自定义label,value显示,分页加载,", + "keywords": [ + "wz-select-popup" + ], + "repository": "", + "engines": { + "HBuilderX": "^3.96" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": ["uni-icons", "uni-popup"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "u" + }, + "App": { + "app-vue": "y", + "app-nvue": "u", + "app-uvue": "n" + }, + "H5-mobile": { + "Safari": "u", + "Android Browser": "u", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "u" + }, + "H5-pc": { + "Chrome": "y", + "IE": "u", + "Edge": "y", + "Firefox": "u", + "Safari": "u" + }, + "小程序": { + "微信": "y", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file