diff --git a/src/pages.json b/src/pages.json index 9a1222b7..d26dec1e 100644 --- a/src/pages.json +++ b/src/pages.json @@ -375,6 +375,13 @@ // } } }, + { + "path": "pages/purchaseReturn/job/returnDetailBatch", + "style": { + "navigationBarTitleText": "退货任务详情", + "enablePullDownRefresh": true + } + }, { "path": "pages/inspect/job/inspectJob", "style": { diff --git a/src/pages/count/job/countLightDetail.vue b/src/pages/count/job/countLightDetail.vue index 86861d7b..9588e1d7 100644 --- a/src/pages/count/job/countLightDetail.vue +++ b/src/pages/count/job/countLightDetail.vue @@ -371,41 +371,74 @@ //按物料、箱码、批次、状态匹配 let items = this.allDetails.filter(r => r.itemCode === itemCode && - r.packingNumber === packingNumber && + // r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus) //不在任务列表中,是否添加库存 if (items.length == 0) { - this.$refs.comMessage.showQuestionMessage("包装【" + result.label.packingNumber + - "】不在任务列表中,是否要添加到列表中?", - res => { - //创建盘点信息,标记为已经扫描 - if (res) { - var detail = this.createAddDetailInfo(pack, qty) - detail.countTime = new Date(); - this.allDetails.push(detail) - this.updateList(); - this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, - null); - } else { - this.scanPopupGetFocus(); - } - }) - } else { - var selectItem = items[0] - //已经扫描 - if (selectItem.scaned) { - this.$refs.comMessage.showQuestionMessage("包装【" + result.label.packingNumber + - "】已经完成盘点,是否要编辑盘点结果?", - res => { + // 按批次 + if (this.managementType == 'BY_BATCH'){ + this.$refs.comMessage.showQuestionMessage("批次【" + result.label.batch + + "】不在任务列表中,是否要添加到列表中?",res => { + //创建盘点信息,标记为已经扫描 if (res) { - this.currentEditItem = selectItem; - this.$refs.countQtyEdit.openEditPopup(selectItem, + var detail = this.createAddDetailInfo(pack, qty) + detail.countTime = new Date(); + this.allDetails.push(detail) + this.updateList(); + this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null); } else { this.scanPopupGetFocus(); } }) + }else{ + this.$refs.comMessage.showQuestionMessage("包装【" + result.label.packingNumber + + "】不在任务列表中,是否要添加到列表中?",res => { + //创建盘点信息,标记为已经扫描 + if (res) { + var detail = this.createAddDetailInfo(pack, qty) + detail.countTime = new Date(); + this.allDetails.push(detail) + this.updateList(); + this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, + null); + } else { + this.scanPopupGetFocus(); + } + }) + } + } else { + var selectItem = items[0] + //已经扫描 + if (selectItem.scaned) { + // 按批次 + if (this.managementType == 'BY_BATCH'){ + this.$refs.comMessage.showQuestionMessage("批次【" + result.label.batch + + "】已经完成盘点,是否要编辑盘点结果?", + res => { + if (res) { + this.currentEditItem = selectItem; + this.$refs.countQtyEdit.openEditPopup(selectItem, + null); + } else { + this.scanPopupGetFocus(); + } + }) + }else{ + this.$refs.comMessage.showQuestionMessage("包装【" + result.label.packingNumber + + "】已经完成盘点,是否要编辑盘点结果?", + res => { + if (res) { + this.currentEditItem = selectItem; + this.$refs.countQtyEdit.openEditPopup(selectItem, + null); + } else { + this.scanPopupGetFocus(); + } + }) + } + } else { //未扫描,赋值 diff --git a/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue b/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue index 1238e443..349f43eb 100644 --- a/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue +++ b/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue @@ -1,35 +1,23 @@ @@ -47,10 +35,12 @@ import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue' import batch from '@/mycomponents/balance/batch.vue' - import { + import qtyEdit from '@/mycomponents/qty/qtyEdit.vue' +import { getDetailOption, - getEditRemoveOption, - getRemoveOption + getPurchaseReceiptOption, + getRemoveOption, + getEditRemoveOption } from '@/common/array.js'; export default { @@ -66,7 +56,8 @@ location, detailInfoPopup, comIssueRequestInfo, - batch + batch, + qtyEdit }, props: { dataContent: { @@ -77,6 +68,10 @@ type: Object, default: {} }, + isEdit: { + type: Boolean, + default: true + }, }, watch: { @@ -90,69 +85,69 @@ batchItem: {}, detailOptions: [], scanOptions: [], - removeOptions: [] + removeOptions: [], + editAndRemoveOptions:[] } }, mounted() { - this.detailOptions = getDetailOption(); - this.scanOptions = getEditRemoveOption(); - this.removeOptions = getRemoveOption() + this.removeOptions = getRemoveOption(); + this.editAndRemoveOptions = getEditRemoveOption() }, methods: { resizeCollapse() { - this.$nextTick(r => { - this.$refs.collapse.forEach(r => { - r.childrens.forEach(i => { - i.init(); - }) - r.resize(); - }) - }); + // this.$nextTick(r => { + // this.$refs.collapse.forEach(r => { + // r.childrens.forEach(i => { + // i.init(); + // }) + // r.resize(); + // }) + // }); }, swipeClick(e, batch, - record,recordIndex, - batchIndex, - Batchs, - locatonIndex, - Locations) { + record, recordIndex, + batchIndex, + Batchs, + locatonIndex, + Locations) { if (e.content.text == "编辑") { this.edit(batch, record) } else if (e.content.text == "移除") { - this.remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations) + this.remove(batch, record, recordIndex, batchIndex, Batchs, locatonIndex, Locations) } }, itemCoceClick(e, item, index) { - if (e.content.text == "移除") { + if (e.content.text == "编辑") { + this.edit(item) + } else if (e.content.text == "移除") { this.dataContent.Items.splice(index, 1); this.$emit('removeItemCode') } }, - edit(batch, item) { - let that = this; - that.editItem = item; - that.batchItem = batch; - item.balance.balanceQty = item.balance.qty; - that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); + edit(item) { + let that = this; + that.editItem = item; + that.$refs.balanceQtyEdit.openEditPopup(item); }, detail(item) { this.showItem = item; this.$refs.receiptHint.openScanPopup() }, - remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations) { + remove(batch, record, recordIndex, batchIndex, Batchs, locatonIndex, Locations) { this.$refs.message.showQuestionMessage("确定移除扫描信息?", res => { if (res) { batch.Records.splice(recordIndex, 1); - if(batch.Records.length==0&&Batchs[batchIndex].isNewAdd){ - Batchs.splice(batchIndex,1) + if (batch.Records.length == 0 && Batchs[batchIndex].isNewAdd) { + Batchs.splice(batchIndex, 1) } - if(batch.Records.length==0&&Locations[locatonIndex].isNewAdd){ - Locations.splice(locatonIndex,1) + if (batch.Records.length == 0 && Locations[locatonIndex].isNewAdd) { + Locations.splice(locatonIndex, 1) } this.resizeCollapse(); this.$emit('updateData', record) @@ -160,13 +155,8 @@ }); }, confirm(val) { - this.editItem.qty = val; + this.editItem.handleQty = Number(val); this.$emit('updateData', this.editItem) - // let qty = 0; - // this.batchItem.Records.forEach(r => { - // qty += Number(r.qty); - // }) - // this.batchItem.handleQty = qty; } } } diff --git a/src/pages/purchaseReturn/coms/comScanReturnPackBatch.vue b/src/pages/purchaseReturn/coms/comScanReturnPackBatch.vue new file mode 100644 index 00000000..c439feae --- /dev/null +++ b/src/pages/purchaseReturn/coms/comScanReturnPackBatch.vue @@ -0,0 +1,579 @@ + + + + + diff --git a/src/pages/purchaseReturn/job/returnDetail.vue b/src/pages/purchaseReturn/job/returnDetail.vue index cb79675b..b4153098 100644 --- a/src/pages/purchaseReturn/job/returnDetail.vue +++ b/src/pages/purchaseReturn/job/returnDetail.vue @@ -23,22 +23,13 @@ - - - + - + @@ -132,7 +123,6 @@ poNumber:"", fromLocationCode:"", managementList:[], - managementType:'' }; }, onLoad(option) { @@ -223,23 +213,6 @@ that.detailSource = getDataSource(that.detailSource,that.subList); that.fromLocationCode =that.subList[0].fromLocationCode that.poNumber =that.subList[0].poNumber - - //获取管理模式,封装参数 - var itemCodes = [] - that.detailSource.forEach(item => { - item.Items.forEach((cur)=>{ - itemCodes.push(cur.itemCode) - }) - item.scaned = false - }) - console.log(that.detailSource) - getManagementPrecisions(itemCodes, that.fromLocationCode, res => { - if (res.success) { - this.managementList = res.list; - this.managementType = this.managementList.some(item => item.ManagementPrecision == - 'BY_BATCH') ? 'BY_BATCH' : '' - } - }) } else { that.showMessage('列表数据为0'); } diff --git a/src/pages/purchaseReturn/job/returnDetailBatch.vue b/src/pages/purchaseReturn/job/returnDetailBatch.vue new file mode 100644 index 00000000..a891213e --- /dev/null +++ b/src/pages/purchaseReturn/job/returnDetailBatch.vue @@ -0,0 +1,492 @@ + + + + + \ No newline at end of file diff --git a/src/pages/purchaseReturn/job/returnJob.vue b/src/pages/purchaseReturn/job/returnJob.vue index 97f80e7c..c9761207 100644 --- a/src/pages/purchaseReturn/job/returnJob.vue +++ b/src/pages/purchaseReturn/job/returnJob.vue @@ -40,7 +40,9 @@ getDetailOption, getDetailGiveupOption } from '@/common/array.js'; - + import { + getManagementPrecisions + } from '@/common/balance.js'; import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue' @@ -185,9 +187,23 @@ openJobDetail(item) { - uni.navigateTo({ - url: './returnDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title - }); + getManagementPrecisions([item.itemCode], item.fromLocationCode, ret => { + if (ret.success) { + this.managementList = ret.list; + this.managementType = this.managementList.some(cur => cur.ManagementPrecision == 'BY_BATCH') ? + 'BY_BATCH' : '' + if (this.managementType == 'BY_BATCH') { + uni.navigateTo({ + url: './returnDetailBatch?id=' + item.masterId + '&status=' + item.status+'&title='+this.title + }); + } else { + uni.navigateTo({ + url: './returnDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title + }); + } + } + }) + }, showItemList(itemList) { @@ -206,8 +222,8 @@ res => { if (res) { this.cancleJob(dataContent.masterId); - } - }); + } + }); } },