Commit 0e8463fe authored by 何远江's avatar 何远江

添加工厂调拨功能

parent 4d63191e
......@@ -60,6 +60,11 @@ const install = (Vue, vm) => {
sapCasePlnr2: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr2?sap-language=ZH&sap-client=' + client, params),
// 待盘点
sapInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_inventory?sap-language=ZH&sap-client='+ client, params),
// 工厂调拨查询
sapSearchAllot: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_allot/search_allot?sap-language=ZH&sap-client='+ client, params),
// 工厂调拨下架
sapAllot: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/PDA_ALLOT_PD/ALLOT_PD?sap-language=ZH&sap-client='+ client, params),
},
mesApi:{
//生产领料查询单号
......
......@@ -89,6 +89,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/factoryTransfer/transferList",
"style": {
"navigationBarTitleText": "工厂间调拨",
"enablePullDownRefresh": false
}
},
{
"path": "pages/salesReturns/salesReturns",
"style": {
......
<template>
<view>
<StickyNavBar>
<NavBar title="工厂间调拨"></NavBar>
<view class="btn">
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描单号"
@input="handleInputPlnr"
></uni-easyinput>
</view>
</StickyNavBar>
<view class="cardBox">
<text class="cardBoxTip">
步骤一 扫描单号
</text>
<u-image class='cardBoxImg' :src="bgSrc" width="560rpx" height="400rpx"></u-image>
<view class="cardBoxTip2">
摄像头对准
</view>
<view class="cardBoxTip3">
生产发料单号二维码
</view>
<view class="cardBoxTip2">
<text class="tipLeft">
点击扫描或
</text>
<text class="tipRight">
点选单号
</text>
</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
},
data() {
return {
bgSrc: require('@/static/images/qrcode.png'),
number: 0,
totalNum: 0,
show: true,
nlpla: '',
wxparams: '',
btnArr: [
{
style: '',
type: 'primary',
text: '扫描单号',
way: 'scanning'
},
{
style: '',
type: 'warning',
text: '查询单号',
way: 'goClick'
}
],
goodsList: [],
isFocus: false,
isDisabled: false
};
},
created() {
// this.getPlnr('SN202400172');
},
methods: {
getBtnHandle(row) {
this[row.way]();
},
goClick() {
// uni.navigateTo({
// url: `/pages/productionIssuance/oddNumList`
// });
},
scanning() {
// uni.navigateTo({
// url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify(this.goodsList)}`
// });
},
handleInputPlnr(e) {
this.isFocus = false;
e && this.getPlnr(e);
},
getPlnr(applyNo) {
this.totalNum = 0;
this.isDisabled = true;
}
}
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.btn {
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
}
}
.cardBox {
min-height: calc(100vh - 400rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.cardBoxTip{
color: #000;
font-size: 28rpx;
}
.cardBoxTip2{
color: #000;
font-size: 28rpx;
text-align: center;
}
.cardBoxTip3{
color: #3f9dcc;
font-size: 28rpx;
text-align: center;
}
.tipRight{
color: #ff9900;
}
</style>
\ No newline at end of file
<template>
<view>
<StickyNavBar>
<NavBar title="工厂间调拨"></NavBar>
<view class="btn">
<uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model="wxparams" :focus="isFocus"
placeholder="请扫描单号" @input="handleInputPlnr"></uni-easyinput>
</view>
</StickyNavBar>
<view class="cardBox">
<text class="cardBoxTip"> 步骤一 扫描单号 </text>
<u-image class="cardBoxImg" :src="bgSrc" width="560rpx" height="400rpx"></u-image>
<view class="cardBoxTip2"> 摄像头对准 </view>
<view class="cardBoxTip3"> 生产发料单号二维码 </view>
<view class="cardBoxTip2">
<text class="tipLeft"> 点击扫描或 </text>
<text class="tipRight"> 点选单号 </text>
</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,
},
data() {
return {
bgSrc: require("@/static/images/qrcode.png"),
number: 0,
totalNum: 0,
show: true,
nlpla: "",
wxparams: "",
goodsList: [],
isFocus: false,
isDisabled: false,
};
},
created() {},
methods: {
handleInputPlnr(e) {
this.isFocus = false;
e && this.getPlnr(e);
},
getPlnr(e) {
this.isDisabled = true
this.$u.api.sapApi
.sapSearchAllot({
ebeln: e,
})
.then((res) => {
if (res.length == 0) {
return setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
this.wxparams = "";
this.$u.toast("未查询到数据");
}, 1000);
}
if (
!res.some((item) => {
if (item.TYPE == "E") {
this.$u.toast(item.MESSAGE);
return true;
}
return false;
})
) {
uni.navigateTo({
url: "/pages/factoryTransfer/transferList?ebeln=" + e,
});
}
});
},
},
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.btn {
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
}
}
.cardBox {
min-height: calc(100vh - 400rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.cardBoxTip {
color: #000;
font-size: 28rpx;
}
.cardBoxTip2 {
color: #000;
font-size: 28rpx;
text-align: center;
}
.cardBoxTip3 {
color: #3f9dcc;
font-size: 28rpx;
text-align: center;
}
.tipRight {
color: #ff9900;
}
</style>
<template>
<view>
<view class="listItemTitle">
<view>
<view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view>
</view>
<view class="right">
<text class="blue">{{ totalVistaNum }}</text>
<text class="line">/</text>
<text class="">{{ item.MENGE }}</text>
</view>
</view>
<view class="listBottom">
<view class="bottomTitle" @tap="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 item.details">
<view class="items">PL:{{ ele.PLNR }}</view>
<view class="items">退货库位:{{ ele.NLPLA }}</view>
<view class="items">数量:{{ ele.PACMG }}</view>
<view class="boxBtn">
<u-button class="botBtn" size="mini" type="primary" plain @click="deleGonds()">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
</view>
</view>
</view>
</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 {};
}
},
},
computed: {
totalVistaNum() {
return this.item.details.reduce((acc, cur) => acc + cur.PACMG, 0);
},
},
data() {
return {
show: true,
};
},
created() {
},
methods: {
deleGonds() {
this.$emit('deleGonds',this.item)
},
}
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.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: #000;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
}
}
.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;
word-break: break-all;
}
.plNum{
height: 80rpx;
word-break: break-all;
}
}
}
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.boxBtn{
display: flex;
justify-content: space-between;
/deep/.u-btn{
margin-right: 0 !important;
}
}
.botBtn{
}
</style>
\ No newline at end of file
<template>
<view class="page">
<StickyNavBar>
<NavBar title="工厂间调拨"></NavBar>
<view class="headerTitle">
<view class="">
<view class="items">调拨申请单号: {{ ebeln }}</view>
</view>
</view>
<view class="btn">
<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="">{{ goodsList.length }}</text>
</view>
</view>
</StickyNavBar>
<ContentLoadingMore class="cardbox" :list="goodsList">
<view class="cardContent" v-for="(item, index) in goodsList" :key="index">
<scanningList :item="item" :list="item.details" />
</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";
import scanningList from "./scanningList.vue";
import { parseTime } from "@/utils/ruoyi";
export default {
components: {
StickyNavBar,
ContentLoadingMore,
BottomBtn,
scanningList,
},
data() {
return {
wxparams: "",
ebeln: '',
catchPl: [],
btnArr: [{
style: "",
type: "warning",
text: "返回",
way: "goBack",
},
{
style: "",
type: "primary",
text: "提交",
way: "goSubmit",
},
],
goodsList: [],
isFocus: true,
isDisabled: false,
};
},
onLoad(option) {
console.log(option, 'option')
if (option.ebeln) {
this.getOrder(option.ebeln)
}
},
watch: {},
created() {},
methods: {
reset() {
setTimeout(() => {
this.wxparams = "";
this.isFocus = true;
this.isDisabled = false;
}, 1000);
},
getOrder(ebeln) {
this.ebeln = ebeln
this.$u.api.sapApi
.sapSearchAllot({
ebeln
})
.then((res) => {
this.goodsList = res.map(item => {
item.details = []
return item
})
});
},
getBtnHandle(row) {
this[row.way]();
},
goBack() {
uni.navigateBack({
delta: 1,
});
},
goSubmit() {
if (this.goodsList.length == 0) return
if (this.goodsList.some(item => item.MENGE != item.details.reduce((acc, cur) => acc + cur.PACMG, 0))){
return this.$u.toast("请确认物料数量是否正确")
}
const params = {
BLDAT: parseTime(new Date(), "{y}{m}{d}"),
lfsnr: this.ebeln,
item: this.goodsList.reduce((acc, cur) => {
acc.push(...cur.details.map(item => {
return {
...cur,
...item,
EBELN: this.ebeln,
EBELP: cur.EBELP
}
}))
return acc
}, [])
}
this.$u.api.sapApi.sapAllot(params).then(res => {
const errobj = res.find(item => item.TYPE == 'E')
if (errobj) {
return this.$u.toast(errobj.MESSAGE)
}
this.$u.toast(res[0].MESSAGE)
setTimeout(() => {
this.goBack()
}, 3000);
})
},
handleInputPlnr(e) {
if (!e) return
if (this.catchPl.length > 0) {
if (!this.catchPl.inculdes(e)) {
this.getPlnr(e);
} else {
this.reset()
this.$u.toast("请不要重复扫码")
}
return
}
this.getPlnr(e);
},
getPlnr(plnr) {
this.isDisabled = true;
this.isFocus = false;
this.$u.api.sapApi
.sapBlpl({
plnr,
ztype: "002",
})
.then((res) => {
// 验证查询PL是否成功
if (res.MSG.some(item => {
if (item.TYPE == 'E') {
this.$u.toast(item.MESSAGE)
return true
}
return false
})) {
return this.reset()
}
if (res.BLPL.length == 0) {
return this.$u.toast("未查询到该条码信息")
}
// 匹配相同物料添加进details
res.BLPL.forEach(item => {
const goods = this.goodsList.find(v => item.MATNR == v.MATNR && item.WERKS ==v.RESWK)
goods && goods.details.push(item)
})
this.reset()
});
},
},
};
</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;
}
}
.cardbox {
min-height: calc(100vh - 480rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
background: #fff;
margin-bottom: 20rpx;
}
.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;
height: 40rpx;
line-height: 40rpx;
}
}
}
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.checkedCase {
margin-top: 10rpx;
}
</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