Browse Source

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

ljc_0803
lijuncheng 3 months ago
parent
commit
d8bb622a72
  1. 27
      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. 86
      src/pages/putaway/record/putawayRecord.vue

27
src/api/request2.js

@ -4493,3 +4493,30 @@ export function fgChangeCommit(params) {
data: params, 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-tr>
</uni-table> </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="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }} <view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view> </view>
@ -68,7 +68,7 @@
</view> </view>
<uni-pagination :current="current" :total="total" :show-icon="true" <uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" /> @change="change" />
</view> </view> -->
</view> </view>
@ -86,6 +86,7 @@
<script> <script>
import { import {
getBasicItemByCodeSenior, getBasicItemByCodeSenior,
getBalanceByBusinessType
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -102,80 +103,81 @@
itemCodeResult: [], itemCodeResult: [],
current: 1, current: 1,
total: 18, total: 18,
tableData: [{ tableData:[]
batch: "20240814", // tableData: [{
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 1 // inventoryStatus: "OK",
}, // qty: 1
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 2 // inventoryStatus: "OK",
}, // qty: 2
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 3 // inventoryStatus: "OK",
}, // qty: 3
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 4 // inventoryStatus: "OK",
}, // qty: 4
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 3 // inventoryStatus: "OK",
}, // qty: 3
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 4 // inventoryStatus: "OK",
}, // qty: 4
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 3 // inventoryStatus: "OK",
}, // qty: 3
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 4 // inventoryStatus: "OK",
}, // qty: 4
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 3 // inventoryStatus: "OK",
}, // qty: 3
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 4 // inventoryStatus: "OK",
}, // qty: 4
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 3 // inventoryStatus: "OK",
}, // qty: 3
{ // },
batch: "20240814", // {
locationCode: "901", // batch: "20240814",
inventoryStatus: "OK", // locationCode: "901",
qty: 4 // inventoryStatus: "OK",
} // qty: 4
// }
] // ]
} }
}, },
props: { props: {
@ -183,10 +185,10 @@
// type: Object, // type: Object,
// default: {} // default: {}
// }, // },
// isShowPack: { businessTypeCode: {
// type: Boolean, type: Boolean,
// default: true default: String
// } }
}, },
watch: { watch: {
@ -211,6 +213,7 @@
selectItemCode(item) { selectItemCode(item) {
this.itemCode = item.code this.itemCode = item.code
this.itemCodeResult = [] this.itemCodeResult = []
this.getBalanceByBusiness(this.itemCode,this.businessTypeCode)
}, },
clearItemCode() { clearItemCode() {
this.itemCode = "" this.itemCode = ""
@ -227,11 +230,12 @@
}) })
getBasicItemByCodeSenior(this.itemCode).then(res => { getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) { if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) { if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code this.itemCode = res.data.list[0].code
this.getBalanceByBusiness(this.itemCode,this.businessTypeCode)
} else { } else {
uni.hideLoading()
this.itemCodeResult = res.data.list this.itemCodeResult = res.data.list
} }
} else { } else {
@ -243,6 +247,26 @@
this.showErrorMessage(error) 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() { showDrawer() {
this.$refs.showRight.open(); this.$refs.showRight.open();
}, },

8
src/mycomponents/record/recordComDetailCard.vue

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

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

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

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

@ -5,10 +5,11 @@
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header"> <view class="page-header">
<view class="header-view">
<view class="header_item"> <view class="header_item">
来源库位 : {{fromLocationCode}} 来源库位 : {{fromLocationCode}}
</view> </view>
<u-line /> </view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -16,7 +17,10 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack"> :isShowModifedLocation="true"
@updateData="updateData"
@editLocation="showScanToLocation"
@removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -43,14 +47,17 @@
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-location ref="scanToLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
</view> </view>
</template> </template>
<script> <script>
import { import {
putawayRecordSubmit, putawayRecordSubmit,
validateItemAndLocation, getPutawayRecommendLocation,
getPutawayRecommendLocation checkItemCodeAndLocation,
recommendLocationRemoveExpectin
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -116,7 +123,8 @@
showToLoaction: true, showToLoaction: true,
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway" businessTypeCode: "PurchasePutaway",
editItem:{}
}; };
}, },
onLoad(option) { onLoad(option) {
@ -168,6 +176,7 @@
// //
this.getRecommendLocation(balance, pack, toLocation => { this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
itemp.toLocationCode = toLocation.locationCode;
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocation.locationCode; newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode; newDetail.toWarehouseCode = toLocation.toWarehouseCode;
@ -445,6 +454,7 @@
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
console.log( JSON.stringify(this.editItem) )
if (this.fromLocationCode == code) { if (this.fromLocationCode == code) {
uni.showToast({ uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
@ -452,7 +462,59 @@
}) })
return 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) { showCommitSuccessMessage(hint) {
@ -461,12 +523,24 @@
}) })
}, },
showQuestionMessage(hint) {
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => {
if (res) {
}else {
}
});
},
clear() { clear() {
this.fromLocationInfo = {}; this.fromLocationInfo = {};
this.fromLocationCode = ''; this.fromLocationCode = '';
this.fromWarehouseCode = ''; this.fromWarehouseCode = '';
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.editItem ={}
} }
} }
} }

Loading…
Cancel
Save