diff --git a/src/mycomponents/scan/winCheckFgLabel.vue b/src/mycomponents/scan/winCheckFgLabel.vue index d6f1a739..8b77a9a1 100644 --- a/src/mycomponents/scan/winCheckFgLabel.vue +++ b/src/mycomponents/scan/winCheckFgLabel.vue @@ -1,243 +1,271 @@ - - - - - \ No newline at end of file diff --git a/src/mycomponents/scan/winComScanCustomerLabel.vue b/src/mycomponents/scan/winComScanCustomerLabel.vue index a82334de..3a952993 100644 --- a/src/mycomponents/scan/winComScanCustomerLabel.vue +++ b/src/mycomponents/scan/winComScanCustomerLabel.vue @@ -139,9 +139,13 @@ this.handelScanMsg(); }, handelScanMsg() { + console.log('handelScanMsg',this.scanMsg) let that = this; + that.scanMsg.replace('\n','') let index = that.scanMsg.indexOf('\n'); - if (index >= 0) { + console.log('index',index) + + // if (index >= 0) { setTimeout(() => { that.losefocus(); let content = uni.$u.trim(that.scanMsg) @@ -159,7 +163,7 @@ this.customerItemCode = items[1]; that.$emit("getResult", this.customerItemCode); }, 500); - } + // } }, getfocus() { let that = this; diff --git a/src/pages/check/checkFgLabel.vue b/src/pages/check/checkFgLabel.vue index def2e899..a0a1918b 100644 --- a/src/pages/check/checkFgLabel.vue +++ b/src/pages/check/checkFgLabel.vue @@ -3,36 +3,43 @@ - + 客户代码 : {{customerCode}} - + - + + WMS 物料 + {{item.itemCode}} + + + 客户 物料 + {{item.customerItemCode}} + + + 实际校验 物料 + {{item.customerItemCode_reality}} + + + + @confirm="confirmSelect"> - - + - @@ -79,7 +86,6 @@ import winCheckFgLabel from "@/mycomponents/scan/winCheckFgLabel.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' - import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' export default { components: { @@ -90,46 +96,22 @@ winScanLocation, winCheckFgLabel, recordComDetailCard, - recordDetailCard }, data() { return { - id: '', - dataContent: {}, //内容 - detailSource: [], //绑定在页面上的数据源 - fromLocationInfo: {}, - fromLocationCode: "", - fromLocationAreaTypeList: [], - toLocationAreaTypeList: [], - inInventoryStatus: "", //目标入库库存状态 - outInventoryStatus: "", //来源出库库存状态 - businessType: {}, showToLoaction: true, recommendLocationList: [], //推荐库位列表 fromWarehouseCode: '', //来源仓库 - businessTypeCode: "Issue", positionList: [], show: false, positionInfo: "请选择生产线", customerList: [], - show: true, customerCode: '', customerName: '', + list:[] }; }, onLoad(option) { - this.clearData(); - // getBusinessType(this.businessTypeCode, res => { - // if (res.success) { - // this.businessType = res.businessType; - // this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; - // this.toLocationAreaTypeList = res.toLocationAreaTypeList; - // // this.showFromLocationPopup(); - // } else { - // this.showErrorMessage(res.message) - // } - // }); - getBasicCustomerList().then(res => { if (res.data.length > 0) { var list = res.data; @@ -159,104 +141,37 @@ mounted() {}, methods: { - getScanResult(result) { - let balance = result.balance; - let label = result.label; - let pack = result.package; - var item = this.detailSource.find(res => { - if (res.itemCode == balance.itemCode) { - return res + //校验结果 + checkResult(result){ + console.log('checkResult',result) + let flag = true + for(let i=0;i { - var itemp = createItemInfo(balance, pack); - let newDetail = createDetailInfo(balance, pack); // - // newDetail.toLocationCode = toLocation.code; - // newDetail.toWarehouseCode = toLocation.warehouseCode; - itemp.subList.push(newDetail); - var dataList = pack.subList - this.detailSource.push(itemp) - this.detailSource.forEach(res => { - res.subList.forEach(pack => { - pack.packList = dataList.filter(c => c.parentNumber == pack - .packingNumber) - pack.packList.forEach(pac => { - pac.parentPackingNumber = pac.parentNumber; - pac.packingNumber = pac.number; - pac.inventoryStatus = "OK"; - pac.scaned = true; - }) - }) - }) - // }) - - } else { - var itemDetail = item.subList.find(r => r.packingNumber == balance.packingNumber && r.batch == - balance.batch); - if (itemDetail != undefined) { - this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") - } + if(flag){ + this.list.unshift(result) } - // calcTreeHandleQty(this.detailSource); - }, - - //获取推荐库位 - getRecommendLocation(balance, pack, callback) { - uni.showLoading({ - title: '扫描中...', - mask: true - }) - let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode); - if (recommend == undefined) { - let param = { - itemCode: balance.itemCode, - batch: balance.batch, - inventoryStatus: balance.inventoryStatus, - supplierCode: pack.supplierCode, - businessCode: this.businessTypeCode - }; - console.log(JSON.stringify(param)) - getPutawayRecommendLocation(param).then(res => { - this.recommendLocationList.push({ - itemCode: balance.itemCode, - locationCode: res.data.code - }) - callback(res.data); - uni.hideLoading(); - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error); - uni.hideLoading(); - }) - - } else { - callback(recommend); + if(result.pass){ + //通过 + this.showMessage('校验通过') + }else{ + this.showErrorMessage('校验未通过') } + this.$refs.scanPopup.closeScanPopup(); }, - + //打开扫描 + openScanPopup() { + this.$refs.scanPopup.openScanPopupForType(this.customerCode); + }, + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) {} }); }, - - calcTreeHandleQty() { - for (let item of this.detailSource) { - item.qty = 0; - for (let detail of item.subList) { - if (detail != undefined) { - item.qty = calc.add(item.qty, detail.qty) - } - } - } - this.$forceUpdate(); - }, - + showSelect() { this.show = true }, @@ -267,48 +182,11 @@ this.customerName = e[0].label } }, - - updateData() { - this.calcTreeHandleQty(); - }, - - removeItem(index, item) { - this.detailSource.splice(index, 1) - }, - - removePack() { - for (var i = 0; i < this.detailSource.length; i++) { - var item = this.detailSource[i]; - if (item.subList.length == 0) { - this.detailSource.splice(i, 1) - } - } - this.updateData(); - }, - - openScanPopup() { - // if (this.fromLocationCode == "") { - // this.showFromLocationPopup(); - // return - // } - this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); - }, - + showFromLocationPopup() { this.show = true; - - // this.$nextTick(() => { - // this.$refs.scanLocationCode.openScanPopup(); - // }) - }, - - showCustomerList() { - this.$nextTick(() => { - this.$refs.scanLocationCode.openScanPopup(); - }) }, - closeScanPopup() { if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.closeScanPopup(); @@ -320,139 +198,11 @@ this.$refs.scanPopup.getfocus(); } }, - - // scanLocationCode(location, code) { - // this.toLocationCode = code - // this.toLocationCode = location; - - // }, - - commit() { - uni.showLoading({ - title: "提交中....", - mask: true - }); - - //记录有目标库位,需要查询管理模式 - let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); - //2:获取管理模式,封装参数 - getPrecisionStrategyList(precisionStrategyParams, res => { - if (res.success) { - this.managementList = res.list; - var params = { - ...this.setRecordParams() - } - console.log("提交参数", JSON.stringify(params)); - - issueRecordSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功
生成采购上架记录
" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") - } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) - }) - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - }); - }, - - - getItemAndLocationRelations() { - var itemList = [] - this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - detail.toLocationCode = this.toLocationCode; - var filterResult = itemList.filter(res => { - if (res.itemCode == item.itemCode && - res.locationCode == detail.toLocationCode && - res.batch == detail.batch && - res.inventoryStatus == detail.inventoryStatus) { - return res - } - }) - //去掉重复元素 - if (filterResult.length == 0) { - var result = { - itemCode: item.itemCode, - locationCode: detail.toLocationCode, - batch: detail.batch, - inventoryStatus: detail.inventoryStatus, - } - itemList.push(result) - } - - } - }) - }) - return itemList; - }, - - setRecordParams() { - var subList = [] - var creator = this.$store.state.user.id - this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, - detail.packingNumber, detail.toLocationCode, detail.batch); - var submitItem = deepCopyData(detail) - submitItem.toPackingNumber = info.packingNumber; - submitItem.toBatch = info.batch; - submitItem.toContainerNumber = detail.containerNumber; - - submitItem.fromPackingNumber = info.packingNumber; - submitItem.fromBatch = info.batch; - submitItem.fromContainerNumber = detail.containerNumber; - - submitItem.fromLocationCode = detail.locationCode; - submitItem.toLocationCode = detail.toLocationCode; - - // detail.toInventoryStatus = detail.inventoryStatus - // detail.toLocationCode = detail.toLocationCode - submitItem.qty = detail.handleQty; - submitItem.package = ""; - submitItem.recordList = [{ - toInventoryStatus: detail.inventoryStatus, - fromPackingNumber: info.packingNumber, - fromBatch: info.batch, - toPackingNumber: info.packingNumber, - toBatch: info.batch, - fromLocationCode: detail.locationCode, - toLocationCode: detail.toLocationCode, - handleQty: detail.handleQty - }] - subList.push(submitItem) - } - }) - }) - if (subList.length > 0) { - this.dataContent.toWarehouseCode = subList[0].toWarehouseCode; - } - this.dataContent.subList = subList - this.dataContent.creator = creator; - this.dataContent.fromWarehouseCode = this.fromWarehouseCode; - return this.dataContent; - }, - showMessage(message) { this.$refs.comMessage.showMessage(message, res => { if (res) {} }); }, - showErrorMessage(message) { - this.$refs.comMessage.showErrorMessage(message, res => { - if (res) { - - } - }); - }, showScanMessage(message) { this.$refs.comMessage.showScanMessage(message); @@ -465,48 +215,11 @@ closeScanMessage() { this.scanPopupGetFocus(); }, - getLocation(location, code) { - this.getFromLocationCode(location, code) - }, - getFromLocationCode(location, code) { - this.fromLocationInfo = location; - this.fromLocationCode = code; - this.openScanPopup(); - }, - getToLocationCode(location, code) { - if (this.fromLocationCode == code) { - uni.showToast({ - title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", - duration: 2000 - }) - return - } - this.toLocationCode = code; - }, - showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - this.clearData(); }) }, - - updateData() { - // this.calcTreeHandleQty(); - for (var i = 0; i < this.detailSource.length; i++) { - let item = this.detailSource[i]; - if (item.qty == 0) { - this.detailSource.splice(i, 1) - } - } - }, - - clearData() { - this.fromLocationInfo = {}; - this.fromLocationCode = ''; - this.fromWarehouseCode = ''; - this.toWarehouseCode = ''; - this.detailSource = []; - } + } } @@ -516,4 +229,11 @@ height: 500rpx; background-color: bisque; } + .refuse_view { + background: linear-gradient(90deg, rgba(255, 160, 161, 1) 0%, rgba(255, 160, 161, 0) 100%) + } + .line { + background-color: #e0e0e0; + height: 1px; + } \ No newline at end of file