Commit 186cabc4 authored by 何远江's avatar 何远江

1

parent f1be7edb
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
<view class="headerTitle"> <view class="headerTitle">
<view class=""> <view class="">
<view class="items">领料申请:{{ goodsInfo.applyNo }}</view> <view class="items">领料申请:{{ goodsInfo.applyNo }}</view>
<view class="items">{{ goodsInfo.workstationCode }}/{{ <view class="items"
>{{ goodsInfo.workstationCode }}/{{
goodsInfo.workstationName goodsInfo.workstationName
}}</view> }}</view
>
<view class="items">计划日期:{{ goodsInfo.startTime }}</view> <view class="items">计划日期:{{ goodsInfo.startTime }}</view>
</view> </view>
<view class="checkedCase"> <view class="checkedCase">
...@@ -17,8 +19,14 @@ ...@@ -17,8 +19,14 @@
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model="wxparams" :focus="isFocus" <uni-easyinput
placeholder="请扫描产品包装条码/外箱码" @input="handleInputPlnr"></uni-easyinput> prefixIcon="search"
: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>
...@@ -38,15 +46,13 @@ ...@@ -38,15 +46,13 @@
</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 { import { parseTime } from "@/utils/ruoyi";
parseTime
} from "@/utils/ruoyi";
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
...@@ -62,7 +68,8 @@ ...@@ -62,7 +68,8 @@
show: true, show: true,
nlpla: "YD-02-02-3", nlpla: "YD-02-02-3",
wxparams: "", wxparams: "",
btnArr: [{ btnArr: [
{
style: "", style: "",
type: "warning", type: "warning",
text: "返回", text: "返回",
...@@ -80,12 +87,12 @@ ...@@ -80,12 +87,12 @@
isDisabled: false, isDisabled: false,
OrderNum: "", OrderNum: "",
list: [], list: [],
scanPLs: [] scanPLs: [],
}; };
}, },
computed: { computed: {
goodsInfo() { goodsInfo() {
return this.goodsList[0] || {} return this.goodsList[0] || {};
}, },
}, },
onLoad(option) { onLoad(option) {
...@@ -113,9 +120,9 @@ ...@@ -113,9 +120,9 @@
}) })
.then((res) => { .then((res) => {
if (res && res.code - 200 === 0) { if (res && res.code - 200 === 0) {
this.goodsList = res.rows.map(item => { this.goodsList = res.rows.map((item) => {
item.details = [] item.details = [];
return item return item;
}); });
} else { } else {
this.$u.toast(res.msg); this.$u.toast(res.msg);
...@@ -138,31 +145,36 @@ ...@@ -138,31 +145,36 @@
goSubmit() { goSubmit() {
// 检查是否扫描PL // 检查是否扫描PL
if (!this.scanPLs.length) { if (!this.scanPLs.length) {
return this.$u.toast('请扫描PL!'); return this.$u.toast("请扫描PL!");
} }
// 可以少发,不可以超发 // 可以少发,不可以超发
if (this.goodsList.some((item) => { if (
return item.applyNum < item.details.reduce((acc, cur) => { this.goodsList.some((item) => {
acc += cur.PACMG return (
item.applyNum <
item.details.reduce((acc, cur) => {
acc += cur.PACMG;
}, 0) }, 0)
})) { );
return this.$u.toast('检查数量是否正确!') })
) {
return this.$u.toast("检查数量是否正确!");
} }
// 获取items // 获取items
const items = this.goodsList.reduce((acc, cur) => { const items = this.goodsList.reduce((acc, cur) => {
// 添加工作中心 // 添加工作中心
acc.push(...cur.details) acc.push(...cur.details);
return acc return acc;
}, []) }, []);
const params = { const params = {
BLDAT: parseTime(new Date(), '{y}{m}{d}'), BLDAT: parseTime(new Date(), "{y}{m}{d}"),
BUDAT: parseTime(new Date(), '{y}{m}{d}'), BUDAT: parseTime(new Date(), "{y}{m}{d}"),
zencode: "A006", zencode: "A006",
TYPE: 'FL', TYPE: "FL",
ZMARK: 'A002', ZMARK: "A002",
item: items, item: items,
}; };
this.$u.api.sapApi.sapRrm([params]).then((res) => { this.$u.api.sapApi.sapRrm([params]).then((res) => {
...@@ -170,21 +182,19 @@ ...@@ -170,21 +182,19 @@
if (!Array.isArray(res)) { if (!Array.isArray(res)) {
return; return;
} }
if (res.every((item) => item.TYPE === "S")) { const errObj = res.find((item) => item.TYPE === "E");
this.handleMes(); if (errObj) {
} return this.$u.toast(errObj.MESSAGE);
const foundObject = res.find((item) => item.TYPE === "E");
if (foundObject && foundObject.MESSAGE) {
this.$u.toast(foundObject.MESSAGE);
} }
this.handleMes();
}); });
}, },
handleMes() { handleMes() {
const params = this.goodsList.map(item => { const params = this.goodsList.map((item) => {
item.windCase = this.checkedBox ? 'Y' : 'N' item.windCase = this.checkedBox ? "Y" : "N";
item.grantNum = item.details.reduce((acc, cur) => acc + cur.PACMG, 0) item.grantNum = item.details.reduce((acc, cur) => acc + cur.PACMG, 0);
return item return item;
}) });
this.$u.api.mesApi.pdaworkstationUpadteNum(params).then((res) => { this.$u.api.mesApi.pdaworkstationUpadteNum(params).then((res) => {
this.loading = false; this.loading = false;
console.log(res); console.log(res);
...@@ -200,7 +210,7 @@ ...@@ -200,7 +210,7 @@
}, },
handleInputPlnr(e) { handleInputPlnr(e) {
if (this.scanPLs.includes(e)) { if (this.scanPLs.includes(e)) {
return this.$u.toast('请勿重复扫描!') return this.$u.toast("请勿重复扫描!");
} }
e && this.getPlnr(e); e && this.getPlnr(e);
}, },
...@@ -215,13 +225,18 @@ ...@@ -215,13 +225,18 @@
.then((res) => { .then((res) => {
if (res && res.MSG[0].TYPE === "S") { if (res && res.MSG[0].TYPE === "S") {
// 相同物料 // 相同物料
const item = this.goodsList.find(v => v.sapItemCode == res.BLPL[0].MATNR) const item = this.goodsList.find(
item && item.details.push(...res.BLPL.map(v => { (v) => v.sapItemCode == res.BLPL[0].MATNR
v.ARBPL = item.workstationCode );
v.ERFMG = v.PACMG item &&
return v item.details.push(
})) ...res.BLPL.map((v) => {
item && this.scanPLs.push(plnr) v.ARBPL = item.workstationCode;
v.ERFMG = v.PACMG;
return v;
})
);
item && this.scanPLs.push(plnr);
this.reset(); this.reset();
} else { } else {
...@@ -232,33 +247,33 @@ ...@@ -232,33 +247,33 @@
}); });
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
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;
} }
} }
.bottomBtn { .bottomBtn {
position: sticky; position: sticky;
padding: 20rpx; padding: 20rpx;
display: flex; display: flex;
...@@ -270,13 +285,13 @@ ...@@ -270,13 +285,13 @@
.u-btn { .u-btn {
width: 300rpx; width: 300rpx;
} }
} }
.blue { .blue {
color: #3f9dcc; color: #3f9dcc;
} }
.total { .total {
background: #fff; background: #fff;
color: #000; color: #000;
padding: 0rpx 40rpx; padding: 0rpx 40rpx;
...@@ -287,21 +302,21 @@ ...@@ -287,21 +302,21 @@
.line { .line {
margin: 0px 10rpx; margin: 0px 10rpx;
} }
} }
.cardbox { .cardbox {
min-height: calc(100vh - 480rpx); min-height: calc(100vh - 480rpx);
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;
} }
.listItemTitle { .listItemTitle {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 20rpx; padding: 20rpx;
...@@ -321,9 +336,9 @@ ...@@ -321,9 +336,9 @@
word-break: break-all; word-break: break-all;
font-weight: 600; font-weight: 600;
} }
} }
.listBottom { .listBottom {
.bottomTitle { .bottomTitle {
height: 80rpx; height: 80rpx;
position: relative; position: relative;
...@@ -360,14 +375,14 @@ ...@@ -360,14 +375,14 @@
} }
} }
} }
} }
/deep/ .u-sticky { /deep/ .u-sticky {
top: 0 !important; top: 0 !important;
background: #fff; background: #fff;
} }
.checkedCase { .checkedCase {
margin-top: 10rpx; margin-top: 10rpx;
} }
</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