白胚入库&采购收货字段调整

master
guoshuang 10 months ago
parent a1e75ddf4c
commit 742c89b7db

@ -264,7 +264,7 @@ export default class receivePO extends BasePage {
if (model.getidcardcode == '200') {
let alreadyList = model.byidcardobj;
alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
let id = alreadyList.userDefined1.split('-')[4];
let id = alreadyList.userDefined4;
this.list.forEach((item) => {
if (item.id == id) {
item.realityNumber += alreadyList.planNumber;
@ -278,9 +278,9 @@ export default class receivePO extends BasePage {
}
confirmNumber(changeobj) {
let addNumber = 0;
let id = changeobj.userDefined1.split('-')[4];
let id = changeobj.userDefined4;
this.receivedlist.forEach((item) => {
if (item.userDefined1.split('-')[4] === id) {
if (item.userDefined4 === id) {
addNumber += parseFloat(item.planNumber ? item.planNumber : '0');
}
});
@ -484,7 +484,7 @@ export default class receivePO extends BasePage {
}
delet(deletobj: any, index: number) {
this.receivedlist.splice(index, 1);
let id = deletobj.userDefined1.split('-')[4];
let id = deletobj.userDefined4;
this.list.forEach((item) => {
if (item.id == id) {
item.realityNumber -= deletobj.planNumber;

@ -352,7 +352,7 @@ export default class receiveSRM extends BasePage {
if (model.getidcardcode == '200') {
let alreadyList = model.byidcardobj;
alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
let id = alreadyList.userDefined1.split('-')[4];
let id = alreadyList.userDefined4;
this.list.forEach((item) => {
if (item.id == id) {
item.realityNumber += alreadyList.planNumber;
@ -456,9 +456,9 @@ export default class receiveSRM extends BasePage {
confirmNumber(changeobj) {
let addNumber = 0;
let id = changeobj.userDefined1.split('-')[4];
let id = changeobj.userDefined4;
this.receivedlist.forEach((item) => {
if (item.userDefined1.split('-')[4] === id) {
if (item.userDefined4 === id) {
addNumber += parseFloat(item.planNumber ? item.planNumber : '0');
}
});
@ -472,7 +472,7 @@ export default class receiveSRM extends BasePage {
}
delet(deletobj: any, index: number) {
this.receivedlist.splice(index, 1);
let id = deletobj.userDefined1.split('-')[4];
let id = deletobj.userDefined4;
this.list.forEach((item) => {
if (item.id == id) {
item.realityNumber -= deletobj.planNumber;

@ -12,7 +12,7 @@
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>工单号:</view>
<view>工单号:</view>
<u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
@ -82,15 +82,15 @@
<view class="rowleft">
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 批次: </view>
<view style="word-break: break-word">{{ item.batchCode }} </view>
<view class="list-item"> 物料: </view>
<view style="word-break: break-word">{{ item.productCode }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 数量: </view>
<view>{{ item.batchQuantity }} </view>
</view>
</view>
<view class="row-list">
<!-- <view class="row-list">
<view class="row-list-item">
<view class="list-item"> 库位码: </view>
<view>{{ item.wlCode }} </view>
@ -99,7 +99,7 @@
<view class="list-item"> 托盘码: </view>
<view>{{ item.sn }} </view>
</view>
</view>
</view> -->
</view>
<view class="rowright">
<view class="righttitle">
@ -123,16 +123,16 @@
</u-row>
</view>
<view>
<u-popup v-model="show" mode="center" width="550rpx" height="450rpx">
<u-popup v-model="show" mode="center" width="550rpx" height="300rpx">
<view class="form5">
<view class="poupitem">
<!-- <view class="poupitem">
<view class="pouptitle">托盘码</view>
<u-input class="poupcontent" :clearable="false" v-model="form5.sn" placeholder="" style="overflow: hidden" />
</view>
<view class="poupitem">
<view class="pouptitle">库位码</view>
<u-input class="poupcontent" :clearable="false" v-model="form5.wlCode" placeholder="" style="overflow: hidden" />
</view>
</view> -->
<view class="poupitem">
<view class="pouptitle">数量</view>
<u-input class="poupcontent" :clearable="false" v-model="form5.batchQuantity" placeholder="" style="overflow: hidden" />
@ -222,9 +222,10 @@ export default class WhiteInstorage extends BasePage {
async confirm() {
//this.itemdetail.orderNo = this.orderNo;
console.log(this.delindex, 'this.delindex');
if (this.itemdetail.batchCode === this.cimWl.value) {
this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity);
}
this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity);
// if (this.itemdetail.batchCode === this.cimWl.value) {
// this.actplanQuantity += parseFloat(this.itemdetail.batchQuantity);
// }
this.list.splice(this.delindex, 1);
// await this.model.deleteTray(this.itemdetail);
// if (this.model.SubmitCode == '200') {
@ -267,6 +268,7 @@ export default class WhiteInstorage extends BasePage {
await this.model.queryOrderNo(this.orderNo);
if (model.orderNoItemList) {
this.orderNoItemList = model.orderNoItemList;
this.actplanQuantity = this.orderNoItemList.attr1;
// this.number1 = this.orderNoItemList.attr3;
} else {
this.orderNoItemList = {};
@ -274,8 +276,8 @@ export default class WhiteInstorage extends BasePage {
if (model.Picilist) {
this.Picilist = model.Picilist;
this.cimWl = this.Picilist[0];
this.planQuantity = this.Picilist[0].batchQuantity - parseFloat(this.Picilist[0].realityNumber);
this.actplanQuantity = this.planQuantity;
//this.planQuantity = this.Picilist[0].batchQuantity - parseFloat(this.Picilist[0].realityNumber);
//this.actplanQuantity = this.Picilist[0].attr1;
// this.number1 = this.orderNoItemList.attr3;
} else {
@ -300,52 +302,52 @@ export default class WhiteInstorage extends BasePage {
});
return;
}
let shijinumber = 0;
this.Picilist.forEach((item) => {
shijinumber = shijinumber + parseFloat(item.batchQuantity);
});
// let shijinumber = 0;
// this.Picilist.forEach((item) => {
// shijinumber = shijinumber + parseFloat(item.batchQuantity);
// });
if (this.actplanQuantity < 0) {
(this.$refs.uToast as any).show({
title: '实际入库数量不能超过计划数量',
// url: '/pages/user/index'
});
return;
}
let insertTarynumber = 0;
this.list.forEach((item) => {
insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity);
});
//console.log(insertTarynumber, model.orderNoItemList.putQuantity, insertTarynumber == model.orderNoItemList.putQuantity);
if (insertTarynumber <= shijinumber) {
let params = {
siteCode: session.FactoryCode,
orderCode: this.orderNoItemList.orderCode,
materialCode: this.orderNoItemList.productCode,
materialDesc: this.orderNoItemList.productName,
unit: this.orderNoItemList.unit,
planNumber: insertTarynumber,
userDefined1: this.cimWl.value,
createBy: session.loginName,
wmsWhiteBilletInforList: this.list,
};
console.log('参数', params);
await this.model.handPut(params);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.show = false;
this.list = [];
this.query();
//this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.show = false;
//this.getlist();
}
let params = {
siteCode: session.FactoryCode,
orderCode: this.orderNo,
materialCode: this.orderNoItemList.productCode,
materialDesc: this.orderNoItemList.productName,
unit: this.orderNoItemList.unit,
planNumber: insertTarynumber,
userDefined1: this.cimWl.value,
createBy: session.loginName,
wmsWhiteBilletInforList: this.list,
};
console.log('参数', params);
await this.model.handPut(params);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.show = false;
this.list = [];
this.query();
//this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '实际入库总数量不能超过入库数量,请正确入库',
// url: '/pages/user/index'
title: '失败',
type: 'error',
});
this.show = false;
//this.getlist();
}
}
async getlist() {
@ -367,10 +369,10 @@ export default class WhiteInstorage extends BasePage {
return;
}
if (this.list.length > 0) {
let insertTarynumber = 0;
this.list.forEach((item) => {
insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity);
});
// let insertTarynumber = 0;
// this.list.forEach((item) => {
// insertTarynumber = insertTarynumber + parseFloat(item.batchQuantity);
// });
//let ordernumber = this.number1 || 0;
if (this.actplanQuantity <= 0) {
(this.$refs.uToast as any).show({
@ -387,26 +389,27 @@ export default class WhiteInstorage extends BasePage {
//
async onOk() {
console.log(this.form5);
if (this.form5.sn == '' || this.form5.wlCode == '' || this.form5.batchQuantity == '') {
(this.$refs.uToast as any).show({
title: '不能为空',
// url: '/pages/user/index'
});
return;
}
// if (this.form5.sn == '' || this.form5.wlCode == '' || this.form5.batchQuantity == '') {
// (this.$refs.uToast as any).show({
// title: '',
// // url: '/pages/user/index'
// });
// return;
// }
if (this.list.length) {
let sum = this.list.reduce((total, item) => {
if (item.batchCode === this.cimWl.value) {
return total + parseFloat(item.batchQuantity);
} else {
return total;
}
}, 0);
// let sum = this.list.reduce((total, item) => {
// if (item.batchCode === this.cimWl.value) {
// return total + parseFloat(item.batchQuantity);
// } else {
// return total;
// }
// }, 0);
let sum = this.list.reduce((acc, item) => acc + parseFloat(item.batchQuantity), 0);
console.log('sum', sum);
console.log('this.planQuantity', this.planQuantity);
//console.log('this.planQuantity', this.planQuantity);
console.log('this.form5.batchQuantity', this.form5.batchQuantity);
if (sum >= this.planQuantity || sum + parseFloat(this.form5.batchQuantity) > this.planQuantity) {
if (sum >= this.actplanQuantity || sum + parseFloat(this.form5.batchQuantity) > this.actplanQuantity) {
(this.$refs.uToast as any).show({
title: '实际入库数量不能超过该批次数量',
});
@ -416,9 +419,7 @@ export default class WhiteInstorage extends BasePage {
}
this.list.push({
batchQuantity: this.form5.batchQuantity,
wlCode: this.form5.wlCode,
sn: this.form5.sn,
batchCode: this.cimWl.value,
productCode: this.orderNoItemList.productCode,
});
this.show = false;
this.actplanQuantity = this.actplanQuantity - this.form5.batchQuantity;

Loading…
Cancel
Save