This commit is contained in:
liuye
2022-04-25 15:39:32 +08:00
parent 9521730bae
commit f0e3aaa3ab
4 changed files with 113 additions and 50 deletions

View File

@@ -27,7 +27,7 @@ export default {
},
created() {
this.dict.load("sex", "fpNation", "fpPrtpStatus", "fpHealth", "fpStudentsInSchool", 'fpYesOrNo', "fpRelationship",
"yesOrNo", "fpLaborSkills", "fpEducation", "fpType", "fpPoliticalOutlook",
"yesOrNo", "fpLaborSkills", "fpEducation", "fpType", "fpPoliticalOutlook","fpType", "fpRiskType",
"fpPublicWelfarePostAssistance","fpHealthAssistance","fpFnancialAssistance","fpEmploymentAssistance","fpEducationalAssistance","fpIndustrialAssistance","fpSocialAssistance")
}
}

View File

@@ -304,7 +304,12 @@ export default {
params: {id}
}).then(res => {
if (res?.data) {
this.form = res.data
res.data.healthyStatusList = []
if(res.data.healthyStatus) {
res.data.healthyStatusList = res.data.healthyStatus.split(',')
}
this.form = {...res.data}
console.log(res.data)
}
})
},
@@ -315,6 +320,8 @@ export default {
submit() {
this.$refs.ruleForm.validate(v => {
if (v) {
this.form.isHousehold = 1
this.form.householdIdNumber = this.form.idNumber
if (this.form.healthyStatusList.length) {
this.form.healthyStatus = this.form.healthyStatusList.join(',')
}

View File

@@ -185,9 +185,9 @@
:editable="false"
/>
</div>
<el-form-item label="健康状况">{{
dict.getLabel("fpHealth", detail.healthyStatus)
}}</el-form-item>
<el-form-item label="健康状况">
<span v-for="(item, index) in detail.healthyStatusList" :key="index"><span v-if="index > 0">,</span>{{dict.getLabel("fpHealth", item)}}</span>
</el-form-item>
</template>
</ai-card>
<ai-card title="联络信息">
@@ -309,7 +309,7 @@
cursor: pointer;
font-size: 12px;
"
@click="addFamily()"
@click="addFamily({})"
>添加</span
>
</template>
@@ -386,7 +386,7 @@
v-model="form.name"
placeholder="请输入姓名"
clearable
:disabled="isEdit"
:disabled="isEdit || isSelectUser"
>
<template slot="append">
<ai-person-select
@@ -402,7 +402,7 @@
v-model="form.idNumber"
placeholder="请输入身份证号"
:maxlength="18"
:disabled="isEdit"
:disabled="isEdit || isSelectUser"
@change="handleIdNumberAutocomplete"
/>
</el-form-item>
@@ -552,6 +552,11 @@
/>
</el-form-item>
</el-form-item>
<el-form-item label="健康状况" prop="healthyStatusList">
<el-checkbox-group v-model="form.healthyStatusList">
<el-checkbox :label="item.dictValue" v-for="(item, index) in dict.getDict('fpHealth')" :key="index">{{item.dictName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</ai-dialog>
<ai-dialog
@@ -569,74 +574,77 @@
<div flex class="flex-start">
<div flex class="half wrap fill">
<el-form-item label="身份证号" prop="name">{{
detail.idNumber
familyInfo.name
}}</el-form-item>
<el-form-item label="身份证号" prop="name">{{
familyInfo.idNumber
}}</el-form-item>
<el-form-item label="性别" prop="sex">{{
dict.getLabel("sex", detail.sex)
dict.getLabel("sex", familyInfo.sex)
}}</el-form-item>
<el-form-item label="出生日期">{{
detail.birthDate
familyInfo.birthDate
}}</el-form-item>
<el-form-item label="年龄" prop="age">{{
detail.age
familyInfo.age
}}</el-form-item>
<el-form-item label="联系方式">{{detail.phone}}</el-form-item>
<el-form-item label="联系方式">{{familyInfo.phone}}</el-form-item>
<el-form-item label="与户主关系">{{
dict.getLabel("fpRelationship", detail.householdRelation)
dict.getLabel("fpRelationship", familyInfo.householdRelation)
}}</el-form-item>
<el-form-item label="文化程度">{{
dict.getLabel("fpEducation", detail.education)
dict.getLabel("fpEducation", familyInfo.education)
}}</el-form-item>
<el-form-item label="民族">{{
dict.getLabel("fpNation", detail.nation)
dict.getLabel("fpNation", familyInfo.nation)
}}</el-form-item>
<el-form-item label="政治面貌"
>{{
dict.getLabel("fpPoliticalOutlook", detail.politicsStatus)
dict.getLabel("fpPoliticalOutlook", familyInfo.politicsStatus)
}}
</el-form-item>
<el-form-item label="在校生状况"
>{{ dict.getLabel("fpStudentsInSchool", detail.schoolStatus) }}
>{{ dict.getLabel("fpStudentsInSchool", familyInfo.schoolStatus) }}
</el-form-item>
<el-form-item label="务工时间(月)" prop="idNumber">{{
detail.workeMonths
familyInfo.workeMonths
}}</el-form-item>
<el-form-item label="劳动技能"
>{{ dict.getLabel("fpLaborSkills", detail.labourStatus) }}
>{{ dict.getLabel("fpLaborSkills", familyInfo.labourStatus) }}
</el-form-item>
<el-form-item label="务工区域" prop="idNumber">{{
detail.workArea
familyInfo.workArea
}}</el-form-item>
<el-form-item label="是否参加大病保险"
>{{
dict.getLabel("fpYesOrNo", detail.seriousIllnessInsurance)
dict.getLabel("fpYesOrNo", familyInfo.seriousIllnessInsurance)
}}
</el-form-item>
<el-form-item label="是否参加基本医保"
>{{ dict.getLabel("fpYesOrNo", detail.basicMedicalTreatment) }}
>{{ dict.getLabel("fpYesOrNo", familyInfo.basicMedicalTreatment) }}
</el-form-item>
<el-form-item label="享受最低生活保障"
>{{ dict.getLabel("fpYesOrNo", detail.subsistenceAllowance) }}
>{{ dict.getLabel("fpYesOrNo", familyInfo.subsistenceAllowance) }}
</el-form-item>
<el-form-item label="是否参加养老保险"
>{{ dict.getLabel("fpYesOrNo", detail.endowmentInsurance) }}
>{{ dict.getLabel("fpYesOrNo", familyInfo.endowmentInsurance) }}
</el-form-item>
<el-form-item label="是否特困供养"
>{{ dict.getLabel("fpYesOrNo", detail.specialPovertySupport) }}
>{{ dict.getLabel("fpYesOrNo", familyInfo.specialPovertySupport) }}
</el-form-item>
</div>
<ai-avatar
:instance="instance"
v-model="detail.photo"
v-model="familyInfo.photo"
:editable="false"
/>
</div>
<el-form-item label="现住址">{{
currentFullAddress
}}</el-form-item>
<el-form-item label="健康状况">{{
currentFullAddress
currentFullAddressFamily
}}</el-form-item>
<el-form-item label="健康状况">
<span v-for="(item, index) in familyInfo.healthyStatusList" :key="index"><span v-if="index > 0">,</span>{{dict.getLabel("fpHealth", item)}}</span>
</el-form-item>
</el-form>
</ai-dialog>
</template>
@@ -684,6 +692,10 @@ export default {
let { countyName, townName, villageName, currentAddress } = this.detail;
return [countyName, townName, villageName, currentAddress].join("");
},
currentFullAddressFamily() {
let { countyName, townName, villageName, currentAddress } = this.familyInfo;
return [countyName, townName, villageName, currentAddress].join("");
},
rules() {
return {
idNumber: [{ required: true, message: "请输入身份证号" }],
@@ -708,28 +720,65 @@ export default {
detail: {},
currentTab: "",
isShowAdd: false,
form: {},
form: {healthyStatusList: []},
isEdit: false,
isShowDetail: false,
familyInfo: {}
familyInfo: {},
isSelectUser: false
};
},
methods: {
checkName(e) {
// this.formData.name = e.name
// this.formData.idNumber = e.idNumber
// this.formData.phone = e.phone
// this.formData.areaId = e.householdAreaId
if(!e) {
this.isSelectUser = false
this.form.name = ''
this.form.idNumber = ''
this.form.phone =''
this.form.areaId = ''
this.form.birthDate = ''
this.form.sex = ''
this.form.age = ''
return
}
this.form.name = e.name
this.form.idNumber = e.idNumber
this.form.phone = e.phone
this.form.areaId = e.householdAreaId
this.handleIdNumberAutocomplete(e.idNumber)
this.isSelectUser = true
},
addFamily(row) {
if(row && row.id) {
this.isEdit = true
}
row.healthyStatusList = []
if(row && row.healthyStatus) {
row.healthyStatusList = row.healthyStatus.split(',')
}
this.form = { ...row }
this.isShowAdd = true
},
viewFamily(row) {
row.healthyStatusList = []
if(row.healthyStatus) {
row.healthyStatusList = row.healthyStatus.split(',')
}
this.familyInfo = {...row}
this.isShowDetail = true
},
delFamily() {},
delFamily(row) {
if(row.isHousehold == 1) {
return this.$message.error('户主信息不允许删除');
}
this.$confirm("是否删除该家庭成员").then(() => {
this.instance.post(`/app/apppreventionreturntopoverty/delete?ids=${row.id}`).then(res => {
if (res.code == 0) {
this.getDetail()
this.$message.success('删除成功!');
}
})
})
},
handleIdNumberAutocomplete(v) {
let { birthday: birthDate, sex } = this.idCardNoUtil.getIdCardInfo(v);
this.form = { ...this.form, birthDate, sex, age: this.$calcAge(v) };
@@ -737,20 +786,23 @@ export default {
onConfirm() {
this.$refs.ruleForm.validate((v) => {
if (v) {
// if (this.form.isHousehold == 1) {
// this.form.householdIdNumber = this.form.idNumber
// }
// this.instance.post(`/app/apppreventionreturntopoverty/addOrUpdate`, this.form).then(res => {
// if (res.code == 0) {
// this.$message.success('提交成功!');
// this.back()
// }
// })
this.form.isHousehold = 0
this.form.householdIdNumber = this.detail.idNumber
if (this.form.healthyStatusList.length) {
this.form.healthyStatus = this.form.healthyStatusList.join(',')
}
this.instance.post(`/app/apppreventionreturntopoverty/addOrUpdate`, this.form).then(res => {
if (res.code == 0) {
this.getDetail()
this.$message.success('提交成功!');
this.isShowAdd = false
}
})
}
});
},
onClose() {
this.isShow = false;
this.isShowAdd = false;
},
back() {
this.$router.push({});
@@ -768,6 +820,10 @@ export default {
this.detail.family?.map((e) => {
e.householdRelation = e.householdRelation || "户主";
});
if(this.detail.healthyStatus) {
this.detail.healthyStatusList = this.detail.healthyStatus.split(',')
}
}
});
},

View File

@@ -38,7 +38,7 @@
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<el-button type="text" @click="showDetail(row)" v-if="row.zwspPictureUrl">详情</el-button>
<el-button type="text" @click="showDetail(row)" v-if="row.zwspId">详情</el-button>
</template>
</el-table-column>
</ai-table>
@@ -98,7 +98,7 @@ export default {
})
},
showDetail(row) {
this.dialogTitle = row.classificationName
this.dialogTitle = row.processName
this.dialogImgUrl = row.zwspPictureUrl
this.dialog = true
},