From dfce0834db800491462e007d91ed4d9f26465632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E9=A3=9E?= Date: Fri, 6 Jun 2025 14:19:48 +0800 Subject: [PATCH] =?UTF-8?q?add:=E4=BA=A7=E6=88=90=E5=93=81=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductStockIn/index - 副本 (2).vue | 776 ------------------ .../features/ProductStockIn/index - 副本.vue | 386 ++++----- .../features/ProductStockIn/index.vue | 225 ++++- 3 files changed, 409 insertions(+), 978 deletions(-) delete mode 100644 pages/material/features/ProductStockIn/index - 副本 (2).vue diff --git a/pages/material/features/ProductStockIn/index - 副本 (2).vue b/pages/material/features/ProductStockIn/index - 副本 (2).vue deleted file mode 100644 index 9ca6774..0000000 --- a/pages/material/features/ProductStockIn/index - 副本 (2).vue +++ /dev/null @@ -1,776 +0,0 @@ - - - - diff --git a/pages/material/features/ProductStockIn/index - 副本.vue b/pages/material/features/ProductStockIn/index - 副本.vue index c96557f..e696cdb 100644 --- a/pages/material/features/ProductStockIn/index - 副本.vue +++ b/pages/material/features/ProductStockIn/index - 副本.vue @@ -15,16 +15,16 @@      + @inputChange="getitems_LocationAll" @change="changeLocationName"> - - - +

扫描条码:

