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

添加委外发料

parent a86b3558
......@@ -22,7 +22,7 @@
摄像头对准
</view>
<view class="cardBoxTip3">
生产发料单号二维码
委外发料单号二维码
</view>
<view class="cardBoxTip2">
<text class="tipLeft">
......@@ -33,7 +33,6 @@
</text>
</view>
</view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view>
</template>
......@@ -109,31 +108,21 @@ export default {
});
}
},
getPlnr(plnr) {
this.totalNum = 0;
this.isDisabled = true;
getPlnr(VBELN) {
this.$u.api.sapApi
.sapPlnr({
plnr
.sapSchDn({
VBELN
})
.then((res) => {
if (res && res.RESULT.TYPE === 'S') {
this.goodsList = this.goodsList.concat(res.DATA);
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
if (res && res.BKDT.length) {
this.goodsList = res.BKDT
uni.navigateTo({
url: `/pages/outsourcedMaterial/outsourcedMaterialList?order=${JSON.stringify(this.goodsList)}`
});
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
} else {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
// res.forEach(element => {
// });
this.$u.toast(res.MSG[0].MESSAGE);
}
this.loading = false;
});
......
<template>
<view>
<StickyNavBar>
<view class="lists page">
<StickyNavBar class="listTitle">
<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="items">退料申请:MO2024032100001</view>
<view class="items">编排单号:MO2024032100001</view>
<view class="items">退料日期:2024/03/22</view>
<view class="items">WC01:数码印刷车间</view>
<view class="items">交货单号:{{ goodsList[0].VBELN }}</view>
<view class="items">8|李XXXXXXX体</view>
<view class="items">计划日期:9999/99/99</view>
</view>
<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>
</view>
<view class="total">
<view class="left">物料明细</view>
<view class="right">
物料数量:
<text class="blue">{{ goodsList.length }}</text>
<text class="line">/</text>
<text class="">{{ goodsList.length }}</text>
<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>
</view>
<view class="total">
<view class="left">明细</view>
<view class="right">
<!-- 物料数量: -->
<text class="blue">{{ totalNum }}</text>
<text class="line">/</text>
<text class="">{{ goodsList.length }}</text>
</view>
</view>
</view>
</StickyNavBar>
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle">
<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>
<ContentLoadingMore class="contentMore" :list="goodsList">
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
<scanningList :item="item" :list="item.ZPLDT" />
</view>
</view>
</view>
</ContentLoadingMore>
<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
},
data() {
return {
number: 0,
show: true,
nlpla: '',
wxparams: '',
btnArr: [
{
style: '',
type: 'warning',
text: '返回',
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
way: 'goSubmit'
}
],
goodsList: [],
isFocus: false,
isDisabled: false
};
},
created() {
this.getPlnr('10000820240325000001|10000320100');
},
methods: {
getBtnHandle(row) {
this[row.way]();
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 {
parseTime
} from "@/utils/ruoyi";
export default {
components: {
StickyNavBar,
ContentLoadingMore,
BottomBtn,
scanningList,
},
data() {
return {
value: "",
type: "select",
border: true,
current: 0,
status: "loadmore",
btnArr: [{
style: "",
type: "warning",
text: "返回",
way: "goBack",
},
{
style: "",
type: "primary",
text: "提交",
way: "goSubmit",
},
],
isFocus: false,
isDisabled: false,
nlpla: "",
wxparams: "",
goodsList: [],
orderItem: {},
resFlag: false
};
},
goBack() {
console.log('进来')
uni.navigateBack({
delta: 1
});
created() {
// this.getPlnr('10000820240325000001|10000320100');
},
goSubmit() {
if (this.goodsList.length === 0) {
return;
onLoad(option) {
if (option && option.order) {
const arr = [...JSON.parse(option.order)];
arr.forEach((ele) => {
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,
};
})
);
});
}
console.log([
{
BLDAT: '20240325',
BUDAT: '20240325',
ZENCODE: 'A014',
ITEM: this.goodsList
},
computed: {
totalNum() {
const count = this.goodsList.filter((item) => item.checkedBox).length;
return count || 0;
},
},
methods: {
goSubmit() {
if (!this.goodsList.length) return
if (this.resFlag) {
return this.$u.toast("当前单据已经提交成功!无需继续提交!");
}
]);
this.$u.api.sapApi
.sapRrm([
{
BLDAT: '20240325',
BUDAT: '20240325',
ZENCODE: 'A014',
// TYPE: 'CG',
ITEM: this.goodsList
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(JSON.parse(JSON.stringify(cur)));
} else {
const item = acc.find((v) => v.POSNR === cur.POSNR);
if (item) {
item.ZPLDT.push(...cur.ZPLDT);
} else {
acc.push(JSON.parse(JSON.stringify(cur)));
}
}
])
.then((res) => {
return acc;
}, []);
this.$u.api.sapApi.sapPickingDn(params).then((res) => {
this.loading = false;
if(!Array.isArray(res)){
return
}
if (res.every((item) => item.TYPE === 'S')) {
this.goodsList = [];
this.nlpla = '';
this.wxparams = '';
this.$u.toast('提交成功');
if (!Array.isArray(res)) {
return;
}
const foundObject = res.find(item => item.TYPE === 'E');
if(foundObject && foundObject.MESSAGE){
this.$u.toast(foundObject.MESSAGE);
const flag = res.some((item) => {
const f = item.TYPE == "E";
if (f) {
this.$u.toast(item.MESSAGE);
}
return f;
});
if (!flag) {
this.$u.toast("提交成功");
// this.resFlag = true
setTimeout(() => {
this.goBack()
}, 1000)
}
});
},
handleInputPlnr(e) {
this.isFocus = false;
e && this.getPlnr(e);
},
handleInputNlpla(e) {
if (e) {
this.nlpla = e;
this.goodsList.forEach((ele) => {
ele.NLPLA = ele.NLPLA || this.nlpla;
});
}
},
getPlnr(plnr) {
this.isDisabled = true;
this.$u.api.sapApi
.sapPlnr({
plnr
})
.then((res) => {
if (res && res.RESULT.TYPE === 'S') {
this.goodsList = this.goodsList.concat(res.DATA);
this.goodsList.forEach((ele) => {
ele.NLPLA = ele.NLPLA || this.nlpla;
},
getPlnr(plnr) {
let params = {
ZCODE: plnr.includes("BL") ? plnr : "",
plnr: plnr.includes("BL") ? "" : plnr,
};
this.$u.api.sapApi.sapBlpl(params).then((res) => {
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
);
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 {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
this.$u.toast(res.MSG[0].MESSAGE);
}
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
this.wxparams = "";
}, 1000);
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" scoped>
page {
background: #f8f8f8;
}
.headerTitle{
padding: 20rpx;
font-weight: 600;
.items{
line-height: 40rpx;
<style lang="scss">
.selectSheet {
border-bottom: 1px solid #ccc;
}
}
.btn {
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
}
.bottomBtn {
position: sticky;
padding: 20rpx;
display: flex;
justify-content: space-between;
background: #fff;
bottom: 0rpx;
margin-top: 20rpx;
.u-btn {
width: 300rpx;
.tabTwo {
/deep/ .u-sticky-wrap {
height: 330rpx !important;
}
}
}
.blue {
color: #3f9dcc;
}
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
.listTitle {}
.contentMore {
margin: 20rpx;
}
}
.cardbox {
min-height: calc(100vh - 480rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
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;
page {
background: #f8f8f8;
}
.item {
line-height: 50rpx;
color: #333;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
.headerTitle {
padding: 20rpx;
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;
.items {
line-height: 40rpx;
}
}
.bottomBox {
.btn {
padding: 20rpx;
.bottomItem {
background: #f8f8f8;
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
.items {
color: #333;
font-size: 24rpx;
height: 40rpx;
line-height: 40rpx;
}
}
}
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
</style>
\ No newline at end of file
.total {
background: #fff;
color: #000;
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>
<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 @@
},
goBack() {
console.log("进来");
uni.navigateBack({
delta: 0,
});
uni.navigateBack();
},
changeTab(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