Commit 175256b7 authored by 何远江's avatar 何远江

销售检配优化

parent ae29ec74
...@@ -13,14 +13,8 @@ ...@@ -13,14 +13,8 @@
<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" :disabled="isDisabled" v-model="wxparams" :focus="isFocus"
prefixIcon="search" placeholder="请扫描产品包装条码/外箱码" @input="handleInputPlnr"></uni-easyinput>
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描产品包装条码/外箱码"
@input="handleInputPlnr"
></uni-easyinput>
</view> </view>
<view class="total"> <view class="total">
<view class="left">明细</view> <view class="left">明细</view>
...@@ -35,11 +29,7 @@ ...@@ -35,11 +29,7 @@
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="contentMore" :list="goodsList"> <ContentLoadingMore class="contentMore" :list="goodsList">
<view class="cardbox"> <view class="cardbox">
<view <view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
class="cardContent"
v-for="(item, index) in goodsList"
:key="item.PLNR"
>
<scanningList :item="item" :list="item.ZPLDT" /> <scanningList :item="item" :list="item.ZPLDT" />
</view> </view>
</view> </view>
...@@ -54,13 +44,15 @@ ...@@ -54,13 +44,15 @@
</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 {
export default { parseTime
} from "@/utils/ruoyi";
export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
...@@ -75,8 +67,7 @@ export default { ...@@ -75,8 +67,7 @@ export default {
border: true, border: true,
current: 0, current: 0,
status: "loadmore", status: "loadmore",
btnArr: [ btnArr: [{
{
style: "", style: "",
type: "warning", type: "warning",
text: "返回", text: "返回",
...@@ -94,8 +85,8 @@ export default { ...@@ -94,8 +85,8 @@ export default {
nlpla: "", nlpla: "",
wxparams: "", wxparams: "",
goodsList: [], goodsList: [],
list: [],
orderItem: {}, orderItem: {},
resFlag: false
}; };
}, },
created() { created() {
...@@ -108,6 +99,11 @@ export default { ...@@ -108,6 +99,11 @@ export default {
this.goodsList.push( this.goodsList.push(
...ele.ZSIZE.map((item) => { ...ele.ZSIZE.map((item) => {
return { return {
KDAUF: ele.KDAUF,
KDPOS: ele.KDPOS,
LFIMG: ele.LFIMG,
MEINS: ele.MEINS,
WERKS: ele.WERKS,
...item, ...item,
MATNR: ele.MATNR, MATNR: ele.MATNR,
MAKTX: ele.MAKTX, MAKTX: ele.MAKTX,
...@@ -115,7 +111,6 @@ export default { ...@@ -115,7 +111,6 @@ export default {
}) })
); );
}); });
this.list = JSON.parse(JSON.stringify(this.goodsList));
} }
}, },
computed: { computed: {
...@@ -126,27 +121,34 @@ export default { ...@@ -126,27 +121,34 @@ export default {
}, },
methods: { methods: {
goSubmit() { goSubmit() {
if (!this.goodsList.length) return
if (this.resFlag) {
return this.$u.toast("当前单据已经提交成功!无需继续提交!");
}
const flag = this.goodsList.every((ele) => { const flag = this.goodsList.every((ele) => {
return ( return (
ele.ZINSNUM == ele?.ZPLDT?.reduce((acc, cur) => acc + cur.PACMG, 0) ele.ZINSNUM == ele?.ZPLDT?.reduce((acc, cur) => acc + cur.PACMG, 0)
); );
}); });
if (!flag) { if (!flag) {
return this.$u.toast("请确认所有包装数量是否正确"); return this.$u.toast("请确认所有包装数量是否正确");
} }
const params = this.goodsList.reduce((acc, cur, index) => { const params = this.goodsList.reduce((acc, cur, index) => {
if (index == 0) { if (index == 0) {
acc.push({ ...cur }); acc.push(JSON.parse(JSON.stringify(cur)));
} else { } else {
const item = acc.find(v => v.POSNR === cur.POSNR) const item = acc.find((v) => v.POSNR === cur.POSNR);
if (item) { if (item) {
item.ZPLDT.push(...cur.ZPLDT) item.ZPLDT.push(...cur.ZPLDT);
}else { } else {
acc.push({ ...cur }) acc.push(JSON.parse(JSON.stringify(cur)));
} }
} }
return acc return acc;
}, []); }, []);
this.$u.api.sapApi.sapPickingDn(params).then((res) => { this.$u.api.sapApi.sapPickingDn(params).then((res) => {
this.loading = false; this.loading = false;
if (!Array.isArray(res)) { if (!Array.isArray(res)) {
...@@ -161,6 +163,7 @@ export default { ...@@ -161,6 +163,7 @@ export default {
}); });
if (!flag) { if (!flag) {
this.$u.toast("提交成功"); this.$u.toast("提交成功");
this.resFlag = true
} }
}); });
}, },
...@@ -173,6 +176,7 @@ export default { ...@@ -173,6 +176,7 @@ export default {
if (res && res.MSG[0].TYPE === "S") { if (res && res.MSG[0].TYPE === "S") {
// 循环BLPL合并相同的物料号和size // 循环BLPL合并相同的物料号和size
res.BLPL.forEach((ele) => { res.BLPL.forEach((ele) => {
ele.TOMNG = ele.PACMG;
const item = this.goodsList.find( const item = this.goodsList.find(
(v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR (v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
); );
...@@ -218,55 +222,54 @@ export default { ...@@ -218,55 +222,54 @@ export default {
e && this.getPlnr(e); e && this.getPlnr(e);
}, },
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.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 { .tabTwo {
/deep/ .u-sticky-wrap { /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;
padding: 0rpx 40rpx; padding: 0rpx 40rpx;
...@@ -277,17 +280,17 @@ page { ...@@ -277,17 +280,17 @@ page {
.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;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
</style> </style>
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