生产领料调整以及包材收获增加删除

master
guoshuang 10 months ago
parent d0a94b1b03
commit e6ffeb6238

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

@ -10,46 +10,45 @@
<view class="fiexdcontent">
<u-form class="form" ref="form" label-width="180rpx">
<!-- 单号 -->
<view class="single">
<!-- <view class="single">
<view class="single-left">
<view>领料单:</view>
<u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
</view>
<!-- <view class="single-right">
<u-button type="primary" @click="query"></u-button>
</view> -->
</view>
<!-- 订单 -->
<u-form-item label="物料编码">
<!-- <u-input :border="true" v-model="histroyItem.productDescZh" placeholder="" style="overflow: hidden" /> -->
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
<u-form-item label="领料单">
<u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
</u-form-item>
<!-- 订单 -->
<!-- <u-form-item label="物料编码">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
</u-form-item> -->
<u-form-item label="标志卡">
<u-search placeholder="请扫描" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search>
</u-form-item>
</u-form>
<u-form v-show="Object.keys(TraysList).length != 0" :style="{ marginTop: '1rpx', backgroundColor: TraysList.planNumber <= outNumber ? '#4eea9b59' : '#ffffff' }" class="form3">
<u-form v-show="materilist.length" v-for="(item, index) in materilist" :key="index" :style="{ marginTop: '1rpx', backgroundColor: item.planNumber <= item.outNumber ? '#4eea9b59' : '#ffffff' }" class="form3">
<view class="list">
<view class="row-list">
<view style="width: 25%" class="list-item"> 领料单: </view>
<view style="width: 80%"> {{ TraysList && TraysList.produceCode }} </view>
<view style="width: 80%"> {{ item.userDefined4 }} </view>
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料编码: </view>
<view style="width: 80%"> {{ TraysList && TraysList.materialCode }} </view>
<view style="width: 80%"> {{ item.handlematerialCode }} </view>
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料名称: </view>
<view style="width: 80%"> {{ TraysList && TraysList.materialDesc }} </view>
<view style="width: 80%"> {{ item.materialDesc }} </view>
</view>
<view class="row-list">
<view class="row-list-item1">
<view class="list-item"> 应出/已出: </view>
<view> {{ TraysList && TraysList.planNumber }}/{{ outNumber }} </view>
<view> {{ item.planNumber }}/{{ item.outNumber }} </view>
</view>
<view class="row-list-item2">
<view class="list-item"> 单位: </view>
<view> {{ TraysList && TraysList.unit }} </view>
<view> {{ item.unit }} </view>
</view>
</view>
</view>
@ -57,7 +56,7 @@
</view>
<!-- <view style="height: 14rpx"></view> -->
<view class="scroll">
<view v-for="item in list" :key="item.id">
<view v-for="(item, index) in list" :key="item.id">
<u-form style="margin-top: 10rpx" class="form2">
<view class="list">
<view class="rowleft">
@ -67,7 +66,7 @@
</view>
<view class="row-list">
<view style="width: 30%" class="list-item"> 物料编码: </view>
<view> {{ item.materialCode }} </view>
<view> {{ item.handlematerialCode }} </view>
</view>
<view class="row-list">
<view style="width: 30%" class="list-item"> 物料名称: </view>
@ -93,7 +92,10 @@
</view>
<view class="row-list">
<view class="list-item"> 数量: </view>
<u-input border placeholder="" @blur="confirmNumber" v-model="item.amount" />
<u-input border placeholder="" @blur="confirmNumber(item)" v-model="item.amount" />
</view>
<view a:if="true" class="righttitle">
<view @click.stop="delet(item, index)" class="boder-icon-rigth"> 删除 </view>
</view>
</view>
</view>
@ -168,17 +170,6 @@ export default class ProductionREQ extends BasePage {
// this.cimWl = this.warehouselist[0];
// }
}
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.list = [];
this.TraysList = e.pickerName;
this.realityaddNumber = e.pickerName.outNumber;
this.outNumber = e.pickerName.outNumber;
//this.queryinformation();
//this.getlist();
}
//
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
@ -191,20 +182,11 @@ export default class ProductionREQ extends BasePage {
await this.model.ProductionMaterialRequisition(this.orderNo);
if (model.orderNoItemList) {
this.materilist = [];
// let a: any = {};
// model.orderNoItemList.forEach((item) => {
// a.label = item.productName;
// a.value = item.productCode;
// this.materilist.push(a);
// });
this.materilist = model.orderNoItemList;
this.aimWl = this.materilist[0];
this.TraysList = this.materilist[0];
//console.log('this.TraysList',this.TraysList);
this.realityaddNumber = this.materilist[0].outNumber;
this.outNumber = this.materilist[0].outNumber;
//this.queryinformation();
//this.getlist();
this.materilist.forEach((item) => {
item.returnoutNumber = item.outNumber;
item.handlematerialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
});
} else {
this.materilist = [];
}
@ -229,55 +211,28 @@ export default class ProductionREQ extends BasePage {
if (model.getidcardcode == '200') {
let alreadyList = model.byidcardobj;
alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
this.materilist.forEach((item) => {
if (item.materialCode == alreadyList.materialCode) {
item.outNumber += alreadyList.amount;
}
});
//alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
this.list.push(alreadyList);
this.confirmNumber();
this.Idcard = '';
}
}
confirmNumber() {
let addNumber = 0;
confirmNumber(changeobj) {
let addnumber = 0;
this.list.forEach((item) => {
addNumber += parseFloat(item.amount ? item.amount : '0');
});
this.outNumber = this.realityaddNumber + addNumber;
if (item.materialCode == changeobj.materialCode) {
addnumber += parseFloat(changeobj.amount);
}
async getlist() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入领料单号',
// url: '/pages/user/index'
});
return;
this.materilist.forEach((item) => {
if (item.materialCode == changeobj.materialCode) {
item.outNumber = addnumber;
}
if (this.aimWl.value == '') {
(this.$refs.uToast as any).show({
title: '请选择一个物料',
// url: '/pages/user/index'
});
return;
}
if (this.bimWl.value == '') {
(this.$refs.uToast as any).show({
title: '请选择一个批次',
// url: '/pages/user/index'
});
return;
}
let item: any = {};
item.produceCode = this.orderNo;
item.materialCode = this.aimWl.value;
item.userDefined1 = this.bimWl.value;
await (this.model as any).showTrays(item);
this.TraysList = model.TraysList;
// if (model.TraysList.length > 0) {
// this.list = model.TraysList;
// this.outnumber = model.TraysList.length;
// } else {
// this.list = [];
// this.outnumber = 0;
// }
console.log(model.TraysList);
}
async onSubmit() {
@ -298,49 +253,43 @@ export default class ProductionREQ extends BasePage {
}
let params = [];
this.list.map((item) => {
item.produceCode = this.TraysList.produceCode;
item.id = this.TraysList.id;
item.createBy = session.loginName;
item.factoryCode = session.FactoryCode;
params.push(item);
});
//console.log('list', params);
await this.model.out(params);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.mepty();
//this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
//this.getlist();
}
console.log('list', params);
// await this.model.out(params);
// if (this.model.SubmitCode == '200') {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'success',
// });
// this.mepty();
// //this.getlist();
// } else {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'error',
// });
// //this.getlist();
// }
}
mepty() {
//this.orderNo = '';
this.list = [];
this.aimWl = {} as OptionType;
this.materilist = [];
this.query();
// this.bimWl = {} as OptionType;
// this.materilist = [];
// this.userDefined1list = [];
// //this.model.mepty();
// this.boxnumber = '';
// this.TraysList = {
// outNumber: 0,
// planNumber: 0,
// id: '',
// produceCode: '',
// materialCode: '',
// materialDesc: '',
// userDefined1: '',
// unit: '',
// };
}
delet(deletobj, index) {
this.list.splice(index, 1);
this.materilist.forEach((item) => {
if (item.materialCode == deletobj.materialCode) {
item.outNumber -= deletobj.amount;
}
});
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
}
}
</script>
@ -451,8 +400,9 @@ body {
background-color: #fff;
padding: 20rpx 20rpx 20rpx;
border-radius: 10rpx;
height: 280rpx;
height: 240rpx;
overflow: scroll;
margin-bottom: 6rpx;
//box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
//color: #8d8989;
// .list {
@ -514,8 +464,8 @@ body {
.scroll {
// margin-top: 2rpx;
height: 680rpx;
overflow: scroll;
// height: 680rpx;
// overflow: scroll;
// position: absolute;
// width: 92%;
// top: 740rpx;
@ -549,6 +499,19 @@ body {
//flex: 1;
}
}
.righttitle {
display: flex;
justify-content: flex-end;
.boder-icon-rigth {
border: 1rpx solid #fa3534;
width: 130rpx;
text-align: center;
background: #fa3534;
color: #ffffff;
margin-top: 10px;
}
}
}
.rowright {
width: 20%;

@ -80,7 +80,7 @@
</view>
<view class="scroll">
<view v-for="item in receivedlist" :key="item.id">
<view v-for="(item, index) in receivedlist" :key="item.id">
<u-form style="margin-top: 10rpx" class="form2">
<view class="list">
<view class="righttitle">
@ -115,9 +115,9 @@
<view class="list-item"> 实际收货: </view>
<u-input border placeholder="" @blur="confirmNumber" v-model="item.planNumber" />
</view>
<!-- <view a:if="true" class="righttitle">
<view @click.stop="onPass(item)" class="boder-icon-rigth"> 收货 </view>
</view> -->
<view a:if="true" class="righttitle">
<view @click.stop="delet(item, index)" class="boder-icon-rigth"> 删除 </view>
</view>
</view>
</u-form>
</view>
@ -281,84 +281,7 @@ export default class receivePO extends BasePage {
this.nooperationNumber = 0;
this.czNumber = '';
}
//
// async onOk() {
// console.log(this.form3);
// // if (this.form3.userDefined6 == '' || this.form3.userDefined6 == undefined) {
// // (this.$refs.uToast as any).show({
// // title: '',
// // type: 'default',
// // });
// // return;
// // }
// if (this.form3.planNumber == '' || this.form3.planNumber == undefined) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// if (this.form3.sn == '' && this.selectway == true) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// if (this.productCodeTypeList.value == '' || this.productCodeTypeList.value == undefined) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// if (this.waCodeTypeList.value == '' || this.waCodeTypeList.value == undefined) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// if (this.receiptNoCode == '' || this.receiptNoCode == undefined) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// console.log('1234567');
// let query = this.clickitem;
// // query.applyList = this.Sparepartlist;
// query.workStatus = this.form3.workStatus;
// if (this.selectway == true) {
// query.sn = this.form3.sn;
// } else {
// query.sn = dayjs().format('YYYYMMDDHHmmss');
// }
// query.planNumber = this.form3.planNumber;
// query.whCode = this.productCodeTypeList.warehouseCode;
// query.waCode = this.waCodeTypeList.value;
// query.factoryCode = session.FactoryCode;
// query.userDefined6 = this.form3.userDefined6;
// query.receiptNoCode = this.receiptNoCode;
// query.poLine = this.clickitem.userDefined3;
// await this.model.PurchaseOrderdeliPda(query);
// console.log(this.model.SubmitCode);
// if (this.model.SubmitCode.code == 200) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// this.show = false;
// this.query();
// // this.ProcureOrderAlready();
// } else {
// (this.$refs.uToast as any).show({
// title: '',
// type: this.model.SubmitCode.msg,
// });
// }
// }
async onFormDoubleClick(item) {
console.log('双击', item);
//await this.model.OnSubmit(item.id);
@ -401,48 +324,14 @@ export default class receivePO extends BasePage {
this.aimWl = this.materilist[0];
this.list.push(this.materilist[0]);
this.procureCode = this.list[0].procureCode;
this.realityaddNumber = this.list[0].realityNumber;
} else {
this.aimWl = {} as OptionType;
}
//this.ProcureOrderAlready();
//this.list = model.orderNoItemList;
}
// async querydelivery() {
// console.log(session);
// if (this.userDefined5 == '' || this.userDefined5.length == 0) {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'default',
// });
// return;
// }
// this.aimWl = {} as OptionType;
// let query = {
// userDefined5: this.userDefined5,
// procureCode: this.procureCode,
// materialCode: this.aimWl.value ? this.aimWl.value : '',
// //this.materialCode,
// factoryCode: session.FactoryCode,
// };
// await this.model.PurchaseOrderPda(query);
// let materilist = model.orderNoItemList;
// this.materilist = materilist.map((item) => {
// let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
// return {
// ...item,
// handlematerialCode: newmaterialCode,
// };
// });
// this.list = [];
// if (this.materilist.length) {
// this.aimWl = this.materilist[0];
// this.list.push(this.materilist[0]);
// } else {
// this.aimWl = {} as OptionType;
// }
// this.ProcureOrderAlready();
// //this.list = model.orderNoItemList;
// }
//
async tidan() {
if (this.procureCode == '' || this.procureCode.length == 0) {
@ -575,20 +464,19 @@ export default class receivePO extends BasePage {
this.list = [];
this.list.push(e.pickerName);
this.procureCode = this.list[0].procureCode;
this.realityaddNumber = this.list[0].realityNumber;
//
//this.queryinformation();
//this.getlist();
}
// bookTypeChangeway(e) {
// //this.showshow = true;
// this.bimWl.value = e.pickerName.value;
// console.log(e);
// // if (e.pickerName.value == '0') {
// // this.selectway = false;
// // } else {
// // this.selectway = true;
// // }
// }
delet(item, index) {
this.receivedlist.splice(index, 1);
this.list[0].realityNumber -= item.planNumber;
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
}
}
</script>
<style lang="scss" scoped>

@ -128,9 +128,9 @@
<view class="list-item">实际收货: </view>
<u-input border placeholder="" @blur="confirmNumber" v-model="item.planNumber" />
</view>
<!-- <view a:if="true" class="righttitle">
<view @click.stop="onPass(item)" class="boder-icon-rigth"> 收货 </view>
</view> -->
<view a:if="true" class="righttitle">
<view @click.stop="delet(item, index)" class="boder-icon-rigth"> 删除 </view>
</view>
</view>
</u-form>
</view>
@ -599,6 +599,7 @@ export default class receiveSRM extends BasePage {
this.list = [];
this.list.push(e.pickerName);
this.procureCode = this.list[0].procureCode;
this.realityaddNumber = this.list[0].realityNumber;
//
//this.queryinformation();
//this.getlist();
@ -623,6 +624,14 @@ export default class receiveSRM extends BasePage {
//console.log('1239999999',this.list[0].realityNumber)
}
delet(item, index: number) {
this.receivedlist.splice(index, 1);
this.list[0].realityNumber -= item.planNumber;
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
}
}
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save