You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.7 KiB
85 lines
1.7 KiB
<style lang="scss" scoped>
|
|
.dPicker.u-popup{
|
|
.u-popup__content{
|
|
&>.btns{
|
|
display:flex;
|
|
justify-content: space-between;
|
|
padding:10rpx;
|
|
align-items: center;
|
|
&>button{
|
|
flex-shrink: 0;
|
|
}
|
|
}
|
|
|
|
picker-view{
|
|
height:500rpx;
|
|
&/deep/ .mask{
|
|
height:60rpx;
|
|
}
|
|
&/deep/ .item{
|
|
height:60rpx;
|
|
line-height: 60rpx;
|
|
display:flex;
|
|
align-items: center;
|
|
padding:0 20rpx;
|
|
text{
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
<template>
|
|
<u-popup class="dPicker" :show="show" @close="show=false">
|
|
<view class="btns">
|
|
<button class="cu-btn sm" @click="show=false">取消</button>
|
|
<button class="cu-btn sm bg-green" @click="$emit('select',list[sureVal]);show=false">确定</button>
|
|
</view>
|
|
<picker-view :value="[value]" indicator-class="mask" @change="changeVal=$event.detail.value[0]">
|
|
<picker-view-column>
|
|
<view class="item" v-for="(v,k) in list" :key="k">
|
|
<text style="margin-left:10rpx;font-weight:bold;">剩余{{v.number}}{{v.packgeUnit}}</text>
|
|
<text style="font-size:24rpx;color:#999;">({{v.specDescribe}})</text>
|
|
<text style="margin-left:auto;color:#999;">{{new Date(v.operateTime).format('yyyy-MM-dd')}}</text>
|
|
</view>
|
|
</picker-view-column>
|
|
</picker-view>
|
|
</u-popup>
|
|
</template>
|
|
<script>
|
|
import {dataType} from 'black-knight/lib/config/tools'
|
|
export default{
|
|
props:{
|
|
value:{
|
|
type:Number,
|
|
default:0
|
|
},
|
|
list:{
|
|
type:Array,
|
|
default:()=>[]
|
|
},
|
|
},
|
|
data(){
|
|
return{
|
|
show:false,
|
|
changeVal:null,
|
|
}
|
|
},
|
|
computed:{
|
|
sureVal(){
|
|
return dataType(this.changeVal,'number')?this.changeVal:this.value
|
|
}
|
|
},
|
|
watch:{
|
|
show(n){
|
|
if(!n){
|
|
this.changeVal=0
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
|
|
},
|
|
}
|
|
</script>
|
|
|