<template>
|
<view class="check_add_index">
|
<view style="height:90vh;overflow: auto;">
|
<view class="check_details_matter">
|
<view class="check_details_card" >
|
<view class="hidden_text">问题照片</view>
|
<view class="check_details_phone hidden_datas" v-for="(item,index) in hiddenPhone">
|
<!-- <u-image :src="`https://szpipe.thhy-tj.com/${item.imgPath}`" ></u-image> -->
|
<u-album :urls="[`https://szpipe.thhy-tj.com/${item.imgPath}`]"></u-album>
|
</view>
|
</view>
|
<view class="check_details_card">
|
<view class="hidden_text">举报时间</view>
|
<view class="hidden_datas">{{hiddenDetails.createTime}}</view>
|
</view>
|
<view class="check_details_card">
|
<view class="hidden_text">隐患地点</view>
|
<view class="hidden_datas">{{hiddenDetails.dangerLocation}}</view>
|
</view>
|
<view class="check_details_card">
|
<view class="hidden_text">隐患内容</view>
|
<view class="hidden_datas">{{hiddenDetails.title}}</view>
|
</view>
|
<view class="check_details_card">
|
<view class="hidden_text">提交人</view>
|
<view class="hidden_datas">{{hiddenDetails.reporter}}</view>
|
</view>
|
</view>
|
<view class="check_details_matter" style="margin-top:15px" v-if="checkShow">
|
<view class="check_details_card">
|
<view class="hidden_text">隐患等级</view>
|
<view class="hidden_datas">{{hiddenDetails.levelName}}</view>
|
</view>
|
<view class="check_details_card">
|
<view class="hidden_text">积分值</view>
|
<view class="hidden_datas">{{hiddenDetails.integral===null?'':hiddenDetails.integral}}</view>
|
</view>
|
</view>
|
<u-form
|
ref="form"
|
:model="formCheck"
|
:rules="rulesCkeck"
|
labelWidth="auto"
|
v-if="!checkShow"
|
labelPosition="left">
|
<u-form-item
|
label="隐患等级"
|
prop="level"
|
borderBottom
|
@click="changeLever()">
|
<u-input
|
v-model="formCheck.level"
|
placeholder="请选择隐患等级"
|
disabledColor="#FFFFFF"
|
border="none">
|
</u-input>
|
<u-icon
|
slot="right"
|
name="arrow-right">
|
</u-icon>
|
</u-form-item>
|
<u-form-item
|
label="积分值"
|
prop="integral"
|
borderBottom>
|
<u-input
|
v-model="formCheck.integral"
|
placeholder="请输入积分值"
|
disabledColor="#FFFFFF"
|
border="none">
|
</u-input>
|
</u-form-item>
|
</u-form>
|
<view class="submit_bnt" v-if="hiddenBtn==='0'">
|
<u-button type="primary" color="#1976FF" text="提交" @click="submitInsertForm()"></u-button>
|
</view>
|
<u-picker
|
:show="showLever"
|
:columns="leverColumns"
|
keyName="label"
|
@cancel="showLever = false"
|
@confirm="selectLever">
|
</u-picker>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { throttle } from '../../plugins/public.js';
|
import { basrUrl } from '@/api/http';
|
export default{
|
data(){
|
return{
|
hiddenBtn:0,//是否展示提交按钮 0:展示
|
checkShow:false,//展示隐患等级和积分值是否可修改
|
showLever: false,//隐患等级弹框显隐
|
leverColumns: [
|
[
|
{
|
label:'一般隐患',
|
value:1
|
},
|
{
|
label:'重大隐患',
|
value:2
|
},
|
{
|
label:'不存在',
|
value:3
|
}
|
]
|
],//所有隐患等级
|
formCheck:{
|
imageList:[],//上传图片
|
levelId:'',//隐患等级id
|
},
|
hiddenDetails:[],//隐患举报详情
|
hiddenPhone:[],//隐患举报图片
|
rulesCkeck: {
|
level: [{
|
required: true,
|
message: '请选择隐患等级',
|
trigger: 'change'
|
}],
|
integral: [{
|
required: true,
|
message: '请输入积分',
|
trigger: 'blur'
|
}],
|
}
|
}
|
},
|
onLoad(option) {
|
this.hiddenBtn = option.status
|
if(option.status==='0'){//0为审批页面、其他为详情页面
|
this.checkShow = false
|
this.getDetailsInfo(option.id,0)
|
}else{
|
this.checkShow = true
|
this.getDetailsInfo(option.id,1)
|
}
|
},
|
methods:{
|
// 打开隐患等级选择
|
changeLever() {
|
this.showLever = true;
|
this.$set(this.formCheck, 'levelId', '');
|
this.$set(this.formCheck, 'level','');
|
},
|
// 确认隐患等级
|
selectLever({ value }) {
|
this.$set(this.formCheck, 'levelId', value[0].value);
|
this.$set(this.formCheck, 'level', value[0].label);
|
this.showLever = false;
|
},
|
//获取信息详情
|
getDetailsInfo(val,num){
|
this.$api.reboSystem.detailsHiddenInfo(val).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.hiddenDetails = res.data
|
this.hiddenPhone = res.data.imgEntities
|
if(num===1){
|
this.$set(this.formCheck,'level',res.data.level)
|
this.$set(this.formCheck,'integral',res.data.integral)
|
}
|
}else{
|
uni.$u.toast(res.statusMsg);
|
}
|
})
|
},
|
//提交按钮
|
submitInsertForm: throttle(function() {
|
this.$refs.form.validate().then((valid) => {
|
if(valid) {
|
const params = Object.assign({},this.hiddenDetails);
|
params.level = this.formCheck.levelId
|
params.integral = this.formCheck.integral
|
this.$api.reboSystem.checkHiddenInfo(params).then((res) => {
|
if(res.success) {
|
uni.$u.toast("提交成功!");
|
uni.redirectTo({
|
url: './checkHidden'
|
});
|
} else {
|
uni.$u.toast(res.statusMsg);
|
}
|
})
|
}
|
})
|
}, 3000),
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.check_add_index{
|
background-color: #F6F6F6;
|
padding: 0 15px;
|
position: relative;
|
height: 100vh;
|
overflow: hidden;
|
|
.check_details_matter{
|
// height: calc(100vh - 112px);
|
background-color: #FFFFFF;
|
border-radius: 6px;
|
|
.check_details_card{
|
padding: 15px 10px;
|
display: flex;
|
justify-content: space-between;
|
|
.hidden_text{
|
color: rgba(153, 153, 153, 1);
|
font-size: 16px;
|
flex: none;
|
}
|
.hidden_datas{
|
color: rgba(51, 51, 51, 1);
|
font-size: 15px;
|
text-align: left;
|
flex: 1;
|
margin-left: 15px;
|
}
|
}
|
.check_details_contents{
|
height: calc(100% - 460px);
|
margin: 15px;
|
padding: 15px;
|
display: flex;
|
// align-items: center;
|
background-color: #F6FAFF;
|
color:#666666 ;
|
}
|
.check_details_phone{
|
margin-top: 5px;
|
margin-left: 15px;
|
display: flex;
|
justify-content: center;
|
overflow: auto;
|
}
|
}
|
}
|
.submit_bnt {
|
position: absolute;
|
bottom: 5%;
|
width: calc(100% - 30px);
|
}
|
|
::v-deep image{
|
width: 320px!important;
|
height: 240px!important;
|
}
|
|
::v-deep .u-input__content__field-wrapper__field {
|
text-align: right !important;
|
}
|
::v-deep .u-form-item{
|
margin: 15px 0;
|
padding: 0 10px;
|
background-color: #FFFFFF;
|
line-height: 40px;
|
border-radius: 4px;
|
}
|
::v-deep .u-textarea{
|
background-color: #EFEFEF !important;
|
color: #999999 !important;
|
}
|
|
</style>
|
<style scoped>
|
.items_tyle /deep/.u-form-item__body{
|
flex-direction: column !important;
|
}
|
.upload_items /deep/.u-upload__wrap{
|
flex-wrap: nowrap;
|
align-items: center;
|
}
|
</style>
|