|
|
@ -102,6 +102,7 @@ |
|
|
|
placeholder="房号" |
|
|
|
size="small" |
|
|
|
clearable |
|
|
|
@change="handleChangeH" |
|
|
|
style="width: 120px" |
|
|
|
class="resi-cell-select" |
|
|
|
> |
|
|
@ -125,10 +126,22 @@ |
|
|
|
class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
|
placeholder="请输入姓名 " |
|
|
|
v-model="fmData.name" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
<el-checkbox v-model="fmData.isWelfare" true-label="1" false-label="0" |
|
|
|
>享受福利</el-checkbox |
|
|
|
> |
|
|
|
<el-checkbox |
|
|
|
v-model="fmData.isCheck" |
|
|
|
true-label="1" |
|
|
|
false-label="0" |
|
|
|
@change="checkResiAvailable" |
|
|
|
>补充居民信息</el-checkbox |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
@ -279,7 +292,7 @@ |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="户主姓名" |
|
|
|
prop="houseHolderName" |
|
|
|
prop="householderName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
@ -288,19 +301,20 @@ |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入户主姓名" |
|
|
|
v-model="fmData.houseHolderName" |
|
|
|
:disabled="fmData.alreadyHaveMaster" |
|
|
|
v-model="fmData.householderName" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="与户主关系" |
|
|
|
prop="houseHolderRelation" |
|
|
|
prop="householderRelation" |
|
|
|
label-width="150px" |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model.trim="fmData.houseHolderRelation" |
|
|
|
v-model.trim="fmData.householderRelation" |
|
|
|
placeholder="与户主关系" |
|
|
|
size="small" |
|
|
|
clearable |
|
|
@ -351,21 +365,17 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import formVltHelper from "dai-js/tools/formVltHelper"; |
|
|
|
import { computedCard } from "@/utils/index"; |
|
|
|
import { isCard, isMobile } from "@/utils/validate"; |
|
|
|
import { isCard } from "@/utils/validate"; |
|
|
|
|
|
|
|
var map; |
|
|
|
var search; |
|
|
|
var markers; |
|
|
|
var infoWindowList; |
|
|
|
let loading; // 加载动画 |
|
|
|
|
|
|
|
function iniFmData() { |
|
|
|
return { |
|
|
|
id: "", |
|
|
|
gridId: "", |
|
|
|
villageId: "", |
|
|
|
buildId: "", |
|
|
@ -374,15 +384,17 @@ function iniFmData() { |
|
|
|
name: "", |
|
|
|
mobile: "", |
|
|
|
idCard: "", |
|
|
|
welfare: "", //福利0否,1是 |
|
|
|
isWelfare: "0", //福利0否,1是 |
|
|
|
isCheck: "0", |
|
|
|
gender: "", |
|
|
|
birthplace: "", |
|
|
|
father: "", |
|
|
|
mother: "", |
|
|
|
count: "", |
|
|
|
reportDate: "", |
|
|
|
houseHolderName: "", |
|
|
|
houseHolderRelation: "", |
|
|
|
householderName: "", |
|
|
|
householderRelation: "", |
|
|
|
alreadyHaveMaster: false, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
@ -465,11 +477,38 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
async checkResiAvailable() { |
|
|
|
const { |
|
|
|
fmData: { idCard, isCheck }, |
|
|
|
} = this; |
|
|
|
if (isCheck == "1" && isCard(idCard)) { |
|
|
|
const { data, code, msg } = await requestPost( |
|
|
|
"/epmetuser/icresiuser/checkuser", |
|
|
|
{ |
|
|
|
idCard, |
|
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
|
} |
|
|
|
); |
|
|
|
if (code === 0) { |
|
|
|
if (!data.moveInstatus) { |
|
|
|
this.$message({ |
|
|
|
type: "error", |
|
|
|
message: `请联系${data.resiAgencyName}迁出该居民后操作`, |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleBlurId() { |
|
|
|
console.log("33333333333333333333"); |
|
|
|
const { sex, birth, age } = computedCard(this.fmData.idCard); |
|
|
|
this.fmData.birthday = birth; |
|
|
|
this.fmData.gender = sex == 1 ? "1" : "2"; |
|
|
|
if (birth) { |
|
|
|
this.fmData.birthday = birth; |
|
|
|
this.fmData.gender = sex == 1 ? "1" : "2"; |
|
|
|
this.checkResiAvailable(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleClearVillage() { |
|
|
@ -511,6 +550,10 @@ export default { |
|
|
|
this.fmData.homeId = ""; |
|
|
|
this.getHouseList(); |
|
|
|
}, |
|
|
|
handleChangeH(val) { |
|
|
|
console.log("val", val); |
|
|
|
this.getHouseMaster(); |
|
|
|
}, |
|
|
|
|
|
|
|
getRelationList() { |
|
|
|
const { user } = this.$store.state; |
|
|
@ -620,16 +663,29 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
handleAddStaff() { |
|
|
|
this.fmData.organizationPersonnel = [ |
|
|
|
...this.fmData.organizationPersonnel, |
|
|
|
{ personName: "", personPhone: "" }, |
|
|
|
]; |
|
|
|
}, |
|
|
|
handleDelStaff(index) { |
|
|
|
const { organizationPersonnel } = this.fmData; |
|
|
|
organizationPersonnel.splice(index, 1); |
|
|
|
this.fmData.organizationPersonnel = organizationPersonnel; |
|
|
|
getHouseMaster() { |
|
|
|
const { homeId } = this.fmData; |
|
|
|
if (!homeId) return (this.alreadyHaveMaster = false); |
|
|
|
|
|
|
|
this.$http |
|
|
|
.post("/epmetuser/icresiuser/queryhousehold/" + homeId, {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log("获取户主信息成功", res.data); |
|
|
|
const { name } = res.data; |
|
|
|
if (name) { |
|
|
|
this.fmData.householderName = name; |
|
|
|
this.alreadyHaveMaster = true; |
|
|
|
} else { |
|
|
|
this.alreadyHaveMaster = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async initForm(type, row) { |
|
|
@ -638,7 +694,22 @@ export default { |
|
|
|
this.formType = type; |
|
|
|
console.log(row); |
|
|
|
if (row) { |
|
|
|
this.fmData = { ...this.fmData, ...row }; |
|
|
|
// this.fmData = { ...this.fmData, ...row }; |
|
|
|
this.getInfo(row.id); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async getInfo(id) { |
|
|
|
const { data, code, msg } = await requestPost( |
|
|
|
"/epmetuser/icBirthRecord", |
|
|
|
{ |
|
|
|
id, |
|
|
|
} |
|
|
|
); |
|
|
|
if (code === 0) { |
|
|
|
this.fmData = { ...this.fmData, ...data }; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -666,9 +737,9 @@ export default { |
|
|
|
async submit() { |
|
|
|
let url = ""; |
|
|
|
if (this.formType === "add") { |
|
|
|
url = "/epmetuser/birth/save"; |
|
|
|
url = "/epmetuser/icBirthRecord/save"; |
|
|
|
} else { |
|
|
|
url = "/epmetuser/birth/edit"; |
|
|
|
url = "/epmetuser/icBirthRecord/update"; |
|
|
|
|
|
|
|
this.fmData.orgId = this.orgId; |
|
|
|
} |
|
|
|