|
@@ -4,9 +4,16 @@
|
|
|
</u-navbar>
|
|
|
<view class="parking-panel">
|
|
|
<view class="panel-left">
|
|
|
- <text class="left-title">{{parkingSite.parking_name}}</text>
|
|
|
- <text class="left-txt">总车位数 {{parkingSite.total_parking_number}}</text>
|
|
|
- <view class="left-txt">普通车位数<text class="num-txt"></text> / <text class="newpower-txt">新能源车位<text class="num-txt"></text></text></view>
|
|
|
+ <view>
|
|
|
+ <text class="left-title">{{parkingSite.parking_name}}</text>
|
|
|
+ <u-icon name="edit-pen" size="32" color="#4a4a4a" style="margin-left:100rpx;padding:10rpx;" @tap="editParking"></u-icon>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="left-txt">
|
|
|
+ <text>总车位数 </text><text class="num-txt">{{parkingSite.total_parking_number}}</text>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="left-txt">剩余车位数<text class="num-txt">{{parkingSite.surplus_parking_number}}</text></view>
|
|
|
</view>
|
|
|
<image :src="parkingSite.pic_url" style="width:200rpx;height:160rpx;border-radius: 10rpx;"></image>
|
|
|
</view>
|
|
@@ -43,6 +50,13 @@
|
|
|
<u-field v-model="passNote" label="" placeholder="请填写放行说明" type="textarea" label-width="0" :auto-height="false" :field-style="{height:'140rpx'}"/>
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
+
|
|
|
+ <u-modal v-model="showEditModal" ref="editModal" title="车位数编辑" :show-cancel-button="true" :async-close="true" @confirm="submitSeat">
|
|
|
+ <view class="slot-content">
|
|
|
+ <u-field type="number" v-model="seatModel.total" label="总车位数" :label-width="150" :field-style="{'border-bottom':'1px solid #55aaff'}"/>
|
|
|
+ <u-field type="number" v-model="seatModel.idle" label="剩余车位数" :label-width="150" :field-style="{'border-bottom':'1px solid #55aaff'}"/>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -61,13 +75,61 @@
|
|
|
parkingSite:{},
|
|
|
chargeRule:{},
|
|
|
othChargeRule:[],
|
|
|
- devs:[]
|
|
|
+ devs:[],
|
|
|
+ showEditModal:false,
|
|
|
+ seatModel:{
|
|
|
+ total:null,
|
|
|
+ idle:null
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
onLoad(opt){
|
|
|
this.loadPageData(opt.park_id);
|
|
|
},
|
|
|
methods: {
|
|
|
+ editParking(){
|
|
|
+ this.showEditModal=true;
|
|
|
+ this.seatModel.total=this.parkingSite.total_parking_number;
|
|
|
+ this.seatModel.idle=this.parkingSite.surplus_parking_number;
|
|
|
+ },
|
|
|
+ closeEditModal(isClose){
|
|
|
+ if(isClose){
|
|
|
+ this.showEditModal=false;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$refs.editModal.clearLoading();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitSeat(){
|
|
|
+
|
|
|
+ api.updateParkingSeat(this.parkingSite.id,this.seatModel.total,this.seatModel.idle).then(resp=>{
|
|
|
+ if(!resp.success){
|
|
|
+ uni.showToast({
|
|
|
+ title:resp.msg||'保存数据失败',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ this.closeEditModal()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.showToast({
|
|
|
+ title:'操作成功',
|
|
|
+ icon:'success'
|
|
|
+ })
|
|
|
+ this.closeEditModal(true)
|
|
|
+
|
|
|
+ //编辑后的值设置到显示对象中,不用请求后台
|
|
|
+ this.parkingSite.total_parking_number=this.seatModel.total;
|
|
|
+ this.parkingSite.surplus_parking_number=this.seatModel.idle;
|
|
|
+
|
|
|
+ }).catch(err=>{
|
|
|
+ uni.showToast({
|
|
|
+ title:'保存数据出错',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ this.closeEditModal()
|
|
|
+ })
|
|
|
+ },
|
|
|
manualPass(channelId,channelName){
|
|
|
if(this.opening){
|
|
|
uni.showToast({
|