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