生产领料功能调整

master
guoshuang 10 months ago
parent ebc5c2be2f
commit d0a94b1b03

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

@ -24,31 +24,28 @@
<!-- <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 label="批次">
<!-- <u-input :border="true" v-model="histroyItem.productDescZh" placeholder="" style="overflow: hidden" /> -->
<jPicker sureColor="#ff0000" @bindpicker="userDefined1Change" showKey="value" valKey="value" :val="bimWl.value" :options="userDefined1list" />
<u-form-item label="标志卡">
<u-search placeholder="请扫描" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search>
</u-form-item>
<!-- 机台 -->
<u-form-item label="出库仓库">
<!-- <u-input :border="true" v-model="histroyItem.productDescZh" placeholder="" style="overflow: hidden" /> -->
<jPicker sureColor="#ff0000" @bindpicker="warehouseChange" showKey="label" valKey="value" :val="cimWl.value" :options="warehouselist" />
</u-form-item>
<!-- <u-form-item label="出库仓库"> 成品库 </u-form-item> -->
</u-form>
<u-form style="margin-top: 1rpx" class="form3">
<u-form v-show="Object.keys(TraysList).length != 0" :style="{ marginTop: '1rpx', backgroundColor: TraysList.planNumber <= outNumber ? '#4eea9b59' : '#ffffff' }" class="form3">
<view class="list">
<view class="row-list">
<view style="width: 18%" class="list-item"> 物料编码: </view>
<view style="width: 25%" class="list-item"> 领料单: </view>
<view style="width: 80%"> {{ TraysList && TraysList.produceCode }} </view>
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料编码: </view>
<view style="width: 80%"> {{ TraysList && TraysList.materialCode }} </view>
</view>
<view class="row-list">
<view style="width: 18%" class="list-item"> 物料名称: </view>
<view style="width: 25%" class="list-item"> 物料名称: </view>
<view style="width: 80%"> {{ TraysList && TraysList.materialDesc }} </view>
</view>
<view class="row-list">
<view class="row-list-item1">
<view class="list-item"> 应出/已出: </view>
<view> {{ TraysList && TraysList.planNumber }}/{{ TraysList && TraysList.outNumber }} </view>
<view> {{ TraysList && TraysList.planNumber }}/{{ outNumber }} </view>
</view>
<view class="row-list-item2">
<view class="list-item"> 单位: </view>
@ -57,41 +54,46 @@
</view>
</view>
</u-form>
<u-form class="form4">
<u-search placeholder="请扫描托盘" @search="addlist" v-model="boxnumber" :show-action="false"></u-search>
<!-- <u-input style="border: 0.5rpx solid #8d8989; border-radius: 10rpx" v-model="boxnumber" @click="clickscan"></u-input> -->
</u-form>
</view>
<!-- <view style="height: 14rpx"></view> -->
<view class="scroll">
<view v-for="(item, index) in list" :key="item.id">
<view v-for="item in list" :key="item.id">
<u-form style="margin-top: 10rpx" class="form2">
<view class="list">
<view class="rowleft">
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 托盘号: </view>
<view> {{ item.sn }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 出库数量: </view>
<view> {{ item.amount }} </view>
</view>
<!-- <view class="row-list-item">
<view class="list-item"> 批次号: </view>
<view> {{ item.barcode }} </view>
</view> -->
<view style="width: 30%" class="list-item"> 标志卡: </view>
<view> {{ item.wlCode }} </view>
</view>
<view class="row-list">
<!-- <view class="row-list-item"> -->
<view class="list-item"> 库位码: </view>
<view> {{ item.wlCode }} </view>
<!-- </view> -->
<view style="width: 30%" class="list-item"> 物料编码: </view>
<view> {{ item.materialCode }} </view>
</view>
</view>
<view class="rowright">
<view class="righttitle">
<view @click.stop="ondelete(item, index)" class="boder-icon-rigth"> 删除 </view>
<view class="row-list">
<view style="width: 30%" class="list-item"> 物料名称: </view>
<view> {{ item.materialDesc }} </view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 仓库: </view>
<view> {{ item.whCode }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 库区: </view>
<view> {{ item.waCode }} </view>
</view>
</view>
<view class="row-list">
<view style="width: 30%" class="list-item"> 托盘号: </view>
<view> {{ item.sn }} </view>
</view>
<view class="row-list">
<view style="width: 30%" class="list-item"> 批次: </view>
<view> {{ item.userDefined2 }} </view>
</view>
<view class="row-list">
<view class="list-item"> 数量: </view>
<u-input border placeholder="" @blur="confirmNumber" v-model="item.amount" />
</view>
</view>
</view>
@ -139,16 +141,8 @@ export default class ProductionREQ extends BasePage {
materilist = [];
userDefined1list = [];
warehouselist = [];
TraysList = {
outNumber: 0,
planNumber: 0,
id: '',
produceCode: '',
materialCode: '',
materialDesc: '',
userDefined1: '',
unit: '',
};
Idcard: any = '';
TraysList: any = {};
// remove: any = {};
// async onReady() {
// await this.model.queryLocation();
@ -162,59 +156,29 @@ export default class ProductionREQ extends BasePage {
orderNoItemList: any = [];
showProduceCodeList: any = [];
itemdetail: any = '';
outnumber: any = 0;
outNumber: any = 0;
realityaddNumber = 0;
async onReady() {
await this.model.getwarehouselist();
this.warehouselist = model.warehouselist;
const cimWl = this.warehouselist.find((item) => item.value === 'WH02');
if (cimWl) {
this.cimWl = cimWl;
} else {
this.cimWl = this.warehouselist[0];
}
// await this.model.getwarehouselist();
// this.warehouselist = model.warehouselist;
// const cimWl = this.warehouselist.find((item) => item.value === 'WH02');
// if (cimWl) {
// this.cimWl = cimWl;
// } else {
// this.cimWl = this.warehouselist[0];
// }
}
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.list = [];
this.queryinformation();
this.TraysList = e.pickerName;
this.realityaddNumber = e.pickerName.outNumber;
this.outNumber = e.pickerName.outNumber;
//this.queryinformation();
//this.getlist();
}
userDefined1Change(e: any) {
this.bimWl = e.pickerName;
this.list = [];
this.getlist();
}
//
warehouseChange(e: any) {
this.cimWl = e.pickerName;
this.list = [];
}
//
async ondelete(item, index) {
console.log('1234567', item);
console.log('index', index);
this.list.splice(index, 1);
this.TraysList.outNumber -= item.amount;
//this.itemdetail = item;
// this.showmodal = true;
// this.content = '?';
//this.itemdetail.orderNo = this.orderNo;
//console.log(this.itemdetail, this.orderNo);
//await this.model.deleteTray(this.itemdetail);
// if (this.model.SubmitCode == '200') {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'success',
// });
// this.getlist();
// } else {
// (this.$refs.uToast as any).show({
// title: '',
// type: 'error',
// });
// this.getlist();
// }
}
//
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
@ -235,32 +199,48 @@ export default class ProductionREQ extends BasePage {
// });
this.materilist = model.orderNoItemList;
this.aimWl = this.materilist[0];
this.queryinformation();
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();
} else {
this.materilist = [];
}
}
//
async queryinformation() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入领料单号',
// url: '/pages/user/index'
});
return;
async querybyidcard() {
if (this.list.length) {
let ischongfu = this.list.some((item) => item.wlCode == this.Idcard);
if (ischongfu) {
(this.$refs.uToast as any).show({
title: '请勿重复扫描标志卡',
});
this.Idcard = '';
return;
}
}
let item: any = {};
item.produceCode = this.orderNo;
item.materialCode = this.aimWl.value;
await this.model.queryinformation(item);
if (model.information) {
this.userDefined1list = model.information;
this.bimWl = this.userDefined1list[0];
} else {
this.userDefined1list = [];
let item = {
factoryCode: session.FactoryCode,
wlCode: this.Idcard,
};
await this.model.getByidcard(item);
if (model.getidcardcode == '200') {
let alreadyList = model.byidcardobj;
alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
this.list.push(alreadyList);
this.confirmNumber();
this.Idcard = '';
}
this.getlist();
}
confirmNumber() {
let addNumber = 0;
this.list.forEach((item) => {
addNumber += parseFloat(item.amount ? item.amount : '0');
});
this.outNumber = this.realityaddNumber + addNumber;
}
async getlist() {
if (this.orderNo == '' || this.orderNo.length == 0) {
@ -299,39 +279,7 @@ export default class ProductionREQ extends BasePage {
// }
console.log(model.TraysList);
}
async addlist() {
if (this.boxnumber == '') {
(this.$refs.uToast as any).show({
title: '请扫描托盘号',
// url: '/pages/user/index'
});
return;
}
// this.listboxnumber
const isDuplicate = this.list.some((item) => item.sn === this.boxnumber);
if (isDuplicate) {
(this.$refs.uToast as any).show({
title: '请勿重复扫描托盘',
// url: '/pages/user/index'
});
return;
}
await this.model.selloutconntray(this.boxnumber);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.list.push(model.selloutconntraydata);
this.TraysList.outNumber += model.selloutconntraydata.amount;
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
}
}
async onSubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
@ -343,26 +291,20 @@ export default class ProductionREQ extends BasePage {
if (this.list.length == 0 || this.list == '') {
(this.$refs.uToast as any).show({
title: '请先扫码箱码',
title: '请先扫描标志卡',
// url: '/pages/user/index'
});
return;
}
let params = [];
this.list.map((item) => {
params.push({
id: this.TraysList.id,
produceCode: this.TraysList.produceCode,
materialCode: this.TraysList.materialCode,
materialDesc: this.TraysList.materialDesc,
userDefined1: this.TraysList.userDefined1,
locCode: this.cimWl.value,
planNumber: item.amount,
sn: item.sn,
factoryCode: session.FactoryCode,
});
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);
//console.log('list', params);
await this.model.out(params);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
@ -380,24 +322,25 @@ export default class ProductionREQ extends BasePage {
}
}
mepty() {
this.orderNo = '';
//this.orderNo = '';
this.list = [];
this.aimWl = {} as OptionType;
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: '',
};
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: '',
// };
}
}
</script>
@ -446,12 +389,12 @@ body {
}
}
.fiexdcontent {
position: fixed;
width: 92%;
box-shadow: 0 0 14px 0 rgb(128 128 128 / 46%);
z-index: 100;
}
// .fiexdcontent {
// position: fixed;
// width: 92%;
// box-shadow: 0 0 14px 0 rgb(128 128 128 / 46%);
// z-index: 100;
// }
.form {
background-color: #fff;
padding: 15rpx;
@ -508,7 +451,7 @@ body {
background-color: #fff;
padding: 20rpx 20rpx 20rpx;
border-radius: 10rpx;
height: 210rpx;
height: 280rpx;
overflow: scroll;
//box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
//color: #8d8989;
@ -572,11 +515,12 @@ body {
.scroll {
// margin-top: 2rpx;
height: 680rpx;
position: absolute;
width: 92%;
top: 740rpx;
/* bottom: 40px; */
overflow: auto;
overflow: scroll;
// position: absolute;
// width: 92%;
// top: 740rpx;
// /* bottom: 40px; */
// overflow: auto;
// background-color: #f2f2f2;
.form2 {
background-color: #fff;
@ -585,10 +529,10 @@ body {
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
color: #8d8989;
.list {
display: flex;
flex-direction: row;
// display: flex;
// flex-direction: row;
.rowleft {
width: 80%;
// width: 80%;
.row-list {
display: flex;
flex-direction: row;
@ -602,7 +546,7 @@ body {
.list-item {
display: flex;
flex-direction: row;
flex: 1;
//flex: 1;
}
}
}

@ -13,11 +13,11 @@ export class ProductionREQ extends VuexModule {
orderNoItemList: any = [];
@MutationAction
async ProductionMaterialRequisition(orderNo: any) {
const result: any = await http.post(url.lanjuwms.raw.ProductionREQ.ProductionMaterialRequisition, {
const result: any = await http.post(url.lanjuwms.raw.ProductionREQ.ProductionMaterialRequisitionSC, {
// headers: {
// poolName: session.PoolName,
// },
produceCode: orderNo,
userDefined4: orderNo,
factoryCode: session.FactoryCode,
});
// http.defaults.headers.common['Accept-Language'] = session.PoolName;
@ -73,7 +73,7 @@ export class ProductionREQ extends VuexModule {
}
@MutationAction
async out(params: any) {
const result: any = await http.post(url.lanjuwms.raw.ProductionREQ.out, params);
const result: any = await http.post(url.lanjuwms.raw.ProductionREQ.NewConMaterialOutSC, params);
const SubmitCode = result.code;
return { SubmitCode };
}
@ -90,6 +90,17 @@ export class ProductionREQ extends VuexModule {
}));
return { warehouselist };
}
///扫描标志卡
getidcardcode: any = '';
byidcardobj: any = {};
@MutationAction
async getByidcard(data: any) {
const result: any = await http.post(url.lanjuwms.raw.ReceivePO.SweepMaterialCardSC, data);
const getidcardcode = result.code;
const byidcardobj = result.data;
return { getidcardcode, byidcardobj };
}
}
export default getModule(ProductionREQ);

@ -116,6 +116,7 @@ export const url = {
addOrderCard: qianzhuione + '/wms/WmsToWCSmission/addOrderCard',
selectOrderCard: qianzhuione + '/wms/WmsToWCSmission/selectOrderCard',
listTableCK: qianzhuione + '/wms/WmsToWCSmission/listTableCK',
SweepMaterialCardSC: qianzhuione + '/wms/WmsToWCSmission/SweepMaterialCardSC',
},
ReceiveSRM: {
// 手持 --包材采购单采购收货查询
@ -153,6 +154,8 @@ export const url = {
warehouselist: qianzhuione + '/wms/order/listCK',
ProductionMaterialRequisitionsn: qianzhuione + '/wms/WmsToWCSmission/ProductionMaterialRequisitionsn',
out: qianzhuione + '/wms/WmsToWCSmission/ProductionMaterialRequisitionAdd',
ProductionMaterialRequisitionSC: qianzhuione + '/wms/WmsToWCSmission/ProductionMaterialRequisitionSC',
NewConMaterialOutSC: qianzhuione + '/wms/WmsToWCSmission/NewConMaterialOutSC',
},
TrayStatusUpdate: {
out: qianzhuione + '/wms/order/TraystatusUpdate',

Loading…
Cancel
Save