wms成品销售出库

master
guoshuang 1 year ago
parent baf683546b
commit 178ccd5828

@ -16,7 +16,7 @@
<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>
<u-button type="primary" @click="tidan"></u-button>
</view>
</view>
<!-- 订单 -->
@ -24,8 +24,24 @@
<!-- <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="出库仓库">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
</u-form-item>
<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-item-top">
<view class="list-item-top"> 出库仓库: </view>
<jPicker sureColor="#ff0000" @bindpicker="wlChange" showKey="label" valKey="value" :val="cimWl.value" :options="warehouselist" />
</view>
<view class="row-list-item-top">
<view class="list-item-top"> 客户名称: </view>
<view> {{ orderNoItemList && orderNoItemList.attr1 }} </view>
</view>
</view>
<!-- 机台 -->
<u-form-item label="出库仓库"> 成品库 </u-form-item>
<!-- <u-form-item label="出库仓库"> 成品库 </u-form-item> -->
</u-form>
<u-form style="margin-top: 1rpx" class="form3">
<view class="list">
@ -54,28 +70,33 @@
</view>
</u-form>
<u-form class="form4">
<u-search placeholder="请扫描箱码" @search="addlist" v-model="boxnumber" :show-action="false"></u-search>
<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-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 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">
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 批次: </view>
<view> {{ item.lotNumber }} </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> {{ item.barcode }} </view>
</view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="row-list-item-row">
<view class="list-item"> 库位码: </view>
<view> {{ item.wlCode }} </view>
</view>
@ -87,7 +108,7 @@
</view>
<view class="rowright">
<view class="righttitle">
<view @click.stop="ondelete(item)" class="boder-icon-rigth"> 删除 </view>
<view @click.stop="ondelete(item, index)" class="boder-icon-rigth"> 删除 </view>
</view>
</view>
</view>
@ -114,6 +135,7 @@ import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model from './model';
import { session } from '@/store/modules/session';
interface OptionType {
label: string;
value: string;
@ -127,7 +149,9 @@ interface OptionType {
export default class SaleOutWH extends BasePage {
model = model;
list: any = [];
aimWl = {} as OptionType;
//productCodebiaozhiwei = '';
cimWl = {} as OptionType;
aimWl: any = {};
boxnumber: any = '';
materilist = [];
// remove: any = {};
@ -144,33 +168,54 @@ export default class SaleOutWH extends BasePage {
showProduceCodeList: any = [];
itemdetail: any = '';
outnumber: any = 0;
warehouselist = [];
Radiolist = [
{
code: 0,
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];
}
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.getlist();
this.queryinformation();
this.orderNoItemList = e.pickerName;
this.list = [];
this.outnumber = this.orderNoItemList.outQuantity;
}
wlChange(e: any) {
this.cimWl = e.pickerName;
}
// radioradio-group
radioGroupChange(e) {
console.log(e);
console.log('selectvalue', this.selectvalue);
}
//
async ondelete(item) {
console.log('1234567', item);
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 ondelete(item, index) {
console.log('this.list', Array.isArray(this.list));
const newList = [...this.list]; //
newList.splice(index, 1); // splice
this.list = newList; //
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
console.log('this.outnumber', this.outnumber);
this.outnumber = this.outnumber - 1;
// if(!this.list.length){
// this.productCodebiaozhiwei = '';
// }
}
//
async query() {
@ -184,53 +229,20 @@ export default class SaleOutWH extends BasePage {
await this.model.showProduceCode(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);
//let a: any = {};
this.model.orderNoItemList.forEach((item) => {
item.label = item.productName;
item.value = item.productCode;
this.materilist.push(item);
});
this.aimWl.value = this.materilist[0].value;
this.queryinformation();
this.getlist();
this.orderNoItemList = this.materilist[0];
this.outnumber = this.orderNoItemList.outQuantity;
} else {
this.materilist = [];
}
}
//
async queryinformation() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
// url: '/pages/user/index'
});
return;
}
let item: any = {};
item.orderNo = this.orderNo;
item.value = this.aimWl.value;
await this.model.queryinformation(item);
if (model.information) {
this.orderNoItemList = model.information;
} else {
this.orderNoItemList = {};
}
// this.getlist();
}
async getlist() {
let item: any = {};
item.orderNo = this.orderNo;
item.value = this.aimWl.value;
await (this.model as any).showTrays(item);
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 addlist() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
@ -246,25 +258,76 @@ export default class SaleOutWH extends BasePage {
});
return;
}
let item: any = {};
item.productCode = this.aimWl.value;
item.barcode = this.boxnumber;
await this.model.selloutconntray(item);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.getlist();
this.boxnumber = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.getlist();
this.boxnumber = '';
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',
});
// if (this.productCodebiaozhiwei == ''&&model.scandatalist.length) {
// this.productCodebiaozhiwei = model.scandatalist[0].productCode;
// }
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') {
// if (this.productCodebiaozhiwei == ''&& model.scandata) {
// this.productCodebiaozhiwei = model.scandata.productCode;
// }
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;
} else {
(this.$refs.uToast as any).show({
title: '必须是同一种物料的',
type: 'error',
});
}
this.boxnumber = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.boxnumber = '';
}
}
// //
// await this.model.queryOrderNo(this.form5);
// this.list = model.orderNoItemList;
@ -285,22 +348,34 @@ export default class SaleOutWH extends BasePage {
});
return;
}
this.list[0].outnumber = this.outnumber;
await this.model.out(this.list);
//this.list[0].outnumber = this.outnumber;
let item = {
factoryCode: session.FactoryCode,
whCode: this.cimWl.value,
id: this.orderNoItemList.id,
productCode: this.orderNoItemList.productCode,
productName: this.orderNoItemList.productName,
wmsProductPutTrayCodeList: this.list,
};
await this.model.out(item);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.getlist();
this.list = [];
this.query();
//this.productCodebiaozhiwei = '';
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.getlist();
}
}
async tidan() {
//
}
}
</script>
<style lang="scss" scoped>
@ -400,6 +475,16 @@ export default class SaleOutWH extends BasePage {
justify-content: space-around;
flex: 1;
}
.row-list-top {
display: flex;
flex-direction: row;
width: 100%;
.row-list-item-top {
display: flex;
flex-direction: row;
width: 50%;
}
}
}
.form3 {
background-color: #fff;
@ -454,10 +539,10 @@ export default class SaleOutWH extends BasePage {
.scroll {
// margin-top: 2rpx;
height: 680rpx;
height: 430rpx;
position: absolute;
width: 92%;
top: 710rpx;
top: 780rpx;
/* bottom: 40px; */
overflow: auto;
.form2 {
@ -481,6 +566,12 @@ export default class SaleOutWH extends BasePage {
justify-content: space-between;
width: 40%;
}
.row-list-item-row {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 60%;
}
.list-item {
display: flex;
flex-direction: row;

@ -13,30 +13,14 @@ export class SaleOutWH extends VuexModule {
orderNoItemList: any = [];
@MutationAction
async showProduceCode(orderNo: any) {
const result: any = await http.get(url.lanjuwms.product.SaleOutWH.showProduceCode + '/' + orderNo, {
headers: {
poolName: session.PoolName,
},
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.selectQueryFinishedProductSales, {
deliveryOrder: orderNo,
factoryCode: session.FactoryCode,
});
// http.defaults.headers.common['Accept-Language'] = session.PoolName;
const orderNoItemList = result.data;
return { orderNoItemList };
}
information: any = [];
@MutationAction
async queryinformation(item) {
console.log(item);
const result: any = await http.get(url.lanjuwms.product.SaleOutWH.queryinformation + '/' + item.orderNo + '/' + item.value, {});
const information = result.data;
return { information };
}
TraysList: any = [];
@MutationAction
async showTrays(item: any) {
const result: any = await http.get(url.lanjuwms.product.SaleOutWH.showTrays + '/' + item.orderNo + '/' + item.value, {});
const TraysList = result.data;
return { TraysList };
}
SubmitCode: any = '';
@MutationAction
async selloutconntray(params: any) {
@ -45,17 +29,42 @@ export class SaleOutWH extends VuexModule {
return { SubmitCode };
}
@MutationAction
async deleteTray(item: any) {
console.log(item);
const result: any = await http.delete(url.lanjuwms.product.SaleOutWH.deleteTray + '/' + item.barcode);
async out(params: any) {
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.confirmFinishedProductSales, params);
const SubmitCode = result.code;
return { SubmitCode };
}
scanCode: any = '';
scandatalist: any = [];
scandata: any = {};
//整托
@MutationAction
async out(params: any) {
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.out + '/' + params[0].outnumber, params);
const SubmitCode = result.code;
return { SubmitCode };
async ScanCodeWholePallet(params: any) {
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.ScanCodeWholePallet, params);
const scanCode = result.code;
const scandatalist = result.data;
return { scanCode, scandatalist };
}
//单箱
@MutationAction
async ScanCodeSingleBox(params: any) {
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.ScanCodeSingleBox, params);
const scanCode = result.code;
const scandata = result.data;
return { scanCode, scandata };
}
warehouselist: any = [];
@MutationAction
async getwarehouselist() {
const result = await http.post(url.lanjuwms.raw.ProductionREQ.warehouselist, {
factoryCode: session.FactoryCode,
});
const warehouselist = result.data.map((element: any) => ({
label: element.warehouseName,
value: element.warehouseCode,
...element,
}));
return { warehouselist };
}
}

@ -65,6 +65,14 @@ export const url = {
showTrays: qianzhuione + '/wms/selloutconntray/showTrays',
// 手持出库确认
out: qianzhuione + '/wms/selloutconntray/out',
//销售出库整托扫码
ScanCodeWholePallet: qianzhuione + '/wms/WmsToWCSmission/ScanCodeWholePallet',
//销售出库单箱扫码
ScanCodeSingleBox: qianzhuione + '/wms/WmsToWCSmission/ScanCodeSingleBox',
//销售出库查询
selectQueryFinishedProductSales: qianzhuione + '/wms/WmsToWCSmission/selectQueryFinishedProductSales',
//销售出库确认
confirmFinishedProductSales: qianzhuione + '/wms/WmsToWCSmission/confirmFinishedProductSales',
},
},
raw: {

Loading…
Cancel
Save