监测对象

This commit is contained in:
liuye
2022-03-26 16:33:51 +08:00
parent 7e063e5a9a
commit 78f966b276
9 changed files with 416 additions and 354 deletions

View File

@@ -8,7 +8,7 @@
<span>监测对象类型</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpType" v-model="form.objectType"></AiSelect>
</div>
</div>
</div>
@@ -16,10 +16,10 @@
<div class="form-item__wrapper">
<div class="left">
<i>*</i>
<span>户主姓名</span>
<span>姓名</span>
</div>
<div class="right">
<input placeholder="请输入" type="text" v-model="form.phone" :maxlength="8"
<input placeholder="请输入" type="text" v-model="form.name" :maxlength="8"
placeholder-style="color: #999; font-size: 30rpx;"/>
</div>
</div>
@@ -31,8 +31,8 @@
<span>身份证号</span>
</div>
<div class="right">
<input placeholder="请输入" type="idcard" v-model="form.phone" :maxlength="18"
placeholder-style="color: #999; font-size: 30rpx;"/>
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="18"
placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" />
</div>
</div>
</div>
@@ -43,8 +43,7 @@
<span>性别</span>
</div>
<div class="right">
<input placeholder="自动识别" type="idcard" v-model="form.phone" disabled
placeholder-style="color: #999; font-size: 30rpx;"/>
<span :style="form.sex === '' ? 'color:#999;' : 'color:#333;' ">{{$dict.getLabel('sex', form.sex) || '自动识别'}}</span>
</div>
</div>
</div>
@@ -69,9 +68,9 @@
<span>现住址</span>
</div>
<div class="right">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.addressArea" :value="form.addressAreaId" :areaId="$areaId" mode="custom" all @select="onAreaChange">
<AiAreaPicker ref="address" class="aiArea" :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :areaId="$areaId" all @select="onAreaChange">
<div class="aiArea">
<span class="label" v-if="form.addressArea">{{ form.addressArea }}</span>
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
@@ -88,7 +87,7 @@
<span>民族</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpNation" v-model="form.nation"></AiSelect>
</div>
</div>
</div>
@@ -99,7 +98,7 @@
<span>政治面貌</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpPoliticalOutlook" v-model="form.politicsStatus"></AiSelect>
</div>
</div>
</div>
@@ -110,7 +109,7 @@
<span>文化程度</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpEducation" v-model="form.education"></AiSelect>
</div>
</div>
</div>
@@ -121,7 +120,7 @@
<span>详细地址</span>
</div>
<div class="right">
<input placeholder="请输入" v-model="form.address" placeholder-style="color: #999; font-size: 30rpx;"/>
<input placeholder="请输入" v-model="form.currentAddress" placeholder-style="color: #999; font-size: 30rpx;"/>
</div>
</div>
</div>
@@ -136,11 +135,11 @@
</div>
</div>
<div class="upload">
<AiUploader :def.sync="form.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
<AiUploader :def.sync="form.files" multiple placeholder="上传图片" :limit="1" action="/admin/file/add2"></AiUploader>
</div>
</div>
<div class="form-group">
<div class="form-group" v-if="isEdit">
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
@@ -148,7 +147,18 @@
<span>在校情况</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpStudentsInSchool" v-model="form.schoolStatus"></AiSelect>
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
<i style="opacity: 0;">*</i>
<span>健康状况</span>
</div>
<div class="right">
<AiSelect dict="fpHealth" v-model="form.healthyStatus"></AiSelect>
</div>
</div>
</div>
@@ -159,7 +169,7 @@
<span>劳动技能</span>
</div>
<div class="right">
<AiSelect dict="fpType" v-model="form.type"></AiSelect>
<AiSelect dict="fpLaborSkills" v-model="form.labourStatus"></AiSelect>
</div>
</div>
</div>
@@ -170,7 +180,7 @@
<span>务工区域</span>
</div>
<div class="right">
<input placeholder="请输入" v-model="form.address" placeholder-style="color: #999; font-size: 30rpx;"/>
<input placeholder="请输入" v-model="form.workArea" placeholder-style="color: #999; font-size: 30rpx;"/>
</div>
</div>
</div>
@@ -181,12 +191,12 @@
<span>务工时间/</span>
</div>
<div class="right">
<input placeholder="请输入" v-model="form.address" type="number" placeholder-style="color: #999; font-size: 30rpx;" maxlength="2"/>
<input placeholder="请输入" v-model="form.workeMonths" type="number" placeholder-style="color: #999; font-size: 30rpx;" maxlength="2"/>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group" v-if="isEdit">
<div class="form-item">
<div class="form-item__wrapper">
<div class="left">
@@ -194,8 +204,8 @@
<span>是否参加医保</span>
</div>
<div class="right">
<div class="check-item" :class="form.medicalInsurance == 1 ? 'check-active' : '' " @click="form.medicalInsurance=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.medicalInsurance != 1 ? 'check-active' : '' " @click="form.medicalInsurance=0"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.basicMedicalTreatment == '01' ? 'check-active' : '' " @click="form.basicMedicalTreatment='01'"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.basicMedicalTreatment != '01' ? 'check-active' : '' " @click="form.basicMedicalTreatment='02'"><img src="./components/img/check-icon.png" alt=""></div>
</div>
</div>
</div>
@@ -206,8 +216,8 @@
<span>是否参加大病保险</span>
</div>
<div class="right">
<div class="check-item" :class="form.sicknessInsurance == 1 ? 'check-active' : '' " @click="form.sicknessInsurance=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.sicknessInsurance != 1 ? 'check-active' : '' " @click="form.sicknessInsurance=0"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.seriousIllnessInsurance == '01' ? 'check-active' : '' " @click="form.seriousIllnessInsurance='01'"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.seriousIllnessInsurance != '01' ? 'check-active' : '' " @click="form.seriousIllnessInsurance='02'"><img src="./components/img/check-icon.png" alt=""></div>
</div>
</div>
</div>
@@ -218,8 +228,8 @@
<span>是否参加养老保险</span>
</div>
<div class="right">
<div class="check-item" :class="form.endowmentInsurance == 1 ? 'check-active' : '' " @click="form.endowmentInsurance=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.endowmentInsurance != 1 ? 'check-active' : '' " @click="form.endowmentInsurance=0"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.endowmentInsurance == '01' ? 'check-active' : '' " @click="form.endowmentInsurance='01'"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.endowmentInsurance != '01' ? 'check-active' : '' " @click="form.endowmentInsurance='02'"><img src="./components/img/check-icon.png" alt=""></div>
</div>
</div>
</div>
@@ -230,8 +240,8 @@
<span>是否享受最低生活保障</span>
</div>
<div class="right">
<div class="check-item" :class="form.subsistenceAllowance == 1 ? 'check-active' : '' " @click="form.subsistenceAllowance=1">享受<img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.subsistenceAllowance != 1 ? 'check-active' : '' " @click="form.subsistenceAllowance=0">未享受<img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.subsistenceAllowance == '01' ? 'check-active' : '' " @click="form.subsistenceAllowance='01'">享受<img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.subsistenceAllowance != '01' ? 'check-active' : '' " @click="form.subsistenceAllowance='02'">未享受<img src="./components/img/check-icon.png" alt=""></div>
</div>
</div>
</div>
@@ -242,15 +252,15 @@
<span>是否特困供养</span>
</div>
<div class="right">
<div class="check-item" :class="form.destitute == 1 ? 'check-active' : '' " @click="form.destitute=1"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.destitute != 1 ? 'check-active' : '' " @click="form.destitute=0"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.specialPovertySupport == '01' ? 'check-active' : '' " @click="form.specialPovertySupport='01'"><img src="./components/img/check-icon.png" alt=""></div>
<div class="check-item" :class="form.specialPovertySupport != '01' ? 'check-active' : '' " @click="form.specialPovertySupport='02'"><img src="./components/img/check-icon.png" alt=""></div>
</div>
</div>
</div>
</div>
<div class="btn" hover-class="text" @click="submit"> {{ isEdit ? '保存' : '申请纳入监测' }}</div>
<div class="btn" hover-class="text" @click="submit"> {{ girdInfo.checkType == 2 ? '保存' : '申请纳入监测' }}</div>
</div>
</template>
@@ -260,54 +270,88 @@ export default {
data() {
return {
form: {
addressAreaId: '',
address: '',
addressArea: '',
move: '02',
place: '',
placeAreaId: '',
placeArea: '',
type: '',
files: []
name: '',
objectType: '',
idNumber: '',
sex: '',
phone: '',
currentAreaId: '',
currentAreaName: '',
nation: '',
politicsStatus: '',
education: '',
currentAddress: '',
files: [],
schoolStatus: '',
labourStatus: '',
workArea: '',
workeMonths: '',
basicMedicalTreatment: '02',
seriousIllnessInsurance: '02',
endowmentInsurance: '02',
subsistenceAllowance: '02',
specialPovertySupport: '02',
girdId: '',
girdName: '',
healthyStatus: '',
},
$areaId: '',
isEdit: false,
id: '',
areaName: '',
girdInfo: {}
}
},
created() {
this.areaName = this.$store.state.user.areaFullName
this.$dict.load(['fpType', 'fpYesOrNo'])
},
onLoad(query) {
if (query.id) {
this.isEdit = true
this.id = query.id
this.isGirdUser()
this.$dict.load(['fpType', 'riskEliminationMethod', 'fpRiskType', 'fpYesOrNo', 'fpNation', 'fpEducation', 'fpStudentsInSchool', 'fpHealth',
'fpLaborSkills', 'fpPoliticalOutlook', 'sex', 'fpHealth']).then(() => {
if (query.id) {
this.isEdit = true
this.id = query.id
this.getInfo(this.id)
}else {
this.currentAreaName = this.$store.state.user.areaFullName
}
})
},
this.getInfo(this.id)
}
document.title = query.id ? '编辑监测对象' : '添加监测对象'
onShow() {
document.title = this.id ? '编辑监测对象' : '添加监测对象'
},
methods: {
rules() {
return {
objectType: '请选择监测对象类型',
name: '请输入姓名',
idNumber: '请输入身份证号',
phone: '请输入联系方式',
currentAreaId: '请选择现住址',
}
},
submit() {
if (!this.form.type) {
return this.$u.toast('请选择监测类型')
const rules = this.rules()
for (let v of Object.keys(rules)) {
if (!this.form[v]) {
return this.$u.toast(rules[v])
}
}
if(!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
return this.$u.toast('现住址必须选到村级')
}
if (!this.form.phone) {
return this.$u.toast('请输入联系方式')
if(this.form.files.length) {
this.form.photo = this.form.files[0].url
}
if (!this.form.addressAreaId) {
return this.$u.toast('请选择住址')
}
uni.showLoading()
this.$http.post('/app/apppreventionreturntopoverty/addOrUpdate', {
this.form.girdId = this.girdInfo.girdId
this.form.girdName = this.girdInfo.girdName
this.form.householdIdNumber = this.form.idNumber
this.$http.post('/app/apppreventionreturntopoverty/addByEwechat', {
...this.form,
id: this.isEdit ? this.id : ''
}).then(res => {
@@ -318,12 +362,11 @@ export default {
delta: 1
})
}
uni.hideLoading()
})
},
onAreaChange(e) {
this.form.addressAreaId = e
this.form.currentAreaId = e
},
onChange(e) {
@@ -337,9 +380,28 @@ export default {
...this.form,
...res.data
}
if(this.form.photo) {
this.form.files = [{url: this.form.photo}]
}
}
})
}
},
changeIdNumber() {
let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (this.form.idNumber.length == 18 && !reg.test(this.form.idNumber)) {
return this.$u.toast('请输入正确的身份证号码')
}
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.sex = info.gender
},
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
this.girdInfo = res.data
}
})
},
}
}
</script>