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

master
guoshuang 10 months ago
parent d0a94b1b03
commit e6ffeb6238

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

@ -10,46 +10,45 @@
<view class="fiexdcontent"> <view class="fiexdcontent">
<u-form class="form" ref="form" label-width="180rpx"> <u-form class="form" ref="form" label-width="180rpx">
<!-- 单号 --> <!-- 单号 -->
<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">
<u-button type="primary" @click="query"></u-button>
</view> --> </view> -->
</view> <u-form-item label="领料单">
<!-- 订单 --> <u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
<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> </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-form-item label="标志卡">
<u-search placeholder="请扫描" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search> <u-search placeholder="请扫描" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search>
</u-form-item> </u-form-item>
</u-form> </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="list">
<view class="row-list"> <view class="row-list">
<view style="width: 25%" class="list-item"> 领料单: </view> <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>
<view class="row-list"> <view class="row-list">
<view style="width: 25%" class="list-item"> 物料编码: </view> <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>
<view class="row-list"> <view class="row-list">
<view style="width: 25%" class="list-item"> 物料名称: </view> <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>
<view class="row-list"> <view class="row-list">
<view class="row-list-item1"> <view class="row-list-item1">
<view class="list-item"> 应出/已出: </view> <view class="list-item"> 应出/已出: </view>
<view> {{ TraysList && TraysList.planNumber }}/{{ outNumber }} </view> <view> {{ item.planNumber }}/{{ item.outNumber }} </view>
</view> </view>
<view class="row-list-item2"> <view class="row-list-item2">
<view class="list-item"> 单位: </view> <view class="list-item"> 单位: </view>
<view> {{ TraysList && TraysList.unit }} </view> <view> {{ item.unit }} </view>
</view> </view>
</view> </view>
</view> </view>
@ -57,7 +56,7 @@
</view> </view>
<!-- <view style="height: 14rpx"></view> --> <!-- <view style="height: 14rpx"></view> -->
<view class="scroll"> <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"> <u-form style="margin-top: 10rpx" class="form2">
<view class="list"> <view class="list">
<view class="rowleft"> <view class="rowleft">
@ -67,7 +66,7 @@
</view> </view>
<view class="row-list"> <view class="row-list">
<view style="width: 30%" class="list-item"> 物料编码: </view> <view style="width: 30%" class="list-item"> 物料编码: </view>
<view> {{ item.materialCode }} </view> <view> {{ item.handlematerialCode }} </view>
</view> </view>
<view class="row-list"> <view class="row-list">
<view style="width: 30%" class="list-item"> 物料名称: </view> <view style="width: 30%" class="list-item"> 物料名称: </view>
@ -93,7 +92,10 @@
</view> </view>
<view class="row-list"> <view class="row-list">
<view class="list-item"> 数量: </view> <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> </view>
</view> </view>
@ -168,17 +170,6 @@ export default class ProductionREQ extends BasePage {
// this.cimWl = this.warehouselist[0]; // 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() { async query() {
if (this.orderNo == '' || this.orderNo.length == 0) { if (this.orderNo == '' || this.orderNo.length == 0) {
@ -191,20 +182,11 @@ export default class ProductionREQ extends BasePage {
await this.model.ProductionMaterialRequisition(this.orderNo); await this.model.ProductionMaterialRequisition(this.orderNo);
if (model.orderNoItemList) { if (model.orderNoItemList) {
this.materilist = []; 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.materilist = model.orderNoItemList;
this.aimWl = this.materilist[0]; this.materilist.forEach((item) => {
this.TraysList = this.materilist[0]; item.returnoutNumber = item.outNumber;
//console.log('this.TraysList',this.TraysList); item.handlematerialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
this.realityaddNumber = this.materilist[0].outNumber; });
this.outNumber = this.materilist[0].outNumber;
//this.queryinformation();
//this.getlist();
} else { } else {
this.materilist = []; this.materilist = [];
} }
@ -229,55 +211,28 @@ export default class ProductionREQ 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]/));
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.list.push(alreadyList);
this.confirmNumber();
this.Idcard = ''; this.Idcard = '';
} }
} }
confirmNumber() { confirmNumber(changeobj) {
let addNumber = 0; let addnumber = 0;
this.list.forEach((item) => { this.list.forEach((item) => {
addNumber += parseFloat(item.amount ? item.amount : '0'); if (item.materialCode == changeobj.materialCode) {
}); addnumber += parseFloat(changeobj.amount);
this.outNumber = this.realityaddNumber + addNumber;
} }
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() { async onSubmit() {
@ -298,49 +253,43 @@ export default class ProductionREQ extends BasePage {
} }
let params = []; let params = [];
this.list.map((item) => { this.list.map((item) => {
item.produceCode = this.TraysList.produceCode;
item.id = this.TraysList.id;
item.createBy = session.loginName; item.createBy = session.loginName;
item.factoryCode = session.FactoryCode; item.factoryCode = session.FactoryCode;
params.push(item); params.push(item);
}); });
//console.log('list', params); console.log('list', params);
await this.model.out(params); // await this.model.out(params);
if (this.model.SubmitCode == '200') { // if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({ // (this.$refs.uToast as any).show({
title: '成功', // title: '',
type: 'success', // type: 'success',
}); // });
this.mepty(); // this.mepty();
//this.getlist(); // //this.getlist();
} else { // } else {
(this.$refs.uToast as any).show({ // (this.$refs.uToast as any).show({
title: '失败', // title: '',
type: 'error', // type: 'error',
}); // });
//this.getlist(); // //this.getlist();
} // }
} }
mepty() { mepty() {
//this.orderNo = '';
this.list = []; this.list = [];
this.aimWl = {} as OptionType; this.materilist = [];
this.query(); this.query();
// this.bimWl = {} as OptionType; }
// this.materilist = []; delet(deletobj, index) {
// this.userDefined1list = []; this.list.splice(index, 1);
// //this.model.mepty(); this.materilist.forEach((item) => {
// this.boxnumber = ''; if (item.materialCode == deletobj.materialCode) {
// this.TraysList = { item.outNumber -= deletobj.amount;
// outNumber: 0, }
// planNumber: 0, });
// id: '', (this.$refs.uToast as any).show({
// produceCode: '', title: '删除成功',
// materialCode: '', type: 'success',
// materialDesc: '', });
// userDefined1: '',
// unit: '',
// };
} }
} }
</script> </script>
@ -451,8 +400,9 @@ body {
background-color: #fff; background-color: #fff;
padding: 20rpx 20rpx 20rpx; padding: 20rpx 20rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
height: 280rpx; height: 240rpx;
overflow: scroll; overflow: scroll;
margin-bottom: 6rpx;
//box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2); //box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
//color: #8d8989; //color: #8d8989;
// .list { // .list {
@ -514,8 +464,8 @@ body {
.scroll { .scroll {
// margin-top: 2rpx; // margin-top: 2rpx;
height: 680rpx; // height: 680rpx;
overflow: scroll; // overflow: scroll;
// position: absolute; // position: absolute;
// width: 92%; // width: 92%;
// top: 740rpx; // top: 740rpx;
@ -549,6 +499,19 @@ body {
//flex: 1; //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 { .rowright {
width: 20%; width: 20%;

@ -80,7 +80,7 @@
</view> </view>
<view class="scroll"> <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"> <u-form style="margin-top: 10rpx" class="form2">
<view class="list"> <view class="list">
<view class="righttitle"> <view class="righttitle">
@ -115,9 +115,9 @@
<view class="list-item"> 实际收货: </view> <view class="list-item"> 实际收货: </view>
<u-input border placeholder="" @blur="confirmNumber" v-model="item.planNumber" /> <u-input border placeholder="" @blur="confirmNumber" v-model="item.planNumber" />
</view> </view>
<!-- <view a:if="true" class="righttitle"> <view a:if="true" class="righttitle">
<view @click.stop="onPass(item)" class="boder-icon-rigth"> 收货 </view> <view @click.stop="delet(item, index)" class="boder-icon-rigth"> 删除 </view>
</view> --> </view>
</view> </view>
</u-form> </u-form>
</view> </view>
@ -281,84 +281,7 @@ export default class receivePO extends BasePage {
this.nooperationNumber = 0; this.nooperationNumber = 0;
this.czNumber = ''; 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) { async onFormDoubleClick(item) {
console.log('双击', item); console.log('双击', item);
//await this.model.OnSubmit(item.id); //await this.model.OnSubmit(item.id);
@ -401,48 +324,14 @@ export default class receivePO extends BasePage {
this.aimWl = this.materilist[0]; this.aimWl = this.materilist[0];
this.list.push(this.materilist[0]); this.list.push(this.materilist[0]);
this.procureCode = this.list[0].procureCode; this.procureCode = this.list[0].procureCode;
this.realityaddNumber = this.list[0].realityNumber;
} else { } else {
this.aimWl = {} as OptionType; this.aimWl = {} as OptionType;
} }
//this.ProcureOrderAlready(); //this.ProcureOrderAlready();
//this.list = model.orderNoItemList; //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() { async tidan() {
if (this.procureCode == '' || this.procureCode.length == 0) { if (this.procureCode == '' || this.procureCode.length == 0) {
@ -575,20 +464,19 @@ export default class receivePO extends BasePage {
this.list = []; this.list = [];
this.list.push(e.pickerName); this.list.push(e.pickerName);
this.procureCode = this.list[0].procureCode; this.procureCode = this.list[0].procureCode;
this.realityaddNumber = this.list[0].realityNumber;
// //
//this.queryinformation(); //this.queryinformation();
//this.getlist(); //this.getlist();
} }
// bookTypeChangeway(e) { delet(item, index) {
// //this.showshow = true; this.receivedlist.splice(index, 1);
// this.bimWl.value = e.pickerName.value; this.list[0].realityNumber -= item.planNumber;
// console.log(e); (this.$refs.uToast as any).show({
// // if (e.pickerName.value == '0') { title: '删除成功',
// // this.selectway = false; type: 'success',
// // } else { });
// // this.selectway = true; }
// // }
// }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

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

Loading…
Cancel
Save