Browse Source

修改上架记录

wms3.0_pda
niexiting 11 months ago
parent
commit
d5d2ceb4af
  1. 26
      api/request2.js
  2. 26
      common/balance.js
  3. 7
      mycomponents/balance/balance.vue
  4. 8
      mycomponents/record/recordComDetailCard.vue
  5. 131
      pages/putaway/record/putawayRecord.vue

26
api/request2.js

@ -319,6 +319,24 @@ export function validateItemAndLocation(parmas) {
}
/**
* 查询上架推荐库位
* @param {*}
* supplierCode
* itemCode
* batch
* inventoryStatus
*/
export function getPutawayRecommendLocation(params) {
return request({
url: baseApi + "/wms/location/recommendLocation",
method: "post",
data: params,
});
}
/**
* 查询物品信息接口
@ -3064,7 +3082,7 @@ export function getPrecisionStrategy(param) {
*/
export function deleteFileById(id) {
return request({
url: baseApi + "/infra/file/delete?id=" + id ,
url: baseApi + "/infra/file/delete?id=" + id,
method: "delete",
data: {},
});
@ -3089,11 +3107,11 @@ export function getFileList(tableName, tableId) {
* @param {*}
*
*/
export function uploadFile(tableName, tableId,filePath,callBack) {
export function uploadFile(tableName, tableId, filePath, callBack) {
var token = storage.getStorage(storage.constant.token)
var url = getApp().globalData.request_url+baseApi
var url = getApp().globalData.request_url + baseApi
uni.uploadFile({
url: url+"/infra/file/upload?tableName="+tableName + "&tableId=" + tableId,
url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId,
filePath: filePath,
name: 'file',
header: {

26
common/balance.js

@ -10,8 +10,30 @@ import {
* @param {*}
*
*/
export function getPrecisionStrategyParams(dataSource) {
export function getPrecisionStrategyParams(detailSource) {
var itemList = []
detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode) {
return res
}
})
//去掉重复元素
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}
/**
*
@ -19,7 +41,7 @@ export function getPrecisionStrategyParams(dataSource) {
* @param {*}
*
*/
export function getPrecisionStrategyParamsByLocation(detailSource,toLocationCode) {
export function getPrecisionStrategyParamsByLocation(detailSource, toLocationCode) {
var itemList = []
detailSource.forEach(item => {
item.subList.forEach(detail => {

7
mycomponents/balance/balance.vue

@ -4,7 +4,8 @@
<view>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location>
<location title="来源库位" v-if="isShowLocation" :locationCode="dataContent.locationCode"></location>
<location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode"></location>
</view>
<view>
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent"
@ -72,6 +73,10 @@
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
},
watch: {

8
mycomponents/record/recordComDetailCard.vue

@ -16,9 +16,7 @@
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
:right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="isShowLocation"></balance>
<!-- <purchase-label :dataContent="detail" :packageContent="detail.package" :isShowStdPack="false"
:isShowPack="true" :isShowLocation="true"></purchase-label> -->
:isShowPack="true" :isShowLocation="isShowLocation" :isShowToLocation="true"></balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -40,6 +38,7 @@
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import location from '@/mycomponents/balance/location.vue'
import {
getDetailOption,
@ -54,7 +53,8 @@
balanceQtyEdit,
balanceDetailPopup,
purchaseLabel,
comMessage
comMessage,
location
// winListHint
},
props: {

131
pages/putaway/record/putawayRecord.vue

@ -21,8 +21,8 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation>
<!-- <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation> -->
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -42,14 +42,15 @@
import {
putawayRequestSubmit,
putawayRecordSubmit,
validateItemAndLocation
validateItemAndLocation,
getPutawayRecommendLocation
} from '@/api/request2.js';
import {
goHome,
updateTitle,
getCurrDateTime,
getPackingNumberAndBatch
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
@ -66,7 +67,7 @@
import {
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParamsByLocation
getPrecisionStrategyParams
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -102,7 +103,8 @@
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
showToLoaction: true
showToLoaction: true,
recommendLocationList: [] //
};
},
onLoad(option) {
@ -130,6 +132,7 @@
onPullDownRefresh() {},
mounted() {},
methods: {
getScanResult(result) {
let balance = result.balance;
@ -141,10 +144,15 @@
}
})
if (item == undefined) {
//
this.getRecommendLocation(balance, pack, toLocationCode => {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocationCode;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
})
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
@ -164,7 +172,33 @@
}
}
this.calcHandleQty();
},
//
getRecommendLocation(balance, pack, callback) {
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
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
this.recommendLocationList.push({
itemCode: balance.itemCode,
locationCode: res.data.code
})
callback(res.data.code);
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
callback(recommend.locationCode);
}
},
showErrorMessage(message) {
@ -215,8 +249,8 @@
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
@ -232,11 +266,6 @@
},
commit() {
if (this.showToLoaction && this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
//
// uni.showLoading({
@ -245,56 +274,30 @@
// });
//
//1:
// var itemCodes = []
// let conditions = [];
// this.detailSource.forEach(item => {
// debugger;
// let condition = {
// itemCode: item.itemCode,
// batch: item.batch,
// inventoryStatus: item.inInventoryStatus,
// locationCode: this.toLocationCode
// };
// conditions.push(condition)
// })
let itemAndLocationRelations = this.getItemAndLocationRelations();
validateItemAndLocation(itemAndLocationRelations, res => {
debugger;
});
let precisionStrategyParams = getPrecisionStrategyParamsByLocation(this.detailSource, this.toLocationCode);
return;
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource);
//2:
// getManagementPrecisions(itemCodes, this.toLocationCode, res => {
// if (res.success) {
// this.managementList = res.list;
// var params = this.setRecordParams(true)
// console.log("", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
getPrecisionStrategyList(precisionStrategyParams, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setRecordParams(true)
console.log("提交参数", JSON.stringify(params));
putawayRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, )
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
@ -336,13 +339,13 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode
detail.package = null;
subList.push(detail)
}

Loading…
Cancel
Save