- 确定 + 确定
- - - + + + - + -
- 批次: {{ item.CHARGE }} -
-
- 料号: {{ item.MATERIALSPECNAME }} - 阶段: {{ item.PHASE }} - SDK规格: {{ item.SPECNAME }} -
-
- 品名: {{ item.DESC_CN }} -
-
- 实际规格: {{ item.TRUEGG }} -
-
- 仓库: {{ item.ERPLOCATION }} -
-
- 货位: {{ item.LOCATIONNAME }} -
-
- 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }} -
-
- 删除 +
+ 批次: {{ item.CHARGE }} +
+
+ 料号: {{ item.MATERIALSPECNAME }} + 阶段: {{ item.PHASE }} + SDK规格: {{ item.SPECNAME }} +
+
+ 品名: {{ item.DESC_CN }} +
+
+ 实际规格: {{ item.TRUEGG }} +
+
+ 仓库: {{ item.ERPLOCATION }} +
+
+ 货位: {{ item.LOCATIONNAME }} +
+
+ 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }} +
+ +
+ 删除 +
+
+
@@ -106,6 +105,9 @@ import { getOpCode } from '@/common/api.js'; + import { + cals + } from '@/utils/cal' import navVar from "@/components/navBar/navBar.vue" export default { components: { @@ -226,8 +228,9 @@ endX: 0, // 触摸结束时的X坐标 isMoving: false, // 是否正在滑动 showDeleteBtn: null, // 显示删除按钮的索引 - isCollapsed: false ,// 默认为展开状态 - searchBatch : '',//搜索的批次 + isCollapsed: false, // 默认为展开状态 + searchBatch: '', //搜索的批次 + lockInput:true } }, mounted() { @@ -248,6 +251,7 @@ this.orgObject = JSON.parse(uni.getStorageSync('orgObject')) this.getERPLocation(); + //this.getLocationName(); // this.GetLiberaryBaeIn() // this.GetLiberaryBaeEn() this.getTimeData(); @@ -258,7 +262,7 @@ this.isCollapsed = !this.isCollapsed; }, //隐藏展示批次 - setVisableCharge (iCharge) { + setVisableCharge(iCharge) { if (this.searchBatch == '') { return 'card-display' } else { @@ -314,7 +318,7 @@ onTouchMove(index, event) { this.endX = event.touches[0].clientX; if (this.startX - this.endX > 50) { // 判断滑动距离,可以根据需要调整 - console.log("222") + console.log("222") this.isMoving = true; this.showDeleteBtn = index; } else if (this.endX - this.startX > 50) { @@ -384,6 +388,9 @@ this.LOCATIONNAME = "" this.getLocationName(); }, + changeLocationName(e) { + this.LOCATIONNAME = e.value; + }, //获取焦点的公共方法 getfocus(nextfocus) { this.initfocus() @@ -412,31 +419,29 @@ }, getLocationName() { this.items_Location = [] - if (this.ERPLOCATION != '') { - this.$MyRequest('/api/storage/getLocationNameForERPLocation', { - ERPLocation: this.ERPLOCATION - }).then(res => { - if (res.data.success) { - for (let i = 0; i < res.data.resultObj.length; i++) { - var _Arr = res.data.resultObj[i]; - this.items_LocationAll.push({ - text: _Arr.DESCRIPTION, - value: _Arr.STORAGENAME - }); - - } - this.getitems_LocationAll(''); - } else { - this.$showMessage(res.data.message) + this.items_LocationAll = [] + let ERPFACTORY = JSON.parse(uni.getStorageSync('orgObject')).ERPFACTORY; + this.$MyRequest('/api/storage/getLocationNameForERPLocation', { + ERPLocation: this.ERPLOCATION + }).then(res => { + if (res.data.success) { + for (let i = 0; i < res.data.resultObj.length; i++) { + var _Arr = res.data.resultObj[i]; + this.items_LocationAll.push({ + text: _Arr.DESCRIPTION, + value: _Arr.STORAGENAME + }); } - this.focusBarCode = true - this.focusShipRequest = false - }).catch(err => { - this.$showMessage(err) - }); - } else { - this.$showMessage("请先选择仓库") - } + console.log(this.items_LocationAll) + this.getitems_LocationAll(''); + } else { + this.$showMessage(res.data.message) + } + this.focusBarCode = true + this.focusShipRequest = false + }).catch(err => { + this.$showMessage(err) + }); }, getitems_LocationAll(query) { @@ -444,117 +449,129 @@ var arr = this.items_LocationAll.filter(item => { return (item.text.includes(query)) || (item.value.includes(query)) }) - if (arr.length > 50) { + this.items_Location = arr.slice(0, arr.length) + /* if (arr.length > 50) { this.items_Location = arr.slice(0, 50) } else { this.items_Location = arr - } + } */ console.log(this.items_Location) }, //扫描成品入库条码 ScanFGBarCode() { - this.focusBarCode = false; - if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) { - this.$showMessage("改标签已扫描,请不要重复扫描!"); - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - return; - } - if (this.LOCATIONNAME == null || this.LOCATIONNAME == "") { - this.$showMessage("请选择货位!"); - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - return; - } - if (this.ERPFACTORY == null || this.ERPFACTORY == "") { - this.$showMessage("请选择组织!"); - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - return; - } - if (this.ERPLOCATION == null || this.ERPLOCATION == "") { - this.$showMessage("请选择仓库!"); - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - return; - } - var barCodeArr = this.MATERIALPACKINGNAME.split("|"); - // 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75 - if (barCodeArr.length < 7) { - this.$showMessage("条码规则不符合需求!") - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - return; - } - let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME) - this.$MyRequest('/FGStockIn/getBarCode', { - MATERIALPACKINGNAME: this.MATERIALPACKINGNAME, - ERPFACTORY: this.ERPFACTORY, - ERPLOCATION: this.ERPLOCATION, - LOCATIONNAME: this.LOCATIONNAME, - MATERIALSPECNAME: barCodeArr[0], - user: this.userId, - // commitDate : this.commitDate, - }).then(res => { - if (res.data.success) { - console.log(res.data.resultObj[0]) - this.BoxListInfo.push(res.data.resultObj[0]); - this.JS = 0 - this.MATERIALQUANTITY = 0 - this.sumList = []; - for (let i = 0; i < this.BoxListInfo.length; i++) { - this.JS = parseFloat(this.JS) + 1 - this.MATERIALQUANTITY = parseFloat(this.MATERIALQUANTITY) + parseFloat(this - .BoxListInfo[i].MATERIALQUANTITY) - if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i] - .RECEIVEREQUESTNAME)) { - this.sumList.push(this.BoxListInfo[i]) - } - } - - try { - Vue.prototype.$playSuccess() - } catch (e) {} - - } else { - this.$showMessage(res.data.message) - this.MATERIALPACKINGNAME = "" + this.opCode = ''; + if (this.lockInput) { + this.lockInput = false; + this.focusBarCode = false; + if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) { + this.$showMessage("改标签已扫描,请不要重复扫描!"); + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) this.$playFail() + return; } - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - }).catch(err => { - this.$showMessage(err) - this.$nextTick(() => { - this.MATERIALPACKINGNAME = "" - this.focusBarCode = true - this.focusShipRequest = false - }) - this.$playFail() - }); + // if (this.LOCATIONNAME == null || this.LOCATIONNAME == "") { + // this.$showMessage("请选择货位!"); + // this.$nextTick(() => { + // this.MATERIALPACKINGNAME = "" + // this.focusBarCode = true + // this.focusShipRequest = false + // }) + // this.$playFail() + // return; + // } + if (this.ERPFACTORY == null || this.ERPFACTORY == "") { + this.$showMessage("请选择组织!"); + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) + this.$playFail() + return; + } + if (this.ERPLOCATION == null || this.ERPLOCATION == "") { + this.$showMessage("请选择仓库!"); + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) + this.$playFail() + return; + } + var barCodeArr = this.MATERIALPACKINGNAME.split("|"); + // 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75 + if (barCodeArr.length < 7) { + this.$showMessage("条码规则不符合需求!") + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) + this.$playFail() + return; + } + let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME) + this.$MyRequest('/FGStockIn/getBarCode', { + MATERIALPACKINGNAME: this.MATERIALPACKINGNAME, + ERPFACTORY: this.ERPFACTORY, + ERPLOCATION: this.ERPLOCATION, + LOCATIONNAME: this.LOCATIONNAME, + MATERIALSPECNAME: barCodeArr[0], + user: this.userId, + // commitDate : this.commitDate, + }).then(res => { + if (res.data.success) { + console.log(res.data.resultObj[0]) + this.BoxListInfo.unshift(res.data.resultObj[0]); + this.JS = 0 + this.MATERIALQUANTITY = 0 + this.sumList = []; + for (let i = 0; i < this.BoxListInfo.length; i++) { + this.JS = parseFloat(this.JS) + 1 + this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i] + .MATERIALQUANTITY)).toNumber() + if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i] + .RECEIVEREQUESTNAME)) { + this.sumList.push(this.BoxListInfo[i]) + } + } + + try { + Vue.prototype.$playSuccess() + } catch (e) {} + + } else { + this.$showMessage(res.data.message) + this.MATERIALPACKINGNAME = "" + this.$playFail() + } + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) + }).catch(err => { + this.$showMessage(err) + this.$nextTick(() => { + this.MATERIALPACKINGNAME = "" + this.focusBarCode = true + this.focusShipRequest = false + this.lockInput = true; + }) + this.$playFail() + }); + + } }, @@ -569,6 +586,7 @@ // if(this.commitDate == ''){ // this.commitDate = this.timeDate // } + this.opCode = ''; console.log(this.commitDate) this.BoxListInfo.map(item => delete item.key) getOpCode({ @@ -583,7 +601,7 @@ opcode: this.opCode, commitDate: this.commitDate }).then(res => { - if (res.data.success) { + if (res.data.success || res.data.code == 200) { this.opCode = ''; this.loading = false; if (this.value == 'true') { @@ -681,7 +699,7 @@ } .list-item { - + margin-top: 16px; /* 卡片之间的间距 */ // padding: 12px; @@ -714,9 +732,11 @@ // box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 卡片阴影效果 */ } + .card-description { margin: 5rpx; } + .card-hidden { flex: 1; // padding-left: 10px; @@ -733,19 +753,19 @@ /* 卡片阴影效果 */ } -.delete-btn { - position: absolute; - right: 120; - top: 0; - width: 120px; - height: 100%; - background-color: red; - color: #fff; - text-align: center; - line-height: 120px; /* 仅当按钮高度固定为120px时使用 */ -} + // .delete-btn { + // position: absolute; + // right: 120; + // top: 0; + // width: 120px; + // height: 100%; + // background-color: red; + // color: #fff; + // text-align: center; + // line-height: 120px; /* 仅当按钮高度固定为120px时使用 */ + // } .collapsed { display: none; } - + \ No newline at end of file diff --git a/pages/material/features/ProductStockIn/index.vue b/pages/material/features/ProductStockIn/index.vue index e696cdb..ed3077c 100644 --- a/pages/material/features/ProductStockIn/index.vue +++ b/pages/material/features/ProductStockIn/index.vue @@ -17,8 +17,8 @@
- + + + + --> + + + + + + + + + + +
+ 单号: {{ item.RECEIVEREQUESTNAME }} +          + 料号: {{ item.MATERIALSPECNAME }} +
+ +
+ 计划数量: {{ item.TOTALQTY }} {{ item.UNIT }} +          + + 已扫描数量: {{ item.HAVEQUANTITY }} {{ item.UNIT }} +
+
+ +
+
+
+ + + +
+ 标签: {{ item.MATERIALPACKINGNAME }} +
+
+ 批次: {{ item.CHARGE }} +
+
+ 料号: {{ item.MATERIALSPECNAME }} +          + 实际规格: {{ item.SDK_ID }} + +
+
+ 品名: {{ item.DESC_CN }} +          + 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }} +
+ + +
+ 删除 +
+
+
+
@@ -116,6 +194,12 @@ }, data() { return { + backgColor: 'limegreen', + current: 1, + nameItem: ['单号列表', '标签列表'], + styleType: 'text', + activeColor: '#007aff', + isFolded: [], // 用于存储每个项目的折叠状态,初始为 false(不折叠) sumList: [], column: [ //列 { @@ -348,17 +432,49 @@ }; }, + //分栏器的点击事件 + clickitem(e) { + if (this.current !== e.currentIndex) { + this.current = e.currentIndex //获取当前选中的index + } + }, + toggleFold(index) { + this.$set(this.isFolded, index, !this.isFolded[index]); + }, + setBbColorByCharge(isCHECK, isBH, SpecName = "") { + let spec = this.searchSpec + let showhidd = 'show' + if (SpecName.includes(spec) || spec == '') { + showhidd = 'show' + } else { + showhidd = 'hidden' + } + console.log("setBbColorByCharge" + isCHECK + ":" + isBH) + if (isCHECK == 'Y' && isBH == 'Y') { + return 'yellowgreen' + '-' + showhidd + } else if (isCHECK == 'N' && isBH == 'N') { + return 'white' + '-' + showhidd + } else { + return 'yellow' + '-' + showhidd + } + }, deleteItem(row, index) { console.log("***********" + index) this.BoxListInfo.splice(index, 1) - this.MATERIALQUANTITY = this.MATERIALQUANTITY - row.MATERIALQUANTITY + this.MATERIALQUANTITY = cals.sub(this.MATERIALQUANTITY,row.MATERIALQUANTITY).toNumber() this.JS = this.JS - 1 if (this.BoxListInfo.length > 0) { for (let i = 0; i < this.sumList.length; i++) { - if (this.BoxListInfo.every(el => el.RECEIVEREQUESTNAME != this.sumList[i].RECEIVEREQUESTNAME)) { + if (this.BoxListInfo.every(el => el.RECEIVEREQUESTNAME != this.sumList[i].RECEIVEREQUESTNAME || el.MATERIALSPECNAME != this.sumList[i].MATERIALSPECNAME)) { this.sumList.splice(i, 1) } } + // 新加 + this.sumList.map(val => { + if ((val.RECEIVEREQUESTNAME == row.RECEIVEREQUESTNAME) && (val.MATERIALSPECNAME == row.MATERIALSPECNAME)) { + val.HAVEQUANTITY = (cals.sub(val.HAVEQUANTITY,row.MATERIALQUANTITY)).toNumber() + } + }) } else { this.sumList = [] } @@ -519,7 +635,7 @@ this.$playFail() return; } - let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME) + // let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME) this.$MyRequest('/FGStockIn/getBarCode', { MATERIALPACKINGNAME: this.MATERIALPACKINGNAME, ERPFACTORY: this.ERPFACTORY, @@ -530,20 +646,91 @@ // commitDate : this.commitDate, }).then(res => { if (res.data.success) { - console.log(res.data.resultObj[0]) - this.BoxListInfo.unshift(res.data.resultObj[0]); + // console.log(res.data.resultObj[0]) + // this.BoxListInfo.unshift(res.data.resultObj[0]); + // this.JS = 0 + // this.MATERIALQUANTITY = 0 + // this.sumList = []; + // for (let i = 0; i < this.BoxListInfo.length; i++) { + // this.JS = parseFloat(this.JS) + 1 + // this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i] + // .MATERIALQUANTITY)).toNumber() + // if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i] + // .RECEIVEREQUESTNAME)) { + // this.sumList.push(this.BoxListInfo[i]) + // } + // } + + var _Arr = res.data.resultObj; + // res.data.resultObj[0] + + let PakageList = res.data.resultObj?.list2[0] || {}; + let orderList = res.data.resultObj?.list4[0] || {}; + this.BoxListInfo.unshift(PakageList); + if(!this.sumList.length) { + this.sumList.unshift(orderList); + } + this.JS = 0 this.MATERIALQUANTITY = 0 - this.sumList = []; for (let i = 0; i < this.BoxListInfo.length; i++) { - this.JS = parseFloat(this.JS) + 1 - this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i] - .MATERIALQUANTITY)).toNumber() - if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i] - .RECEIVEREQUESTNAME)) { - this.sumList.push(this.BoxListInfo[i]) - } + this.JS = Number(this.JS) + 1 + this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY,this.BoxListInfo[i].MATERIALQUANTITY)).toNumber() } + // this.sumList = []; + // this.MATERIALPACKINGNAME = _Arr[0].MATERIALPACKINGNAME; + // this.CHARGE = _Arr[0].CHARGE; + // this.MATERIALSPECNAME = _Arr[0].MATERIALSPECNAME; + // this.SPECNAME = _Arr[0].SPECNAME; + // this.DESC_CN = _Arr[0].DESC_CN; + // this.PHASE = _Arr[0].PHASE; + /* if (this.RECEIVEACTNO == "") { + this.createActNo(); + } else { + this.createBoxInfo(); + } */ + // this.MATERIALPACKINGNAME = "" HAVEQUANTITY + + // || (el.MATERIALSPECNAME != this.BoxListInfo[i].MATERIALSPECNAME) + // for (let i = 0; i < this.BoxListInfo.length; i++) { + // if (this.sumList.every(el => ((el.RECEIVEREQUESTNAME != this.BoxListInfo[i].RECEIVEREQUESTNAME)))) { + // this.sumList.unshift(this.BoxListInfo[i]) + // } + // } + // for (let i = 0; i < this.BoxListInfo.length; i++) { + // this.sumList.map(val => { + // // if((val.RECEIVEREQUESTNAME == this.BoxListInfo[i].RECEIVEREQUESTNAME)) { + // val.HAVEQUANTITY = this.BoxListInfo.reduce((total, currentValue) => { + // if(val.RECEIVEREQUESTNAME == currentValue.RECEIVEREQUESTNAME) { + // return cals.add(total,currentValue.MATERIALQUANTITY).toNumber() + // } + // },0) + // // } + // }) + // } + /* console.log('orderList',orderList) + for (let i = 0; i < this.BoxListInfo.length; i++) { + if (this.sumList.every(el => ((el.RECEIVEREQUESTNAME != this.BoxListInfo[i].RECEIVEREQUESTNAME)))) { + console.log(111) + this.sumList = [...this.sumList,...orderList] + } + }*/ + + this.sumList.map(val => { + if((val.RECEIVEREQUESTNAME == PakageList.RECEIVEREQUESTNAME && val.MATERIALSPECNAME == PakageList.MATERIALSPECNAME)) { + val.HAVEQUANTITY = cals.add(val.HAVEQUANTITY,PakageList.MATERIALQUANTITY).toNumber() + } + // else { + // orderList.HAVEQUANTITY = PakageList.MATERIALQUANTITY + // this.sumList.unshift(orderList); + // } + }) + if(this.sumList.every(el => el.RECEIVEREQUESTNAME != PakageList.RECEIVEREQUESTNAME || el.MATERIALSPECNAME != PakageList.MATERIALSPECNAME)) { + orderList.HAVEQUANTITY = PakageList.MATERIALQUANTITY + this.sumList.unshift(orderList); + } + + console.log('this.sumList',this.sumList) try { Vue.prototype.$playSuccess()