Commit cfd281ec authored by 何远江's avatar 何远江

销售检配

parent 3c0a4a87
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
}; };
}, },
created() { created() {
this.getPlnr('80000033'); // this.getPlnr('80000033');
}, },
methods: { methods: {
getBtnHandle(row) { getBtnHandle(row) {
......
<template> <template>
<view class="lists page"> <view class="lists page">
<StickyNavBar class="listTitle"> <StickyNavBar class="listTitle">
<NavBar title="销售拣货"></NavBar> <NavBar title="销售拣货"></NavBar>
<!-- <view class="selectSheet"> <!-- <view class="selectSheet">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs> <u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
</view> --> </view> -->
<view class="headerTitle"> <view class="headerTitle">
<view class="items">交货单号:{{ goodsList[0].VBELN }}</view> <view class="items">交货单号:{{ goodsList[0].VBELN }}</view>
<view class="items">8|李XXXXXXX体</view> <view class="items">8|李XXXXXXX体</view>
<view class="items">计划日期:9999/99/99</view> <view class="items">计划日期:9999/99/99</view>
</view> </view>
<view class=""> <view class="">
<view class="btn"> <view class="btn">
<!-- <uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput> --> <!-- <uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput> -->
<uni-easyinput <uni-easyinput
prefixIcon="search" prefixIcon="search"
:disabled="isDisabled" :disabled="isDisabled"
v-model="wxparams" v-model="wxparams"
:focus="isFocus" :focus="isFocus"
placeholder="请扫描产品包装条码/外箱码" placeholder="请扫描产品包装条码/外箱码"
@input="handleInputPlnr" @input="handleInputPlnr"
></uni-easyinput> ></uni-easyinput>
</view> </view>
<view class="total"> <view class="total">
<view class="left">明细</view> <view class="left">明细</view>
<view class="right"> <view class="right">
<!-- 物料数量: --> <!-- 物料数量: -->
<text class="blue">{{ totalNum }}</text> <text class="blue">{{ totalNum }}</text>
<text class="line">/</text> <text class="line">/</text>
<text class="">{{ goodsList.length }}</text> <text class="">{{ goodsList.length }}</text>
</view> </view>
</view> </view>
</view> </view>
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="contentMore" :list='goodsList'> <ContentLoadingMore class="contentMore" :list="goodsList">
<view class="cardbox"> <view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR"> <view
<scanningList :item='item' :list='list'/> class="cardContent"
</view> v-for="(item, index) in goodsList"
</view> :key="item.PLNR"
<!-- <view class="cardbox" v-else> >
<view class="cardContent" v-for="(item, index) in goodsList"> <scanningList :item="item" :list="item.ZPLDT" />
<stockList :item='item' /> </view>
</view> </view>
</view> --> <!-- <view class="cardbox" v-else>
</ContentLoadingMore> <view class="cardContent" v-for="(item, index) in goodsList">
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <stockList :item='item' />
</view> </view>
</template> </view> -->
</ContentLoadingMore>
<script> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
import StickyNavBar from '@/components/StickyNavBar/index.vue'; </view>
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; </template>
import BottomBtn from '@/components/BottomBtn/index.vue';
import scanningList from "./scanningList.vue" <script>
import stockList from "./stockList.vue" import StickyNavBar from "@/components/StickyNavBar/index.vue";
import { parseTime} from "@/utils/ruoyi"; import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
export default { import BottomBtn from "@/components/BottomBtn/index.vue";
components: { import scanningList from "./scanningList.vue";
StickyNavBar, import stockList from "./stockList.vue";
ContentLoadingMore, import { parseTime } from "@/utils/ruoyi";
BottomBtn, export default {
scanningList, components: {
stockList StickyNavBar,
}, ContentLoadingMore,
data() { BottomBtn,
return { scanningList,
value: '', stockList,
type: 'select', },
border: true, data() {
current: 0, return {
status: 'loadmore', value: "",
btnArr: [ type: "select",
{ border: true,
style: '', current: 0,
type: 'warning', status: "loadmore",
text: '返回', btnArr: [
way: 'goBack' {
}, style: "",
{ type: "warning",
style: '', text: "返回",
type: 'primary', way: "goBack",
text: '提交', },
way: 'goSubmit' {
} style: "",
], type: "primary",
isFocus: false, text: "提交",
isDisabled: false, way: "goSubmit",
nlpla: '', },
wxparams: '', ],
goodsList: [], isFocus: false,
list: [], isDisabled: false,
orderItem: {}, nlpla: "",
}; wxparams: "",
}, goodsList: [],
created() { list: [],
// this.getPlnr('10000820240325000001|10000320100'); orderItem: {},
}, };
onLoad(option) { },
if(option && option.order){ created() {
const arr = [ // this.getPlnr('10000820240325000001|10000320100');
...JSON.parse(option.order) },
] onLoad(option) {
arr.forEach(ele => { if (option && option.order) {
// ele.checkedBox = false const arr = [...JSON.parse(option.order)];
ele.ZSIZE.forEach(item => { arr.forEach((ele) => {
if(ele.POSNR === item.POSNR){ this.goodsList.push(
item.MATNR = ele.MATNR ...ele.ZSIZE.map((item) => {
item.MAKTX = ele.MAKTX return {
this.goodsList.push(item) ...item,
} MATNR: ele.MATNR,
}); MAKTX: ele.MAKTX,
}); };
this.list = JSON.parse(JSON.stringify(this.goodsList)) })
} );
}, });
computed:{ this.list = JSON.parse(JSON.stringify(this.goodsList));
totalNum(){ }
const count = this.goodsList.filter(item => item.checkedBox).length },
return count || 0 computed: {
}, totalNum() {
}, const count = this.goodsList.filter((item) => item.checkedBox).length;
methods: { return count || 0;
goSubmit() { },
// const checkboxArr = this.goodsList.filter(item => item.checkedBox) },
// if (checkboxArr.length === 0) { methods: {
// this.$u.toast('暂无提交数据'); goSubmit() {
// return; const flag = this.goodsList.every((ele) => {
// } return (
// const chargLength = checkboxArr.filter(item => item.CHARG).length ele.ZINSNUM == ele?.ZPLDT?.reduce((acc, cur) => acc + cur.PACMG, 0)
// const chargListLength = this.goodsList.filter(item => item.CHARG).length );
// if (chargLength > 1 || chargListLength != chargLength) { });
// this.$u.toast('超过拣配数量'); if (!flag) {
// return; return this.$u.toast("请确认所有包装数量是否正确");
// } }
const arr = this.list.filter(item => item.PLNR) const params = this.goodsList.reduce((acc, cur, index) => {
this.$u.api.sapApi if (index == 0) {
.sapPickingDn(arr) acc.push({ ...cur });
.then((res) => { } else {
this.loading = false; const item = acc.find(v => v.POSNR === cur.POSNR)
if(!Array.isArray(res)){ if (item) {
return item.ZPLDT.push(...cur.ZPLDT)
} }else {
if (res.every((item) => item.TYPE === 'S')) { acc.push({ ...cur })
this.$u.toast('提交成功'); }
} }
const foundObject = res.find(item => item.TYPE === 'E'); return acc
if(foundObject && foundObject.MESSAGE){ }, []);
this.$u.toast(foundObject.MESSAGE); this.$u.api.sapApi.sapPickingDn(params).then((res) => {
} this.loading = false;
}); if (!Array.isArray(res)) {
}, return;
getPlnr(plnr) { }
let params = { const flag = res.some((item) => {
ZCODE: plnr.includes('BL') ? plnr : '', const f = item.TYPE == "E";
plnr: plnr.includes('BL') ? '': plnr if (f) {
} this.$u.toast(item.MESSAGE);
this.$u.api.sapApi }
.sapBlpl(params) return f;
.then((res) => { });
if (res && res.MSG[0].TYPE === 'S') { if (!flag) {
this.list.forEach(ele => { this.$u.toast("提交成功");
res.BLPL.forEach(item => { }
if(ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR ){ });
if((item.PACMG-0) > ele.ZINSNUM){ },
this.$u.toast('太多了'); getPlnr(plnr) {
}else{ let params = {
this.list.push({ ZCODE: plnr.includes("BL") ? plnr : "",
...ele, plnr: plnr.includes("BL") ? "" : plnr,
...item };
}) this.$u.api.sapApi.sapBlpl(params).then((res) => {
} if (res && res.MSG[0].TYPE === "S") {
} // 循环BLPL合并相同的物料号和size
}); res.BLPL.forEach((ele) => {
}); const item = this.goodsList.find(
} else { (v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
this.$u.toast(res.MSG[0].MESSAGE); );
} if (item) {
setTimeout(() => { if (Reflect.has(item, "ZPLDT")) {
this.isFocus = true; item.ZPLDT.push(ele);
this.isDisabled = false; } else {
this.wxparams = '' this.$set(item, "ZPLDT", [ele]);
}, 1000); }
this.loading = false; }
}); });
}, } else {
// 加载更多 this.$u.toast(res.MSG[0].MESSAGE);
onReachBottom() { }
console.log('加载更多inventoryCounting'); setTimeout(() => {
}, this.isFocus = true;
getBtnHandle(row) { this.isDisabled = false;
console.log('getBtnHandle', row); this.wxparams = "";
this[row.way](); }, 1000);
}, this.loading = false;
goBack() { });
console.log('进来'); },
uni.navigateBack({ // 加载更多
delta: 0 onReachBottom() {
}); console.log("加载更多inventoryCounting");
}, },
changeTab(index) { getBtnHandle(row) {
this.current = index; console.log("getBtnHandle", row);
}, this[row.way]();
handleInputNlpla(e) { },
goBack() {
}, console.log("进来");
handleInputPlnr(e) { uni.navigateBack({
this.isFocus = false; delta: 0,
e && this.getPlnr(e); });
}, },
} changeTab(index) {
}; this.current = index;
</script> },
handleInputNlpla(e) {},
<style lang="scss"> handleInputPlnr(e) {
.selectSheet { this.isFocus = false;
border-bottom: 1px solid #ccc; e && this.getPlnr(e);
} },
/deep/ .u-sticky { },
top: 0 !important; };
background: #fff; </script>
}
.tabTwo{ <style lang="scss">
/deep/ .u-sticky-wrap{ .selectSheet {
height: 330rpx !important; border-bottom: 1px solid #ccc;
} }
}
.listTitle{ /deep/ .u-sticky {
} top: 0 !important;
.contentMore { background: #fff;
margin: 20rpx; }
}
page { .tabTwo {
background: #f8f8f8; /deep/ .u-sticky-wrap {
} height: 330rpx !important;
.headerTitle{ }
padding: 20rpx; }
font-weight: 600;
.items{ .listTitle {
line-height: 40rpx; }
}
} .contentMore {
.btn { margin: 20rpx;
padding: 20rpx; }
background: #fff;
.topSearch { page {
margin-bottom: 20rpx; background: #f8f8f8;
} }
}
.total { .headerTitle {
background: #fff; padding: 20rpx;
color: #000; font-weight: 600;
padding: 0rpx 40rpx;
display: flex; .items {
justify-content: space-between; line-height: 40rpx;
font-size: 32rpx; }
.line { }
margin: 0px 10rpx;
} .btn {
} padding: 20rpx;
.cardbox { background: #fff;
min-height: calc(100vh - 410rpx);
padding: 0rpx 20rpx; .topSearch {
margin-top: 20rpx; margin-bottom: 20rpx;
} }
.cardContent { }
border-radius: 8px;
background: #fff; .total {
margin-bottom: 20rpx; background: #fff;
} color: #000;
</style> padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
.cardbox {
min-height: calc(100vh - 410rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
background: #fff;
margin-bottom: 20rpx;
}
</style>
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.PLNR+idx" v-if="ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR && ele.PLNR"> <view class="bottomItem" v-for="(ele, idx) in list" :key="ele.PLNR+idx" v-if="ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR && ele.PLNR">
<view class="items">PL号:{{ ele.PLNR }}</view> <view class="items">PL号:{{ ele.PLNR }}</view>
<view class="items">物料批号:{{ ele.CHARG }}</view> <view class="items">物料批号:{{ ele.CHARG }}</view>
<view class="items">库位:{{ ele.NLPLA }}</view> <view class="items">库位:{{ ele.LGORT }} - {{ ele.LGOBE }}</view>
<view class="items">仓位:{{ ele.NLPLA }}</view>
<!-- <view class="items">{{ ele.MATNR }}</view> --> <!-- <view class="items">{{ ele.MATNR }}</view> -->
<view class="items inputItem"> <view class="items inputItem">
<!-- <u-row gutter="8"> --> <!-- <u-row gutter="8"> -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment