diff --git a/src/mycomponents/balance/handleBalanceBatch.vue b/src/mycomponents/balance/handleBalanceBatch.vue new file mode 100644 index 00000000..4ab44d8e --- /dev/null +++ b/src/mycomponents/balance/handleBalanceBatch.vue @@ -0,0 +1,85 @@ + + + + + \ No newline at end of file diff --git a/src/mycomponents/qty/recommendQty.vue b/src/mycomponents/qty/recommendQty.vue index 925108d0..8a8b5f00 100644 --- a/src/mycomponents/qty/recommendQty.vue +++ b/src/mycomponents/qty/recommendQty.vue @@ -2,7 +2,7 @@ - + {{Number(dataContent.qty)}} @@ -77,6 +77,10 @@ isShowPackCount: { type: Boolean, default: true + }, + isShowCount: { + type: Boolean, + default: true } }, watch: { diff --git a/src/pages.json b/src/pages.json index 02121c75..d173fcf8 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1816,6 +1816,13 @@ "enablePullDownRefresh": true } }, + { + "path": "pages/stockUp/job/stockUpJobDetailBatch", + "style": { + "navigationBarTitleText": "备货任务详情", + "enablePullDownRefresh": true + } + }, { "path": "pages/scrap/record/scrapRecord", "style": { diff --git a/src/pages/repleinsh/coms/comScanReplishPackBatch.vue b/src/pages/repleinsh/coms/comScanReplishPackBatch.vue index 8587f364..7def153c 100644 --- a/src/pages/repleinsh/coms/comScanReplishPackBatch.vue +++ b/src/pages/repleinsh/coms/comScanReplishPackBatch.vue @@ -574,26 +574,11 @@ }, calcBatchHandleQty(balance) { - // let handleQty = 0; - // batch.Records.forEach(res => { - // handleQty = calc.add(handleQty, res.qty) - // }) - // batch.handleQty = handleQty; + this.dataContent.subList.forEach(item => { if(item.itemCode == balance.itemCode){ item.handleQty = balance.qty; } - // toLocationCode.Items.forEach(item => { - // var itemCodeHandleQty = 0; - // item.Locations.forEach(batch => { - // batch.Batchs.forEach(batchHandleQty => { - // itemCodeHandleQty = calc.add(itemCodeHandleQty, - // batchHandleQty.handleQty) - // }) - // }) - // item.handleQty = itemCodeHandleQty; - // }) - }) }, diff --git a/src/pages/repleinsh/job/repleinshDetailBatch.vue b/src/pages/repleinsh/job/repleinshDetailBatch.vue index e5c876f9..43428d8c 100644 --- a/src/pages/repleinsh/job/repleinshDetailBatch.vue +++ b/src/pages/repleinsh/job/repleinshDetailBatch.vue @@ -194,11 +194,7 @@ that.toLocationCode = that.subList[0].toLocationCode that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) - var itemCodes = [] - res.data.subList.forEach(item => { - itemCodes.push(item.itemCode) - item.scaned = false - }) + that.detailSource = res.data; if (that.scanMessage) { @@ -252,12 +248,12 @@ //防止重复点击 this.$throttle(this.submitJob, 2000, this)() } else { - // this.scanPopupGetFocus() + this.scanPopupGetFocus() } }); } else { //防止重复点击 - // this.$throttle(this.submitJob, 2000, this)() + this.$throttle(this.submitJob, 2000, this)() } }, @@ -307,28 +303,37 @@ // } }, - submitJob() { + async submitJob() { uni.showLoading({ title: "提交中....", mask: true }); - var params = this.setParams() - console.log("提交参数", params); - if (!params.subList || params.subList.length == 0) { - uni.hideLoading() - this.showErrorMessage("请扫描您需要提交的补料任务") - return - } - repleinshJobSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") + var itemCodes = [] + this.detailSource.subList.forEach(item => { + itemCodes.push(item.itemCode) + }) + await getManagementPrecisions(itemCodes, that.toLocationCode, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交参数", params); + if (!params.subList || params.subList.length == 0) { + uni.hideLoading() + this.showErrorMessage("请扫描您需要提交的补料任务") + return + } + repleinshJobSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) }) }, @@ -336,8 +341,6 @@ var commitSubList = [] var createTime = getCurrDateTime(); var creator = this.$store.state.user.id - - console.log(this.detailSource) this.detailSource.subList.forEach(r => { if(r.scaned){ let subItem = { @@ -370,6 +373,13 @@ .packingNumber; record.toPackUnit = r.packUnit; record.toBatch = r.batch; + var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch); + record.toPackingNumber = info.packingNumber; + record.packingNumber = info.packingNumber; + record.fromPackingNumber = info.packingNumber; + subItem.toPackingNumber = info.packingNumber; + subItem.packingNumber = info.packingNumber; + subItem.fromPackingNumber = info.packingNumber; subItem.recordList.push(record); commitSubList.push(deepCopyData(subItem)); } diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index 6b0d5da0..a1063cda 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -367,7 +367,6 @@ this.managementList = ret.list; this.managementType = this.managementList.some(cur => cur.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' - this.managementType ='BY_BATCH' if (this.managementType == 'BY_BATCH') { uni.navigateTo({ url: './repleinshDetailBatch?id=' + result.masterId + '&status=' + result.status + diff --git a/src/pages/stockUp/coms/comScanStockUpPackBatch.vue b/src/pages/stockUp/coms/comScanStockUpPackBatch.vue new file mode 100644 index 00000000..38b41f1e --- /dev/null +++ b/src/pages/stockUp/coms/comScanStockUpPackBatch.vue @@ -0,0 +1,508 @@ + + + + + \ No newline at end of file diff --git a/src/pages/stockUp/coms/comStockUpDetailCardBatch.vue b/src/pages/stockUp/coms/comStockUpDetailCardBatch.vue index cc579071..aba4983b 100644 --- a/src/pages/stockUp/coms/comStockUpDetailCardBatch.vue +++ b/src/pages/stockUp/coms/comStockUpDetailCardBatch.vue @@ -3,50 +3,22 @@ - - - - - - - - - - - - - - - - - - 实际 - - - - - - - - - - - - - - - - - + + + + + + + + + + - + @@ -56,17 +28,20 @@ import recommend from '@/mycomponents/recommend/recommend.vue' import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' import handleBalance from '@/mycomponents/balance/handleBalance.vue' + import handleBalanceBatch from '@/mycomponents/balance/handleBalanceBatch.vue' import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' + import qtyEdit from '@/mycomponents/qty/qtyEdit.vue' import location from '@/mycomponents/balance/location.vue' import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' - import { +import { getDetailOption, - getEditRemoveOption, - getRemoveOption + getPurchaseReceiptOption, + getRemoveOption, + getEditRemoveOption } from '@/common/array.js'; export default { @@ -78,9 +53,10 @@ handleBalance, recommendQtyEdit, requiredLocation, - balanceQtyEdit, + qtyEdit, location, - detailInfoPopup + detailInfoPopup, + handleBalanceBatch }, props: { dataContent: { @@ -91,6 +67,10 @@ type: Object, default: null }, + isEdit: { + type: Boolean, + default: true + }, }, watch: { @@ -109,9 +89,9 @@ }, mounted() { - this.detailOptions = getDetailOption(); - this.scanOptions = getEditRemoveOption(); - this.removeOptions = getRemoveOption() + + this.removeOptions = getRemoveOption(); + this.editAndRemoveOptions = getEditRemoveOption() }, methods: { @@ -126,38 +106,35 @@ }); }, - swipeClick(e, batch, record, index) { + swipeClick(e, item, index) { if (e.content.text == "编辑") { - this.edit(batch, record) + this.edit(item) } else if (e.content.text == "移除") { - this.remove(batch, record, index) + this.remove(item, index) } }, - edit(batch, item) { + edit(item) { let that = this; that.editItem = item; - that.batchItem = batch; - item.balance.balanceQty=item.balance.qty; - that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); + that.$refs.balanceQtyEdit.openEditPopup(item); }, detail(item) { this.showItem = item; this.$refs.receiptHint.openScanPopup() }, - remove(batch, record, index) { + remove(item, index) { this.$refs.message.showQuestionMessage("确定移除扫描信息?", res => { if (res) { - batch.Records.splice(index, 1); - this.resizeCollapse(); - this.$emit('updateData', record) + item.handleQty = 0; + item.scaned = false ; } }); }, confirm(val) { - this.editItem.qty = val; + this.editItem.handleQty = val; this.$emit('updateData', this.editItem) // let qty = 0; // this.batchItem.Records.forEach(r => { diff --git a/src/pages/stockUp/job/stockUpJob.vue b/src/pages/stockUp/job/stockUpJob.vue index 0c889b7f..58276213 100644 --- a/src/pages/stockUp/job/stockUpJob.vue +++ b/src/pages/stockUp/job/stockUpJob.vue @@ -42,7 +42,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' import comStockUpJobCard from '@/pages/stockUp/coms/comStockUpJobCard.vue' @@ -178,10 +180,23 @@ }, openJobDetail(item) { - uni.navigateTo({ - url: './stockUpJobDetail?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' : '' + this.managementType ='BY_BATCH' + if (this.managementType == 'BY_BATCH') { + uni.navigateTo({ + url: './stockUpJobDetailBatch?id=' + item.masterId + '&status=' + item.status+'&title='+this.title + }); + } else { + uni.navigateTo({ + url: './stockUpJobDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title + }); + } + } + }) }, showItemList(itemList) { diff --git a/src/pages/stockUp/job/stockUpJobDetailBatch.vue b/src/pages/stockUp/job/stockUpJobDetailBatch.vue new file mode 100644 index 00000000..84f6f6d2 --- /dev/null +++ b/src/pages/stockUp/job/stockUpJobDetailBatch.vue @@ -0,0 +1,458 @@ + + + + + \ No newline at end of file