Browse Source

修改第三方库移除

pda_nev
李俊城 12 months ago
parent
commit
07d42f801a
  1. 47
      fe/PDA/api/index.js
  2. 4
      fe/PDA/pages.json
  3. 1
      fe/PDA/pages/request/thirdLocationRequest.vue
  4. 181
      fe/PDA/pages/return/productionReturnFg.vue

47
fe/PDA/api/index.js

@ -97,6 +97,44 @@ export function changePassword(params) { //
method: "post" method: "post"
}) })
} }
//kitting 推荐 isPackingCode=true 按箱,false 按数量
export const getRecommendBalance = (itemCode,productLine,isPackingCode) => request(
devUrl + "/api/pda/inventory/balances/get-recommend-balance?itemCode="+itemCode+"&productLine="+productLine+"&isPackingCode="+isPackingCode,{ //
data: {},
method: "post"
})
//获取库存 去除预计入和预计出
// {
// "itemCode": "string",
// "locationCode": "string",
// "lot": "string",
// "packingCode": "string",
// "containerCode": "string",
// "inventoryStatuses": [
// 0
// ],
// "locationTypes": [
// 0
// ],
// "pageSize": 0,
// "pageIndex": 0,
// "sortBy": "string"
// }
export const getBalanceRemoveInAndOutAsync = (params) => promise(
devUrl + "/api/pda/inventory/balances/by-balances-request-many-parameter-not-in-expect-out",{ //
data: params,
method: "post"
})
//通过零件号和库位查询库存,去除预计出
export const getRecommendBalanceByLocationAsync = (params,itemCode,isPackingCode) => promise(
devUrl + "/api/pda/inventory/balances/get-recommend-balance-by-locations?itemCode="+itemCode+"&isPackingCode="+isPackingCode,{ //
data: params,
method: "post"
})
//通用 //通用
//查询库存明细 //查询库存明细
export const balances = (params) => request( export const balances = (params) => request(
@ -1939,11 +1977,8 @@ export const getCountByItemCode = (itemCode) => request(
method: "get" method: "get"
}) })
//kitting 推荐 isPackingCode=true 按箱,false 按数量
export const getRecommendBalance = (itemCode,productLine,isPackingCode) => request(
devUrl + "/api/pda/inventory/balances/get-recommend-balance?itemCode="+itemCode+"&productLine="+productLine+"&isPackingCode="+isPackingCode,{ //
data: {},
method: "post"
})

4
fe/PDA/pages.json

