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

销售检配优化

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