diff --git a/api/request2.js b/api/request2.js index e3119611..7b0568a3 100644 --- a/api/request2.js +++ b/api/request2.js @@ -1886,8 +1886,8 @@ export function deliverRequestSubmit(params) { */ export function deliverRecordSubmit(params) { return request({ - url: baseApi + "/wms/purchasereturn-request-main/submit", - method: "put", + url: baseApi + "/wms/deliver-record-main/create", + method: "post", data: params, }); } diff --git a/mycomponents/record/recordComDetailCard.vue b/mycomponents/record/recordComDetailCard.vue index 797dae48..f369ba2b 100644 --- a/mycomponents/record/recordComDetailCard.vue +++ b/mycomponents/record/recordComDetailCard.vue @@ -43,7 +43,7 @@ import { getDetailOption, - getDetailRemoveOption, + getDetailEditRemoveOption, getClearOption } from '@/common/array.js'; export default { @@ -113,7 +113,7 @@ mounted() { this.detailOptions = getDetailOption(); - this.scanOptions = getDetailRemoveOption(); + this.scanOptions = getDetailEditRemoveOption(); this.removeOptions = getClearOption(); }, diff --git a/pages/customerReturn/record/returnRecord.vue b/pages/customerReturn/record/returnRecord.vue index bd33a5d0..02ed207b 100644 --- a/pages/customerReturn/record/returnRecord.vue +++ b/pages/customerReturn/record/returnRecord.vue @@ -8,9 +8,8 @@ - + @@ -21,7 +20,7 @@ - @@ -32,7 +31,8 @@ - + + @@ -49,7 +49,7 @@ getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'; - + import { getPrecisionStrategyList } from '@/common/balance.js'; @@ -58,7 +58,7 @@ updateTitle, getPackingNumberAndBatchByList } from '@/common/basic.js'; - + import { getBusinessType, createItemInfo, @@ -75,8 +75,8 @@ import comMessage from '@/mycomponents/common/comMessage.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' - - + + export default { components: { winScanButton, @@ -105,12 +105,12 @@ toLocationCode: "", fromlocationTypeList: [], tolocationTypeList: [], - managementList: [], - toWarehouseCode:'' + managementList: [], + toWarehouseCode: '', }; }, onLoad(option) { - var typeCode ="CustomerreturnRecord" + var typeCode = "CustomerreturnRecord" getBusinessType(typeCode, res => { if (res.success) { this.businessType = res.businessType; @@ -118,22 +118,10 @@ this.tolocationTypeList = res.tolocationTypeList; this.showFromLocationPopup(); } else { - this.showErrorMessage(res.message ) + this.showErrorMessage(res.message) } }); - getBasicCustomerList().then(res => { - if (res.data.length > 0) { - var list = res.data; - list.forEach(item => { - item.text = item.Name - item.value = item.Code - }) - this.customerList = list; - } - }).catch(error => { - this.showErrorMessage(error) - }) }, //返回首页 onNavigationBarButtonTap(e) { @@ -147,7 +135,7 @@ onPullDownRefresh() {}, mounted() { - + }, methods: { getScanResult(result) { @@ -185,7 +173,7 @@ this.calcHandleQty(); }, - + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { @@ -248,27 +236,27 @@ }) }, - - commit() { - - if (this.toLocationCode == "") { - this.showMessage("请先选择目标库位") - return; - } - if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { - //查询管理模式 - uni.showLoading({ - title: "提交中....", - mask: true - }); - this.managementList = []; - var precisionStrategParams = this.setPrecisionStrategParams() - - getPrecisionStrategyList(precisionStrategParams, res => { - if (res.success) { - this.managementList = res.list; - var params = this.setParams() - console.log("提交" + JSON.stringify(params)) + + commit() { + + if (this.toLocationCode == "") { + this.showMessage("请先选择目标库位") + return; + } + if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { + //查询管理模式 + uni.showLoading({ + title: "提交中....", + mask: true + }); + this.managementList = []; + var precisionStrategParams = this.setPrecisionStrategParams() + + getPrecisionStrategyList(precisionStrategParams, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交" + JSON.stringify(params)) customerReturnRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -280,88 +268,88 @@ uni.hideLoading() this.showErrorMessage(error) }) - - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - - }) - - } else { - this.showErrorMessage("没有要提交的数据,请先扫描") - } - - - }, - - setPrecisionStrategParams() { - 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 && - detail.toLocationCode == res.locationCode) { - return res - } - }) - //去掉重复元素 - if (filterResult.length == 0) { - var result = { - itemCode: item.itemCode, - locationCode: detail.toLocationCode + + } else { + uni.hideLoading(); + this.showErrorMessage(res.message); + } + + }) + + } else { + this.showErrorMessage("没有要提交的数据,请先扫描") + } + + + }, + + setPrecisionStrategParams() { + 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 && + detail.toLocationCode == res.locationCode) { + return res + } + }) + //去掉重复元素 + if (filterResult.length == 0) { + var result = { + itemCode: item.itemCode, + locationCode: detail.toLocationCode + } + itemList.push(result) } - itemList.push(result) + } - - } + }) }) - }) - return itemList; - }, - - setParams() { - - 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); - detail.itemCode = detail.itemCode; - detail.itemName = detail.package.itemName; - detail.itemDesc1 = detail.package.itemDesc1; - detail.itemDesc2 = detail.package.itemDesc2; - - detail.inventoryStatus = detail.inventoryStatus; - detail.toInventoryStatus = detail.inventoryStatus; - - detail.fromPackingNumber = info.packingNumber; - detail.toPackingNumber = info.packingNumber; - - detail.fromContainerNumber = detail.containerNumber; - detail.toContainerNumber = detail.containerNumber - - detail.fromBatch = info.batch; - detail.toBatch = info.batch; - - detail.fromLocationCode = detail.locationCode; - detail.toLocationCode = detail.toLocationCode; - - subList.push(detail) - } + return itemList; + }, + + setParams() { + + 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); + detail.itemCode = detail.itemCode; + detail.itemName = detail.package.itemName; + detail.itemDesc1 = detail.package.itemDesc1; + detail.itemDesc2 = detail.package.itemDesc2; + + detail.inventoryStatus = detail.inventoryStatus; + detail.toInventoryStatus = detail.inventoryStatus; + + detail.fromPackingNumber = info.packingNumber; + detail.toPackingNumber = info.packingNumber; + + detail.fromContainerNumber = detail.containerNumber; + detail.toContainerNumber = detail.containerNumber + + detail.fromBatch = info.batch; + detail.toBatch = info.batch; + + detail.fromLocationCode = detail.locationCode; + detail.toLocationCode = detail.toLocationCode; + + subList.push(detail) + } + }) }) - }) - this.dataContent.subList = subList; - this.dataContent.creator = creator; - this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode; - this.dataContent.toWarehouseCode = this.toWarehouseCode; - return this.dataContent; - }, - + this.dataContent.subList = subList; + this.dataContent.creator = creator; + this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode; + this.dataContent.toWarehouseCode = this.toWarehouseCode; + return this.dataContent; + }, + showMessage(message) { this.$refs.comMessage.showMessage(message, res => { diff --git a/pages/deliver/record/deliverRecord.vue b/pages/deliver/record/deliverRecord.vue index 7dbe4113..9a9af942 100644 --- a/pages/deliver/record/deliverRecord.vue +++ b/pages/deliver/record/deliverRecord.vue @@ -1,7 +1,7 @@