Files
dvcp_v2_wxcp_app/src/apps/AppMonitoringObject/MonitorFamilySituation.vue

293 lines
6.5 KiB
Vue
Raw Normal View History

2022-03-24 11:17:05 +08:00
<template>
<div class="add">
<div class="form-group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
<i>*</i>
<span>监测对象类型</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
<i>*</i>
<span>是否危房</span>
</div>
<div class="right">
2022-03-24 14:29:32 +08:00
<div class="check-item" :class="form.dilapidatedHouse == 1 ? 'check-active' : '' " @click="form.dilapidatedHouse=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.dilapidatedHouse != 1 ? 'check-active' : '' " @click="form.dilapidatedHouse=0"><img src="./components/img/check-icon.png" alt=""></div>
2022-03-24 11:17:05 +08:00
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
<i>*</i>
<span>是否饮水安全问题</span>
</div>
<div class="right">
2022-03-24 14:29:32 +08:00
<div class="check-item" :class="form.drinkingWaterSafety == 1 ? 'check-active' : '' " @click="form.drinkingWaterSafety=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.drinkingWaterSafety != 1 ? 'check-active' : '' " @click="form.drinkingWaterSafety=0"><img src="./components/img/check-icon.png" alt=""></div>
2022-03-24 11:17:05 +08:00
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
<i>*</i>
<span>是否搬迁</span>
</div>
<div class="right">
2022-03-24 14:29:32 +08:00
<div class="check-item" :class="form.drinkingWaterSafety == 1 ? 'check-active' : '' " @click="form.drinkingWaterSafety=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.drinkingWaterSafety != 1 ? 'check-active' : '' " @click="form.drinkingWaterSafety=0"><img src="./components/img/check-icon.png" alt=""></div>
2022-03-24 11:17:05 +08:00
</div>
</div>
</div>
</div>
<div class="btn" hover-class="text" @click="submit">保存</div>
2022-03-24 14:29:32 +08:00
2022-03-24 11:17:05 +08:00
</div>
</template>
<script>
export default {
data() {
return {
form: {
2022-03-24 14:29:32 +08:00
dilapidatedHouse: '',
drinkingWaterSafety: '',
riskType: ''
2022-03-24 11:17:05 +08:00
},
2022-03-24 14:29:32 +08:00
id: ''
2022-03-24 11:17:05 +08:00
}
},
onLoad(query) {
2022-03-24 14:29:32 +08:00
this.$dict.load(['fpYesOrNo', 'fpRiskType'])
uni.showLoading()
this.id = query.id
this.getInfo(query.id)
document.title = query.id ? '编辑家庭情况' : '添加家庭情况'
2022-03-24 11:17:05 +08:00
},
methods: {
2022-03-24 14:29:32 +08:00
getInfo(id) {
this.$http.post(`/app/apppreventionreturntopoverty/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = {
...this.form,
...res.data
}
}
2022-03-24 11:17:05 +08:00
2022-03-24 14:29:32 +08:00
uni.hideLoading()
})
},
2022-03-24 11:17:05 +08:00
2022-03-24 14:29:32 +08:00
submit() {
2022-03-24 11:17:05 +08:00
uni.showLoading()
this.$http.post('/app/apppreventionreturntopoverty/addOrUpdate', {
...this.form,
2022-03-24 14:29:32 +08:00
id: this.id
2022-03-24 11:17:05 +08:00
}).then(res => {
if (res.code === 0) {
this.$u.toast(this.isEdit ? '保存成功' : '提交成功')
uni.$emit('reload')
uni.navigateBack({
delta: 1
})
}
uni.hideLoading()
})
},
}
}
</script>
<style lang="scss">
.add {
padding-bottom: 120px;
2022-03-24 14:29:32 +08:00
.form-textarea {
padding: 32px;
2022-03-24 11:17:05 +08:00
2022-03-24 14:29:32 +08:00
h2 {
margin-bottom: 32px;
color: #333333;
font-size: 32px;
font-weight: 500;
2022-03-24 11:17:05 +08:00
}
2022-03-24 14:29:32 +08:00
textarea {
width: 100%;
height: 200px;
2022-03-24 11:17:05 +08:00
}
}
2022-03-24 14:29:32 +08:00
& > div {
margin-bottom: 16px;
background: #fff;
}
2022-03-24 11:17:05 +08:00
::v-deep .u-radio {
&:last-child {
.u-radio__label {
margin-right: 0;
}
}
}
.form-group {
.form-item {
padding-left: 32px;
.form-item__wrapper {
display: flex;
align-items: center;
justify-content: space-between;
height: 112px;
border-bottom: 1px solid #E4E5E6;
}
.right {
height: 112px;
line-height: 112px;
padding-right: 32px;
span {
font-size: 30px;
color: #999999;
}
.check-item{
display: inline-block;
width: 160px;
height: 64px;
line-height: 64px;
text-align: center;
background: #F5F5F5;
border-radius: 4px;
font-size: 30px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
position: relative;
img{
display: none;
}
}
.check-item:nth-of-type(1) {
margin-right: 36px;
}
.check-active{
background: #E7F1FE;
color: #1174FE;
img{
display: block;
position: absolute;
bottom: 0;
right: 0;
width: 48px;
height: 48px;
}
}
}
input {
height: 100%;
text-align: right;
}
.left {
display: flex;
align-items: center;
span {
color: #333333;
font-size: 32px;
}
i {
margin-right: 4px;
font-style: normal;
color: #FF4466;
font-size: 32px;
}
}
&:last-child {
.form-item__wrapper {
border: none;
}
}
}
}
.form-item__imgs {
padding: 32px;
.form-item__title {
display: flex;
align-items: center;
margin-bottom: 34px;
h2 {
color: #333333;
font-weight: normal;
font-size: 32px;
}
i {
color: #999999;
font-size: 28px;
font-style: normal;
}
}
textarea {
width: 100%;
}
}
.form-type {
display: flex;
align-items: center;
justify-content: space-between;
height: 112px;
padding: 0 32px;
h2 {
font-weight: normal;
color: #333333;
font-size: 32px;
}
span {
color: #999999;
font-size: 28px;
}
}
.btn {
position: fixed;
left: 0;
bottom: 0;
z-index: 11;
width: 100%;
height: 112px;
line-height: 112px;
margin: 0;
text-align: center;
color: #FFFFFF;
font-size: 32px;
background: #3192F4;
}
}
</style>