Browse Source

修改泡沫点检

master
lijuncheng 8 months ago
parent
commit
4e5bf1b90a
  1. 111
      src/mycomponents/form/customerFrom.vue
  2. 24
      src/pages/foam/check.vue
  3. 2
      src/pages/setter/index.vue

111
src/mycomponents/form/customerFrom.vue

@ -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>
<view class="methond" style="margin-bottom: 10rpx; margin-left: 40rpx;">
点检方法 : {{item.methond}}
</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,16 +184,39 @@
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.name == "") { if (item.type == "inputRange") {
uni.showToast({ if(item.inputLow.name == ""){
title: item.placeholder this.showHint("点检内容 : " + item.content, item.inputLow.placeholder)
}) break
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) { if (isCheckPass) {
callBack(this.formData) callBack(this.formData)
@ -167,11 +226,26 @@
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];
item.name = "" if(item.type=="inputRange"){
item.value = "" item.inputLow.name="";
item.inputHigh.name=""
}else {
item.name = ""
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;
} }

24
src/pages/foam/check.vue

@ -16,8 +16,8 @@
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll" >
<view> <view style="padding-bottom: 80rpx;">
<customerFrom ref="customerFrom" :formData="formData"> </customerFrom> <customerFrom ref="customerFrom" :formData="formData"> </customerFrom>
</view> </view>
</scroll-view> </scroll-view>
@ -79,6 +79,26 @@
name: '', name: '',
value: "", value: "",
}, },
{
type: "inputRange",
position: "PB",
content: "检查气袋气压",
methond: "压力表示数范围2.5bar-4.5bar",
inputLow:{
name: "",
value: "",
placeholder: "请输入最低压力",
lower:"2.5",
upper:"4.5"
},
inputHigh:{
name: "",
value: "",
placeholder: "请输入最高压力",
lower:"2.5",
upper:"4.5"
}
},
{ {
type: "select", type: "select",
content: "选择班组", content: "选择班组",

2
src/pages/setter/index.vue

@ -21,7 +21,7 @@
</view> </view>
<view> <view>
<button class="footbtn" @click="handlerlogout">退出登录</button> <button type="primary" style="margin:40rpx;" @click="handlerlogout">退出登录</button>
</view> </view>
</view> </view>

Loading…
Cancel
Save