瀏覽代碼

设备名称

zkx 2 年之前
父節點
當前提交
70f4b46367
共有 1 個文件被更改,包括 50 次插入16 次删除
  1. 50 16
      pagesFinance/user/confirmBinding.vue

+ 50 - 16
pagesFinance/user/confirmBinding.vue

@@ -10,14 +10,7 @@
 					{{obj1.deviceNo}}
 				</view>
 			</view>
-			<view class="item">
-				<view class="title">
-					设备名称
-				</view>
-				<view class="content">
-					{{obj1.name}}
-				</view>
-			</view>
+		
 			<view class="item">
 				<view class="title">
 					设备类型
@@ -72,7 +65,15 @@
 			</view>
 		</view>
 		<u-picker mode="selector" v-model="isswitchshow" :range="objlist" range-key="name" :default-selector="columnsindex" @confirm="switchBtn" ></u-picker>
-		
+		
+		<!-- <view class="item">
+			<view class="title">
+				设备名称
+			</view>
+			<view class="content">
+				{{obj1.name}}
+			</view>
+		</view> -->
 		<view class="equipment-infos">
 			<view class="item">
 				<view class="title">
@@ -81,10 +82,24 @@
 				<view class="content" style="color: #acacac;">
 					
 				<u-input v-model="stationName"
-				 :placeholder="obj2.name"
+				 :placeholder="obj2.name"
+				 @focus="focus(0)"
 				 type="text" :border="false" />
 
 				</view>
+			</view>
+			<view class="item">
+				<view class="title">
+					<text>*</text>车位号
+				</view>
+				<view class="content" style="color: #acacac;">
+					
+				<u-input v-model="deviceName"
+				 @focus="focus(1)"
+				 :placeholder="obj1.name"
+				 type="text" :border="false" />
+			
+				</view>
 			</view>
 		</view>
 		<button class="btn" @click="submit">确认绑定并激活</button>
@@ -101,7 +116,8 @@
 			return {
 				id:"",
 				obj1:{},obj2:{},
-				stationName:"",
+				stationName:"",
+				deviceName:"",
 				objlist:[],
 				isswitchshow:false,
 				columnsindex:[0],
@@ -116,7 +132,20 @@
 		onReady() {
 			
 		},
-		methods: {
+		methods: {
+			focus(k){
+				if(k==0){
+					if(!this.stationName){
+						this.stationName=this.obj2.name;
+					}
+				
+				}
+				if(k==1){
+					if(!this.deviceName){
+						this.deviceName=this.obj1.name;
+					}
+				}
+			},
 			switchBtn(e){
 				this.columnsindex=e;
 				
@@ -127,14 +156,19 @@
 			submit(){
 				if(!this.stationName){
 					this.stationName=this.obj2.name;
-				}
+				}
+				if(!this.deviceName){
+					this.deviceName=this.obj1.name;
+				}
+			
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 				API.bindCategoryDevice({
 					deviceNo:this.id,
-					stationName:this.stationName,
+					stationName:this.stationName,
+					deviceName:this.deviceName,
 					stationId:this.obj2.id
 				}).then((res) => {
 					//this.obj = res.data
@@ -196,8 +230,8 @@
 			border-bottom: solid 1px #C2C2C2;
 			font-size: 16px;
 			.title{
-				
-				margin-right: 42rpx;
+				width: 80px;
+			
 				color: #777777;
 				text{
 					color: #ee3138;