Browse Source

修改原料上架查询采购订单明细

dev_pda
李俊城 2 years ago
parent
commit
e19e5b48e8
  1. 9
      fe/PDA/api/index.js
  2. 62
      fe/PDA/mycomponents/common/comList.vue
  3. 126
      fe/PDA/pages/putaway/purchasePutaway.vue

9
fe/PDA/api/index.js

@ -1190,6 +1190,15 @@ export const purchasePutaway = (params) => request(
method: "post"
});
//采购上架 ,通过采购订单号获取详细
export const getPurchasePutawayAsyncDetail = (poNumber) => promise(
devUrl + "/api/pda/store/purchase-receipt/get-packing-by-purchase-recepit-note?poNumber="+poNumber, { //
data: {},
method: "post"
});
//半成品上架
export const semiPutaway = (params) => request(
devUrl + "/api/pda/note/put-away/by-semi", { //

62
fe/PDA/mycomponents/common/comList.vue

@ -0,0 +1,62 @@
<template>
<view class="">
<uni-popup ref="popupItems" >
<scroll-view scroll-y="true" class="scroll" style="">
<view class="uni-flex uni-column">
<view class=" uni-center" style="margin: 15rpx;">
采购订单: {{poNumber}}
</view>
<view class="" style=" margin: 10rpx;background-color:#EBEEF0;width: 100%;"
v-for="(item, index) in showList" :key="index">
<view class="text-wrap">
({{index+1}})箱码 : {{item}}
</view>
</view>
</view>
</scroll-view>
</uni-popup>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
showList: [],
poNumber: ''
};
},
//
props: {},
filters: {},
methods: {
openPopup(data, poNumber) {
this.showList = data;
this.poNumber = poNumber
this.$refs.popupItems.open('center');
}
}
}
</script>
<style lang="scss">
.text-wrap {
word-wrap: break-word;
word-break: break-all;
white-space: pre-line;
}
.scroll {
border-radius: 20rpx;
background-color: #fff;
height: 80vh;
width:80vw;
}
</style>

126
fe/PDA/pages/putaway/purchasePutaway.vue

