You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
2.5 KiB
Vue

2 years ago
<template>
<view class="Main">
<view class="Add">
2 years ago
<text class="AddText" @click='ClickAdd'><text class='icon'>+</text>添加</text>
2 years ago
</view>
<view class="Unit" v-for="(item,index) in form" :key='index'>
<view class="UnitBox">
<view class="title">提单号</view>
<input class="input" v-model="item.A" placeholder="请输入提单号" />
</view>
<view class="UnitBox">
<view class="title">场站</view>
<uni-data-select class='select' v-model="item.B" :localdata="range" @change="change"></uni-data-select>
</view>
<view class="bottom"></view>
</view>
<view class="buttonBox">
2 years ago
<button class="buttonBoxButton" type="default" size="mini" @click="close"></button>
<button class="buttonBoxButton" type="primary" size="mini">订阅</button>
2 years ago
</view>
</view>
</template>
<script>
2 years ago
import {
GetYaRDList
} from '../../../common/js/api/homePage/moveTrace.js'
2 years ago
export default {
data() {
return {
2 years ago
form: [{
A: '',
B: ''
2 years ago
}],
2 years ago
range: [],
2 years ago
}
},
2 years ago
mounted() {
2 years ago
GetYaRDList().then(res => {
res.value.forEach(item => {
item.value = item.code
item.text = item.name
})
this.range = res.value
2 years ago
})
},
2 years ago
methods: {
2 years ago
close() {
2 years ago
this.$emit('close')
},
2 years ago
ClickAdd() {
2 years ago
this.form.push({
2 years ago
A: '',
B: ''
2 years ago
})
},
change(e) {
2 years ago
console.log(this.form);
2 years ago
console.log("e:", e);
},
},
}
</script>
<style lang="scss" scoped>
.Main {
2 years ago
background: #f2f2f2;
height: 100%;
padding: 1rem;
margin-bottom: 1rem;
2 years ago
.Add {
width: 100%;
display: flex;
justify-content: flex-end;
color: #337ab7;
2 years ago
.AddText {
2 years ago
height: 1.5rem;
line-height: 1.5rem;
display: flex;
2 years ago
2 years ago
.icon {
display: inline-block;
height: 1.5rem;
line-height: 1.5rem;
margin-right: .3rem;
font-size: 1.5rem
}
}
}
.Unit {
.UnitBox {
display: flex;
align-items: center;
margin-top: .5rem;
.title {
width: 140rpx;
text-align: right;
}
.input {
flex: 10;
width: 400rpx;
border: 1rpx solid #DCDCDC;
min-height: 36px;
border-radius: 4px;
padding: 0 5px;
2 years ago
font-size: 14px;
2 years ago
}
.select {
flex: 10;
padding: 0;
}
}
2 years ago
.bottom {
margin-top: 1rem;
width: 100%;
border-bottom: 1rpx solid #e8e8e8;
}
2 years ago
}
2 years ago
.buttonBox {
2 years ago
display: flex;
justify-content: flex-end;
margin-top: .5rem;
width: 100%;
2 years ago
.buttonBoxButton {
2 years ago
margin: 0;
2 years ago
&:first-child {
2 years ago
margin-right: .5rem;
}
}
}
}
</style>