diff --git a/src/api/request2.js b/src/api/request2.js index ac332ad9..02c07550 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -506,6 +506,24 @@ export function getProductionlineItem(params) { }); } +/** + * 通过物料查询包装规格 + * @param {*} itemCode + * + */ +export function getPackUnitByItemCode(itemCode) { + var params = { + itemCode: itemCode, + pageNo: 1, + pageSize: 100 + } + return request({ + url: baseApi + "/wms/itempackage/page", + method: "get", + data: params, + }); +} + /** * 查询生产线-车间-工位 * @param {*} @@ -3517,19 +3535,17 @@ export function mergePackageRecordSubmit(params) { } /** - * 翻包 提交 + * 翻包直接生成记录 提交 * @param {*} params */ export function overPackageRecordSubmit(params) { return request({ - url: baseApi + "/wms/packageover-main/create", + url: baseApi + "/wms/packageover-record-main/create", method: "post", data: params, }); } - - /** * "itemCodes": [], "locationCode":"INSPECT" @@ -3689,7 +3705,7 @@ export function getPackageUnitList(params) { */ export function takeOverPageJob(id) { return request({ - url: baseApi + "/wms/issue-job-main/accept?id=" + id, + url: baseApi + "/wms/packageover-job-main/accept?id=" + id, method: "put", data: {}, }); @@ -3702,7 +3718,7 @@ export function takeOverPageJob(id) { */ export function cancleTakeOverPageJob(id) { return request({ - url: baseApi + "/wms/issue-job-main/abandon?id=" + id, + url: baseApi + "/wms/packageover-job-main/abandon?id=" + id, method: "put", data: {}, }); @@ -3718,7 +3734,7 @@ export function cancleTakeOverPageJob(id) { */ export function getOverPageJobList(params) { return request({ - url: baseApi + "/wms/issue-job-main/senior", + url: baseApi + "/wms/packageover-job-main/senior", method: "post", data: params, }); @@ -3731,7 +3747,7 @@ export function getOverPageJobList(params) { */ export function getOverPageJobDetail(id) { return request({ - url: baseApi + "/wms/issue-job-main/getIssueJobById?id=" + id, + url: baseApi + "/wms/packageover-job-main/getPackageoverJobById?id=" + id, method: "get", data: {}, }); @@ -3743,7 +3759,7 @@ export function getOverPageJobDetail(id) { */ export function overPageSubmit(params) { return request({ - url: baseApi + "/wms/issue-job-main/execute", + url: baseApi + "/wms/packageover-job-main/execute", method: "put", data: params, }); diff --git a/src/mycomponents/qty/compareQty.vue b/src/mycomponents/qty/compareQty.vue index c623f594..2f844585 100644 --- a/src/mycomponents/qty/compareQty.vue +++ b/src/mycomponents/qty/compareQty.vue @@ -67,7 +67,7 @@ dataContent: { type: Object, - default: {} + default: null }, recommendQty: { type: Number, diff --git a/src/pages.json b/src/pages.json index 81e36cbd..90c8c015 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1080,6 +1080,75 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/productReceipt/job/completeReceiveJob", + "style": { + "navigationBarTitleText": "完工收货任务", + "enablePullDownRefresh": true, + "titleNView": { + // "autoBackButton": "true", + "buttons": [ + // 右边按钮 + { + "float": "right", + "fontSize": "58rpx", //按钮上文字的大小 + "text": "\ue696", + "fontSrc": "/static/ali_icon/iconfont.ttf" + + }, + { + + "float": "right", + "fontSize": "52rpx", //按钮上文字的大小 + "text": "\ue6e2", + "fontSrc": "/static/ali_icon/iconfont.ttf" + } + ] + } + } + }, + { + "path": "pages/productReceipt/job/completeReceiveJobDetail", + "style": { + "navigationBarTitleText": "完工收货任务详情", + "enablePullDownRefresh": true + } + }, + + { + "path": "pages/pick/job/pickJob", + "style": { + "navigationBarTitleText": "直接备货任务", + "enablePullDownRefresh": true, + "titleNView": { + // "autoBackButton": "true", + "buttons": [ + // 右边按钮 + { + "float": "right", + "fontSize": "58rpx", //按钮上文字的大小 + "text": "\ue696", + "fontSrc": "/static/ali_icon/iconfont.ttf" + + }, + { + + "float": "right", + "fontSize": "52rpx", //按钮上文字的大小 + "text": "\ue6e2", + "fontSrc": "/static/ali_icon/iconfont.ttf" + } + ] + } + } + }, + { + "path": "pages/pick/job/pickJobDetail", + "style": { + "navigationBarTitleText": "直接备货任务详情", + "enablePullDownRefresh": true + } + }, { "path": "pages/scrap/record/scrapRecord", "style": { diff --git a/src/pages/package/coms/comOverPackJobCard.vue b/src/pages/package/coms/comOverPackJobCard.vue index 9226463b..41c577a8 100644 --- a/src/pages/package/coms/comOverPackJobCard.vue +++ b/src/pages/package/coms/comOverPackJobCard.vue @@ -4,9 +4,6 @@ 申请单号 {{dataContent.requestNumber}} - - 车间 {{dataContent.workShopCode}} - diff --git a/src/pages/package/coms/comOverPackJobDetailCard.vue b/src/pages/package/coms/comOverPackJobDetailCard.vue index ff0ba129..7cd7c1f1 100644 --- a/src/pages/package/coms/comOverPackJobDetailCard.vue +++ b/src/pages/package/coms/comOverPackJobDetailCard.vue @@ -69,7 +69,6 @@ import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import location from '@/mycomponents/balance/location.vue' import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' - import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue' import { getDetailOption, getEditRemoveOption, @@ -88,7 +87,6 @@ balanceQtyEdit, location, detailInfoPopup, - comIssueRequestInfo }, props: { dataContent: { diff --git a/src/pages/package/coms/comScanPackagePack.vue b/src/pages/package/coms/comScanPackagePack.vue new file mode 100644 index 00000000..1e1997d2 --- /dev/null +++ b/src/pages/package/coms/comScanPackagePack.vue @@ -0,0 +1,540 @@ + + + + + diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index a98e8dce..daf9aa03 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -11,10 +11,21 @@ - - + + + 原始包装规格 : {{subList[0].fromPackUnit}} + + + 原始标包数量 : {{subList[0].fromPackQty}} + + + 新包装规格 : {{subList[0].toPackUnit}} + + + 新标包数量 : {{subList[0].toPackQty}} + + + @@ -33,8 +44,8 @@ - - + + @@ -59,7 +70,7 @@ import { getDataSource - } from '@/pages/issue/js/issue.js'; + } from '@/pages/package/js/package.js'; import { getManagementPrecisions @@ -72,7 +83,7 @@ import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import comOverPackJobDetailCard from '@/pages/package/coms/comOverPackJobDetailCard.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue' - import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' + import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue' import jobTop from '@/mycomponents/job/jobTop.vue' import workStation from '@/mycomponents/workStation/workStation.vue' @@ -82,7 +93,7 @@ jobDetailPopup, winScanButton, comOverPackJobDetailCard, - comScanIssuePack, + comScanPackagePack, jobTop, workStation }, @@ -243,10 +254,6 @@ // }, submit() { - uni.showLoading({ - title: "提交中....", - mask: true - }); //目前任务只到一个库位 var itemCodes = [] @@ -259,13 +266,13 @@ //使用在途库,不查询管理模式 if (this.jobContent.useOnTheWayLocation == 'TRUE') { - this.submitJob(); + this.checkSubmit(); } else { //获取管理模式,封装参数 getManagementPrecisions(itemCodes, locationCode, res => { if (res.success) { this.managementList = res.list; - this.submitJob(); + this.checkSubmit(); } else { uni.hideLoading(); this.showErrorMessage(res.message); @@ -273,11 +280,42 @@ }); } }, + checkSubmit(){ + var tempHandleQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].handleQty + var tempQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].qty + var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty + if(tempHandleQty>tempQty){ + //大于需求数量 + this.showCommitMessage("实际数量【"+tempHandleQty+"】大于需求数量"+"【"+tempQty+"】, 是否提交?",tempHandleQty,toPackQty) + }else if (tempHandleQty0){ + var count= Math.ceil(tempHandleQty / toPackQty); + //发翻两包 + this.$refs.comMessage.showQuestionMessage("新标包数量是【"+toPackQty+"】,扫描数量【"+tempHandleQty+"】,将不能翻成【"+count+"】个整包,是否提交?", res => { + if (res) { + this.submitJob() + } + }); + + }else{ + this.submitJob() + } + }, submitJob() { + uni.showLoading({ + title: "提交中....", + mask: true + }); var params = this.setParams() console.log("提交参数", JSON.stringify(params)); - overPageSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -317,7 +355,7 @@ .ContainerNumber; record.toInventoryStatus = r .inventoryStatus; - record.toLocationCode = subItem + record.fromLocationCode = subItem .toLocationCode; record.supplierCode = r.supplierCode; @@ -328,25 +366,32 @@ record.singlePrice = single_price; record.amount = single_price * r.qty; + record.fromPackUnit = subItem.fromPackUnit; + record.toPackUnit = subItem.toPackUnit; + record.fromPackQty = subItem.fromPackQty; + record.toPackQty = subItem.toPackQty; + + record.toBatch = r.batch; + record.toPackingNumber = "" //使用在途库不改变管理模式 - if (this.jobContent - .useOnTheWayLocation == - 'TRUE') { - record.toPackingNumber = r - .packingNumber; - record.toBatch = r.batch; - } else { - var info = - getPackingNumberAndBatch( - this.managementList, r - .itemCode, - r.packingNumber, r - .batch); - record.toPackingNumber = info - .packingNumber; - record.toBatch = info.batch; - } + // if (this.jobContent + // .useOnTheWayLocation == + // 'TRUE') { + // record.toPackingNumber = r + // .packingNumber; + // record.toBatch = r.batch; + // } else { + // var info = + // getPackingNumberAndBatch( + // this.managementList, r + // .itemCode, + // r.packingNumber, r + // .batch); + // record.toPackingNumber = info + // .packingNumber; + // record.toBatch = info.batch; + // } subItem.recordList.push(record); }) subList.push(subItem); @@ -436,6 +481,13 @@ } }); }, + showCommitMessage(message,tempHandleQty,toPackQty) { + this.$refs.comMessage.showQuestionMessage(message, res => { + if (res) { + this.packageHint(tempHandleQty,toPackQty) + } + }); + }, showScanMessage(message) { this.$refs.comMessage.showScanMessage(message); @@ -459,10 +511,6 @@ this.scanPopupGetFocus(); }, - showScanMessage(message) { - this.$refs.comMessage.showScanMessage(message); - }, - closeScanMessage() { this.scanPopupGetFocus(); }, @@ -477,7 +525,7 @@ var datacontent = {} //克隆对象,深度克隆,防止双向绑定同一个变量 // Object.assign(datacontent, this.detailSource); - this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent); + this.$refs.comScanPackagePack.openScanPopup(this.detailSource, this.jobContent); }, closeScanPopup() { this.updateCommitBtn(); diff --git a/src/pages/package/js/package.js b/src/pages/package/js/package.js new file mode 100644 index 00000000..f7766c48 --- /dev/null +++ b/src/pages/package/js/package.js @@ -0,0 +1,114 @@ + import { + calc + } from '@/common/calc.js'; +export function getDataSource(list, subList) { + for (var i = 0; i < subList.length; i++) { + let detail = subList[i]; + var location = list.find(r => + r.toLocationCode == detail.toLocationCode) + if (location == undefined) { + location = { + toLocationCode: detail.toLocationCode, + productionLineCode: detail.productionLineCode, + workStationCode: detail.workStationCode, + Items: [] + } + list.push(location); + } + createDetailInfo(location, detail); + } + return list; +} + +//树形结构:需求库位 -> 物料Items -> 库位 Locations-> 批次Batchs -> 记录Records +export function createDetailInfo(location, detail) { + var item = location.Items.find(r => + r.itemCode == detail.itemCode) + if (item == undefined) { + item = createItemInfo(detail); + location.Items.push(item) + } else { + item.qty = calc.add(item.qty,detail.qty) + //在物料下查找库位 + let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode); + if (location == undefined) { + location = createLocationInfo(detail); + item.Locations.push(location); + } else { + //在库位下查找批次 + let batch = location.Batchs.find(r => r.batch == detail.batch); + if (batch == undefined) { + let batch = createBatchInfo(detail); + location.Batchs.push(batch); + } else { + if (detail.packingNumber != "" && detail.packingNumber != null) { + batch.Recommends.push(detail); + } + } + } + } +} + +export function createItemInfo(detail) { + let item = { + itemCode: detail.itemCode, + itemName: detail.itemName, + productionLineCode: detail.productionLineCode, + workStationCode: detail.workStationCode, + stdPackQty: detail.stdPackQty, + packUnit: detail.packUnit, + qty: detail.qty, + uom: detail.uom, + handleQty: 0, + Locations: [] + } + let location = createLocationInfo(detail); + item.Locations.push(location); + return item; +} + +export function createLocationInfo(detail) { + let location = { + fromLocationCode: detail.fromLocationCode, + qty: detail.qty, + uom: detail.uom, + handleQty: 0, + Batchs: [] + } + let batch = createBatchInfo(detail); + location.Batchs.push(batch); + return location; +} + +export function createBatchInfo(detail) { + let batch = { + detail: detail, + batch: detail.batch, + packingNumber: detail.packingNumber, + qty: detail.qty, + uom: detail.uom, + handleQty: 0, + fromPackUnit:detail.fromPackUnit, + toPackUnit:detail.toPackUnit, + fromPackQty:detail.fromPackQty, + toPackQty:detail.toPackQty, + Recommends: [], + Records: [], + } + + //推荐到了箱码和批次 + if (detail.packingNumber != "" && detail.packingNumber != null) { + batch.Recommends.push(detail); + } + return batch; +} + +export function createRecordInfo(detail) { + var record = {} + detail.scaned = true; + // let record = JSON.parse(JSON.stringify(detail)); + //克隆对象,深度克隆,防止双向绑定同一个变量 + Object.assign(record, detail) + record.toLocationCode = this.toLocationCode; + return record; +} diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 475ed2ee..33e54e40 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -9,8 +9,16 @@ - + + 来源库位 : {{item.subList[0].locationCode}} + + 来源包装规格 : {{getPackUnitName(packUnit)}} + + + + @@ -22,6 +30,16 @@ + + 目标包装规格 : + + + {{toPackUnit}} + + + + @@ -38,11 +56,12 @@ :locationTypeList="fromlocationTypeList"> - + + + diff --git a/src/pages/pick/job/pickJobDetail.vue b/src/pages/pick/job/pickJobDetail.vue new file mode 100644 index 00000000..6759a483 --- /dev/null +++ b/src/pages/pick/job/pickJobDetail.vue @@ -0,0 +1,418 @@ + + + + + diff --git a/src/pages/productReceipt/job/completeReceiveJob.vue b/src/pages/productReceipt/job/completeReceiveJob.vue new file mode 100644 index 00000000..02409e35 --- /dev/null +++ b/src/pages/productReceipt/job/completeReceiveJob.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/src/pages/productReceipt/job/completeReceiveJobDetail.vue b/src/pages/productReceipt/job/completeReceiveJobDetail.vue new file mode 100644 index 00000000..02409e35 --- /dev/null +++ b/src/pages/productReceipt/job/completeReceiveJobDetail.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/src/pages/setter/index.vue b/src/pages/setter/index.vue index 9b616cfc..e5304ea6 100644 --- a/src/pages/setter/index.vue +++ b/src/pages/setter/index.vue @@ -88,6 +88,17 @@ plus.runtime.quit() // #endif + }).catch(error=>{ + clearStorage(); + // #ifdef H5 + uni.reLaunch({ + url: '../login/index' + }) + // #endif + + // #ifdef APP + plus.runtime.quit() + // #endif }) }; diff --git a/src/static/config.js b/src/static/config.js index 3f42814d..e9b53adc 100644 --- a/src/static/config.js +++ b/src/static/config.js @@ -1,5 +1,5 @@ -let request_url = "http://dev.ccwin-in.com:25300/api/admin-api" -// let request_url = "http://192.168.0.211:12080/admin-api" +// let request_url = "http://dev.ccwin-in.com:25300/api/admin-api" +let request_url = "http://192.168.0.128:12080/admin-api" let isDevelopment = true