销售出库标志卡数量等部分调整

master
guoshuang 5 months ago
parent df89d52250
commit f9465203cc

@ -142,7 +142,7 @@ export default class LoginPage extends BasePage {
// console.log('Version////', this.Version);
}
///******************
version = '0.0.166'; //
version = '0.0.167'; //
//version = '0.0.14'; //
//*************** false true ****************
//isTest = true;

@ -136,7 +136,7 @@
</view>
<view class="row-list-item">
<view class="list-item"> 数量: </view>
<u-input v-model="item.amount" type="number " border @blur="confirmNumber(item)" />
<u-input v-model="item.amount" type="number " border @blur="confirmNumber(item, index)" />
<!-- <view>{{item.amount}} </view> -->
</view>
</view>
@ -385,6 +385,7 @@ export default class SaleOutWH extends BasePage {
});
model.scandatalist.map((item) => {
item.productCode = item.productCode.slice(item.productCode.search(/[1-9]/));
item.oldamount = item.amount;
if (item.productCode == this.orderNoItemList.productCode) {
this.list.push(item);
this.orderNoItemList.outQuantity += item.amount;
@ -436,35 +437,43 @@ export default class SaleOutWH extends BasePage {
});
return;
}
//this.list[0].outnumber = this.outnumber;
let wmsFpStorageNewsSns = [];
this.list.map((item) => {
wmsFpStorageNewsSns.push({
storageId: item.storageId,
amount: item.amount,
});
});
let item = {
factoryCode: session.FactoryCode,
createBy: session.loginName,
id: this.orderNoItemList.id,
wmsFpStorageNewsSns: wmsFpStorageNewsSns,
};
//console.log('000------',item);
await this.model.out(item);
if (this.model.SubmitCode == '200') {
if (this.orderNoItemList.planQuantity < this.orderNoItemList.outQuantity) {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
title: '出库数量大于计划数量,不能出库',
// url: '/pages/user/index'
});
this.list = [];
this.query();
//this.productCodebiaozhiwei = '';
return;
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
//this.list[0].outnumber = this.outnumber;
let wmsFpStorageNewsSns = [];
this.list.map((item) => {
wmsFpStorageNewsSns.push({
storageId: item.storageId,
amount: parseInt(item.amount),
});
});
let item = {
factoryCode: session.FactoryCode,
createBy: session.loginName,
id: this.orderNoItemList.id,
wmsFpStorageNewsSns: wmsFpStorageNewsSns,
};
//console.log('000------',item);
await this.model.out(item);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.list = [];
this.query();
//this.productCodebiaozhiwei = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
}
}
}
async tidan() {
@ -498,13 +507,22 @@ export default class SaleOutWH extends BasePage {
}
}
confirmNumber(item) {
confirmNumber(item, index) {
console.log(item);
let addnumber = 0;
this.list.forEach((item) => {
addnumber += parseFloat(item.amount ? item.amount : '0');
});
this.orderNoItemList.outQuantity = this.orderNoItemList.outnumber + addnumber;
if (item.oldamount < item.amount) {
(this.$refs.uToast as any).show({
title: '输入数量不允许超过' + item.oldamount,
type: 'error',
});
this.list[index].amount = item.oldamount;
return;
} else {
let addnumber = 0;
this.list.forEach((item) => {
addnumber += parseFloat(item.amount ? item.amount : '0');
});
this.orderNoItemList.outQuantity = this.orderNoItemList.outnumber + addnumber;
}
}
}
</script>

Loading…
Cancel
Save