6 changed files with 206 additions and 2 deletions
@ -0,0 +1,111 @@
|
||||
<template> |
||||
<view> |
||||
<view class="card"> |
||||
<view>设备名:{{info?info.name:''}}</view> |
||||
<view>设备型号:{{info?info.model:''}}</view> |
||||
<view>设备编号:{{info?info.in_number:''}}</view> |
||||
<view>检测项目:{{info?info.check_item:''}}</view> |
||||
<view>检测目的:{{info?info.check_aim:''}}</view> |
||||
</view> |
||||
<view class="from"> |
||||
<picker @change="bindTypeCircle($event,typeCircle)" :value="typeCircleIds" :range="typeCircle" :range-key="'title'" > |
||||
<view class="list"> |
||||
<view>检测周期</view> |
||||
<view class="right"> |
||||
<text>{{typeCircle[typeCircleIds].title}}</text> |
||||
<image class="next" src="../../static/next.png"></image> |
||||
</view> |
||||
</view> |
||||
</picker> |
||||
<picker @change="bindMaterial" :value="materialIds" :range="material" > |
||||
<view class="list"> |
||||
<view>保养情况</view> |
||||
<view class="right"> |
||||
<text>{{material[materialIds]}}</text> |
||||
<image class="next" src="../../static/next.png"></image> |
||||
</view> |
||||
</view> |
||||
</picker> |
||||
<view class="remark"> |
||||
<view> |
||||
备注 |
||||
</view> |
||||
<textarea v-model="from.device[0].remark" placeholder="" /> |
||||
</view> |
||||
<view class="remark"> |
||||
<view> |
||||
设备其他情况 |
||||
</view> |
||||
<textarea v-model="from.remark" placeholder="" /> |
||||
</view> |
||||
</view> |
||||
<view class="submit-btn" > |
||||
<button type="primary" :disabled="buttonState==false?true:false" @tap="submit()">提交</button> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import {deviceRecord} from "../../api/user.js" |
||||
export default { |
||||
data() { |
||||
return { |
||||
type:0, |
||||
info:{}, |
||||
lineId:0, |
||||
typeCircle:[ |
||||
{id:1,title:'半月检'}, |
||||
{id:2,title:'月检'}, |
||||
{id:3,title:'半年检'} |
||||
], |
||||
typeCircleIds:0, |
||||
material:["未完成","已完成"], |
||||
materialIds:0, |
||||
from:{ |
||||
line_id:0, |
||||
remark:'',//设备其他情况 |
||||
type:1,//类型:1=半月检,2=月检,3=半年检, |
||||
device:[ |
||||
{ |
||||
device_id:'', |
||||
status:1, |
||||
remark:'' |
||||
} |
||||
] |
||||
}, |
||||
buttonState:true |
||||
}; |
||||
},onLoad(e) { |
||||
this.type=e.type; |
||||
this.info = JSON.parse(decodeURIComponent(e.planInfo)); |
||||
this.lineId=e.id |
||||
},methods:{ |
||||
bindTypeCircle(e,list){ |
||||
this.typeCircleIds=e.detail.value |
||||
}, |
||||
bindMaterial(e){ |
||||
this.materialIds=e.detail.value |
||||
}, |
||||
submit(){ |
||||
this.from.line_id=this.lineId; |
||||
this.from.type=this.typeCircle[this.typeCircleIds].id; |
||||
this.from.device[0].status=this.materialIds+1; |
||||
this.from.device[0].device_id=this.info.id; |
||||
this.buttonState=false |
||||
deviceRecord(this.from).then(res=>{ |
||||
this.buttonState=false |
||||
this.$functions.success("操作成功").then(() => { |
||||
uni.navigateBack() |
||||
}).catch(res=>{ |
||||
this.buttonState=true |
||||
}) |
||||
console.log("biaodan",this.from) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "./index.scss" |
||||
</style> |
@ -0,0 +1,57 @@
|
||||
.card{ |
||||
@include wh(710upx,auto); |
||||
padding: 30upx; |
||||
margin: auto; |
||||
background: white; |
||||
view{ |
||||
@include fonts(26upx,#333); |
||||
line-height: 55upx; |
||||
} |
||||
} |
||||
.from{ |
||||
@include wh(750upx,auto); |
||||
background: white; |
||||
margin-top: 30upx; |
||||
.list{ |
||||
width: 710upx; |
||||
margin: auto; |
||||
padding-top: 25upx; |
||||
padding-bottom: 25upx; |
||||
@include flex(center,space-between); |
||||
view{ |
||||
@include fonts(26upx,#333); |
||||
width: 600upx; |
||||
} |
||||
.right{ |
||||
width: 100upx; |
||||
@include flex(center,flex-end); |
||||
text{ |
||||
@include fonts(24upx,#666) |
||||
} |
||||
image{ |
||||
@include wh(22upx,33upx) |
||||
} |
||||
} |
||||
} |
||||
.remark{ |
||||
width: 710upx; |
||||
margin: auto; |
||||
padding-top: 25upx; |
||||
padding-bottom: 25upx; |
||||
@include flex(flex-start,space-between); |
||||
textarea{ |
||||
font-size: 26upx; |
||||
border: 1upx solid #F1F1F1; |
||||
padding: 10upx; |
||||
} |
||||
view{ |
||||
@include fonts(26upx,#333); |
||||
width: 200upx; |
||||
} |
||||
} |
||||
} |
||||
.submit-btn{ |
||||
@include wh(710upx,auto); |
||||
margin: auto; |
||||
margin-top: 30upx; |
||||
} |
Loading…
Reference in new issue