李书文 2 年之前
父节点
当前提交
f1a81ca54c
共有 2 个文件被更改,包括 33 次插入20 次删除
  1. 10 7
      common/common.scss
  2. 23 13
      pages/index/detail.vue

+ 10 - 7
common/common.scss

@@ -73,7 +73,7 @@
 	}
 }
 .form_group {
-	padding: 10px 15px 10px 15px;
+	padding: 10px 15px 8px 15px;
 	overflow: hidden;
 	border-bottom: 1px solid $line;
 	background-color: white;
@@ -102,12 +102,13 @@
 		width: 70%;
 		margin-top: 5px;
 		color: #909090;
+		position: relative;
 		text {
 			font-size: 15px;
 		}
 		.span {
 			float: left;
-			width: 93%;
+			width: 92%;
 			text-align: right;
 			white-space: nowrap;
 			text-overflow: ellipsis;
@@ -117,22 +118,24 @@
 			font-size: 20px;
 		}
 		.more {
-			float: right;
-			margin-top: 4px;
+			position: absolute;
+			right: -3px;
+			top: 4px;
 		}
 	}
 	picker {
-		margin-left: 106px;
 		margin-top: 5px;
+		float: right;
+		padding-left: 20px;
 	}
 	input {
 		margin-left: 20px;
 		float: left;
 		font-size: 15px;
-		margin-top: -7px;
 		border-radius: 5px;
 		padding: 10px;
-		width: 60%;
+		width: 80%;
+		margin-top: -9px;
 	}
 	textarea {
 		display: block;

+ 23 - 13
pages/index/detail.vue

@@ -11,21 +11,21 @@
 		<view class="form_group">
 			<view class="lable">标题</view>
 			<view class="tag">
-				<text class="span">{{ item.title }}</text>
+				<input v-model="item.title" placeholder="输入标题" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">申请单位/部门</view>
 			<view class="tag">
-				<text class="span">{{ item.dept }}</text>
+				<input v-model="item.dept" placeholder="输入申请单位/部门" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">试验目的</view>
 			<view class="tag">
-				<text class="span">{{ item.purpose }}</text>
+				<input v-model="item.purpose" placeholder="输入试验目的" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
@@ -33,47 +33,50 @@
 		<view class="form_group">
 			<view class="lable">申请人</view>
 			<view class="tag">
-				<text class="span">{{ item.applicant }}</text>
+				<input v-model="item.applicant" placeholder="输入申请人" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">电话</view>
 			<view class="tag">
-				<text class="span">{{ item.tel }}</text>
+				<input v-model="item.tel" placeholder="输入电话" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">试验部门</view>
 			<view class="tag">
-				<text class="span">{{ item.test_dept }}</text>
+				<input v-model="item.test_dept" placeholder="输入试验部门" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">所属项目</view>
 			<view class="tag">
-				<text class="span">{{ item.item }}</text>
+				<input v-model="item.item" placeholder="输入所属项目" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">试验类型</view>
 			<view class="tag">
-				<text class="span">
-					<text>{{ item.product }}</text>
-					/
-					<text>{{ item.experiment_type }}</text>
-				</text>
+				<view class="span">
+					<picker @change="bindChange($event, 'experiment_type')" :range="array2">
+						<view class="picks">{{ item.experiment_type ? item.experiment_type : '选择2' }}</view>
+					</picker>
+					<picker  @change="bindChange($event, 'product')" :range="array1">
+						<view class="picks">{{ item.product ? item.product : '选择1' }}</view>
+					</picker>
+				</view>
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
 		<view class="form_group">
 			<view class="lable">项目编号</view>
 			<view class="tag">
+				<input v-model="item.item_num" placeholder="输入项目编号" />
 				<text class="icon more">&#xe631;</text>
-				<text class="span">{{ item.item_num }}</text>
 			</view>
 		</view>
 		<view class="form_group">
@@ -216,6 +219,8 @@ export default {
 					items: {}
 				}
 			},
+			array1: ['类型1', '类型2', '类型3', '类型4'], //实验类型1
+			array2: ['类型2', '类型12', '类型13', '类型14'], //实验类型2
 			show: false,
 			bshow: false,
 			dshow: false,
@@ -265,6 +270,11 @@ export default {
 		});
 	},
 	methods: {
+		//选择实验类型
+		bindChange(e, type) {
+			this.item[type] = this.array1[e.target.value];
+			this.$forceUpdate();
+		},
 		//下载模板
 		download(url) {
 			const a = document.createElement('a');