<template>
|
<view class="">
|
<cu-custom bgColor="bg-white" :isBack="true">
|
<block slot="backText">
|
</block>
|
<block slot="content">呼叫空托</block>
|
</cu-custom>
|
<view class="flex justify-end align-center padding_right30rpx padding_top12rpx">
|
<text class="fontSize12rpx"> 操作人:{{operator}} </text>
|
</view>
|
<modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
|
<view class="">
|
<u-form labelPosition="top" :model="warehouse" ref="warehouseRef">
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10" @tap="getVehicleType">
|
<u-form-item label="容器类型:" prop="tray" required
|
style="font-size: 16px;font-weight: bold;padding: 0;">
|
<text class="padding_left30rpx fontSize32rpx" :class="warehouse.tray?'':'text-80'"
|
style="font-weight: bolder;">{{warehouse.tray?warehouse.tray:'请选择容器类型'}}</text>
|
<u-select v-model="modalshow" :list="wolist" @confirm="confirm"></u-select>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon name="arrow-down" class="padding_left30rpx"></u-icon>
|
</u-col>
|
</u-row>
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10">
|
<u-form-item label="容器数量:" prop="num" required
|
style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;">
|
<input v-model="warehouse.num" type="number" @focus="focu=true" @blur="clear"
|
placeholder="请输入容器数量" class="width"
|
style="font-weight: bolder;margin-left: 30rpx;margin-top: 16rpx;">
|
</input>
|
<u-icon name="close-circle-fill" color="#848484" v-if="warehouse.num && focu"
|
@click="warehouse.num=''"></u-icon>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon class="padding_left30rpx " name="arrow-down"></u-icon>
|
</u-col>
|
</u-row>
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10" @tap="getCollect">
|
<u-form-item label="目标位置:" prop="locaddr" required
|
style="font-size: 16px;font-weight: bold;padding: 0;">
|
<text class="padding_left30rpx fontSize32rpx" :class="warehouse.locaddr?'':'text-80'"
|
style="font-weight: bolder">{{warehouse.locaddr?warehouse.locaddr:'请选择目标位置'}}</text>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon class="padding_left30rpx " name="arrow-down"></u-icon>
|
</u-col>
|
</u-row>
|
</u-form>
|
</view>
|
<u-popup v-model="bottomshow" mode="bottom" border-radius="14">
|
<view>
|
<cu-custom bgColor="bg-white" :isBack="false">
|
<block slot="backText">
|
</block>
|
<block slot="content">选择目标位置</block>
|
</cu-custom>
|
<view class="width flex justify-around flex-wrap">
|
<view class="width30 radius margin_top20rpx" v-for="(item,eindex) in addrlist"
|
@tap="addtap(item,eindex)" :key='eindex'>
|
<view
|
class="width flex align-center padding20_0 justify-center text_align_center height56rpx padding5_10 fontSize36rpx"
|
:class="active==eindex?'bg-f18202':'color_f18202 border_1989FA' ">
|
<text class="text_overflow text-bold ">{{item.value}}</text>
|
</view>
|
</view>
|
</view>
|
|
<view class="flex">
|
<button class="width45 margin_top40rpx margin_bottom30rpx bg-grey" @tap="bottomRest">取消</button>
|
<button class=" width45 margin_top40rpx margin_bottom30rpx bg-f18202" @tap="bottomSub">确认</button>
|
</view>
|
</view>
|
</u-popup>
|
<button-modal :subShow='true' garmenTitle='呼叫空托' @submit='call' @reset='rest' />
|
|
</view>
|
</template>
|
|
<script>
|
import ButtonModal from '../../components/buttonModal.vue'
|
import ModalCode from '../../components/ModalCode.vue'
|
import {
|
getCallTray,
|
getContainerTypes,
|
getCollect
|
} from '../../api/putIn/callTray.js'
|
export default {
|
data() {
|
return {
|
rescode: 0,
|
resmessage: "",
|
wolist: [{
|
key: '1205',
|
value: '江'
|
},
|
{
|
key: '24432',
|
value: '湖'
|
}
|
],
|
warehouse: {
|
tray: '', //载具类型
|
num: "", //载具数量
|
locaddr: '' //目标位置
|
},
|
focu: false, //清空按钮隐显
|
show: false,
|
modalshow: false,
|
bottomshow: false,
|
addrlist: [],
|
value: '',
|
active: -1,
|
// flag: false,
|
vehiclelist: [], //载具参数
|
storehouselist: [], //目标位置参数
|
warehouseRules: {
|
tray: [{
|
required: true,
|
message: '容器类型不能为空',
|
trigger: 'blur'
|
}],
|
num: [{
|
required: true,
|
message: '容器数量不能为空',
|
trigger: 'blur'
|
}],
|
locaddr: [{
|
required: true,
|
message: '目标位置不能为空',
|
trigger: 'blur'
|
}]
|
},
|
trayRules: {
|
tray: [{
|
required: true,
|
message: '容器类型不能为空',
|
trigger: 'blur'
|
}],
|
},
|
numRules: {
|
num: [{
|
required: true,
|
message: '容器数量不能为空',
|
trigger: 'blur'
|
}]
|
},
|
locaddrRules: {
|
locaddr: [{
|
required: true,
|
message: '目标位置不能为空',
|
trigger: 'blur'
|
}]
|
},
|
operator: ''
|
}
|
},
|
components: {
|
ButtonModal,
|
ModalCode
|
},
|
onReady() {},
|
mounted() {
|
this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
|
},
|
methods: {
|
//载具类型
|
getVehicleType() {
|
getContainerTypes({
|
WareContainerType: ""
|
}).then((res) => {
|
if (res.code == 200) {
|
if (res.data.length == 0) {
|
this.rescode = 400
|
this.resmessage = '暂无数据'
|
this.$refs.resmodal.show = true
|
return
|
}
|
this.wolist = res.data
|
this.wolist.forEach((item, index) => {
|
item.label = `${item.TypeName}(${item.Sums})`
|
item.value = index + 1
|
})
|
this.modalshow = true
|
} else {
|
uni.showModal({
|
title: '提示',
|
content: res.message,
|
showCancel: false,
|
});
|
}
|
})
|
},
|
// 注意返回值为一个数组,单列时取数组的第一个元素即可(只有一个元素)
|
confirm(e) {
|
let index = e[0].value - 1
|
this.vehiclelist = this.wolist[index]
|
// this.warehouse.locaddr = e[0].label
|
this.warehouse.tray = e[0].label
|
this.$refs.warehouseRef.setRules(this.trayRules)
|
this.$refs.warehouseRef.validate(valid => {})
|
},
|
clear() {
|
setTimeout(() => {
|
this.focu = false
|
}, 200)
|
this.$refs.warehouseRef.setRules(this.numRules)
|
this.$refs.warehouseRef.validate(valid => {})
|
},
|
//目标位置
|
getCollect() {
|
getCollect().then((res) => {
|
if (res.code == 200) {
|
this.addrlist = res.data
|
} else {
|
uni.showModal({
|
title: '提示',
|
content: res.message,
|
showCancel: false,
|
});
|
}
|
})
|
this.bottomshow = true
|
},
|
//选择目标位置
|
addtap(val, index) {
|
this.active = index
|
this.warehouse.locaddr = val.value
|
this.storehouselist = val
|
this.$refs.warehouseRef.setRules(this.locaddrRules)
|
this.$refs.warehouseRef.validate(valid => {})
|
},
|
//目标位置取消
|
bottomRest() {
|
this.active = -1
|
this.bottomshow = false
|
},
|
//目标位置确认
|
bottomSub() {
|
this.active = -1
|
this.bottomshow = false
|
},
|
//重置
|
rest() {
|
this.warehouse.tray = ''
|
this.warehouse.num = ''
|
this.warehouse.locaddr = ''
|
},
|
//呼叫容器
|
call() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
this.$refs.warehouseRef.validate(valid => {
|
if (valid) {
|
let params = {
|
vehicleKey: this.vehiclelist.key,
|
vehicleValue: this.vehiclelist.label,
|
num: this.warehouse.num,
|
storehouseKey: this.storehouselist.key,
|
storehouseName: this.storehouselist.value
|
}
|
getCallTray(params).then((res) => {
|
this.$refs.resmodal.show = true
|
this.rescode = res.code
|
this.resmessage = res.message
|
if (res.code == 200) {
|
this.rest()
|
}
|
})
|
|
} else {}
|
})
|
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.text-80 {
|
color: #808080;
|
}
|
</style>
|