|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
// 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,20 +302,26 @@ 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,
|
|
|
|
|
orderCode: this.orderNo,
|
|
|
|
|
materialCode: this.orderNoItemList.productCode,
|
|
|
|
|
materialDesc: this.orderNoItemList.productName,
|
|
|
|
|
unit: this.orderNoItemList.unit,
|
|
|
|
@ -341,12 +349,6 @@ export default class WhiteInstorage extends BasePage {
|
|
|
|
|
this.show = false;
|
|
|
|
|
//this.getlist();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
(this.$refs.uToast as any).show({
|
|
|
|
|
title: '实际入库总数量不能超过入库数量,请正确入库',
|
|
|
|
|
// url: '/pages/user/index'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async getlist() {
|
|
|
|
|
await (this.model as any).list(this.orderNo);
|
|
|
|
@ -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;
|
|
|
|
|