@ -178,14 +178,14 @@
{ {
"path": "pages/return/productionReturnRaw", "path": "pages/return/productionReturnRaw",
"style": { "style": {
"navigationBarTitleText": "原料退库", "navigationBarTitleText": "生产退库(原料)",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/return/productionReturnFg", "path": "pages/return/productionReturnFg",
"style": { "style": {
"navigationBarTitleText": "半成品退库", "navigationBarTitleText": "生产退库(半成品)",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },

1
fe/PDA/pages/request/thirdLocationRequest.vue

@ -247,6 +247,7 @@
remove(item, index) { remove(item, index) {
showConfirmMsg("是否移除当前" + item.itemCode, res => { showConfirmMsg("是否移除当前" + item.itemCode, res => {
if (res) { if (res) {
this.showList.splice(index,1)
this.allDataList.splice(index, 1); this.allDataList.splice(index, 1);
this.allCount = this.allDataList.length; this.allCount = this.allDataList.length;
this.updateTitle() this.updateTitle()

181
fe/PDA/pages/return/productionReturnFg.vue

@ -73,7 +73,7 @@
<win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button>
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code> <win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code>
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code> <win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code>
<win-scan-by-pack ref="scanPackPopup" @getScanResult='getScanResult'></win-scan-by-pack> <winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> <com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' <com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'> @afterCloseCommitMessage='closeCommitMessage'>
@ -84,7 +84,7 @@
<script> <script>
import { import {
locations, locations,
getBalancesByFilterAsync, getRecommendBalanceByLocationAsync,
getWipListAsync, getWipListAsync,
returnToWarehouse, returnToWarehouse,
} from '@/api/index.js'; } from '@/api/index.js';
@ -105,6 +105,7 @@
import comBalance from '@/mycomponents/common/comBalance.vue' import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
export default { export default {
name: 'returnToWarehouse', name: 'returnToWarehouse',
@ -118,7 +119,8 @@
comScanSemiPutaway, comScanSemiPutaway,
comBalance, comBalance,
winCollapseLocation, winCollapseLocation,
SemiCollapseItem SemiCollapseItem,
winScanByProductCode
}, },
data() { data() {
return { return {
@ -137,7 +139,7 @@
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
}else if(e.index === 1){ } else if (e.index === 1) {
window.location.reload(); window.location.reload();
} }
}, },
@ -158,7 +160,7 @@
}); });
locations(code).then(res => { locations(code).then(res => {
if (res != null) { if (res != null) {
if (res.type == 3||res.type == 4||res.type == 5) { if (res.type == 3 || res.type == 4 || res.type == 5) {
that.fromLocation = res; that.fromLocation = res;
this.openPackLabel(); this.openPackLabel();
this.closeScanFromLocationPopup(); this.closeScanFromLocationPopup();
@ -214,105 +216,48 @@
}, },
getScanResult(result) { getScanResult(result) {
let that = this; let item = this.itemList.find(r => {
that.currentLabel = result.data; return r.itemCode == result.itemCode
let code = result.data.code; });
if (code) {
let datas = [];
//
this.itemList.filter(r => {
if (r.toPackingCode == code) {
datas.push(r);
return;
}
})
if (datas.length > 0) {
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?');
// showConfirmMsg('' + code + ',?', confirm => {
// if (confirm) {
// that.itemList.forEach((r, i) => {
// if (r.toPackingCode == code) {
// that.itemList.splice(i, 1);
// return;
// }
// });
// that.getLabel();
// }
// });
} else {
that.getLabel();
}
if (item) {
this.showMessage("物料[" + result.itemCode + "]已经扫描")
} else { } else {
this.showMessage('请先扫描箱标签'); this.getLabel(result.itemCode);
return;
} }
},
//
afterRescan(val) {
let that = this;
if (confirm) {
that.itemList.forEach((r, i) => {
if (r.toPackingCode == that.currentLabel.packingCode) {
that.itemList.splice(i, 1);
return;
}
});
that.getLabel();
} else {
this.scanPopupGetFocus();
}
}, },
async getLabel() { async getLabel(itemCode) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '扫描中...', title: '扫描中...',
mask: true mask: true
}) })
let balanceParams = { let balanceParams = [this.fromLocation.code]
pageSize: 100,
pageIndex: 1, let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams,itemCode,false);
packingCode: that.currentLabel.packingCode, if (balanceRes.length == 0) {
}; this.showScanMessage('零件【' + itemCode + '】在【' + this.fromLocation.code +
'】库位没有库存信息,不可以退库');
let balanceRes = await getBalancesByFilterAsync(balanceParams);
if (balanceRes.totalCount > 0) {
let locationCode = balanceRes.items[0].locationCode;
this.showScanMessage('箱码【' + that.currentLabel.packingCode + '】在【' + locationCode +
'】库位已经有库存信息,请重新扫描箱码');
} else { } else {
let itemInfo = that.itemList.find(r => { let balanceItem = balanceRes[0];
return r.itemCode == that.currentLabel.itemCode let item = {
}) itemCode: itemCode,
if (itemInfo == undefined) { itemName:balanceItem.itemName,
let params = { totalQty: balanceItem.qty,
locationCode: that.fromLocation.code, uom: balanceItem.uom,
itemCode: that.currentLabel.itemCode locationCode:this.fromLocation.code,
}; scanQty: 0,
qty:balanceItem.qty,
let wipRes = await getWipListAsync(params); status: balanceItem.status,
if (wipRes.totalCount == 0) { balanceItem: balanceItem,
this.showScanMessage('零件【' + that.currentLabel.itemCode + '】在【' + this.fromLocation.code + labelList: []
'】库位没有库存信息,不可以退库'); };
} else { this.addLabel(item);
let balanceItem = wipRes.items[0];
let item = {
itemCode: that.currentLabel.itemCode,
totalQty: balanceItem.qty,
uom: balanceItem.uom,
scanQty: 0,
status: balanceItem.status,
balanceItem: balanceItem,
labelList: []
};
this.addLabel(item);
}
} else {
this.addLabel(itemInfo);
}
} }
uni.hideLoading(); uni.hideLoading();
}, },
@ -320,40 +265,30 @@
addLabel(item) { addLabel(item) {
// //
if (item.labelList.length == 0) { if (item.labelList.length == 0) {
if (this.currentLabel.qty > item.totalQty) {
this.showScanMessage('标签数量【' + this.currentLabel.qty +
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库')
} else {
let data = this.itemList.find(r => r.itemCode == item.itemCode) let data = this.itemList.find(r => r.itemCode == item.itemCode)
if (data == undefined) { if (data == undefined) {
this.itemList.push(item) this.itemList.push(item)
} }
this.calcScanQty(item, 0) this.calcScanQty(item, 0)
item.labelList.unshift(this.currentLabel); item.labelList.unshift(item);
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}
} else { } else {
let scanQty = 0; let scanQty = 0;
item.labelList.forEach(r => { item.labelList.forEach(r => {
scanQty += Number(r.qty) scanQty += Number(r.qty)
}) })
if (scanQty + this.currentLabel.qty > item.totalQty) { this.calcScanQty(item, scanQty)
this.showScanMessage('已扫描数量【' + scanQty + '】加标签数量【' + this.currentLabel.qty + item.labelList.unshift(item);
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') this.scanPopupGetFocus();
} else {
this.calcScanQty(item, scanQty)
item.labelList.unshift(this.currentLabel);
this.scanPopupGetFocus();
}
} }
}, },
calcScanQty(item, scanQty) { calcScanQty(item, scanQty) {
item.scanQty = scanQty + this.currentLabel.qty; item.scanQty = scanQty + item.qty;
// //
this.currentLabel.locationCode = this.fromLocation.code; // this.item.locationCode = this.fromLocation.code;
this.currentLabel.status = 2; // this.item.status = 2;
}, },
scanToLocation(item) { scanToLocation(item) {
@ -373,7 +308,7 @@
if (res == null) { if (res == null) {
that.showMessage('目标库位【' + locationCode + '】不存在'); that.showMessage('目标库位【' + locationCode + '】不存在');
} else { } else {
if (res.type == 2 || res.type == 3||res.type == 4 ||res.type == 6) { if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) {
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】', showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】',
confirm => { confirm => {
@ -420,7 +355,7 @@
that.showMessage('目标库位【' + code + '】不存在'); that.showMessage('目标库位【' + code + '】不存在');
} else { } else {
if (res.type == 2 || res.type == 3||res.type == 4||res.type == 6) { if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) {
this.handledToLocation(this.currentItem, res); this.handledToLocation(this.currentItem, res);
} else { } else {
this.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') this.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】')
@ -475,6 +410,7 @@
let item = this.getSubmitParam(); let item = this.getSubmitParam();
let params = JSON.stringify(item); let params = JSON.stringify(item);
console.log("提交",params)
returnToWarehouse(params) returnToWarehouse(params)
.then(res => { .then(res => {
that.showCommitSuccess(); that.showCommitSuccess();
@ -492,11 +428,11 @@
let that = this; let that = this;
let item = { let item = {
number: "", number: "",
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
putawayType: 2, putawayType: 2,
details: [] details: []
} }
that.itemList.forEach(i => { that.itemList.forEach(i => {
let balanceItem = i.balanceItem; let balanceItem = i.balanceItem;
i.labelList.forEach(l => { i.labelList.forEach(l => {
@ -510,9 +446,9 @@
detail.stdPackQty = balanceItem.stdPackQty; detail.stdPackQty = balanceItem.stdPackQty;
detail.fromPackingCode = balanceItem.packingCode; detail.fromPackingCode = balanceItem.packingCode;
detail.toPackingCode = l.packingCode; detail.toPackingCode = "";
detail.fromLot = balanceItem.lot; detail.fromLot = balanceItem.lot;
detail.toLot = l.lot; detail.toLot = "";
detail.fromLocationCode = that.fromLocation.code; detail.fromLocationCode = that.fromLocation.code;
detail.fromLocationErpCode = that.fromLocation.erpLocationCode; detail.fromLocationErpCode = that.fromLocation.erpLocationCode;
@ -545,27 +481,28 @@
detail.recommendExpireDate = l.expireDate; detail.recommendExpireDate = l.expireDate;
detail.recommendLot = balanceItem.lot;; detail.recommendLot = balanceItem.lot;;
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code;
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation
.areaCode;
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation
.locationGroupCode; .locationGroupCode;
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation
.erpLocationCode; .erpLocationCode;
detail.recommendToWarehouseCode = localStorage.warehouseCode; detail.recommendToWarehouseCode = localStorage.warehouseCode;
detail.recommendQty = balanceItem.qty; detail.recommendQty = balanceItem.qty;
detail.handledContainerCode = l.containerCode; detail.handledContainerCode = l.containerCode;
detail.handledPackingCode = l.packingCode; detail.handledPackingCode = l.packingCode;
detail.handledSupplierBatch = l.supplierBatch; detail.handledSupplierBatch = l.supplierBatch;
detail.handledArriveDate = l.arriveDate; detail.handledArriveDate = l.arriveDate;
detail.handledProduceDate = l.produceDate; detail.handledProduceDate = l.produceDate;
detail.handledExpireDate = l.expireDate; detail.handledExpireDate = l.expireDate;
detail.handledLot = l.lot; detail.handledLot = l.lot;
detail.handledToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; detail.handledToLocationCode = l.toLocationCode ?? that.defaultToLocation.code;
detail.handledToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; detail.handledToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode;
detail.handledToLocationGroup = l.toLocationGroup ?? that.defaultToLocation detail.handledToLocationGroup = l.toLocationGroup ?? that.defaultToLocation
.locationGroupCode; .locationGroupCode;
detail.handledToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation detail.handledToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation
.erpLocationCode; .erpLocationCode;
detail.handledToWarehouseCode = localStorage.warehouseCode; detail.handledToWarehouseCode = localStorage.warehouseCode;
detail.handledQty = l.qty; detail.handledQty = l.qty;
@ -645,4 +582,4 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
Loading…
Cancel
Save