修改销售出库

master
李靖 2 years ago
parent 28b51b24af
commit 1a4b1af699

@ -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="tidan"></u-button>
<u-button type="primary" @click="query"></u-button>
</view>
</view>
<!-- 订单 -->
@ -31,30 +31,30 @@
<view class="list">
<view class="row-list">
<view class="list-item"> 产品编码: </view>
<view> 40000006954 </view>
<view> {{ orderNoItemList && orderNoItemList.productCode }} </view>
</view>
<view class="row-list">
<view class="list-item"> 产品名称: </view>
<view> 纸箱 </view>
<view> {{ orderNoItemList && orderNoItemList.productName }} </view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 订单数量: </view>
<view> 100/0 </view>
<view> {{ orderNoItemList && orderNoItemList.planQuantity }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 单位: </view>
<view> </view>
<view> {{ orderNoItemList && orderNoItemList.unitOfMeasure }} </view>
</view>
</view>
<view class="row-list">
<view class="list-item">捡货数量: </view>
<view> 3 </view>
<view> {{ outnumber }} </view>
</view>
</view>
</u-form>
<u-form class="form4">
<u-search placeholder="请扫描箱码" v-model="boxnumber" :show-action="false"></u-search>
<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>
@ -67,17 +67,17 @@
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 批次号: </view>
<view> 100/0 </view>
<view> {{ item.lotNumber }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 箱码: </view>
<view> </view>
<view> {{ item.barcode }} </view>
</view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 库位码: </view>
<view> 100/0 </view>
<view> {{ item.wlCode }} </view>
</view>
<!-- <view class="row-list-item">
<view class="list-item"> 出库数量: </view>
@ -87,7 +87,7 @@
</view>
<view class="rowright">
<view class="righttitle">
<view @click.stop="onPass(item)" class="boder-icon-rigth"> 删除 </view>
<view @click.stop="ondelete(item)" class="boder-icon-rigth"> 删除 </view>
</view>
</view>
</view>
@ -106,6 +106,7 @@
</u-col>
</u-row>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script lang="ts">
@ -125,19 +126,10 @@ interface OptionType {
})
export default class SaleOutWH extends BasePage {
model = model;
list: any = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }, { id: 8 }];
list: any = [];
aimWl = {} as OptionType;
boxnumber: any = '';
materilist = [
{
label: '合格',
value: '1',
},
{
label: '不合格',
value: '0',
},
];
materilist = [];
// remove: any = {};
// async onReady() {
// await this.model.queryLocation();
@ -148,64 +140,166 @@ export default class SaleOutWH extends BasePage {
// }
orderNo: any = '';
border = true;
height = 100;
autoHeight = true;
imgList: any = [];
imgUrlList: any = [];
isqualified = [
{
label: '合格',
value: '1',
},
{
label: '不合格',
value: '0',
},
];
productCodeList: any = {};
orderNoItemList: any = [];
showProduceCodeList: any = [];
itemdetail: any = '';
outnumber: any = 0;
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.getlist();
this.queryinformation();
}
//
onPass(item) {
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 query() {
// if (this.orderNo == '' || this.orderNo.length == 0) {
// this.customToast('nficl');
// return;
// }
// await this.model.queryOrderNo(this.orderNo);
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
// url: '/pages/user/index'
});
return;
}
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);
});
this.aimWl.value = this.materilist[0].value;
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;
}
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({
title: '请输入备货单号',
// url: '/pages/user/index'
});
return;
}
if (this.aimWl.value == '' || this.aimWl.value.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入选择产品编码',
// url: '/pages/user/index'
});
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 = '';
}
// //
// await this.model.queryOrderNo(this.form5);
// this.list = model.orderNoItemList;
}
histroyItem: any = {};
barcode: any = '';
onSubmit() {
console.log('1234567');
}
// tidan() {}
clickscan() {
const self: SaleOutWH = this as SaleOutWH;
const showToast = (message: string) => {
uni.showToast({
title: message,
icon: 'none',
async onSubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入备货单号',
// url: '/pages/user/index'
});
};
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
self.boxnumber = res.result;
//that.getByPoint();
},
fail: function () {
showToast('扫码不成功');
},
});
return;
}
if (this.list.length == 0 || this.list == '') {
(this.$refs.uToast as any).show({
title: '请先扫码箱码',
// url: '/pages/user/index'
});
return;
}
this.list[0].outnumber = this.outnumber;
await this.model.out(this.list);
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();
}
}
}
</script>

@ -10,46 +10,52 @@ import { session } from '@/store/modules/session';
name: 'page.product.SaleOutWH',
})
export class SaleOutWH extends VuexModule {
WlList = [];
@MutationAction
async queryLocation() {
const result: any = await http.post(url.warehouse.wholeTransfer.getSpareMdLocation, {
// factoryCode: session.factoryCode,
loginName: session.loginName,
});
const WlList = result.data.map((_: any) => ({
label: _.locationCode,
value: _.locationCode,
}));
return { WlList };
}
orderNoItemList: any = [];
productCodeList: any = [];
@MutationAction
async queryOrderNo(orderNo: any) {
const result: any = await http.post(url.warehouse.wholeTransfer.queryDownshelfOrder, {
// factoryCode: session.factoryCode,
loginName: session.loginName,
orderNo,
async showProduceCode(orderNo: any) {
const result: any = await http.get(url.lanjuwms.product.SaleOutWH.showProduceCode + '/' + orderNo, {
headers: {
poolName: session.PoolName,
},
});
// http.defaults.headers.common['Accept-Language'] = session.PoolName;
const orderNoItemList = result.data;
// const productCodeList = result.data.map((_: any) => ({
// label: _.productCode,
// value: _.productCode,
// }));
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 OnSubmit(params: any) {
const result: any = await http.post(url.warehouse.wholeTransfer.offshelf, params);
async selloutconntray(params: any) {
const result: any = await http.post(url.lanjuwms.product.SaleOutWH.selloutconntray, params);
const SubmitCode = result.code;
return { SubmitCode };
}
@MutationAction
async empty() {
const productCodeList = [];
return { productCodeList };
async deleteTray(item: any) {
console.log(item);
const result: any = await http.delete(url.lanjuwms.product.SaleOutWH.deleteTray + '/' + item.barcode);
const SubmitCode = result.code;
return { SubmitCode };
}
@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 };
}
}

@ -417,6 +417,21 @@ export const url = {
handPut: '/api/dev-api/wms/tray/wms/handPut',
list: '/api/dev-api/wms/tray/listTary',
},
// 销售出库/sellout/showProduceCode/ /sellout/s/订单号/产品编码
SaleOutWH: {
// 根据交货单号查询下面的产品编码
showProduceCode: '/api/dev-api/wms/sellout/showProduceCode',
// 根据订单号和产品编码查询
queryinformation: '/api/dev-api/wms/sellout/s',
// 扫描箱码接口
selloutconntray: '/api/dev-api/wms/selloutconntray',
deleteTray: '/api/dev-api/wms/selloutconntray/deleteTray',
// 根据交货单号和产品编码查询展示接口
showTrays: '/api/dev-api/wms/selloutconntray/showTrays',
// 手持出库确认
out: '/api/dev-api/wms/selloutconntray/out',
},
},
},
};

Loading…
Cancel
Save