Commit 25945c6a authored by 何远江's avatar 何远江

添加委外发料

parent a86b3558
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
摄像头对准 摄像头对准
</view> </view>
<view class="cardBoxTip3"> <view class="cardBoxTip3">
生产发料单号二维码 委外发料单号二维码
</view> </view>
<view class="cardBoxTip2"> <view class="cardBoxTip2">
<text class="tipLeft"> <text class="tipLeft">
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
</text> </text>
</view> </view>
</view> </view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view> </view>
</template> </template>
...@@ -109,31 +108,21 @@ export default { ...@@ -109,31 +108,21 @@ export default {
}); });
} }
}, },
getPlnr(plnr) { getPlnr(VBELN) {
this.totalNum = 0;
this.isDisabled = true;
this.$u.api.sapApi this.$u.api.sapApi
.sapPlnr({ .sapSchDn({
plnr VBELN
}) })
.then((res) => { .then((res) => {
if (res && res.RESULT.TYPE === 'S') { if (res && res.BKDT.length) {
this.goodsList = this.goodsList.concat(res.DATA); this.goodsList = res.BKDT
this.goodsList.forEach((ele) => { uni.navigateTo({
this.totalNum += ele.ERFMG; url: `/pages/outsourcedMaterial/outsourcedMaterialList?order=${JSON.stringify(this.goodsList)}`
ele.NLPLA = ele.NLPLA || this.nlpla;
}); });
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
} else { } else {
setTimeout(() => { // res.forEach(element => {
this.isFocus = true; // });
this.isDisabled = false; this.$u.toast(res.MSG[0].MESSAGE);
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
} }
this.loading = false; this.loading = false;
}); });
......
<template> <template>
<view> <view class="lists page">
<StickyNavBar> <StickyNavBar class="listTitle">
<NavBar title="委外发料"></NavBar> <NavBar title="委外发料"></NavBar>
<!-- <view class="selectSheet">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
</view> -->
<view class="headerTitle"> <view class="headerTitle">
<view class="items">退料申请:MO2024032100001</view> <view class="items">交货单号:{{ goodsList[0].VBELN }}</view>
<view class="items">编排单号:MO2024032100001</view> <view class="items">8|李XXXXXXX体</view>
<view class="items">退料日期:2024/03/22</view> <view class="items">计划日期:9999/99/99</view>
<view class="items">WC01:数码印刷车间</view>
</view> </view>
<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>
<view class="right"> <view class="right">
物料数量: <!-- 物料数量: -->
<text class="blue">{{ goodsList.length }}</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>
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="contentMore" :list="goodsList">
<view class="cardbox"> <view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList"> <view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
<view class="listItemTitle"> <scanningList :item="item" :list="item.ZPLDT" />
<view>
<view class="item">生产单号:{{ item.MATNR }}</view>
<view class="item">物料批次:{{ item.MATNR }}</view>
<view class="item">{{ item.MATNR }} | {{ item.MAKTX }}</view>
<view class="item">
<u-row gutter="16">
库位:
<uni-easyinput v-model="wxparams"></uni-easyinput>
</u-row>
</view>
<view class="item">扫描人员:{{ item.MAKTX }}</view>
<view class="item">退料数量:{{ item.MAKTX }}</view>
</view>
</view>
</view> </view>
</view> </view>
</ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view> </view>
</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";
export default { import scanningList from "./scanningList.vue";
import {
parseTime
} from "@/utils/ruoyi";
export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
BottomBtn BottomBtn,
scanningList,
}, },
data() { data() {
return { return {
number: 0, value: "",
show: true, type: "select",
nlpla: '', border: true,
wxparams: '', current: 0,
btnArr: [ status: "loadmore",
{ 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",
} },
], ],
goodsList: [],
isFocus: false, isFocus: false,
isDisabled: false isDisabled: false,
nlpla: "",
wxparams: "",
goodsList: [],
orderItem: {},
resFlag: false
}; };
}, },
created() { created() {
this.getPlnr('10000820240325000001|10000320100'); // this.getPlnr('10000820240325000001|10000320100');
}, },
methods: { onLoad(option) {
getBtnHandle(row) { if (option && option.order) {
this[row.way](); const arr = [...JSON.parse(option.order)];
}, arr.forEach((ele) => {
goBack() { this.goodsList.push(
console.log('进来') ...ele.ZSIZE.map((item) => {
uni.navigateBack({ return {
delta: 1 KDAUF: ele.KDAUF,
KDPOS: ele.KDPOS,
LFIMG: ele.LFIMG,
MEINS: ele.MEINS,
WERKS: ele.WERKS,
...item,
MATNR: ele.MATNR,
MAKTX: ele.MAKTX,
};
})
);
}); });
}
},
computed: {
totalNum() {
const count = this.goodsList.filter((item) => item.checkedBox).length;
return count || 0;
}, },
},
methods: {
goSubmit() { goSubmit() {
if (this.goodsList.length === 0) { if (!this.goodsList.length) return
return; if (this.resFlag) {
return this.$u.toast("当前单据已经提交成功!无需继续提交!");
} }
console.log([ const flag = this.goodsList.every((ele) => {
{ return (
BLDAT: '20240325', ele.ZINSNUM == ele?.ZPLDT?.reduce((acc, cur) => acc + cur.PACMG, 0)
BUDAT: '20240325', );
ZENCODE: 'A014', });
ITEM: this.goodsList
if (!flag) {
return this.$u.toast("请确认所有包装数量是否正确");
} }
]);
this.$u.api.sapApi const params = this.goodsList.reduce((acc, cur, index) => {
.sapRrm([ if (index == 0) {
{ acc.push(JSON.parse(JSON.stringify(cur)));
BLDAT: '20240325', } else {
BUDAT: '20240325', const item = acc.find((v) => v.POSNR === cur.POSNR);
ZENCODE: 'A014', if (item) {
// TYPE: 'CG', item.ZPLDT.push(...cur.ZPLDT);
ITEM: this.goodsList } else {
acc.push(JSON.parse(JSON.stringify(cur)));
} }
])
.then((res) => {
this.loading = false;
if(!Array.isArray(res)){
return
} }
if (res.every((item) => item.TYPE === 'S')) { return acc;
this.goodsList = []; }, []);
this.nlpla = '';
this.wxparams = ''; this.$u.api.sapApi.sapPickingDn(params).then((res) => {
this.$u.toast('提交成功'); this.loading = false;
if (!Array.isArray(res)) {
return;
} }
const foundObject = res.find(item => item.TYPE === 'E'); const flag = res.some((item) => {
if(foundObject && foundObject.MESSAGE){ const f = item.TYPE == "E";
this.$u.toast(foundObject.MESSAGE); if (f) {
this.$u.toast(item.MESSAGE);
} }
return f;
}); });
}, if (!flag) {
handleInputPlnr(e) { this.$u.toast("提交成功");
this.isFocus = false; // this.resFlag = true
e && this.getPlnr(e); setTimeout(() => {
}, this.goBack()
handleInputNlpla(e) { }, 1000)
if (e) {
this.nlpla = e;
this.goodsList.forEach((ele) => {
ele.NLPLA = ele.NLPLA || this.nlpla;
});
} }
});
}, },
getPlnr(plnr) { getPlnr(plnr) {
this.isDisabled = true; let params = {
this.$u.api.sapApi ZCODE: plnr.includes("BL") ? plnr : "",
.sapPlnr({ plnr: plnr.includes("BL") ? "" : plnr,
plnr };
}) this.$u.api.sapApi.sapBlpl(params).then((res) => {
.then((res) => { if (res && res.MSG[0].TYPE === "S") {
if (res && res.RESULT.TYPE === 'S') { // 循环BLPL合并相同的物料号和size
this.goodsList = this.goodsList.concat(res.DATA); res.BLPL.forEach((ele) => {
this.goodsList.forEach((ele) => { ele.TOMNG = ele.PACMG;
ele.NLPLA = ele.NLPLA || this.nlpla; const item = this.goodsList.find(
(v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
);
if (item) {
if (Reflect.has(item, "ZPLDT")) {
item.ZPLDT.push(ele);
} else {
this.$set(item, "ZPLDT", [ele]);
}
}
}); });
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
} else { } else {
this.$u.toast(res.MSG[0].MESSAGE);
}
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
this.isDisabled = false; this.isDisabled = false;
this.wxparams = "";
}, 1000); }, 1000);
this.$u.toast(res.RESULT.MESSAGE);
}
this.loading = false; this.loading = false;
}); });
},
// 加载更多
onReachBottom() {
console.log("加载更多inventoryCounting");
},
getBtnHandle(row) {
console.log("getBtnHandle", row);
this[row.way]();
},
goBack() {
console.log("进来");
uni.navigateBack();
},
changeTab(index) {
this.current = index;
},
handleInputNlpla(e) {},
handleInputPlnr(e) {
this.isFocus = false;
e && this.getPlnr(e);
},
},
};
</script>
<style lang="scss">
.selectSheet {
border-bottom: 1px solid #ccc;
} }
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
} }
};
</script>
<style lang="scss" scoped> .tabTwo {
page { /deep/ .u-sticky-wrap {
height: 330rpx !important;
}
}
.listTitle {}
.contentMore {
margin: 20rpx;
}
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;
} }
}
.bottomBtn {
position: sticky;
padding: 20rpx;
display: flex;
justify-content: space-between;
background: #fff;
bottom: 0rpx;
margin-top: 20rpx;
.u-btn {
width: 300rpx;
} }
}
.blue { .total {
color: #3f9dcc;
}
.total {
background: #fff; background: #fff;
color: #000; color: #000;
padding: 0rpx 40rpx; padding: 0rpx 40rpx;
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 {
min-height: calc(100vh - 480rpx); .cardbox {
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;
}
.listItemTitle {
display: flex;
justify-content: space-between;
padding: 20rpx;
border-bottom: 2px solid #f8f8f8;
.u-btn {
width: 150rpx;
margin: 0px;
margin-top: 10rpx;
}
.item {
line-height: 50rpx;
color: #333;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
font-weight: 600;
}
}
.listBottom {
.bottomTitle {
height: 80rpx;
position: relative;
.desc {
color: #bbb;
font-size: 24rpx;
line-height: 80rpx;
padding-left: 20rpx;
}
.topIcons {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #aaa;
}
}
.bottomBox {
padding: 20rpx;
.bottomItem {
background: #f8f8f8;
padding: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.items {
color: #333;
font-size: 24rpx;
height: 40rpx;
line-height: 40rpx;
}
} }
}
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
</style> </style>
<template>
<view>
<view class="listItemTitle">
<view>
<view class="item">行号:{{ item.POSNR }}</view>
<view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">尺码:{{ item.ZSIZE }}</view>
<view class="item">数量:{{ handleNum() }}/{{ item.ZINSNUM }}</view>
</view>
<view class="right">
<!-- <checkbox-group class="checkedBox">
<checkbox value="r1" :checked="item.checkedBox" disabled/>
</checkbox-group> -->
<!-- <text class="blue">{{ item.CLABS }}</text>
<text class="line">/</text>
<text class="">{{item.LFIMG}}pcs</text> -->
</view>
</view>
<view class="listBottom">
<view class="bottomTitle" @click="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
<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">物料批号:{{ ele.CHARG }}</view>
<view class="items">库位:{{ ele.LGORT }} - {{ ele.LGOBE }}</view>
<view class="items">仓位:{{ ele.NLPLA }}</view>
<!-- <view class="items">{{ ele.MATNR }}</view> -->
<view class="items inputItem">
<!-- <u-row gutter="8"> -->
数量:
{{ele.PACMG}}
<!-- <uni-easyinput v-model="ele.CLABS"></uni-easyinput> -->
<!-- /
{{ ele.LFIMG }} -->
<!-- </u-row> -->
</view>
</view>
</view>
</view>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
</view>
</template>
<script>
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
export default {
components: {
StickyNavBar,
ContentLoadingMore,
BottomBtn
},
props: {
item: {
type: Object,
default: function () {
return {};
}
},
list: {
type: Array,
default: function () {
return [];
}
}
},
data() {
return {
r1:'',
number: 0,
totalNum: 0,
nlpla: '',
wxparams: '',
btnArr: [
{
style: '',
type: 'warning',
text: '返回',
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
way: 'goSubmit'
}
],
isFocus: false,
show: true,
};
},
methods: {
handleNum(){
let num = 0
this.list.forEach(ele => {
if(ele.ZSIZE === this.item.ZSIZE && ele.MATNR === this.item.MATNR && ele.PLNR){
num += (ele.PACMG-0)
}
});
return num
}
}
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.headerTitle {
padding: 20rpx;
font-weight: 600;
.items {
line-height: 40rpx;
}
}
.btn {
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
}
}
.bottomBtn {
position: sticky;
padding: 20rpx;
display: flex;
justify-content: space-between;
background: #fff;
bottom: 0rpx;
margin-top: 20rpx;
.u-btn {
width: 300rpx;
}
}
.blue {
color: #3f9dcc;
}
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
.listItemTitle {
display: flex;
justify-content: space-between;
padding: 20rpx;
border-bottom: 2px solid #f8f8f8;
.u-btn {
width: 150rpx;
margin: 0px;
margin-top: 10rpx;
}
.item {
line-height: 50rpx;
color: #333;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
font-weight: 600;
}
}
.listBottom {
.bottomTitle {
height: 80rpx;
position: relative;
.desc {
color: #bbb;
font-size: 24rpx;
line-height: 80rpx;
padding-left: 20rpx;
}
.topIcons {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #aaa;
}
}
.bottomBox {
padding: 20rpx;
.bottomItem {
background: #f8f8f8;
padding: 20rpx;
margin-bottom: 20rpx;
.items {
color: #333;
font-size: 24rpx;
line-height: 40rpx;
/deep/ .uni-easyinput{
width: 200rpx;
}
}
.inputItem{
display: inline-flex;
// line-height: 76rpx;
}
}
}
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.checkedBox{
text-align: right;
}
/deep/ .uni-checkbox-input-disabled:before{
color: #007aff !important;
}
</style>
...@@ -212,9 +212,7 @@ ...@@ -212,9 +212,7 @@
}, },
goBack() { goBack() {
console.log("进来"); console.log("进来");
uni.navigateBack({ uni.navigateBack();
delta: 0,
});
}, },
changeTab(index) { changeTab(index) {
this.current = index; this.current = index;
......
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