Commit 09695334 authored by tanjunxin's avatar tanjunxin

fix: 余料退料添加副产品标识

parent 6508ee13
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "mes-pda", "name" : "mes-pda",
"appid" : "__UNI__FB0FD5F", "appid" : "__UNI__FB0FD5F",
"description" : "MES-PDA", "description" : "MES-PDA",
"versionName" : "1.2.3", "versionName" : "1.2.4",
"versionCode" : 123, "versionCode" : 124,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
均摊明细 均摊明细
</u-button> </u-button>
</view> </view>
<view class="item input">退料数量:<uni-easyinput v-model="num" trim="all" type="text" <view class="item input">退料数量:<uni-easyinput v-model="num" trim="all" type="number"
@input="handleChange"></uni-easyinput>/PCS @input="handleChange"></uni-easyinput>/PCS
</view> </view>
<view class="item">申请数量:{{ batchNum }}/PCS</view> <view class="item">申请数量:{{ batchNum }}/PCS</view>
<view class="item">是否副产品:{{ item.coproduct == "Y" ? '是' : '否' }}</view>
</view> </view>
<view class="listBottom"> <view class="listBottom">
<view class="bottomTitle" @tap="show = !show"> <view class="bottomTitle" @tap="show = !show">
...@@ -27,13 +28,15 @@ ...@@ -27,13 +28,15 @@
</view> </view>
</view> </view>
<view v-if="show" class="bottomBox"> <view v-if="show" class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in sapList"> <view class="bottomItem" v-for="(ele, idx) in sapList" :key="idx">
<view class="items">{{ ele.batchNo }}</view> <view class="items">{{ ele.batchNo }}</view>
<view class="items">{{ ele.sapItemCode }}<br>{{ele.itemName}}</view> <view class="items">{{ ele.sapItemCode }}<br>{{ele.itemName}}</view>
<view class="items">PL号:<br> <view class="items">PL号:<br>
<view class="items" v-for="p in ele.plNum.split('|')"> <template v-if="ele.plNum">
{{ p }} <view class="items" v-for="(p, i) in ele.plNum.split('|')" key="i">
</view> {{ p }}
</view>
</template>
</view> </view>
<view class="items">批次数量:{{ ele.backNum }}/PCS</view> <view class="items">批次数量:{{ ele.backNum }}/PCS</view>
<view class="items">生产日期:{{ ele.produceTime }}</view> <view class="items">生产日期:{{ ele.produceTime }}</view>
...@@ -42,7 +45,7 @@ ...@@ -42,7 +45,7 @@
</view> </view>
<u-popup class="oddments-popup" v-model="visible" mode="center" :mask-close-able="false"> <u-popup class="oddments-popup" v-model="visible" mode="center" :mask-close-able="false">
<scroll-view scroll-y="true" style="height: 600rpx;"> <scroll-view scroll-y="true" style="height: 600rpx;">
<view class="content" v-for="(ele, idx) in pordList"> <view class="content" v-for="(ele, idx) in pordList" :index="idx">
<view class="item">生产单号:{{ ele.workorderCode }}</view> <view class="item">生产单号:{{ ele.workorderCode }}</view>
<view class="item">{{ ele.sapItemCode }}<br>{{ele.itemName}}</view> <view class="item">{{ ele.sapItemCode }}<br>{{ele.itemName}}</view>
<view class="item">工单计划数:{{ ele.quantity }}/PCS</view> <view class="item">工单计划数:{{ ele.quantity }}/PCS</view>
...@@ -141,7 +144,12 @@ ...@@ -141,7 +144,12 @@
this.$u.toast("退料数量不可以超过申请数量!"); this.$u.toast("退料数量不可以超过申请数量!");
} else { } else {
this.sapList.forEach(ele => { this.sapList.forEach(ele => {
ele.ERFMG = (val * (ele.quantity / this.totalNum)).toFixed(2); if (ele.coproduct == "Y") {
ele.ERFMG = val;
} else {
ele.ERFMG = (val * (ele.quantity / this.totalNum)).toFixed(2);
}
ele.COPRODUCT = ele.coproduct;
}) })
} }
// } // }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
<ContentLoadingMore class="cardbox" :list='chargaArr'> <ContentLoadingMore class="cardbox" :list='chargaArr'>
<scroll-view scroll-y="true" style="height: 680rpx;"> <scroll-view scroll-y="true" style="height: 680rpx;">
<view class="cardContent" v-for="(item, index) in chargaArr"> <view class="cardContent" v-for="(item, index) in chargaArr" :key="index">
<PutwayItem :item='item' :list='chargaArr' @delGonds="delGonds" /> <PutwayItem :item='item' :list='chargaArr' @delGonds="delGonds" />
</view> </view>
</scroll-view> </scroll-view>
......
<template> <template>
<view class="lists"> <view class="lists">
<StickyNavBar> <StickyNavBar>
<NavBar title="发货下架"></NavBar> <NavBar title="发货下架"></NavBar>
<FactorySelect v-model="lgort" :options="options" /> <FactorySelect v-model="lgort" :options="options" />
<view class="btn"> <view class="btn">
<uni-easyinput <uni-easyinput class="boxSelect" prefixIcon="search" v-model.trim="vbeln" placeholder="请扫描交货单"
class="boxSelect" @confirm="handleConfirm"></uni-easyinput>
prefixIcon="search" <uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model.trim="wxparams" :focus="isFocus"
v-model.trim="vbeln" placeholder="请扫描产品包装条码/外箱码" @confirm="handleConfirmPlnr"></uni-easyinput>
placeholder="请扫描交货单" </view>
@confirm="handleConfirm" <!-- <view class="total" v-show="goodsList && goodsList.length > 0">
></uni-easyinput>
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model.trim="wxparams"
:focus="isFocus"
placeholder="请扫描产品包装条码/外箱码"
@confirm="handleConfirmPlnr"
></uni-easyinput>
</view>
<!-- <view class="total" v-show="goodsList && goodsList.length > 0">
<view class="left">明细</view> <view class="left">明细</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 in goodsList" :key="item.PLNR"> <view class="cardContent" v-for="item in goodsList" :key="item.PLNR">
<scanningList :item="item" :list="item.ZPLDT" /> <scanningList :item="item" :list="item.ZPLDT" />
</view> </view>
</view> </view>
</ContentLoadingMore> </ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view> </view>
</template> </template>
<script> <script>
import BottomBtn from "@/components/BottomBtn/index.vue"; import BottomBtn from "@/components/BottomBtn/index.vue";
import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue"; import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
import scanningList from "../salesOutbound/scanningList.vue"; import scanningList from "../salesOutbound/scanningList.vue";
import StickyNavBar from "@/components/StickyNavBar/index.vue"; import StickyNavBar from "@/components/StickyNavBar/index.vue";
import { parseTime } from "@/utils/ruoyi"; import {
parseTime
} from "@/utils/ruoyi";
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
scanningList, scanningList,
BottomBtn, BottomBtn,
}, },
data() { data() {
return { return {
wxparams: "", wxparams: "",
lgort: "", lgort: "",
vbeln: "", vbeln: "",
isDisabled: false, isDisabled: false,
isFocus: false, isFocus: false,
goodsList: [], goodsList: [],
options: [ options: [{
{ WERKS: "1000",
WERKS: "1000", LGORT: "S000",
LGORT: "S000", LGOBE: "发运仓",
LGOBE: "发运仓", label: "S000-发运仓",
label: "S000-发运仓", value: "S000",
value: "S000", }, ],
}, pls: [], // 已经扫码的pl号
], btnArr: [{
pls: [], // 已经扫码的pl号 style: "",
btnArr: [ type: "warning",
{ text: "返回",
style: "", way: "goBack",
type: "warning", },
text: "返回", {
way: "goBack", style: "",
}, type: "primary",
{ text: "提交",
style: "", way: "goSubmit",
type: "primary", },
text: "提交", ],
way: "goSubmit", };
}, },
], computed: {
}; /**
}, * 缓存的扫描过的pl条目
computed: { */
/** catchPL() {
* 缓存的扫描过的pl条目 return this.vuex_sales_outbound[this.vbeln] || null;
*/ },
catchPL() { },
return this.vuex_sales_outbound[this.vbeln] || null; methods: {
}, handleConfirmPlnr(e) {
}, if (!e) return;
methods: { this.isFocus = false;
handleConfirmPlnr(e) { console.log(this.pls, "this.pls");
if (!e) return; if (this.pls.includes(e)) {
this.isFocus = false; return this.$u.toast("请勿重复扫描!");
console.log(this.pls, "this.pls"); }
if (this.pls.includes(e)) { this.getPlnr(e);
return this.$u.toast("请勿重复扫描!"); },
} getPlnr(plnr) {
this.getPlnr(e); if (!this.goodsList.length) {
}, return this.$u.toast("请先扫描交货单!");
getPlnr(plnr) { }
if (!this.goodsList.length) { let params = {
return this.$u.toast("请先扫描交货单!"); ztype: "005",
} };
let params = { plnr.startsWith('B') ? (params.ZCODE = plnr) : (params.PLNR = plnr)
ztype: "005", this.$u.api.sapApi.sapBlpl(params).then((res) => {
}; if (res && res.MSG[0].TYPE === "S") {
plnr.startsWith('B') ? (params.ZCODE = plnr) :(params.PLNR = plnr) this.setSalesBoundPL(res.BLPL);
this.$u.api.sapApi.sapBlpl(params).then((res) => { } else {
if (res && res.MSG[0].TYPE === "S") { this.$u.toast(res.MSG[0].MESSAGE);
this.setSalesBoundPL(res.BLPL); }
} else { setTimeout(() => {
this.$u.toast(res.MSG[0].MESSAGE); this.isFocus = true;
} this.isDisabled = false;
setTimeout(() => { this.wxparams = "";
this.isFocus = true; }, 1000);
this.isDisabled = false; this.loading = false;
this.wxparams = ""; });
}, 1000); },
this.loading = false; setSalesBoundPL(pls) {
}); console.log(pls, "pls");
}, // 循环BLPL合并相同的物料号和size
setSalesBoundPL(pls) { pls.forEach((ele) => {
console.log(pls, "pls"); if (!this.pls.includes(ele.PLNR) || !this.pls.includes(ele.ZCODE)) {
// 循环BLPL合并相同的物料号和size ele.PLNR && this.pls.push(ele.PLNR);
pls.forEach((ele) => { ele.ZCODE && this.pls.push(ele.ZCODE);
if (!this.pls.includes(ele.PLNR) || !this.pls.includes(ele.ZCODE)) { }
ele.PLNR && this.pls.push(ele.PLNR); ele.TOMNG = ele.PACMG;
ele.ZCODE && this.pls.push(ele.ZCODE); const item = this.goodsList.find(
} (v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
ele.TOMNG = ele.PACMG; );
const item = this.goodsList.find( if (item) {
(v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR if (Reflect.has(item, "ZPLDT")) {
); item.ZPLDT.push(ele);
if (item) { } else {
if (Reflect.has(item, "ZPLDT")) { this.$set(item, "ZPLDT", [ele]);
item.ZPLDT.push(ele); }
} else { }
this.$set(item, "ZPLDT", [ele]); });
} },
} initGoodsList(arr, VBELN) {
}); // 有SIZE行就取ZINSNUM+ZLOSSC,没有SIZE行的就是取交货单行的LFIMG
}, arr.forEach((ele) => {
initGoodsList(arr, VBELN) { if (ele.ZSIZE.length) {
// 有SIZE行就取ZINSNUM+ZLOSSC,没有SIZE行的就是取交货单行的LFIMG this.goodsList.push(
arr.forEach((ele) => { ...ele.ZSIZE.map((item) => {
if (ele.ZSIZE.length) { return {
this.goodsList.push( KDAUF: ele.KDAUF,
...ele.ZSIZE.map((item) => { KDPOS: ele.KDPOS,
return { LFIMG: ele.LFIMG,
KDAUF: ele.KDAUF, MEINS: ele.MEINS,
KDPOS: ele.KDPOS, WERKS: ele.WERKS,
LFIMG: ele.LFIMG, ...item,
MEINS: ele.MEINS, KUNNR: ele.KUNNR,
WERKS: ele.WERKS, NAME1: ele.NAME1,
...item, WADAT: ele.WADAT,
KUNNR: ele.KUNNR, XSNUM: ele.XSNUM,
NAME1: ele.NAME1, MATNR: ele.MATNR,
WADAT: ele.WADAT, MAKTX: ele.MAKTX,
XSNUM: ele.XSNUM, VBELN: VBELN,
MATNR: ele.MATNR, POSNR: ele.POSNR,
MAKTX: ele.MAKTX, ZPLDT: [],
VBELN: VBELN, sumNum: item.ZINSNUM + item.ZLOSSC,
POSNR: ele.POSNR, };
ZPLDT: [], })
sumNum: item.ZINSNUM + item.ZLOSSC, );
}; } else {
}) ele.ZSIZE = "";
); ele.sumNum = ele.LFIMG;
} else { ele.ZPLDT = []
ele.ZSIZE = ""; // ele.ZINSNUM = ele.LFIMG;
ele.sumNum = ele.LFIMG; this.goodsList.push(ele);
ele.ZPLDT = [] this.$u.toast(`物料编号:${ele.MATNR}--没有尺码信息`);
// ele.ZINSNUM = ele.LFIMG; }
this.goodsList.push(ele); });
this.$u.toast(`物料编号:${ele.MATNR}--没有尺码信息`); },
} handleConfirm(VBELN) {
}); this.$u.api.sapApi
}, .sapSchDn({
handleConfirm(VBELN) { VBELN,
this.$u.api.sapApi })
.sapSchDn({ .then((res) => {
VBELN, this.initGoodsList(res.BKDT, VBELN);
}) setTimeout(() => {
.then((res) => { this.vbeln = "";
this.initGoodsList(res.BKDT, VBELN); }, 1000);
setTimeout(() => { });
this.vbeln = ""; },
}, 1000); deleGonds(index) {
}); this.goodsList.splice(index, 1);
}, },
deleGonds(index) { reset() {
this.goodsList.splice(index, 1); setTimeout(() => {
}, this.isFocus = true;
reset() { this.isDisabled = false;
setTimeout(() => { this.wxparams = "";
this.isFocus = true; }, 1000);
this.isDisabled = false; },
this.wxparams = ""; goBack() {
}, 1000); uni.navigateBack();
}, },
goBack() { getBtnHandle(row) {
uni.navigateBack(); console.log("getBtnHandle", row);
}, this[row.way]();
getBtnHandle(row) { },
console.log("getBtnHandle", row); // 提交
this[row.way](); goSubmit() {
}, // console.log(this.goodsList, '--------');
// 提交 // return
goSubmit() { if (!this.goodsList.length) {
// console.log(this.goodsList, '--------'); return this.$u.toast("请先扫描交货单!");
// return }
if (!this.goodsList.length) { if (!this.lgort) {
return this.$u.toast("请先扫描交货单!"); return this.$u.toast("请选择目标仓位");
} }
if (!this.lgort) { const arr = this.goodsList.reduce((acc, cur) => {
return this.$u.toast("请选择目标仓位"); acc.push(
} ...cur.ZPLDT.map((item) => {
const arr = this.goodsList.reduce((acc, cur) => { item.LGORT = this.lgort;
acc.push( item.VBELN = cur.VBELN;
...cur.ZPLDT.map((item) => { item.POSNR = cur.POSNR;
item.LGORT = this.lgort; return item;
item.VBELN = cur.VBELN; })
item.POSNR = cur.POSNR; );
return item; return acc;
}) }, []);
); // const arr = this.goodsList.map((item) => {
return acc; // item.LGORT = this.lgort
}, []); // item.VBELN = this.vbeln
// const arr = this.goodsList.map((item) => { // return item
// item.LGORT = this.lgort // })
// item.VBELN = this.vbeln this.$u.api.sapApi.sapCasePlnr2(arr).then((res) => {
// return item const flag = res.some((item) => {
// }) const b = item.TYPE == "E";
this.$u.api.sapApi.sapCasePlnr2(arr).then((res) => { if (b) {
const flag = res.some((item) => { this.$u.toast(item.MESSAGE);
const b = item.TYPE == "E"; }
if (b) { return b;
this.$u.toast(item.MESSAGE); });
} if (!flag) {
return b; this.$u.toast(res[0].MESSAGE);
}); this.goodsList = [];
if (!flag) { }
this.$u.toast(res[0].MESSAGE); });
this.goodsList = []; },
} },
}); };
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.lists { .lists {
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
} }
page { page {
background: #f8f8f8; background: #f8f8f8;
} }
/deep/ .u-sticky { /deep/ .u-sticky {
top: 0 !important; top: 0 !important;
background: #fff; background: #fff;
} }
.btn { .btn {
padding: 20rpx; padding: 20rpx;
background: #fff; background: #fff;
.boxSelect { .boxSelect {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
.contentMore { .contentMore {
margin: 20rpx; margin: 20rpx;
} }
.cardbox {
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent { .cardbox {
border-radius: 8px; padding: 0rpx 20rpx;
background: #fff; margin-top: 20rpx;
margin-bottom: 20rpx; }
}
.total { .cardContent {
background: #fff; border-radius: 8px;
color: #000; background: #fff;
padding: 0rpx 40rpx; margin-bottom: 20rpx;
display: flex; }
justify-content: space-between;
font-size: 32rpx;
.line { .total {
margin: 0px 10rpx; background: #fff;
} color: #000;
} padding: 0rpx 40rpx;
</style> display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
</style>
\ No newline at end of file
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