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

master
guoshuang 10 months ago
parent a1e75ddf4c
commit 742c89b7db

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

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

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

Loading…
Cancel
Save