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. 129
      fe/PDA/pages/return/productionReturnFg.vue

47
fe/PDA/api/index.js

@ -97,6 +97,44 @@ export function changePassword(params) { //
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(
@ -1939,11 +1977,8 @@ export const getCountByItemCode = (itemCode) => request(
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",
"style": {
"navigationBarTitleText": "原料退库",
"navigationBarTitleText": "生产退库(原料)",
"enablePullDownRefresh": true
}
},
{
"path": "pages/return/productionReturnFg",
"style": {
"navigationBarTitleText": "半成品退库",
"navigationBarTitleText": "生产退库(半成品)",
"enablePullDownRefresh": true
}
},

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

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

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

@ -73,7 +73,7 @@
<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="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-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
@ -84,7 +84,7 @@
<script>
import {
locations,
getBalancesByFilterAsync,
getRecommendBalanceByLocationAsync,
getWipListAsync,
returnToWarehouse,
} from '@/api/index.js';
@ -105,6 +105,7 @@
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
export default {
name: 'returnToWarehouse',
@ -118,7 +119,8 @@
comScanSemiPutaway,
comBalance,
winCollapseLocation,
SemiCollapseItem
SemiCollapseItem,
winScanByProductCode
},
data() {
return {
@ -214,105 +216,48 @@
},
getScanResult(result) {
let that = this;
that.currentLabel = result.data;
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();
}
let item = this.itemList.find(r => {
return r.itemCode == result.itemCode
});
if (item) {
this.showMessage("物料[" + result.itemCode + "]已经扫描")
} else {
this.showMessage('请先扫描箱标签');
return;
this.getLabel(result.itemCode);
}
},
//
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;
uni.showLoading({
title: '扫描中...',
mask: true
})
let balanceParams = {
pageSize: 100,
pageIndex: 1,
packingCode: that.currentLabel.packingCode,
};
let balanceRes = await getBalancesByFilterAsync(balanceParams);
if (balanceRes.totalCount > 0) {
let locationCode = balanceRes.items[0].locationCode;
this.showScanMessage('箱码【' + that.currentLabel.packingCode + '】在【' + locationCode +
'】库位已经有库存信息,请重新扫描箱码');
} else {
let itemInfo = that.itemList.find(r => {
return r.itemCode == that.currentLabel.itemCode
})
if (itemInfo == undefined) {
let params = {
locationCode: that.fromLocation.code,
itemCode: that.currentLabel.itemCode
};
let balanceParams = [this.fromLocation.code]
let wipRes = await getWipListAsync(params);
if (wipRes.totalCount == 0) {
this.showScanMessage('零件【' + that.currentLabel.itemCode + '】在【' + this.fromLocation.code +
let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams,itemCode,false);
if (balanceRes.length == 0) {
this.showScanMessage('零件【' + itemCode + '】在【' + this.fromLocation.code +
'】库位没有库存信息,不可以退库');
} else {
let balanceItem = wipRes.items[0];
let balanceItem = balanceRes[0];
let item = {
itemCode: that.currentLabel.itemCode,
itemCode: itemCode,
itemName:balanceItem.itemName,
totalQty: balanceItem.qty,
uom: balanceItem.uom,
locationCode:this.fromLocation.code,
scanQty: 0,
qty:balanceItem.qty,
status: balanceItem.status,
balanceItem: balanceItem,
labelList: []
};
this.addLabel(item);
}
} else {
this.addLabel(itemInfo);
}
}
uni.hideLoading();
},
@ -320,40 +265,30 @@
addLabel(item) {
//
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)
if (data == undefined) {
this.itemList.push(item)
}
this.calcScanQty(item, 0)
item.labelList.unshift(this.currentLabel);
item.labelList.unshift(item);
this.scanPopupGetFocus();
}
} else {
let scanQty = 0;
item.labelList.forEach(r => {
scanQty += Number(r.qty)
})
if (scanQty + this.currentLabel.qty > item.totalQty) {
this.showScanMessage('已扫描数量【' + scanQty + '】加标签数量【' + this.currentLabel.qty +
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库')
} else {
this.calcScanQty(item, scanQty)
item.labelList.unshift(this.currentLabel);
item.labelList.unshift(item);
this.scanPopupGetFocus();
}
}
},
calcScanQty(item, scanQty) {
item.scanQty = scanQty + this.currentLabel.qty;
item.scanQty = scanQty + item.qty;
//
this.currentLabel.locationCode = this.fromLocation.code;
this.currentLabel.status = 2;
// this.item.locationCode = this.fromLocation.code;
// this.item.status = 2;
},
scanToLocation(item) {
@ -475,6 +410,7 @@
let item = this.getSubmitParam();
let params = JSON.stringify(item);
console.log("提交",params)
returnToWarehouse(params)
.then(res => {
that.showCommitSuccess();
@ -510,9 +446,9 @@
detail.stdPackQty = balanceItem.stdPackQty;
detail.fromPackingCode = balanceItem.packingCode;
detail.toPackingCode = l.packingCode;
detail.toPackingCode = "";
detail.fromLot = balanceItem.lot;
detail.toLot = l.lot;
detail.toLot = "";
detail.fromLocationCode = that.fromLocation.code;
detail.fromLocationErpCode = that.fromLocation.erpLocationCode;
@ -545,7 +481,8 @@
detail.recommendExpireDate = l.expireDate;
detail.recommendLot = balanceItem.lot;;
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
.locationGroupCode;
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation

Loading…
Cancel
Save