|
|
@ -2,25 +2,26 @@ |
|
|
|
<view class=""> |
|
|
|
<view class="" v-for="(item, index) in formData" :key="index"> |
|
|
|
<view class="" v-if="item.type=='inputAndSelect'"> |
|
|
|
<view class="flex uni-row u-col-center" style=" border-bottom: #9e9e9e;"> |
|
|
|
<view class=""> |
|
|
|
<view class="flex uni-row " style=" padding-left: 10rpx; border-bottom: #9e9e9e;"> |
|
|
|
<view class=" " style="margin-top: 3rpx;"> |
|
|
|
<text class="colorRed">*</text> |
|
|
|
<text class="num" style="font-size: 32rpx;">{{ index + 1 }}.</text> |
|
|
|
</view> |
|
|
|
<view class="" style="display: flex;flex-direction: column;"> |
|
|
|
<view class="uni-flex uni-column"> |
|
|
|
<view class="content"> |
|
|
|
点检部位 : {{ item.position }} |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
点检内容 : {{ item.content }} |
|
|
|
</view> |
|
|
|
<view class="methond" style="margin-bottom: 10rpx;"> |
|
|
|
点检方法 : {{item.methond}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="methond" style="margin-bottom: 10rpx; margin-left: 40rpx;"> |
|
|
|
点检方法 : {{item.methond}} |
|
|
|
</view> |
|
|
|
<view class="flex uni-row uni-center align-center"> |
|
|
|
<input class="input" :placeholder="item.placeholder" v-model="item.name" /> |
|
|
|
<input class="input" style="margin-left: 50rpx;" :placeholder="item.placeholder" |
|
|
|
v-model="item.name" /> |
|
|
|
<view class=""> |
|
|
|
<!-- <image src="../../static/icons/arrow_down.svg" style="width: 50rpx; height: 50rpx;"></image> --> |
|
|
|
<button type="primary" size="mini" @click="select(item)">选择</button> |
|
|
@ -30,9 +31,9 @@ |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" v-else> |
|
|
|
<view class="flex uni-row u-col-center" style=" border-bottom: #9e9e9e;"> |
|
|
|
<view class=""> |
|
|
|
<view class="" v-else-if="item.type=='select'"> |
|
|
|
<view class="flex uni-row" style="padding-left: 10rpx; border-bottom: #9e9e9e;"> |
|
|
|
<view class="" style="margin-top: 3rpx;"> |
|
|
|
<text class="colorRed">*</text> |
|
|
|
<text class="num" style="font-size: 32rpx;">{{ index + 1 }}.</text> |
|
|
|
</view> |
|
|
@ -43,18 +44,53 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="flex uni-row uni-center align-center"> |
|
|
|
<input class="input" disabled :placeholder="item.placeholder" v-model="item.name" /> |
|
|
|
<input class="input" style="margin-left: 50rpx;" disabled :placeholder="item.placeholder" |
|
|
|
v-model="item.name" /> |
|
|
|
<view class=""> |
|
|
|
<!-- <image src="../../static/icons/arrow_down.svg" style="width: 50rpx; height: 50rpx;"></image> --> |
|
|
|
<button type="primary" size="mini" @click="selectClass(item)">选择</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="" v-else-if="item.type=='inputRange'"> |
|
|
|
<view class="flex uni-row " style="padding-left: 10rpx; border-bottom: #9e9e9e;"> |
|
|
|
<view class="" style="margin-top: 3rpx;"> |
|
|
|
<text class="colorRed">*</text> |
|
|
|
<text class="num" style="font-size: 32rpx;">{{ index + 1 }}.</text> |
|
|
|
</view> |
|
|
|
<view class="uni-flex uni-column"> |
|
|
|
<view class="content"> |
|
|
|
点检部位 : {{ item.position }} |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
点检内容 : {{ item.content }} |
|
|
|
</view> |
|
|
|
<view class="methond" style="margin-bottom: 10rpx;"> |
|
|
|
点检方法 : {{item.methond}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<view class="" style="margin-left: 50rpx;"> |
|
|
|
<text style="font-size: 32rpx; margin: 10rpx;">{{item.inputLow.placeholder}}</text> |
|
|
|
<input class="input" type="number" :placeholder="item.inputLow.placeholder" |
|
|
|
v-model="item.inputLow.name" /> |
|
|
|
</view> |
|
|
|
<view class="" style="margin-left: 50rpx;"> |
|
|
|
<text style="font-size: 32rpx; margin: 10rpx;">{{item.inputHigh.placeholder}}</text> |
|
|
|
<input class="input" type="number" :placeholder="item.inputHigh.placeholder" |
|
|
|
v-model="item.inputHigh.name" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<selectPopup :dataList="dataList2" ref="selectPopup2" title="选择班次" @select="getSelect2"></selectPopup> |
|
|
|
|
|
|
|
<selectPopup :dataList="dataList" ref="selectPopup" title="选择点检状态" @select="getSelect"></selectPopup> |
|
|
|
<u-top-tips ref="uTips"></u-top-tips> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -148,16 +184,39 @@ |
|
|
|
this.selectStateItem.value = item.value |
|
|
|
console.log(item) |
|
|
|
}, |
|
|
|
|
|
|
|
submit(callBack) { |
|
|
|
var isCheckPass = true |
|
|
|
for (var i = 0; i < this.formData.length; i++) { |
|
|
|
var item = this.formData[i]; |
|
|
|
if (item.name == "") { |
|
|
|
uni.showToast({ |
|
|
|
title: item.placeholder |
|
|
|
}) |
|
|
|
break |
|
|
|
if (item.type == "inputRange") { |
|
|
|
if(item.inputLow.name == ""){ |
|
|
|
this.showHint("点检内容 : " + item.content, item.inputLow.placeholder) |
|
|
|
break |
|
|
|
}else { |
|
|
|
if(!this.isWithinInterval(item.inputLow.name,item.inputLow.lower,item.inputLow.upper)){ |
|
|
|
this.showHint("点检内容 : " + item.content, "最低压 : 输入数量【"+item.inputLow.name+"】不在【"+item.inputLow.lower+"】和【"+item.inputLow.upper+"】之间") |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(item.inputHigh.name == ""){ |
|
|
|
this.showHint("点检内容 : " + item.content, item.inputHigh.placeholder) |
|
|
|
break |
|
|
|
}else { |
|
|
|
if(!this.isWithinInterval(item.inputHigh.name,item.inputHigh.lower,item.inputHigh.upper)){ |
|
|
|
this.showHint("点检内容 : " + item.content, "最高压 : 输入数量【"+item.inputHigh.name+"】不在【"+item.inputHigh.lower+"】和【"+item.inputHigh.upper+"】之间") |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
if (item.name == "") { |
|
|
|
this.showHint("点检内容 : " + item.content, item.placeholder) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (isCheckPass) { |
|
|
|
callBack(this.formData) |
|
|
@ -167,11 +226,26 @@ |
|
|
|
console.log(this.formData) |
|
|
|
} |
|
|
|
}, |
|
|
|
isWithinInterval(num, lower, upper){ |
|
|
|
return num >= lower && num <= upper; |
|
|
|
}, |
|
|
|
showHint(title, hint) { |
|
|
|
uni.showModal({ |
|
|
|
title: title, |
|
|
|
content: hint |
|
|
|
}) |
|
|
|
}, |
|
|
|
reset() { |
|
|
|
for (var i = 0; i < this.formData.length; i++) { |
|
|
|
var item = this.formData[i]; |
|
|
|
item.name = "" |
|
|
|
item.value = "" |
|
|
|
if(item.type=="inputRange"){ |
|
|
|
item.inputLow.name=""; |
|
|
|
item.inputHigh.name="" |
|
|
|
}else { |
|
|
|
item.name = "" |
|
|
|
item.value = "" |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.$emit("reset", this.formData) |
|
|
|
console.log(this.formData) |
|
|
@ -193,7 +267,6 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.methond { |
|
|
|
margin-left: 30rpx; |
|
|
|
font-size: 29rpx; |
|
|
|
color: #999; |
|
|
|
} |
|
|
|