@ -11,10 +11,18 @@
</view>
</view>
</view>
<view class="" style="font-size: 35rpx;margin-top: 10rpx;">
采购订单 : {{poNumber}}
<view class="uni-flex space-between u-col-center"
style="font-size: 33rpx;align-items: center;margin-top: 5rpx;margin-bottom: 5rpx;">
<view class="">
<text>采购订单 : {{poNumber}}</text>
</view>
<view @click="showPopListPopup" class=""
style="font-size: 33rpx;background-color: #3399FF; padding:10rpx ;border-radius:10rpx;color: #FFFFFF;">
查看箱码
</view>
</view>
<view class="" style="background-color: black; width: 100%; margin-top:10rpx; height: 1rpx;">
<view class="" style="background-color: black; width: 100%; height: 1rpx;">
</view>
</view>
@ -54,6 +62,7 @@
<win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<comList ref="comList"> </comList>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
</com-message>
@ -66,6 +75,7 @@
getBalancesByFilterAsync,
getPurchaseDetailAsync,
purchasePutaway,
getPurchasePutawayAsyncDetail
} from '@/api/index.js';
import {
@ -80,6 +90,7 @@
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comList from '@/mycomponents/common/comList.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import comCollapseItem from '@/mycomponents/common/comCollapseItem.vue'
@ -93,7 +104,8 @@
winScanByPack,
comBalance,
winCollapseLocation,
comCollapseItem
comCollapseItem,
comList
},
data() {
return {
@ -103,7 +115,8 @@
recommendErpLocationCode: '',
currentLabel: null,
reScanItem: null, //
poNumber: ""
poNumber: "",
showPopList: []
};
},
props: {
@ -159,6 +172,7 @@
}
if (this.itemList == 0) {
this.poNumber = ""
this.showPopList = []
}
},
@ -166,49 +180,26 @@
let that = this;
that.currentLabel = result.data;
let code = result.data.packingCode;
let itemInfo = that.itemList.find(r => {
let itemInfo = this.itemList.find(r => {
return r.itemCode == result.data.itemCode
})
console.log("采购订单" + this.poNumber)
if (this.poNumber == "") {
this.poNumber = that.currentLabel.poNumber
} else {
if (this.poNumber != that.currentLabel.poNumber) {
this.showMessage("当前采购订单是号[" + this.poNumber + "]与扫描的箱码["+code+"]对应的采购订单号[" + that.currentLabel.poNumber + "]不一致")
return;
}
}
let params = JSON.stringify(that.currentLabel);
console.log('采购上架', params);
if (itemInfo == undefined) {
that.getBalance();
this.getBalance();
} else {
let data = itemInfo.labelList.find(r => {
return r.packingCode == code
})
if (data == undefined) {
that.getBalance();
this.getBalance();
} else {
this.reScanItem = itemInfo;
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?');
// showConfirmMsg('' + code + ',?', confirm => {
// if (confirm) {
// itemInfo.labelList.forEach((r, i) => {
// if (r.packingCode == code) {
// itemInfo.labelList.splice(i, 1);
// return;
// }
// });
// that.getBalance();
// } else {
// this.scanPopupGetFocus();
// }
// });
}
}
},
//
afterRescan(val) {
let that = this;
@ -265,14 +256,50 @@
let locationErpCode = purchaseDetail.recommendErpCode;
if (this.itemList.length == 0) {
this.recommendErpLocationCode = locationErpCode;
this.createItem(balanceItem, purchaseDetail);
this.checkData(balanceItem, purchaseDetail)
} else {
if (this.recommendErpLocationCode != locationErpCode) {
this.showScanMessage('当前零件的ERP储位是【' + locationErpCode + '】与【' + this
.recommendErpLocationCode +
'】不是同一ERP储位,请重新扫描');
} else {
this.createItem(balanceItem, purchaseDetail);
this.checkData(balanceItem, purchaseDetail)
}
}
},
checkData(balanceItem, purchaseDetail) {
var that = this;
var poNumber = purchaseDetail.poNumber;
var packingCode = purchaseDetail.packingCode
if (that.poNumber == "" && that.showPopList.length == 0) {
uni.showLoading({
title: "获取采购订单箱码...",
mask: true
});
getPurchasePutawayAsyncDetail(poNumber).then(res => {
uni.hideLoading()
if (res.length > 0) {
that.poNumber = poNumber
that.showPopList = res;
that.createItem(balanceItem, purchaseDetail);
}
}).catch(error => {
uni.hideLoading()
that.poNumber = "";
that.showPopList = [];
that.showMessage(err.message);
})
} else {
let item = that.showPopList.find(r => {
return r == packingCode
})
if (item == undefined) {
//
that.showMessage("扫描的箱码[" + packingCode + "]不在当前采购订单[" + this.poNumber + "]中");
return
} else {
that.createItem(balanceItem, purchaseDetail);
}
}
},
@ -445,6 +472,10 @@
this.location = null;
},
showPopListPopup() {
this.$refs.comList.openPopup(this.showPopList, this.poNumber);
},
submit() {
let that = this;
if (that.itemList.length === 0) {
@ -477,18 +508,17 @@
item.details.push(r);
})
})
console.log("采购订单" + this.poNumber)
let params = JSON.stringify(item);
// purchasePutaway(params)
// .then(res => {
// that.showCommitSuccess();
// that.clearInfo();
// uni.hideLoading();
// })
// .catch(err => {
// that.showMessage(err.message);
// uni.hideLoading();
// });
purchasePutaway(params)
.then(res => {
that.showCommitSuccess();
that.clearInfo();
uni.hideLoading();
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
cancel() {
@ -505,6 +535,8 @@
that.itemList = [];
that.location = null;
that.recommendErpLocationCode = '';
that.poNumber = "";
that.showPopList = [];
},
clearPackCode() {

Loading…
Cancel
Save