Commit e8309f3d authored by 何远江's avatar 何远江

添加解除装箱功能

parent 05e17ab6
<template> <template>
<view class="lists"> <view class="lists">
<StickyNavBar :class="{'meteringTab':current === 1}"> <StickyNavBar :class="{'meteringTab':current !== 0}">
<NavBar title="装箱"></NavBar> <NavBar title="装箱"></NavBar>
<view class="selectSheet"> <view class="selectSheet">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs> <u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
</view> </view>
<!-- <view class="headerTitle">
<view class="items">箱号:{{ orderBoxNum }}</view>
</view> -->
<view class="" v-if="current === 0"> <view class="" v-if="current === 0">
<view class="btn"> <view class="btn">
<view class="boxSelect"> <view class="boxSelect">
...@@ -32,6 +29,7 @@ ...@@ -32,6 +29,7 @@
</StickyNavBar> </StickyNavBar>
<relationships v-show="current === 0" :list="goodsList" @deleGonds="deleGonds" /> <relationships v-show="current === 0" :list="goodsList" @deleGonds="deleGonds" />
<metering v-show="current === 1" :form="form" /> <metering v-show="current === 1" :form="form" />
<unpacking v-show="current === 2" />
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" v-if="current === 0"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" v-if="current === 0"></BottomBtn>
</view> </view>
</template> </template>
...@@ -42,6 +40,7 @@ ...@@ -42,6 +40,7 @@
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from '@/components/BottomBtn/index.vue';
import relationships from './relationships.vue'; import relationships from './relationships.vue';
import metering from './metering.vue'; import metering from './metering.vue';
import unpacking from './unpacking.vue';
import { import {
parseTime parseTime
} from "@/utils/ruoyi"; } from "@/utils/ruoyi";
...@@ -52,7 +51,8 @@ ...@@ -52,7 +51,8 @@
ContentLoadingMore, ContentLoadingMore,
BottomBtn, BottomBtn,
relationships, relationships,
metering metering,
unpacking
}, },
data() { data() {
return { return {
...@@ -62,9 +62,10 @@ ...@@ -62,9 +62,10 @@
border: true, border: true,
list: [{ list: [{
name: '装箱关联' name: '装箱关联'
}, },{
{
name: '计量称重' name: '计量称重'
},{
name: '解除装箱'
} }
], ],
current: 0, current: 0,
......
<template>
<view>
<view class="btn">
<uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model="wxparams" :focus="isFocus"
placeholder="请扫描产品包装条码/外箱码" @input="handleInputPlnr"></uni-easyinput>
<view class="title">
<text>明细</text>
</view>
</view>
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
<view class="listItemTitle">
<view>
<view class="item">PL号:{{ item }}</view>
</view>
<u-button size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
</view>
</view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view>
</template>
<script>
import BottomBtn from '@/components/BottomBtn/index.vue';
import { parseTime} from "@/utils/ruoyi";
export default {
components: {
BottomBtn
},
data() {
return {
isFocus: false,
isDisabled: false,
wxparams: "",
goodsList: [],
btnArr: [{
style: '',
type: 'warning',
text: '返回',
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
way: 'goSubmit'
}
],
};
},
methods: {
handleInputPlnr(e) {
this.isFocus = false;
this.isDisabled = true;
if (this.goodsList.some((item) => item === e)) {
this.$u.toast('已经存在当前条码');
this.reset()
return
}
e && this.goodsList.push(e)
this.reset()
},
deleGonds(index) {
this.goodsList.splice(index, 1)
},
reset() {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
this.wxparams = ''
}, 1000);
},
getBtnHandle(row) {
console.log('getBtnHandle', row);
this[row.way]();
},
// 提交
goSubmit() {
if (!this.goodsList.length) {
return this.$u.toast('请添加需要解除装箱的箱条码/外箱码')
}
const DATUM = parseTime(new Date(),'{y}{m}{d}'),
UNAME = this.vuex_user.nickName,
UZEIT = parseTime(new Date(),'{h}{i}{s}');
const arr = this.goodsList.map((item) => {
return {
plnr: item,
UPDKZ: 'D',
DATUM,
UNAME,
UZEIT,
}
})
this.$u.api.sapApi
.sapCasePlnr(arr)
.then((res) => {
const flag = res.some((item) => {
const b = item.TYPE == 'E'
if (b) {
this.$u.toast(item.MESSAGE)
}
return b
})
if (!flag) {
this.$u.toast(res[0].MESSAGE);
this.goodsList = []
}
})
},
goBack() {}
},
};
</script>
<style scoped lang='scss'>
.btn {
padding: 10rpx 20rpx;
background: #fff;
.title {
margin-top: 10rpx;
color: #000;
font-size: 34rpx;
}
}
.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;
}
}
</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