Commit 05e17ab6 authored by 何远江's avatar 何远江

装箱添加弹窗信息

parent 79a4011a
......@@ -8,21 +8,18 @@
<!-- <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="boxSelect">
<u-picker v-model="show" mode="selector" :default-selector="[0]" range-key="text" :range="actionSheetList" @confirm="actionSheetCallback"></u-picker>
<u-input v-model="form.ZZXFS" placeholder="请选择装箱方式" type="select" :border="true" @click="show = true" />
<u-picker v-model="show" mode="selector" :default-selector="[0]" range-key="text"
:range="actionSheetList" @confirm="actionSheetCallback"></u-picker>
<u-input v-model="form.ZZXFS" placeholder="请选择装箱方式" type="select" :border="true"
@click="show = true" />
</view>
<uni-easyinput prefixIcon="search" class="topSearch" v-model="blNum" focus placeholder="请扫描箱码" @change="handleInputNlpla" :disabled="form.ZZXFS === 'PL'"></uni-easyinput>
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描产品包装条码/外箱码"
@input="handleInputPlnr"
></uni-easyinput>
<uni-easyinput prefixIcon="search" class="topSearch" v-model="blNum" focus placeholder="请扫描箱码"
@change="handleInputNlpla" :disabled="form.ZZXFS === 'PL'"></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>
......@@ -33,21 +30,23 @@
</view>
</view>
</StickyNavBar>
<relationships v-show="current === 0" :list="goodsList" @deleGonds="deleGonds"/>
<metering v-show="current === 1" :form="form"/>
<relationships v-show="current === 0" :list="goodsList" @deleGonds="deleGonds" />
<metering v-show="current === 1" :form="form" />
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" v-if="current === 0"></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 relationships from './relationships.vue';
import metering from './metering.vue';
import { parseTime} from "@/utils/ruoyi";
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
import relationships from './relationships.vue';
import metering from './metering.vue';
import {
parseTime
} from "@/utils/ruoyi";
export default {
export default {
components: {
StickyNavBar,
ContentLoadingMore,
......@@ -61,8 +60,7 @@ export default {
type: 'select',
show: false,
border: true,
list: [
{
list: [{
name: '装箱关联'
},
{
......@@ -71,8 +69,7 @@ export default {
],
current: 0,
status: 'loadmore',
btnArr: [
{
btnArr: [{
style: '',
type: 'warning',
text: '返回',
......@@ -91,8 +88,7 @@ export default {
isDisabled: false,
orderBoxNum: '',
show: false,
actionSheetList: [
{
actionSheetList: [{
text: 'BL+PL'
},
{
......@@ -125,48 +121,61 @@ export default {
// }
// },
methods: {
goSubmit(){
if(this.goodsList.length === 0){
goSubmit() {
if (this.goodsList.length === 0) {
this.$u.toast('暂无提交数据');
return
}
if(!this.blNum){
if (!this.blNum) {
this.$u.toast('请扫描箱码');
return
}
if(!this.form.long || !this.form.wide || !this.form.high || !this.form.brgew ||!this.form.zxntgew ){
this.$u.toast('请填写体积和重量');
return
if (!this.form.long || !this.form.wide || !this.form.high || !this.form.brgew || !this.form.zxntgew) {
uni.showModal({
title: '提示',
content: '还未填写计量称重信息!是否继续提交?',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
this.subRequest()
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
this.subRequest()
}
},
// 请求发送
subRequest() {
const arr = []
this.goodsList.forEach(ele => {
arr.push(
{
arr.push({
plnr: ele,
...this.form,
zxspe: this.form.long +'*'+ this.form.wide +'*'+ this.form.high,
zxvolum: (this.form.long * this.form.wide*this.form.high)/1000000,
ntgew: (this.form.brgew-0) - (this.form.zxntgew-0),
zxspe: this.form.long + '*' + this.form.wide + '*' + this.form.high,
zxvolum: (this.form.long * this.form.wide * this.form.high) / 1000000,
ntgew: (this.form.brgew - 0) - (this.form.zxntgew - 0),
zcode: this.form.ZZXFS === 'PL' ? '' : this.blNum,
datum: parseTime(new Date(),'{y}{m}{d}'),
uzeit: parseTime(new Date(),'{h}{i}{s}'),
}
)
datum: parseTime(new Date(), '{y}{m}{d}'),
uzeit: parseTime(new Date(), '{h}{i}{s}'),
})
});
this.$u.api.sapApi
.sapCasePlnr(arr)
.then((res) => {
if(!Array.isArray(res)){
if (!Array.isArray(res)) {
return
}
if (res.every((item) => item.TYPE === 'S')) {
this.$u.toast(res[0].MESSAGE);
setTimeout(()=>{
setTimeout(() => {
this.goBack()
},1000)
}, 1000)
}
const foundObject = res.find(item => item.TYPE === 'E');
if(foundObject && foundObject.MESSAGE){
if (foundObject && foundObject.MESSAGE) {
this.$u.toast(foundObject.MESSAGE);
}
});
......@@ -175,10 +184,10 @@ export default {
deleGonds(idx) {
this.goodsList.splice(idx, 1);
},
handleInputNlpla(e){
console.log(`output->e`,e)
handleInputNlpla(e) {
console.log(`output->e`, e)
},
reset(){
reset() {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
......@@ -199,7 +208,7 @@ export default {
// 点击actionSheet回调
actionSheetCallback(index) {
this.form.ZZXFS = this.actionSheetList[index].text;
if(this.form.ZZXFS === 'PL'){
if (this.form.ZZXFS === 'PL') {
this.blNum = ''
}
},
......@@ -219,55 +228,67 @@ export default {
this.current = index;
}
}
};
};
</script>
<style lang="scss" scoped>
.selectSheet {
.selectSheet {
border-bottom: 1px solid #ccc;
}
/deep/ .u-sticky {
}
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.contentMore {
}
.contentMore {
margin: 20rpx;
}
page {
}
page {
background: #f8f8f8;
}
.headerTitle{
}
.headerTitle {
padding: 20rpx;
font-weight: 600;
.items{
.items {
line-height: 40rpx;
}
}
.btn {
}
.btn {
padding: 20rpx;
background: #fff;
.boxSelect {
margin-bottom: 20rpx;
}
}
.total {
}
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
.meteringTab{
}
.meteringTab {
// height: 200rpx;
/deep/.u-sticky-wrap{
height: 170rpx!important;
/deep/.u-sticky-wrap {
height: 170rpx !important;
}
}
}
.topSearch{
.topSearch {
margin-bottom: 20rpx;
}
}
</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