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) {
......
...@@ -33,10 +33,14 @@ ...@@ -33,10 +33,14 @@
</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"
v-for="(item, index) in goodsList"
:key="item.PLNR"
>
<scanningList :item="item" :list="item.ZPLDT" />
</view> </view>
</view> </view>
<!-- <view class="cardbox" v-else> <!-- <view class="cardbox" v-else>
...@@ -50,45 +54,45 @@ ...@@ -50,45 +54,45 @@
</template> </template>
<script> <script>
import StickyNavBar from '@/components/StickyNavBar/index.vue'; import StickyNavBar from "@/components/StickyNavBar/index.vue";
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from "@/components/BottomBtn/index.vue";
import scanningList from "./scanningList.vue" import scanningList from "./scanningList.vue";
import stockList from "./stockList.vue" import stockList from "./stockList.vue";
import { parseTime} from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
BottomBtn, BottomBtn,
scanningList, scanningList,
stockList stockList,
}, },
data() { data() {
return { return {
value: '', value: "",
type: 'select', type: "select",
border: true, border: true,
current: 0, current: 0,
status: 'loadmore', status: "loadmore",
btnArr: [ btnArr: [
{ {
style: '', style: "",
type: 'warning', type: "warning",
text: '返回', text: "返回",
way: 'goBack' way: "goBack",
}, },
{ {
style: '', style: "",
type: 'primary', type: "primary",
text: '提交', text: "提交",
way: 'goSubmit' way: "goSubmit",
} },
], ],
isFocus: false, isFocus: false,
isDisabled: false, isDisabled: false,
nlpla: '', nlpla: "",
wxparams: '', wxparams: "",
goodsList: [], goodsList: [],
list: [], list: [],
orderItem: {}, orderItem: {},
...@@ -98,118 +102,122 @@ export default { ...@@ -98,118 +102,122 @@ export default {
// this.getPlnr('10000820240325000001|10000320100'); // this.getPlnr('10000820240325000001|10000320100');
}, },
onLoad(option) { onLoad(option) {
if(option && option.order){ if (option && option.order) {
const arr = [ const arr = [...JSON.parse(option.order)];
...JSON.parse(option.order) arr.forEach((ele) => {
] this.goodsList.push(
arr.forEach(ele => { ...ele.ZSIZE.map((item) => {
// ele.checkedBox = false return {
ele.ZSIZE.forEach(item => { ...item,
if(ele.POSNR === item.POSNR){ MATNR: ele.MATNR,
item.MATNR = ele.MATNR MAKTX: ele.MAKTX,
item.MAKTX = ele.MAKTX };
this.goodsList.push(item) })
} );
});
}); });
this.list = JSON.parse(JSON.stringify(this.goodsList)) this.list = JSON.parse(JSON.stringify(this.goodsList));
} }
}, },
computed:{ computed: {
totalNum(){ totalNum() {
const count = this.goodsList.filter(item => item.checkedBox).length const count = this.goodsList.filter((item) => item.checkedBox).length;
return count || 0 return count || 0;
}, },
}, },
methods: { methods: {
goSubmit() { goSubmit() {
// const checkboxArr = this.goodsList.filter(item => item.checkedBox) const flag = this.goodsList.every((ele) => {
// if (checkboxArr.length === 0) { return (
// this.$u.toast('暂无提交数据'); ele.ZINSNUM == ele?.ZPLDT?.reduce((acc, cur) => acc + cur.PACMG, 0)
// return; );
// } });
// const chargLength = checkboxArr.filter(item => item.CHARG).length if (!flag) {
// const chargListLength = this.goodsList.filter(item => item.CHARG).length return this.$u.toast("请确认所有包装数量是否正确");
// if (chargLength > 1 || chargListLength != chargLength) { }
// this.$u.toast('超过拣配数量'); const params = this.goodsList.reduce((acc, cur, index) => {
// return; if (index == 0) {
// } acc.push({ ...cur });
const arr = this.list.filter(item => item.PLNR) } else {
this.$u.api.sapApi const item = acc.find(v => v.POSNR === cur.POSNR)
.sapPickingDn(arr) if (item) {
.then((res) => { item.ZPLDT.push(...cur.ZPLDT)
}else {
acc.push({ ...cur })
}
}
return acc
}, []);
this.$u.api.sapApi.sapPickingDn(params).then((res) => {
this.loading = false; this.loading = false;
if(!Array.isArray(res)){ if (!Array.isArray(res)) {
return return;
} }
if (res.every((item) => item.TYPE === 'S')) { const flag = res.some((item) => {
this.$u.toast('提交成功'); const f = item.TYPE == "E";
if (f) {
this.$u.toast(item.MESSAGE);
} }
const foundObject = res.find(item => item.TYPE === 'E'); return f;
if(foundObject && foundObject.MESSAGE){ });
this.$u.toast(foundObject.MESSAGE); if (!flag) {
this.$u.toast("提交成功");
} }
}); });
}, },
getPlnr(plnr) { getPlnr(plnr) {
let params = { let params = {
ZCODE: plnr.includes('BL') ? plnr : '', ZCODE: plnr.includes("BL") ? plnr : "",
plnr: plnr.includes('BL') ? '': plnr plnr: plnr.includes("BL") ? "" : plnr,
} };
this.$u.api.sapApi this.$u.api.sapApi.sapBlpl(params).then((res) => {
.sapBlpl(params) if (res && res.MSG[0].TYPE === "S") {
.then((res) => { // 循环BLPL合并相同的物料号和size
if (res && res.MSG[0].TYPE === 'S') { res.BLPL.forEach((ele) => {
this.list.forEach(ele => { const item = this.goodsList.find(
res.BLPL.forEach(item => { (v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
if(ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR ){ );
if((item.PACMG-0) > ele.ZINSNUM){ if (item) {
this.$u.toast('太多了'); if (Reflect.has(item, "ZPLDT")) {
}else{ item.ZPLDT.push(ele);
this.list.push({ } else {
...ele, this.$set(item, "ZPLDT", [ele]);
...item
})
} }
} }
}); });
});
} else { } else {
this.$u.toast(res.MSG[0].MESSAGE); this.$u.toast(res.MSG[0].MESSAGE);
} }
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
this.isDisabled = false; this.isDisabled = false;
this.wxparams = '' this.wxparams = "";
}, 1000); }, 1000);
this.loading = false; this.loading = false;
}); });
}, },
// 加载更多 // 加载更多
onReachBottom() { onReachBottom() {
console.log('加载更多inventoryCounting'); console.log("加载更多inventoryCounting");
}, },
getBtnHandle(row) { getBtnHandle(row) {
console.log('getBtnHandle', row); console.log("getBtnHandle", row);
this[row.way](); this[row.way]();
}, },
goBack() { goBack() {
console.log('进来'); console.log("进来");
uni.navigateBack({ uni.navigateBack({
delta: 0 delta: 0,
}); });
}, },
changeTab(index) { changeTab(index) {
this.current = index; this.current = index;
}, },
handleInputNlpla(e) { handleInputNlpla(e) {},
},
handleInputPlnr(e) { handleInputPlnr(e) {
this.isFocus = false; this.isFocus = false;
e && this.getPlnr(e); e && this.getPlnr(e);
}, },
} },
}; };
</script> </script>
...@@ -217,37 +225,47 @@ export default { ...@@ -217,37 +225,47 @@ export default {
.selectSheet { .selectSheet {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
/deep/ .u-sticky { /deep/ .u-sticky {
top: 0 !important; top: 0 !important;
background: #fff; background: #fff;
} }
.tabTwo{
/deep/ .u-sticky-wrap{ .tabTwo {
/deep/ .u-sticky-wrap {
height: 330rpx !important; height: 330rpx !important;
} }
} }
.listTitle{
.listTitle {
} }
.contentMore { .contentMore {
margin: 20rpx; margin: 20rpx;
} }
page { page {
background: #f8f8f8; background: #f8f8f8;
} }
.headerTitle{
.headerTitle {
padding: 20rpx; padding: 20rpx;
font-weight: 600; font-weight: 600;
.items{
.items {
line-height: 40rpx; line-height: 40rpx;
} }
} }
.btn { .btn {
padding: 20rpx; padding: 20rpx;
background: #fff; background: #fff;
.topSearch { .topSearch {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
.total { .total {
background: #fff; background: #fff;
color: #000; color: #000;
...@@ -255,15 +273,18 @@ page { ...@@ -255,15 +273,18 @@ page {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 32rpx; font-size: 32rpx;
.line { .line {
margin: 0px 10rpx; margin: 0px 10rpx;
} }
} }
.cardbox { .cardbox {
min-height: calc(100vh - 410rpx); min-height: calc(100vh - 410rpx);
padding: 0rpx 20rpx; padding: 0rpx 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.cardContent { .cardContent {
border-radius: 8px; border-radius: 8px;
background: #fff; background: #fff;
......
...@@ -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