销售出库调整

master
guoshuang 8 months ago
parent 4c8da7dc4f
commit a995a3a4bc

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

@ -103,7 +103,7 @@
<div>物料名称 : {{ clickitem.materialName }}</div>
</div>
<div class="details">
<div>数量 : {{ clickitem.quality }}</div>
<div>数量 : {{ clickitem.quality }}{{ clickitem.unit }}</div>
<div style="margin-left: 30px">检验状态 : {{ clickitem.checkStatus == 0 ? '待检验' : '检验完成' }}</div>
</div>
<div class="details">

@ -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">
@ -22,7 +22,11 @@
<!-- 订单 -->
<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" />
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="prodlist" />
</u-form-item>
<u-form-item label="批次">
<!-- <u-input :border="true" v-model="histroyItem.productDescZh" placeholder="" style="overflow: hidden" /> -->
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChangepici" showKey="lotNumber" valKey="lotNumber" :val="bimWl.value" :options="picilist" />
</u-form-item>
<!-- <u-form-item label="出库仓库">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
@ -30,20 +34,17 @@
<u-form-item label="客户名称">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
</u-form-item> -->
<view class="row-list-top">
<!-- <view class="row-list-top">
<view class="row-list-item-top">
<view class="list-item-top"> 出库仓库: </view>
<jPicker sureColor="#ff0000" @bindpicker="wlChange" showKey="label" valKey="value" :val="cimWl.value" :options="warehouselist" />
<view>{{loc.label}}</view>
</view>
<view class="row-list-item-top">
<view class="list-item-top"> 客户名称: </view>
<view> {{ orderNoItemList && orderNoItemList.attr1 }} </view>
</view>
</view>
</view> -->
<!-- 机台 -->
<!-- <u-form-item label="出库仓库"> 成品库 </u-form-item> -->
</u-form>
<u-form style="margin-top: 1rpx" class="form3">
<u-form :style="{ marginTop: '1rpx', backgroundColor: orderNoItemList.planQuantity <= orderNoItemList.outQuantity ? '#4eea9b59' : '#ffffff' }" class="form3">
<view class="list">
<view class="row-list">
<view class="list-item"> 产品编码: </view>
@ -55,7 +56,7 @@
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 订单数量: </view>
<view class="list-item"> 计划数量: </view>
<view> {{ orderNoItemList && orderNoItemList.planQuantity }} </view>
</view>
<view class="row-list-item">
@ -64,17 +65,23 @@
</view>
</view>
<view class="row-list">
<view class="list-item">捡货数量: </view>
<view> {{ outnumber }} </view>
<view class="row-list-item">
<view class="list-item"> 出库数量: </view>
<view> {{ orderNoItemList && orderNoItemList.outQuantity }} </view>
</view>
<view class="row-list-item">
<view style="width: 50%" class="list-item"> 出库仓库: </view>
<view> {{ loc.userDefined2 }} </view>
</view>
</view>
</view>
</u-form>
<u-form class="form4">
<u-radio-group v-model="selectvalue" style="width: 100%" @change="radioGroupChange">
<!-- <u-radio-group v-model="selectvalue" style="width: 100%" @change="radioGroupChange">
<u-radio style="width: 50%" v-for="(item, index) in Radiolist" :key="index" :name="item.code" :disabled="item.disabled">
{{ item.name }}
</u-radio>
</u-radio-group>
</u-radio-group> -->
<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>
@ -85,25 +92,36 @@
<u-form style="margin-top: 10rpx" class="form2">
<view class="list">
<view class="rowleft">
<view class="row-list">
<!-- <view class="row-list">
<view class="row-list-item">
<view class="list-item"> 托盘号: </view>
<view class="list-item"> 标志卡: </view>
<view>{{ item.sn }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 箱码: </view>
<view> {{ item.barcode }} </view>
</view>
</view> -->
<view class="row-list">
<view class="list-item"> 批次: </view>
<view> {{ item.batchNumber }} </view>
</view>
<view class="row-list">
<view class="list-item"> 产品名称: </view>
<view>{{ item.productName }} </view>
</view>
<view class="row-list">
<view class="list-item"> 产品编码: </view>
<view> {{ item.productCode }} </view>
</view>
<view class="row-list">
<view class="row-list-item-row">
<view class="list-item"> 库位码: </view>
<view> {{ item.wlCode }} </view>
<view class="list-item"> 库区: </view>
<view> {{ item.waCode }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 数量: </view>
<u-input v-model="item.amount" type="number " border @blur="confirmNumber(item)" />
<!-- <view>{{item.amount}} </view> -->
</view>
<!-- <view class="row-list-item">
<view class="list-item"> 出库数量: </view>
<view> </view>
</view> -->
</view>
</view>
<view class="rowright">
@ -152,8 +170,12 @@ export default class SaleOutWH extends BasePage {
//productCodebiaozhiwei = '';
cimWl = {} as OptionType;
aimWl: any = {};
bimWl: any = {};
boxnumber: any = '';
materilist = [];
prodlist = [];
picilist = [];
loc: any = {};
// remove: any = {};
// async onReady() {
// await this.model.queryLocation();
@ -175,22 +197,42 @@ export default class SaleOutWH extends BasePage {
name: '整托扫描',
disabled: false,
},
{
code: 1,
name: '单箱扫描',
disabled: false,
},
// {
// code: 1,
// name: '',
// disabled: false,
// },
];
selectvalue: any = 0;
async onLoad() {
await this.model.getwarehouselist();
this.warehouselist = model.warehouselist;
this.cimWl = this.warehouselist[0];
//this.cimWl = this.warehouselist[0];
}
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.picilist = this.materilist.filter((item) => {
return item.productCode === this.aimWl.value;
});
this.bimWl = this.picilist[0];
this.list = [];
this.orderNoItemList = this.picilist[0];
this.orderNoItemList.outQuantity = this.orderNoItemList.outnumber;
this.outnumber = this.orderNoItemList.outQuantity;
this.warehouselist.some((item) => {
if (item.userDefined1 === this.orderNoItemList.whCode) {
this.loc = item;
return true; // some true
}
return false; //
});
}
//
bookTypeChangepici(e: any) {
this.bimWl = e.pickerName;
this.orderNoItemList = e.pickerName;
this.list = [];
this.orderNoItemList.outQuantity = this.orderNoItemList.outnumber;
this.outnumber = this.orderNoItemList.outQuantity;
}
wlChange(e: any) {
@ -203,16 +245,17 @@ export default class SaleOutWH extends BasePage {
}
//
async ondelete(item, index) {
console.log('this.list', Array.isArray(this.list));
const newList = [...this.list]; //
newList.splice(index, 1); // splice
this.list = newList; //
// console.log('this.list', Array.isArray(this.list));
// const newList = [...this.list]; //
// newList.splice(index, 1); // splice
this.list.splice(index, 1); //
this.orderNoItemList.outQuantity -= item.amount;
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
console.log('this.outnumber', this.outnumber);
this.outnumber = this.outnumber - 1;
//console.log('this.outnumber', this.outnumber);
// if(!this.list.length){
// this.productCodebiaozhiwei = '';
// }
@ -221,7 +264,7 @@ export default class SaleOutWH extends BasePage {
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
title: '请输入装运单号',
// url: '/pages/user/index'
});
return;
@ -233,94 +276,101 @@ export default class SaleOutWH extends BasePage {
this.model.orderNoItemList.forEach((item) => {
item.label = item.productName;
item.value = item.productCode;
item.outnumber = item.outQuantity;
this.materilist.push(item);
});
this.aimWl.value = this.materilist[0].value;
this.orderNoItemList = this.materilist[0];
const productCodeMap = {};
//
const uniqueItems = [];
this.materilist.forEach((item) => {
if (!productCodeMap[item.productCode]) {
productCodeMap[item.productCode] = true;
uniqueItems.push(item);
}
});
this.prodlist = uniqueItems;
this.aimWl.value = this.prodlist[0].value;
//
this.picilist = this.materilist.filter((item) => {
return item.productCode === this.aimWl.value;
});
this.bimWl.value = this.picilist[0].lotNumber;
this.orderNoItemList = this.picilist[0];
this.outnumber = this.orderNoItemList.outQuantity;
this.warehouselist.some((item) => {
if (item.userDefined1 === this.orderNoItemList.whCode) {
this.loc = item;
return true; // some true
}
return false; //
});
// this.loc = this.warehouselist.filter((item)=>{
// return item.userDefined1 === this.orderNoItemList.whCode;
// })
console.log('库位', this.loc);
// this.orderNoItemList = this.materilist[0];
// this.outnumber = this.orderNoItemList.outQuantity;
} else {
this.materilist = [];
this.prodlist = [];
}
}
async addlist() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
title: '请输入装运单号',
// url: '/pages/user/index'
});
return;
}
if (this.aimWl.value == '' || this.aimWl.value.length == 0) {
if (Object.keys(this.orderNoItemList).length == 0) {
(this.$refs.uToast as any).show({
title: '请输入选择产品编码',
title: '请先选择产品',
// url: '/pages/user/index'
});
return;
}
if (this.selectvalue == 0) {
//
let item: any = {};
item.sn = this.boxnumber;
item.siteCode = session.FactoryCode;
await this.model.ScanCodeWholePallet(item);
if (this.model.scanCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
model.scandatalist.map((item) => {
if (item.productCode == this.aimWl.value) {
this.list.push({ sn: item.sn, barcode: item.barcode, wlCode: item.wlCode, storageId: item.storageId });
this.outnumber += 1;
} else {
(this.$refs.uToast as any).show({
title: '扫描的物料必须与选择的物料相同',
type: 'error',
});
}
});
// this.list.push()
this.boxnumber = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.boxnumber = '';
}
} else if (this.selectvalue == 1) {
let item: any = {};
item.barcode = this.boxnumber;
item.siteCode = session.FactoryCode;
await this.model.ScanCodeSingleBox(item);
if (this.model.scanCode == '200') {
let scandata = model.scandata;
if (this.aimWl.value == scandata.productCode) {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.list.push({ sn: scandata.sn, barcode: scandata.barcode, wlCode: scandata.wlCode, storageId: scandata.storageId });
this.outnumber += 1;
// if (this.selectvalue == 0) {
//
let item: any = {};
item.sn = this.boxnumber;
item.siteCode = session.FactoryCode;
await this.model.ScanCodeWholePallet(item);
if (this.model.scanCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
model.scandatalist.map((item) => {
item.productCode = item.productCode.slice(item.productCode.search(/[1-9]/));
if (item.productCode == this.orderNoItemList.productCode) {
this.list.push(item);
this.orderNoItemList.outQuantity += item.amount;
} else {
(this.$refs.uToast as any).show({
title: '扫描的物料必须与选择的物料相同',
type: 'error',
});
}
});
// this.list.push()
this.boxnumber = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.boxnumber = '';
}
this.boxnumber = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.boxnumber = '';
}
//}
// //
// await this.model.queryOrderNo(this.form5);
@ -329,7 +379,7 @@ export default class SaleOutWH extends BasePage {
async onSubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
title: '请输入装运单号',
// url: '/pages/user/index'
});
return;
@ -337,20 +387,25 @@ export default class SaleOutWH extends BasePage {
if (this.list.length == 0 || this.list == '') {
(this.$refs.uToast as any).show({
title: '请先扫描箱码',
title: '请先扫描标志卡',
// url: '/pages/user/index'
});
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,
whCode: this.cimWl.value,
id: this.orderNoItemList.id,
productCode: this.orderNoItemList.productCode,
productName: this.orderNoItemList.productName,
wmsProductPutTrayCodeList: this.list,
wmsFpStorageNewsSns: wmsFpStorageNewsSns,
};
//console.log('000------',item);
await this.model.out(item);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
@ -397,6 +452,15 @@ export default class SaleOutWH extends BasePage {
});
}
}
confirmNumber(item) {
console.log(item);
let addnumber = 0;
this.list.forEach((item) => {
addnumber += parseFloat(item.amount ? item.amount : '0');
});
this.orderNoItemList.outQuantity = this.orderNoItemList.outnumber + addnumber;
}
}
</script>
<style lang="scss" scoped>
@ -560,10 +624,10 @@ export default class SaleOutWH extends BasePage {
.scroll {
// margin-top: 2rpx;
height: 430rpx;
height: 400rpx;
position: absolute;
width: 92%;
top: 780rpx;
top: 800rpx;
/* bottom: 40px; */
overflow: auto;
.form2 {
@ -596,7 +660,7 @@ export default class SaleOutWH extends BasePage {
.list-item {
display: flex;
flex-direction: row;
flex: 1;
// flex: 1;
}
}
}

@ -60,8 +60,8 @@ export class SaleOutWH extends VuexModule {
factoryCode: session.FactoryCode,
});
const warehouselist = result.data.map((element: any) => ({
label: element.warehouseName,
value: element.warehouseCode,
label: element.userDefined2,
value: element.userDefined1,
...element,
}));
return { warehouselist };

Loading…
Cancel
Save