# Conflicts:
#	src/apps/AppMonitoringObject/Add.vue
This commit is contained in:
shijingjing
2022-04-29 18:15:05 +08:00

View File

@@ -23,7 +23,7 @@
<span>与户主关系</span>
</div>
<div class="right">
<span v-if="id">{{ $dict.getLabel('fpRelationship',form.householdRelation) }}</span>
<span v-if="id">{{ $dict.getLabel('fpRelationship', form.householdRelation) }}</span>
<AiSelect dict="fpRelationship" v-model="form.householdRelation" v-else></AiSelect>
</div>
</div>
@@ -35,10 +35,8 @@
<span>选择人员</span>
</div>
<div class="right">
<AiPagePicker class="select" :selected.sync="userList" householdName="1" >
<span v-if="!userList.length">请选择</span>
<span v-if="userList.length" style="color: #333;">{{ userList[0].name }}</span>
<u-icon name="arrow-right" color="#DDD" size="28"></u-icon>
<AiPagePicker class="select" :selected.sync="userList" householdName="1" single>
<AiMore v-model="form.name"/>
</AiPagePicker>
</div>
</div>
@@ -51,7 +49,7 @@
</div>
<div class="right">
<input placeholder="请输入" type="text" v-model="form.name" :maxlength="8"
placeholder-style="color: #999; font-size: 30rpx;" disabled />
placeholder-style="color: #999; font-size: 30rpx;" disabled/>
</div>
</div>
</div>
@@ -63,7 +61,7 @@
</div>
<div class="right">
<input placeholder="请输入" type="text" v-model="form.name" :maxlength="8"
placeholder-style="color: #999; font-size: 30rpx;" :disabled="isEdit" />
placeholder-style="color: #999; font-size: 30rpx;" :disabled="isEdit"/>
</div>
</div>
</div>
@@ -75,7 +73,7 @@
</div>
<div class="right">
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="20"
placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" :disabled ="userList.length? true : false" />
placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" :disabled="!!userList.length"/>
</div>
</div>
</div>
@@ -87,7 +85,7 @@
</div>
<div class="right">
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="20"
placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" disabled />
placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" disabled/>
</div>
</div>
</div>
@@ -98,7 +96,7 @@
<span>性别</span>
</div>
<div class="right">
<span :style="form.sex === '' ? 'color:#999;' : 'color:#333;' ">{{$dict.getLabel('sex', form.sex) || '自动识别'}}</span>
<span :style="form.sex === '' ? 'color:#999;' : 'color:#333;' ">{{ $dict.getLabel('sex', form.sex) || '自动识别' }}</span>
</div>
</div>
</div>
@@ -112,7 +110,7 @@
</div>
<div class="right">
<input placeholder="请输入" type="number" v-model="form.phone" :maxlength="11"
placeholder-style="color: #999; font-size: 30rpx;"/>
placeholder-style="color: #999; font-size: 30rpx;"/>
</div>
</div>
</div>
@@ -124,12 +122,8 @@
</div>
<div class="right">
<!-- :areaId="user.areaId" v-model="form.currentAreaId"-->
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :root="user.areaId" @select="onAreaChange">
<div class="aiArea">
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
<AiAreaPicker :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :root="user.areaId">
<AiMore v-model="form.currentAreaName"/>
</AiAreaPicker>
</div>
</div>
@@ -194,9 +188,9 @@
<AiUploader :def.sync="photo" multiple placeholder="上传图片" :limit="1" action="/admin/file/add2" :disabled="id != ''"></AiUploader>
</div>
</div>
<div class="form-group" >
<div class="form-group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
@@ -219,7 +213,7 @@
</div>
<div class="bottoms">
<div class="cards" v-for="(e, index) in helthList" :key="index">
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="userClick(e, index)" >{{ e.dictName }}</div>
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="userClick(e, index)">{{ e.dictName }}</div>
</div>
</div>
</div>
@@ -262,7 +256,7 @@
</div>
<div class="bottoms">
<div class="cards" v-for="(e, index) in basicsCheckList" :key="index">
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="basicsCheck(e, index)" >{{ e.dictName }}</div>
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="basicsCheck(e, index)">{{ e.dictName }}</div>
</div>
</div>
</div>
@@ -279,7 +273,7 @@
</div>
<div class="bottoms">
<div class="cards" v-for="(e, index) in guaranteeCheckList" :key="index">
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="guaranteeCheck(e, index)" >{{ e.dictName }}</div>
<div :style="{color:e.checked == true ? '#1174FE' : '#333'}" @click="guaranteeCheck(e, index)">{{ e.dictName }}</div>
</div>
</div>
</div>
@@ -412,7 +406,7 @@
<div class="remark">
<p><span style="display: inline-block;width: 6px;"></span>备注说明</p>
<div>
<u-input v-model="form.detail" type="textarea" height="150" placeholder="请输入备注说明" :maxlength='500' clearable />
<u-input v-model="form.detail" type="textarea" height="150" placeholder="请输入备注说明" :maxlength='500' clearable/>
</div>
</div>
<div style="height: 8px; width: 100%;background: #f3f4f5;"></div>
@@ -423,8 +417,8 @@
</div>
</div>
</div>
<div class="btn" hover-class="text" @click="nextStep" v-if="current == 0">下一步</div>
<div class="btn" hover-class="text" @click="submit" v-if="current == 0 && id">保存</div>
<div class="btn" hover-class="text" @click="submit" v-if="current == 1"> {{ girdInfo.checkType == 2 ? '保存' : '申请纳入监测' }}</div>
@@ -433,15 +427,15 @@
<script>
import {mapState} from 'vuex'
import listVue from '../AppBuilding/list.vue';
export default {
data() {
return {
numList: [
{name: '基本信息'},
{name: '情况描述'},
{name: '等待审核'},
],
numList: [
{name: '基本信息'},
{name: '情况描述'},
{name: '等待审核'},
],
current: 0,
form: {
name: '',
@@ -495,15 +489,15 @@ export default {
userList: [],
flag: false,
helthList: [],
namelist:[],
namelist: [],
basicsCheckList: [
{dictName: '城乡居民基本医疗保险', checked: false},
{dictName: '城镇职工基本医疗保险',checked: false},
{dictName: '大病保险',checked: false},
{dictName: '商业补充医疗保险',checked: false},
{dictName: '城乡居民基本养老保险',checked: false},
{dictName: '城镇职工基本养老保险',checked: false},
{dictName: '享受人身意外保险补贴',checked: false},
{dictName: '城镇职工基本医疗保险', checked: false},
{dictName: '大病保险', checked: false},
{dictName: '商业补充医疗保险', checked: false},
{dictName: '城乡居民基本养老保险', checked: false},
{dictName: '城镇职工基本养老保险', checked: false},
{dictName: '享受人身意外保险补贴', checked: false},
],
basicsList: [],
guaranteeCheckList: [
@@ -521,15 +515,13 @@ export default {
computed: {
...mapState(['user']),
},
watch:{
userList:{
handler: function (newValue,oldValue) {
watch: {
userList: {
handler: function (v) {
this.isEdit = true;
this.form.name = newValue[0].name;
this.form.idNumber = newValue[0].idNumber;
this.form.sex = this.form.idNumber.substr(16, 1) % 2 == 0 ? '1' : '0'
this.form.currentAreaId = newValue[0].currentAreaId
this.form.currentAreaName = newValue[0].currentAreaName
let {name, idNumber, currentAreaId, currentAreaName} = v?.[0] || {}
this.form = {...this.form, name, idNumber, currentAreaId, currentAreaName}
this.form.sex = this.idCardNoUtil.getIdCardInfo(idNumber)?.sex
},
deep: true,
},
@@ -537,10 +529,10 @@ export default {
onLoad(query) {
this.isGirdUser()
this.$dict.load(['fpType','fpRiskType', 'riskEliminationMethod', 'fpRiskType', 'fpYesOrNo', 'fpNation', 'fpEducation', 'fpStudentsInSchool', 'fpHealth',
'fpLaborSkills', 'fpPoliticalOutlook', 'sex', 'fpHealth','fpDisabilityType','fpYear','fpYesOrNo','fpEmploymentChannels']).then(() => {
this.$dict.load(['fpType', 'fpRiskType', 'riskEliminationMethod', 'fpRiskType', 'fpYesOrNo', 'fpNation', 'fpEducation', 'fpStudentsInSchool', 'fpHealth',
'fpLaborSkills', 'fpPoliticalOutlook', 'sex', 'fpHealth', 'fpDisabilityType', 'fpYear', 'fpYesOrNo', 'fpEmploymentChannels']).then(() => {
this.$dict.getDict('fpHealth').map((item) =>{
this.$dict.getDict('fpHealth').map((item) => {
this.helthList.push({
dictName: item.dictName,
dictValue: item.dictValue,
@@ -554,22 +546,18 @@ export default {
if (query.id) {
this.flag = true
this.id = query.id
this.getInfo(this.id)
} else if (!query.id) {
this.form.currentAreaId = this.user.areaId
}
}
})
},
onShow() {
document.title = this.id ? '编辑监测对象' : '添加监测对象'
console.log(this.userList);
},
methods: {
rules() {
return {
@@ -590,17 +578,17 @@ export default {
userClick(row, i) {
if (!this.helthList[i].checked) {
this.helthList[i].checked = true // 确定
this.namelist.push({ dictValue: row.dictValue, dictName: row.dictName }) // 赋值
this.namelist.push({dictValue: row.dictValue, dictName: row.dictName}) // 赋值
} else {
this.helthList[i].checked = false // 取消
this.namelist.map((item, index) => {
if (item.dictValue == row.dictValue) {
if (item.dictValue == row.dictValue) {
this.namelist.splice(index, 1)
}
})
}
this.form.healthyStatus = this.namelist.map(v=>v.dictValue).join(',')
this.form.healthyStatus = this.namelist.map(v => v.dictValue).join(',')
},
// 医疗保险
@@ -614,31 +602,29 @@ export default {
nextStep() {
// objectType: '请选择监测对象类型',
// name: '请输入户主姓名',
// idNumber: '请输入身份证号',
// phone: '请输入联系方式',
// currentAreaId: '请选择现住址',
// name: '请输入户主姓名',
// idNumber: '请输入身份证号',
// phone: '请输入联系方式',
// currentAreaId: '请选择现住址',
if(!id) {
if(!this.form.objectType) {
if (!id) {
if (!this.form.objectType) {
this.$u.toast('请选择监测对象类型')
}
}
if(!this.form.idNumber) {
if (!this.form.idNumber) {
this.$u.toast('请输入身份证号')
}
if(!this.form.phone) {
if (!this.form.phone) {
this.$u.toast('请输入联系方式')
}
if(!this.form.currentAreaId) {
if (!this.form.currentAreaId) {
this.$u.toast('请选择现住址')
}
// const rules = this.rules()
// for (let v of Object.keys(rules)) {
@@ -650,17 +636,17 @@ export default {
if (this.form.phone.length == 11 && !regTel.test(this.form.phone)) {
return this.$u.toast('请输入正确的手机号')
}
if(!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
if (!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
return this.$u.toast('现住址必须选到村级')
}
if(this.form.files.length) {
if (this.form.files.length) {
this.form.photo = this.form.files[0].url
}
if(this.photo.length) {
if (this.photo.length) {
this.form.photo = this.photo[0].accessUrl
}
this.form.girdId = this.girdInfo.girdId
this.form.girdName = this.girdInfo.girdName
this.form.householdIdNumber = this.form.idNumber
@@ -670,20 +656,20 @@ export default {
},
checkInit(formName, list, index) {
if(list[index].checked) {
if (list[index].checked) {
this.form[formName] = '01'
}else {
} else {
this.form[formName] = '02'
}
},
submit() {
if(!this.form.riskType) {
if (!this.form.riskType) {
return this.$u.toast('请选择风险因素')
}
this.basicsCheckList.map((item, index) => {
if (item.checked) {
if (item.checked) {
this.basicsList.push(index)
}
})
@@ -691,26 +677,26 @@ export default {
this.form.basicsCheck = this.basicsList.join(',')
this.guaranteeCheckList.map((item, index) => {
if (item.checked) {
if (item.checked) {
this.guaranteeList.push(index)
}
})
this.form.guaranteeCheck = this.guaranteeList.join(',')
this.checkInit('jcbxCxyiliao',this.basicsCheckList, 0)
this.checkInit('jcbxCzyiliao',this.basicsCheckList, 1)
this.checkInit('jcbxDabing',this.basicsCheckList, 2)
this.checkInit('jcbxShangye',this.basicsCheckList, 3)
this.checkInit('jcbxCxyanglao',this.basicsCheckList, 4)
this.checkInit('jcbxCzyanglao',this.basicsCheckList, 5)
this.checkInit('jcbxRenshenyiwai',this.basicsCheckList, 6)
this.checkInit('jcbxCxyiliao', this.basicsCheckList, 0)
this.checkInit('jcbxCzyiliao', this.basicsCheckList, 1)
this.checkInit('jcbxDabing', this.basicsCheckList, 2)
this.checkInit('jcbxShangye', this.basicsCheckList, 3)
this.checkInit('jcbxCxyanglao', this.basicsCheckList, 4)
this.checkInit('jcbxCzyanglao', this.basicsCheckList, 5)
this.checkInit('jcbxRenshenyiwai', this.basicsCheckList, 6)
this.checkInit('bzcsNongcundibao',this.guaranteeCheckList, 0)
this.checkInit('bzcsTekungongyang',this.guaranteeCheckList, 1)
this.checkInit('bzcsWubaohu',this.guaranteeCheckList, 2)
this.checkInit('bzcsYiliaojiuzhu',this.guaranteeCheckList, 3)
this.checkInit('bzcsQita',this.guaranteeCheckList, 4)
this.checkInit('bzcsNongcundibao', this.guaranteeCheckList, 0)
this.checkInit('bzcsTekungongyang', this.guaranteeCheckList, 1)
this.checkInit('bzcsWubaohu', this.guaranteeCheckList, 2)
this.checkInit('bzcsYiliaojiuzhu', this.guaranteeCheckList, 3)
this.checkInit('bzcsQita', this.guaranteeCheckList, 4)
this.$http.post('/app/apppreventionreturntopoverty/addByEwechat', {
...this.form,
@@ -718,7 +704,7 @@ export default {
girdId: this.user.girdId,
}).then(res => {
if (res.code == 0) {
this.$u.toast(this.id? '保存成功' : '提交成功')
this.$u.toast(this.id ? '保存成功' : '提交成功')
uni.$emit('reload')
uni.navigateTo({url: './serviceResult'})
}
@@ -727,10 +713,6 @@ export default {
})
},
onAreaChange(e) {
this.form.currentAreaId = e
},
onChange(e) {
this.form.placeAreaId = e
},
@@ -739,19 +721,19 @@ export default {
this.$http.post(`/app/apppreventionreturntopoverty/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
res.data.basicsCheckList = res.data.basicsCheck.split(',')
res.data.basicsCheckList.map((item,index)=> {
res.data.basicsCheckList.map((item, index) => {
this.basicsCheckList[index].checked = true
})
res.data.guaranteeCheckList = res.data.guaranteeCheck.split(',')
res.data.guaranteeCheckList.map((item,index)=> {
res.data.guaranteeCheckList.map((item, index) => {
this.guaranteeCheckList[index].checked = true
})
res.data.healthyStatusList = res.data.healthyStatus.split(',')
res.data.healthyStatusList.map((item)=>{
this.helthList.map(items=>{
if(item == items.dictValue) {
res.data.healthyStatusList.map((item) => {
this.helthList.map(items => {
if (item == items.dictValue) {
items.checked = true
}
})
@@ -762,9 +744,9 @@ export default {
...this.form,
...res.data
}
this.photo = [{url:this.form.photo}]
this.photo = [{url: this.form.photo}]
if(this.form.photo) {
if (this.form.photo) {
this.form.files = [{url: this.form.photo}]
}
}
@@ -803,12 +785,13 @@ export default {
.add {
padding-bottom: 120px;
.isActive {
background: #3975C6;
}
.isActive {
background: #3975C6;
}
.steps {
height: 176px;
::v-deep .u-steps {
box-sizing: border-box;
padding-top: 40px;
@@ -823,7 +806,7 @@ export default {
max-width: 480px;
height: 112px;
overflow: hidden;
text-overflow:ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
color: #303133 !important;
font-size: 30px;
@@ -863,26 +846,30 @@ export default {
}
.form-item__wrappers {
padding-right:30px;
padding-right: 30px;
box-sizing: border-box;
.top {
font-size: 32px;
padding: 32px 0;
}
.bottoms{
.bottoms {
padding-bottom: 20px;
.cards {
padding: 20px;
box-sizing: border-box;
border: 1px solid #CCCCCC;
border-radius: 16px;
margin-bottom: 16px;
.changeActive {
.changeActive {
color: #1174FE;
border: 1px solid #1174FE;
}
}
}
}
@@ -895,7 +882,8 @@ export default {
font-size: 30px;
color: #999999;
}
.check-item{
.check-item {
display: inline-block;
width: 140px;
height: 64px;
@@ -908,17 +896,21 @@ export default {
font-weight: 500;
color: #333;
position: relative;
img{
img {
display: none;
}
}
.check-item:nth-of-type(1) {
margin-right: 36px;
}
.check-active{
.check-active {
background: #E7F1FE;
color: #1174FE;
img{
img {
display: block;
position: absolute;
bottom: 0;
@@ -1000,12 +992,14 @@ export default {
.condition {
margin-top: 16px;
.risk {
display: flex;
justify-content: space-between;
padding: 30px 32px;
box-sizing: border-box;
}
.remark {
padding: 30px 32px;
box-sizing: border-box;
@@ -1026,14 +1020,17 @@ export default {
font-size: 32px;
background: #3192F4;
}
.upload {
width: 100%;
padding: 10px 32px 32px 32px;
box-sizing: border-box;
}
.border-b0{
border-bottom: 0!important;
.border-b0 {
border-bottom: 0 !important;
}
::v-deep .AiSelect .display .selectedLabel {
font-size: 28px;
}