Browse Source

修改发料查询库存,上架修改库位

ljc_0803
lijuncheng 3 months ago
parent
commit
d8bb622a72
  1. 29
      src/api/request2.js
  2. 184
      src/mycomponents/query/balanceQuery.vue
  3. 8
      src/mycomponents/record/recordComDetailCard.vue
  4. 1
      src/pages/productPutaway/record/productPutawayRecord.vue
  5. 90
      src/pages/putaway/record/putawayRecord.vue

29
src/api/request2.js

@ -4492,4 +4492,31 @@ export function fgChangeCommit(params) {
method: "post",
data: params,
});
}
}
/**
* 查询物料与库位关系
*/
export function checkItemCodeAndLocation(params) {
return request({
url: baseApi + "/wms/location/checkRecommendLocation",
method: "post",
data: params,
});
}
/**
* 库存余额根据业务类型汇总接口
*/
export function getBalanceByBusinessType(params) {
return request({
url: baseApi + "/wms/balance/summaryByBusinessType",
method: "get",
data: params,
});
}

184
src/mycomponents/query/balanceQuery.vue

@ -60,7 +60,7 @@
</uni-tr>
</uni-table>
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view>
@ -68,7 +68,7 @@
</view>
<uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" />
</view>
</view> -->
</view>
@ -86,6 +86,7 @@
<script>
import {
getBasicItemByCodeSenior,
getBalanceByBusinessType
} from '@/api/request2.js';
import {
@ -102,80 +103,81 @@
itemCodeResult: [],
current: 1,
total: 18,
tableData: [{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 1
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 2
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
}
tableData:[]
// tableData: [{
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 1
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 2
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 3
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 4
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 3
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 4
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 3
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 4
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 3
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 4
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 3
// },
// {
// batch: "20240814",
// locationCode: "901",
// inventoryStatus: "OK",
// qty: 4
// }
]
// ]
}
},
props: {
@ -183,10 +185,10 @@
// type: Object,
// default: {}
// },
// isShowPack: {
// type: Boolean,
// default: true
// }
businessTypeCode: {
type: Boolean,
default: String
}
},
watch: {
@ -211,6 +213,7 @@
selectItemCode(item) {
this.itemCode = item.code
this.itemCodeResult = []
this.getBalanceByBusiness(this.itemCode,this.businessTypeCode)
},
clearItemCode() {
this.itemCode = ""
@ -227,11 +230,12 @@
})
getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code
this.getBalanceByBusiness(this.itemCode,this.businessTypeCode)
} else {
uni.hideLoading()
this.itemCodeResult = res.data.list
}
} else {
@ -243,6 +247,26 @@
this.showErrorMessage(error)
})
},
getBalanceByBusiness(itemCode,businessType){
var params ={
itemCode:itemCode,
businessType:businessType
}
getBalanceByBusinessType(params).then(res=>{
uni.hideLoading()
if(res.data&&res.data.length>0){
console.log(this.tableData)
this.tableData= res.data
}else {
this.showErrorMessage("发料中未查询到物料号["+itemCode+"]的库存")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
},
showDrawer() {
this.$refs.showRight.open();
},

8
src/mycomponents/record/recordComDetailCard.vue

@ -106,6 +106,12 @@
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
},
watch: {
@ -143,7 +149,7 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getEditLocationRemoveOption();
this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption();
},
methods: {

1
src/pages/productPutaway/record/productPutawayRecord.vue

@ -10,6 +10,7 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card>
</view>

90
src/pages/putaway/record/putawayRecord.vue

@ -5,10 +5,11 @@
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header_item">
来源库位 : {{fromLocationCode}}
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
</view>
<u-line />
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
@ -16,7 +17,10 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
:isShowModifedLocation="true"
@updateData="updateData"
@editLocation="showScanToLocation"
@removePack="removePack">
</record-com-detail-card>
</view>
@ -43,14 +47,17 @@
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-location ref="scanToLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
</view>
</template>
<script>
import {
putawayRecordSubmit,
validateItemAndLocation,
getPutawayRecommendLocation
getPutawayRecommendLocation,
checkItemCodeAndLocation,
recommendLocationRemoveExpectin
} from '@/api/request2.js';
import {
@ -116,7 +123,8 @@
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway"
businessTypeCode: "PurchasePutaway",
editItem:{}
};
},
onLoad(option) {
@ -168,6 +176,7 @@
//
this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack);
itemp.toLocationCode = toLocation.locationCode;
let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode;
@ -445,6 +454,7 @@
this.openScanPopup();
},
getToLocationCode(location, code) {
console.log( JSON.stringify(this.editItem) )
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
@ -452,7 +462,59 @@
})
return
}
this.toLocationCode = code;
var item = this.editItem.subList[0]
if(item){
var param ={
batch:item.batch,
inventoryStatus:item.inventoryStatus,
itemCode:item.itemCode,
toLocationCode:item.toLocationCode,
expectinNumber: item.packingNumber + "-" + Date.now(),
}
checkItemCodeAndLocation(param).then(res=>{
if(res.data.recommendFlag){
this.editItem.toLocationCode = code;
}else {
if(res.data.errorMsg){
this.showErrorMessage(res.data.errorMsg)
}else {
if(res.data.balanceMsg){
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => {
if (res) {
}else {
this.removeRecommendLocation(res.data.recommendList)
}
});
}else {
this.editItem.toLocationCode = code;
}
}
}
}).catch(error=>{
this.showErrorMessage(error)
})
}
},
//
removeRecommendLocation(lst) {
let param = {
expectinNumberList: lst,
};
recommendLocationRemoveExpectin(param).then(res => {
}).catch(err => {
this.showErrorMessage('【' + lst.join(',') + '】移除预占用失败,请在PC端的预占用中移除')
})
},
showScanToLocation(item) {
this.editItem = item;
setTimeout(r => {
this.$refs.scanToLocationCode.openScanPopup();
})
},
showCommitSuccessMessage(hint) {
@ -460,6 +522,17 @@
this.clear();
})
},
showQuestionMessage(hint) {
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => {
if (res) {
}else {
}
});
},
clear() {
this.fromLocationInfo = {};
@ -467,6 +540,7 @@
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = [];
this.editItem ={}
}
}
}

Loading…
Cancel
Save