lijuncheng 9 months ago
parent
commit
79c919a76d
  1. 26
      api/request2.js
  2. 26
      common/balance.js
  3. 9
      mycomponents/balance/balance.vue
  4. 2
      mycomponents/recommend/recommend.vue
  5. 8
      mycomponents/record/recordComDetailCard.vue
  6. 2
      pages/inventoryMove/coms/comMovebalance.vue
  7. 139
      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) { export function deleteFileById(id) {
return request({ return request({
url: baseApi + "/infra/file/delete?id=" + id , url: baseApi + "/infra/file/delete?id=" + id,
method: "delete", method: "delete",
data: {}, data: {},
}); });
@ -3089,11 +3107,11 @@ export function getFileList(tableName, tableId) {
* @param {*} * @param {*}
* *
*/ */
export function uploadFile(tableName, tableId,filePath,callBack) { export function uploadFile(tableName, tableId, filePath, callBack) {
var token = storage.getStorage(storage.constant.token) var token = storage.getStorage(storage.constant.token)
var url = getApp().globalData.request_url+baseApi var url = getApp().globalData.request_url + baseApi
uni.uploadFile({ uni.uploadFile({
url: url+"/infra/file/upload?tableName="+tableName + "&tableId=" + tableId, url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId,
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {

26
common/balance.js

@ -10,8 +10,30 @@ import {
* @param {*} * @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 {*} * @param {*}
* *
*/ */
export function getPrecisionStrategyParamsByLocation(detailSource,toLocationCode) { export function getPrecisionStrategyParamsByLocation(detailSource, toLocationCode) {
var itemList = [] var itemList = []
detailSource.forEach(item => { detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {

9
mycomponents/balance/balance.vue

@ -1,10 +1,11 @@
<template> <template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="uni-flex uni-row space-between"> <view class="uni-flex uni-row space-between" style="align-items: center">
<view> <view>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack> <pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch> <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>
<view> <view>
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" <!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent"
@ -72,6 +73,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowToLocation: {
type: Boolean,
default: false
},
}, },
watch: { watch: {

2
mycomponents/recommend/recommend.vue

@ -1,6 +1,6 @@
<template> <template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="uni-flex uni-row space-between "> <view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉--> <!-- uni-inline-item 暂时拿掉-->
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>

8
mycomponents/record/recordComDetailCard.vue

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

2
pages/inventoryMove/coms/comMovebalance.vue

@ -1,7 +1,7 @@
<template> <template>
<view :class="dataContent.scaned?'scan_view':''"> <view :class="dataContent.scaned?'scan_view':''">
<view class="uni-flex uni-column "> <view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between uni-inline-item"> <view class="uni-flex uni-row space-between " style="align-items: center">
<view> <view>
<pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber"> <pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber">
</pack> </pack>

139
pages/putaway/record/putawayRecord.vue

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

Loading…
Cancel
Save