对接户籍管理模块接口
This commit is contained in:
parent
3478197e2c
commit
3368f3f0f6
|
|
@ -119,4 +119,14 @@ export function peopleDetail(params) {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*人员删除
|
||||||
|
*/
|
||||||
|
export function peopleDel(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/people/peopleDel/${params.peopleId}`,
|
||||||
|
method: "DELETE",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
331
src/views/base-manage/flow/dialog/detail-addPersonnel.vue
Normal file
331
src/views/base-manage/flow/dialog/detail-addPersonnel.vue
Normal file
|
|
@ -0,0 +1,331 @@
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="titleName + '人员'"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:footerkeepnaem="readonly ? false : true"
|
||||||
|
:diafooter="true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-width="120"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="formData"
|
||||||
|
>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话" prop="phoneNumber">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入电话"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.phoneNumber"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别" prop="sex">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="formData.sex"
|
||||||
|
>
|
||||||
|
<el-option label="男" :value="1">男</el-option>
|
||||||
|
<el-option label="女" :value="0">女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
|
<el-cascader
|
||||||
|
:disabled="readonly"
|
||||||
|
ref="cascader"
|
||||||
|
v-model="formData.areaCode"
|
||||||
|
placeholder="请选择地区"
|
||||||
|
:options="orgList"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'orgname',
|
||||||
|
value: 'orgcode',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="人员标签" prop="peopleTag">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择人员标签"
|
||||||
|
v-model="formData.peopleTag"
|
||||||
|
>
|
||||||
|
<el-option label="常住人口" :value="1">常住人口</el-option>
|
||||||
|
<el-option label="流动人口" :value="2">流动人口</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关系" prop="relation">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择关系"
|
||||||
|
v-model="formData.relation"
|
||||||
|
>
|
||||||
|
<el-option label="户主" :value="1">户主</el-option>
|
||||||
|
<el-option label="父亲" :value="2">父亲</el-option>
|
||||||
|
<el-option label="母亲" :value="3">母亲</el-option>
|
||||||
|
<el-option label="祖父" :value="4">祖父</el-option>
|
||||||
|
<el-option label="祖母" :value="5">祖母</el-option>
|
||||||
|
<el-option label="子女" :value="6">子女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择出生日期"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.createTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择创建时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="typeId" style="width: 100%;">
|
||||||
|
<el-select
|
||||||
|
multiple
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择类型"
|
||||||
|
v-model="formData.typeId"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in typeList"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
>{{ item.typeName }}</el-option
|
||||||
|
>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.idCard"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="当前地址" prop="nowAddress" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入当前地址"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.nowAddress"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡状态"
|
||||||
|
prop="deathState"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择死亡状态"
|
||||||
|
v-model="formData.deathState"
|
||||||
|
>
|
||||||
|
<el-option label="正常" :value="1">正常</el-option>
|
||||||
|
<el-option label="死亡" :value="2">死亡</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡时间"
|
||||||
|
prop="deathTime"
|
||||||
|
>
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.deathTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择死亡时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang='ts'>
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { crTypeList, peopleAdd, peopleDetail } from "@/api/base";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["close"]);
|
||||||
|
const titleName = ref("新增");
|
||||||
|
// 表单
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
let isCardId = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return new Error("请输入身份证号)");
|
||||||
|
} else {
|
||||||
|
const reg =
|
||||||
|
/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/;
|
||||||
|
const card = reg.test(value);
|
||||||
|
if (!card) {
|
||||||
|
//判断座机为12位
|
||||||
|
callback(new Error("身份证格式如:423024xxxx0216xxxx"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||||
|
phoneNumber: [{ required: true, message: "请输入电话", trigger: "blur" }],
|
||||||
|
areaCode: [{ required: true, message: "请选择地区", trigger: "blur" }],
|
||||||
|
idCard: [
|
||||||
|
{ required: true, message: "请输入身份证号", trigger: "blur" },
|
||||||
|
{ validator: isCardId, trigger: "blur" },
|
||||||
|
],
|
||||||
|
createTime: [{ required: true, message: "请选择创建时间", trigger: "blur" }],
|
||||||
|
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
||||||
|
nowAddress: [{ required: true, message: "请输入地址", trigger: "blur" }],
|
||||||
|
peopleTag: [{ required: true, message: "请选择人员标签", trigger: "blur" }],
|
||||||
|
relation: [{ required: true, message: "请选择人员关系", trigger: "blur" }],
|
||||||
|
typeId: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const formData = ref<any>({});
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (formData.value.deathState == 2 && !formData.value.deathTime) {
|
||||||
|
ElMessage.error({
|
||||||
|
message: "请选择死亡时间",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let params = {
|
||||||
|
...formData.value,
|
||||||
|
areaCode: "",
|
||||||
|
peopleId: formData.value.peopleId ? formData.value.peopleId : null,
|
||||||
|
domicileId:props.id,
|
||||||
|
};
|
||||||
|
if (formData.value.areaCode instanceof Array) {
|
||||||
|
params.areaCode =
|
||||||
|
formData.value.areaCode[formData.value.areaCode.length - 1];
|
||||||
|
} else {
|
||||||
|
params.areaCode = formData.value.areaCode;
|
||||||
|
}
|
||||||
|
peopleAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getareaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取类型
|
||||||
|
const typeList = ref([]);
|
||||||
|
const getCrTypeList = () => {
|
||||||
|
crTypeList(userId.value).then((res: any) => {
|
||||||
|
typeList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//查看人员详情
|
||||||
|
const getPeopleDetail = (id) => {
|
||||||
|
peopleDetail({ peopleId: id }).then((res: any) => {
|
||||||
|
formData.value = res.data;
|
||||||
|
formData.value.typeId = res.data.typeIds;
|
||||||
|
formData.value.peopleTag = res.data.peopleTag * 1;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
formRef.value?.clearValidate();
|
||||||
|
formData.value = {};
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getareaTree();
|
||||||
|
getCrTypeList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//详情
|
||||||
|
watch(
|
||||||
|
() => props.form,
|
||||||
|
(val: any) => {
|
||||||
|
titleName.value = val.peopleId ? "编辑" : "新增";
|
||||||
|
if (val.peopleId) {
|
||||||
|
getPeopleDetail(val.peopleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,18 +1,11 @@
|
||||||
<!-- 流动人口 -->
|
<!-- 贫困户管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="percentage-content">
|
<div class="percentage-content">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
||||||
<div>
|
<div>
|
||||||
<div class="h-layout">
|
<div class="h-layout">
|
||||||
<div
|
<div class="tool-item" @click="getList">
|
||||||
class="tool-item"
|
|
||||||
@click="(currentItem = {}), (visible = true)"
|
|
||||||
>
|
|
||||||
<svg-icon name="add" class="icon" />
|
|
||||||
<span>新增</span>
|
|
||||||
</div>
|
|
||||||
<div class="tool-item">
|
|
||||||
<svg-icon name="refurbish" class="icon" />
|
<svg-icon name="refurbish" class="icon" />
|
||||||
<span>刷新</span>
|
<span>刷新</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,13 +61,14 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="姓名"
|
label="姓名"
|
||||||
prop="name"
|
prop="name"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="户籍"
|
label="户籍地址"
|
||||||
prop="loc"
|
prop="domicileAddress"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -82,35 +76,66 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="性别"
|
label="性别"
|
||||||
prop="sex"
|
prop="sex"
|
||||||
|
width="80"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.sex == 1? '男':'女'}}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="出生日期"
|
label="出生日期"
|
||||||
prop="birth"
|
prop="birthday"
|
||||||
|
width="250"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员标签"
|
label="关系"
|
||||||
prop="tag"
|
prop="relation"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.relation == 1? '户主':scope.row.relation == 2? '父亲':
|
||||||
|
scope.row.relation == 3? '母亲':scope.row.relation == 4? '祖父':
|
||||||
|
scope.row.relation == 5? '祖母':'子女' }}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员类别"
|
label="人员状态"
|
||||||
prop="type"
|
prop="deathState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.deathState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.deathState == 2"
|
||||||
|
>死亡</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="left"
|
align="center"
|
||||||
label="现居地址"
|
label="户籍状态"
|
||||||
prop="address"
|
prop="domicileState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.domicileState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.domicileState == 2"
|
||||||
|
>注销</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
|
|
@ -121,19 +146,23 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="
|
||||||
|
(form = scope.row),
|
||||||
|
(detailDialogVisible = true),
|
||||||
|
(readonly = false)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<svg-icon name="edit" class="icon"></svg-icon>
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
<span class="edit">编辑</span>
|
<span class="edit">编辑</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="(detailDialogVisible = true), (form = scope.row), (readonly = true)"
|
||||||
>
|
>
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
<span class="detail">详情</span>
|
<span class="detail">详情</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="operate" @click="del(scope.row, '删除')">
|
<span class="operate" @click="del(scope.row.peopleId)">
|
||||||
<svg-icon name="delete" class="icon"></svg-icon>
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
<span class="func">删除</span>
|
<span class="func">删除</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -154,19 +183,21 @@
|
||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<add-edit
|
<DetailAddPersonnel
|
||||||
:visible="visible"
|
:visible="detailDialogVisible"
|
||||||
:form="currentItem"
|
:form="form"
|
||||||
@close="(visible = false), (currentItem = {})"
|
:readonly="readonly"
|
||||||
|
:id="domicileId"
|
||||||
|
@close="onclone"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import AddEdit from "../population/dialog/add-edit.vue";
|
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
||||||
import { areaTree } from "@/api/account";
|
import { areaTree } from "@/api/account";
|
||||||
import { peoplePage } from "@/api/base";
|
import { peoplePage, peopleDel } from "@/api/base";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const user = ref(JSON.parse(userStore.userInfo));
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
|
@ -174,18 +205,22 @@ const userId = ref(user.value.userId);
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const currentItem = ref();
|
const currentItem = ref();
|
||||||
|
//人员信息
|
||||||
|
const form = ref({});
|
||||||
|
//人员信息弹窗
|
||||||
|
const detailDialogVisible = ref(false);
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
const search = ref({
|
const search = ref({
|
||||||
condition: "",
|
condition: "",
|
||||||
areaCode:"",
|
areaCode: "",
|
||||||
});
|
});
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
const total = ref(4);
|
const total = ref(2);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
//获取列表
|
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
|
//获取列表
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
tableDataloading.value = true;
|
tableDataloading.value = true;
|
||||||
let params = {
|
let params = {
|
||||||
|
|
@ -194,7 +229,7 @@ const getList = () => {
|
||||||
condition: search.value.condition,
|
condition: search.value.condition,
|
||||||
userId: userId.value,
|
userId: userId.value,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
typeName: "常驻人口",
|
typeName: "流动人口",
|
||||||
};
|
};
|
||||||
if (search.value.areaCode) {
|
if (search.value.areaCode) {
|
||||||
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
||||||
|
|
@ -206,6 +241,30 @@ const getList = () => {
|
||||||
tableDataloading.value = false;
|
tableDataloading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*删除人员
|
||||||
|
*/
|
||||||
|
const del = (id) => {
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
peopleDel({peopleId:id}).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
//获取地区
|
//获取地区
|
||||||
const orgList = ref([]);
|
const orgList = ref([]);
|
||||||
const getareaTree = () => {
|
const getareaTree = () => {
|
||||||
|
|
@ -213,17 +272,12 @@ const getareaTree = () => {
|
||||||
orgList.value = res.data;
|
orgList.value = res.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
//关闭弹窗
|
||||||
* 删除
|
const onclone = () => {
|
||||||
*/
|
detailDialogVisible.value = false;
|
||||||
const del = (item, tips) => {
|
form.value = {};
|
||||||
ElMessageBox.confirm(`是否确认${tips}?`, "提示", {
|
getList();
|
||||||
confirmButtonText: "是",
|
|
||||||
cancelButtonText: "否",
|
|
||||||
type: "warning",
|
|
||||||
}).then(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getareaTree();
|
getareaTree();
|
||||||
getList();
|
getList();
|
||||||
|
|
|
||||||
331
src/views/base-manage/permanent/dialog/detail-addPersonnel.vue
Normal file
331
src/views/base-manage/permanent/dialog/detail-addPersonnel.vue
Normal file
|
|
@ -0,0 +1,331 @@
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="titleName + '人员'"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:footerkeepnaem="readonly ? false : true"
|
||||||
|
:diafooter="true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-width="120"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="formData"
|
||||||
|
>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话" prop="phoneNumber">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入电话"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.phoneNumber"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别" prop="sex">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="formData.sex"
|
||||||
|
>
|
||||||
|
<el-option label="男" :value="1">男</el-option>
|
||||||
|
<el-option label="女" :value="0">女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
|
<el-cascader
|
||||||
|
:disabled="readonly"
|
||||||
|
ref="cascader"
|
||||||
|
v-model="formData.areaCode"
|
||||||
|
placeholder="请选择地区"
|
||||||
|
:options="orgList"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'orgname',
|
||||||
|
value: 'orgcode',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="人员标签" prop="peopleTag">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择人员标签"
|
||||||
|
v-model="formData.peopleTag"
|
||||||
|
>
|
||||||
|
<el-option label="常住人口" :value="1">常住人口</el-option>
|
||||||
|
<el-option label="流动人口" :value="2">流动人口</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关系" prop="relation">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择关系"
|
||||||
|
v-model="formData.relation"
|
||||||
|
>
|
||||||
|
<el-option label="户主" :value="1">户主</el-option>
|
||||||
|
<el-option label="父亲" :value="2">父亲</el-option>
|
||||||
|
<el-option label="母亲" :value="3">母亲</el-option>
|
||||||
|
<el-option label="祖父" :value="4">祖父</el-option>
|
||||||
|
<el-option label="祖母" :value="5">祖母</el-option>
|
||||||
|
<el-option label="子女" :value="6">子女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择出生日期"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.createTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择创建时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="typeId" style="width: 100%;">
|
||||||
|
<el-select
|
||||||
|
multiple
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择类型"
|
||||||
|
v-model="formData.typeId"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in typeList"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
>{{ item.typeName }}</el-option
|
||||||
|
>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.idCard"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="当前地址" prop="nowAddress" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入当前地址"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.nowAddress"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡状态"
|
||||||
|
prop="deathState"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择死亡状态"
|
||||||
|
v-model="formData.deathState"
|
||||||
|
>
|
||||||
|
<el-option label="正常" :value="1">正常</el-option>
|
||||||
|
<el-option label="死亡" :value="2">死亡</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡时间"
|
||||||
|
prop="deathTime"
|
||||||
|
>
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.deathTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择死亡时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang='ts'>
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { crTypeList, peopleAdd, peopleDetail } from "@/api/base";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["close"]);
|
||||||
|
const titleName = ref("新增");
|
||||||
|
// 表单
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
let isCardId = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return new Error("请输入身份证号)");
|
||||||
|
} else {
|
||||||
|
const reg =
|
||||||
|
/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/;
|
||||||
|
const card = reg.test(value);
|
||||||
|
if (!card) {
|
||||||
|
//判断座机为12位
|
||||||
|
callback(new Error("身份证格式如:423024xxxx0216xxxx"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||||
|
phoneNumber: [{ required: true, message: "请输入电话", trigger: "blur" }],
|
||||||
|
areaCode: [{ required: true, message: "请选择地区", trigger: "blur" }],
|
||||||
|
idCard: [
|
||||||
|
{ required: true, message: "请输入身份证号", trigger: "blur" },
|
||||||
|
{ validator: isCardId, trigger: "blur" },
|
||||||
|
],
|
||||||
|
createTime: [{ required: true, message: "请选择创建时间", trigger: "blur" }],
|
||||||
|
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
||||||
|
nowAddress: [{ required: true, message: "请输入地址", trigger: "blur" }],
|
||||||
|
peopleTag: [{ required: true, message: "请选择人员标签", trigger: "blur" }],
|
||||||
|
relation: [{ required: true, message: "请选择人员关系", trigger: "blur" }],
|
||||||
|
typeId: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const formData = ref<any>({});
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (formData.value.deathState == 2 && !formData.value.deathTime) {
|
||||||
|
ElMessage.error({
|
||||||
|
message: "请选择死亡时间",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let params = {
|
||||||
|
...formData.value,
|
||||||
|
areaCode: "",
|
||||||
|
peopleId: formData.value.peopleId ? formData.value.peopleId : null,
|
||||||
|
domicileId:props.id,
|
||||||
|
};
|
||||||
|
if (formData.value.areaCode instanceof Array) {
|
||||||
|
params.areaCode =
|
||||||
|
formData.value.areaCode[formData.value.areaCode.length - 1];
|
||||||
|
} else {
|
||||||
|
params.areaCode = formData.value.areaCode;
|
||||||
|
}
|
||||||
|
peopleAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getareaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取类型
|
||||||
|
const typeList = ref([]);
|
||||||
|
const getCrTypeList = () => {
|
||||||
|
crTypeList(userId.value).then((res: any) => {
|
||||||
|
typeList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//查看人员详情
|
||||||
|
const getPeopleDetail = (id) => {
|
||||||
|
peopleDetail({ peopleId: id }).then((res: any) => {
|
||||||
|
formData.value = res.data;
|
||||||
|
formData.value.typeId = res.data.typeIds;
|
||||||
|
formData.value.peopleTag = res.data.peopleTag * 1;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
formRef.value?.clearValidate();
|
||||||
|
formData.value = {};
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getareaTree();
|
||||||
|
getCrTypeList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//详情
|
||||||
|
watch(
|
||||||
|
() => props.form,
|
||||||
|
(val: any) => {
|
||||||
|
titleName.value = val.peopleId ? "编辑" : "新增";
|
||||||
|
if (val.peopleId) {
|
||||||
|
getPeopleDetail(val.peopleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,18 +1,11 @@
|
||||||
<!-- 常驻人口管理 -->
|
<!-- 贫困户管理 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="percentage-content">
|
<div class="percentage-content">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
||||||
<div>
|
<div>
|
||||||
<div class="h-layout">
|
<div class="h-layout">
|
||||||
<div
|
<div class="tool-item" @click="getList">
|
||||||
class="tool-item"
|
|
||||||
@click="(currentItem = {}), (visible = true)"
|
|
||||||
>
|
|
||||||
<svg-icon name="add" class="icon" />
|
|
||||||
<span>新增</span>
|
|
||||||
</div>
|
|
||||||
<div class="tool-item">
|
|
||||||
<svg-icon name="refurbish" class="icon" />
|
<svg-icon name="refurbish" class="icon" />
|
||||||
<span>刷新</span>
|
<span>刷新</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,13 +61,14 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="姓名"
|
label="姓名"
|
||||||
prop="name"
|
prop="name"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="户籍"
|
label="户籍地址"
|
||||||
prop="loc"
|
prop="domicileAddress"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -82,42 +76,66 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="性别"
|
label="性别"
|
||||||
prop="sex"
|
prop="sex"
|
||||||
|
width="80"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.sex == 1? '男':'女'}}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="出生日期"
|
label="出生日期"
|
||||||
prop="birth"
|
prop="birthday"
|
||||||
|
width="250"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员标签"
|
label="关系"
|
||||||
prop="tag"
|
prop="relation"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.relation == 1? '户主':scope.row.relation == 2? '父亲':
|
||||||
|
scope.row.relation == 3? '母亲':scope.row.relation == 4? '祖父':
|
||||||
|
scope.row.relation == 5? '祖母':'子女' }}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员类别"
|
label="人员状态"
|
||||||
prop="type"
|
prop="deathState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.deathState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.deathState == 2"
|
||||||
|
>死亡</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="是否为贫困户"
|
label="户籍状态"
|
||||||
prop="poor"
|
prop="domicileState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
<template #default="scope">
|
||||||
<el-table-column
|
<span class="table_ormal" v-if="scope.row.domicileState == 1"
|
||||||
:resizable="true"
|
>正常</span
|
||||||
align="left"
|
|
||||||
label="现居地址"
|
|
||||||
prop="address"
|
|
||||||
>
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.domicileState == 2"
|
||||||
|
>注销</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
|
|
@ -128,19 +146,23 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="
|
||||||
|
(form = scope.row),
|
||||||
|
(detailDialogVisible = true),
|
||||||
|
(readonly = false)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<svg-icon name="edit" class="icon"></svg-icon>
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
<span class="edit">编辑</span>
|
<span class="edit">编辑</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="(detailDialogVisible = true), (form = scope.row), (readonly = true)"
|
||||||
>
|
>
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
<span class="detail">详情</span>
|
<span class="detail">详情</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="operate" @click="del(scope.row, '删除')">
|
<span class="operate" @click="del(scope.row.peopleId)">
|
||||||
<svg-icon name="delete" class="icon"></svg-icon>
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
<span class="func">删除</span>
|
<span class="func">删除</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -161,19 +183,21 @@
|
||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<add-edit
|
<DetailAddPersonnel
|
||||||
:visible="visible"
|
:visible="detailDialogVisible"
|
||||||
:form="currentItem"
|
:form="form"
|
||||||
@close="(visible = false), (currentItem = {})"
|
:readonly="readonly"
|
||||||
|
:id="domicileId"
|
||||||
|
@close="onclone"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import AddEdit from "../population/dialog/add-edit.vue";
|
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
||||||
import { areaTree } from "@/api/account";
|
import { areaTree } from "@/api/account";
|
||||||
import { peoplePage } from "@/api/base";
|
import { peoplePage, peopleDel } from "@/api/base";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const user = ref(JSON.parse(userStore.userInfo));
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
|
@ -181,18 +205,22 @@ const userId = ref(user.value.userId);
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const currentItem = ref();
|
const currentItem = ref();
|
||||||
|
//人员信息
|
||||||
|
const form = ref({});
|
||||||
|
//人员信息弹窗
|
||||||
|
const detailDialogVisible = ref(false);
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
const search = ref({
|
const search = ref({
|
||||||
condition: "",
|
condition: "",
|
||||||
areaCode:"",
|
areaCode: "",
|
||||||
});
|
});
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
const total = ref(6);
|
const total = ref(2);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
//获取列表
|
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
|
//获取列表
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
tableDataloading.value = true;
|
tableDataloading.value = true;
|
||||||
let params = {
|
let params = {
|
||||||
|
|
@ -201,7 +229,7 @@ const getList = () => {
|
||||||
condition: search.value.condition,
|
condition: search.value.condition,
|
||||||
userId: userId.value,
|
userId: userId.value,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
typeName: "常驻人口",
|
typeName: "常住人口",
|
||||||
};
|
};
|
||||||
if (search.value.areaCode) {
|
if (search.value.areaCode) {
|
||||||
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
||||||
|
|
@ -213,15 +241,29 @@ const getList = () => {
|
||||||
tableDataloading.value = false;
|
tableDataloading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
*删除人员
|
||||||
*/
|
*/
|
||||||
const del = (item, tips) => {
|
const del = (id) => {
|
||||||
ElMessageBox.confirm(`是否确认${tips}?`, "提示", {
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
confirmButtonText: "是",
|
confirmButtonText: "是",
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {});
|
}).then(() => {
|
||||||
|
peopleDel({peopleId:id}).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
//获取地区
|
//获取地区
|
||||||
const orgList = ref([]);
|
const orgList = ref([]);
|
||||||
|
|
@ -230,6 +272,12 @@ const getareaTree = () => {
|
||||||
orgList.value = res.data;
|
orgList.value = res.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
detailDialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getareaTree();
|
getareaTree();
|
||||||
getList();
|
getList();
|
||||||
|
|
|
||||||
331
src/views/base-manage/poor/dialog/detail-addPersonnel.vue
Normal file
331
src/views/base-manage/poor/dialog/detail-addPersonnel.vue
Normal file
|
|
@ -0,0 +1,331 @@
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="titleName + '人员'"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:footerkeepnaem="readonly ? false : true"
|
||||||
|
:diafooter="true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-width="120"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="formData"
|
||||||
|
>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话" prop="phoneNumber">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入电话"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.phoneNumber"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别" prop="sex">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="formData.sex"
|
||||||
|
>
|
||||||
|
<el-option label="男" :value="1">男</el-option>
|
||||||
|
<el-option label="女" :value="0">女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
|
<el-cascader
|
||||||
|
:disabled="readonly"
|
||||||
|
ref="cascader"
|
||||||
|
v-model="formData.areaCode"
|
||||||
|
placeholder="请选择地区"
|
||||||
|
:options="orgList"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'orgname',
|
||||||
|
value: 'orgcode',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="人员标签" prop="peopleTag">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择人员标签"
|
||||||
|
v-model="formData.peopleTag"
|
||||||
|
>
|
||||||
|
<el-option label="常住人口" :value="1">常住人口</el-option>
|
||||||
|
<el-option label="流动人口" :value="2">流动人口</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关系" prop="relation">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择关系"
|
||||||
|
v-model="formData.relation"
|
||||||
|
>
|
||||||
|
<el-option label="户主" :value="1">户主</el-option>
|
||||||
|
<el-option label="父亲" :value="2">父亲</el-option>
|
||||||
|
<el-option label="母亲" :value="3">母亲</el-option>
|
||||||
|
<el-option label="祖父" :value="4">祖父</el-option>
|
||||||
|
<el-option label="祖母" :value="5">祖母</el-option>
|
||||||
|
<el-option label="子女" :value="6">子女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择出生日期"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.createTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择创建时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="typeId" style="width: 100%;">
|
||||||
|
<el-select
|
||||||
|
multiple
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择类型"
|
||||||
|
v-model="formData.typeId"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in typeList"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
>{{ item.typeName }}</el-option
|
||||||
|
>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.idCard"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="当前地址" prop="nowAddress" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入当前地址"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.nowAddress"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡状态"
|
||||||
|
prop="deathState"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择死亡状态"
|
||||||
|
v-model="formData.deathState"
|
||||||
|
>
|
||||||
|
<el-option label="正常" :value="1">正常</el-option>
|
||||||
|
<el-option label="死亡" :value="2">死亡</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡时间"
|
||||||
|
prop="deathTime"
|
||||||
|
>
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.deathTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择死亡时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang='ts'>
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { crTypeList, peopleAdd, peopleDetail } from "@/api/base";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["close"]);
|
||||||
|
const titleName = ref("新增");
|
||||||
|
// 表单
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
let isCardId = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return new Error("请输入身份证号)");
|
||||||
|
} else {
|
||||||
|
const reg =
|
||||||
|
/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/;
|
||||||
|
const card = reg.test(value);
|
||||||
|
if (!card) {
|
||||||
|
//判断座机为12位
|
||||||
|
callback(new Error("身份证格式如:423024xxxx0216xxxx"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||||
|
phoneNumber: [{ required: true, message: "请输入电话", trigger: "blur" }],
|
||||||
|
areaCode: [{ required: true, message: "请选择地区", trigger: "blur" }],
|
||||||
|
idCard: [
|
||||||
|
{ required: true, message: "请输入身份证号", trigger: "blur" },
|
||||||
|
{ validator: isCardId, trigger: "blur" },
|
||||||
|
],
|
||||||
|
createTime: [{ required: true, message: "请选择创建时间", trigger: "blur" }],
|
||||||
|
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
||||||
|
nowAddress: [{ required: true, message: "请输入地址", trigger: "blur" }],
|
||||||
|
peopleTag: [{ required: true, message: "请选择人员标签", trigger: "blur" }],
|
||||||
|
relation: [{ required: true, message: "请选择人员关系", trigger: "blur" }],
|
||||||
|
typeId: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const formData = ref<any>({});
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (formData.value.deathState == 2 && !formData.value.deathTime) {
|
||||||
|
ElMessage.error({
|
||||||
|
message: "请选择死亡时间",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let params = {
|
||||||
|
...formData.value,
|
||||||
|
areaCode: "",
|
||||||
|
peopleId: formData.value.peopleId ? formData.value.peopleId : null,
|
||||||
|
domicileId:props.id,
|
||||||
|
};
|
||||||
|
if (formData.value.areaCode instanceof Array) {
|
||||||
|
params.areaCode =
|
||||||
|
formData.value.areaCode[formData.value.areaCode.length - 1];
|
||||||
|
} else {
|
||||||
|
params.areaCode = formData.value.areaCode;
|
||||||
|
}
|
||||||
|
peopleAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getareaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取类型
|
||||||
|
const typeList = ref([]);
|
||||||
|
const getCrTypeList = () => {
|
||||||
|
crTypeList(userId.value).then((res: any) => {
|
||||||
|
typeList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//查看人员详情
|
||||||
|
const getPeopleDetail = (id) => {
|
||||||
|
peopleDetail({ peopleId: id }).then((res: any) => {
|
||||||
|
formData.value = res.data;
|
||||||
|
formData.value.typeId = res.data.typeIds;
|
||||||
|
formData.value.peopleTag = res.data.peopleTag * 1;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
formRef.value?.clearValidate();
|
||||||
|
formData.value = {};
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getareaTree();
|
||||||
|
getCrTypeList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//详情
|
||||||
|
watch(
|
||||||
|
() => props.form,
|
||||||
|
(val: any) => {
|
||||||
|
titleName.value = val.peopleId ? "编辑" : "新增";
|
||||||
|
if (val.peopleId) {
|
||||||
|
getPeopleDetail(val.peopleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -5,14 +5,7 @@
|
||||||
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
||||||
<div>
|
<div>
|
||||||
<div class="h-layout">
|
<div class="h-layout">
|
||||||
<div
|
<div class="tool-item" @click="getList">
|
||||||
class="tool-item"
|
|
||||||
@click="(currentItem = {}), (visible = true)"
|
|
||||||
>
|
|
||||||
<svg-icon name="add" class="icon" />
|
|
||||||
<span>新增</span>
|
|
||||||
</div>
|
|
||||||
<div class="tool-item">
|
|
||||||
<svg-icon name="refurbish" class="icon" />
|
<svg-icon name="refurbish" class="icon" />
|
||||||
<span>刷新</span>
|
<span>刷新</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,13 +61,14 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="姓名"
|
label="姓名"
|
||||||
prop="name"
|
prop="name"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="户籍"
|
label="户籍地址"
|
||||||
prop="loc"
|
prop="domicileAddress"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -82,35 +76,66 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="性别"
|
label="性别"
|
||||||
prop="sex"
|
prop="sex"
|
||||||
|
width="80"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.sex == 1? '男':'女'}}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="出生日期"
|
label="出生日期"
|
||||||
prop="birth"
|
prop="birthday"
|
||||||
|
width="250"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员标签"
|
label="关系"
|
||||||
prop="tag"
|
prop="relation"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.relation == 1? '户主':scope.row.relation == 2? '父亲':
|
||||||
|
scope.row.relation == 3? '母亲':scope.row.relation == 4? '祖父':
|
||||||
|
scope.row.relation == 5? '祖母':'子女' }}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="人员类别"
|
label="人员状态"
|
||||||
prop="type"
|
prop="deathState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.deathState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.deathState == 2"
|
||||||
|
>死亡</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="left"
|
align="center"
|
||||||
label="现居地址"
|
label="户籍状态"
|
||||||
prop="address"
|
prop="domicileState"
|
||||||
|
width="100"
|
||||||
>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.domicileState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.domicileState == 2"
|
||||||
|
>注销</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
|
|
@ -121,19 +146,23 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="
|
||||||
|
(form = scope.row),
|
||||||
|
(detailDialogVisible = true),
|
||||||
|
(readonly = false)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<svg-icon name="edit" class="icon"></svg-icon>
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
<span class="edit">编辑</span>
|
<span class="edit">编辑</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="(currentItem = scope.row), (visible = true)"
|
@click="(detailDialogVisible = true), (form = scope.row), (readonly = true)"
|
||||||
>
|
>
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
<span class="detail">详情</span>
|
<span class="detail">详情</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="operate" @click="del(scope.row, '删除')">
|
<span class="operate" @click="del(scope.row.peopleId)">
|
||||||
<svg-icon name="delete" class="icon"></svg-icon>
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
<span class="func">删除</span>
|
<span class="func">删除</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -154,19 +183,21 @@
|
||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<add-edit
|
<DetailAddPersonnel
|
||||||
:visible="visible"
|
:visible="detailDialogVisible"
|
||||||
:form="currentItem"
|
:form="form"
|
||||||
@close="(visible = false), (currentItem = {})"
|
:readonly="readonly"
|
||||||
|
:id="domicileId"
|
||||||
|
@close="onclone"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import AddEdit from "../population/dialog/add-edit.vue";
|
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
||||||
import { areaTree } from "@/api/account";
|
import { areaTree } from "@/api/account";
|
||||||
import { peoplePage } from "@/api/base";
|
import { peoplePage, peopleDel } from "@/api/base";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const user = ref(JSON.parse(userStore.userInfo));
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
|
@ -174,6 +205,11 @@ const userId = ref(user.value.userId);
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const currentItem = ref();
|
const currentItem = ref();
|
||||||
|
//人员信息
|
||||||
|
const form = ref({});
|
||||||
|
//人员信息弹窗
|
||||||
|
const detailDialogVisible = ref(false);
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
const search = ref({
|
const search = ref({
|
||||||
condition: "",
|
condition: "",
|
||||||
|
|
@ -207,14 +243,27 @@ const getList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
*删除人员
|
||||||
*/
|
*/
|
||||||
const del = (item, tips) => {
|
const del = (id) => {
|
||||||
ElMessageBox.confirm(`是否确认${tips}?`, "提示", {
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
confirmButtonText: "是",
|
confirmButtonText: "是",
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {});
|
}).then(() => {
|
||||||
|
peopleDel({peopleId:id}).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
//获取地区
|
//获取地区
|
||||||
const orgList = ref([]);
|
const orgList = ref([]);
|
||||||
|
|
@ -223,6 +272,12 @@ const getareaTree = () => {
|
||||||
orgList.value = res.data;
|
orgList.value = res.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
detailDialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getareaTree();
|
getareaTree();
|
||||||
getList();
|
getList();
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@
|
||||||
<span class="span">刷新</span>
|
<span class="span">刷新</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
v-if="detailForm.domicileState == 1?true:false"
|
||||||
class="h-layout h-titlec"
|
class="h-layout h-titlec"
|
||||||
@click="(detailDialogVisible = true), (form = {}), (readonly = false)"
|
@click="(detailDialogVisible = true), (form = {}), (readonly = false)"
|
||||||
>
|
>
|
||||||
|
|
@ -238,7 +239,7 @@
|
||||||
align="center"
|
align="center"
|
||||||
label="关系"
|
label="关系"
|
||||||
prop="relation"
|
prop="relation"
|
||||||
width="130"
|
width="100"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ scope.row.relation == 1? '户主':scope.row.relation == 2? '父亲':
|
<span>{{ scope.row.relation == 1? '户主':scope.row.relation == 2? '父亲':
|
||||||
|
|
@ -246,14 +247,32 @@
|
||||||
scope.row.relation == 5? '祖母':'子女' }}</span>
|
scope.row.relation == 5? '祖母':'子女' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="人员状态"
|
||||||
|
prop="deathState"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.deathState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.deathState == 2"
|
||||||
|
>死亡</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="350"
|
width="250"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
|
v-if="detailForm.domicileState == 1?true:false"
|
||||||
class="operate"
|
class="operate"
|
||||||
@click="
|
@click="
|
||||||
(form = scope.row),
|
(form = scope.row),
|
||||||
|
|
@ -271,7 +290,7 @@
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
<span class="detail">详情</span>
|
<span class="detail">详情</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="operate" @click="del(scope.row.domicileId)">
|
<span v-if="detailForm.domicileState == 1?true:false" class="operate" @click="del(scope.row.peopleId)">
|
||||||
<svg-icon name="delete" class="icon"></svg-icon>
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
<span class="func">删除</span>
|
<span class="func">删除</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -308,7 +327,7 @@ import { onMounted, reactive, ref } from "vue";
|
||||||
import { ElMessage, FormInstance, FormRules, ElMessageBox } from "element-plus";
|
import { ElMessage, FormInstance, FormRules, ElMessageBox } from "element-plus";
|
||||||
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
||||||
import { areaTree } from "@/api/account";
|
import { areaTree } from "@/api/account";
|
||||||
import { domicileAdd, domicileDetail, domicilePeoplePageList } from "@/api/base";
|
import { domicileAdd, domicileDetail, domicilePeoplePageList, peopleDel } from "@/api/base";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
|
|
@ -390,8 +409,6 @@ const handleSumit = () => {
|
||||||
} else {
|
} else {
|
||||||
params.areaCode = detailForm.value.areaCode;
|
params.areaCode = detailForm.value.areaCode;
|
||||||
}
|
}
|
||||||
console.log(params,'params===>');
|
|
||||||
|
|
||||||
domicileAdd(params).then((res: any) => {
|
domicileAdd(params).then((res: any) => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
ElMessage.success({
|
ElMessage.success({
|
||||||
|
|
@ -423,6 +440,8 @@ const clone = () => {
|
||||||
//获取详情
|
//获取详情
|
||||||
const getDetail = () => {
|
const getDetail = () => {
|
||||||
domicileDetail({domicileId:route.query.id}).then((res: any) => {
|
domicileDetail({domicileId:route.query.id}).then((res: any) => {
|
||||||
|
console.log(res.data,'res===>');
|
||||||
|
|
||||||
detailForm.value = res.data;
|
detailForm.value = res.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -453,26 +472,26 @@ const getList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*删除
|
*删除人员
|
||||||
*/
|
*/
|
||||||
const delEquip = (id) => {
|
const del = (id) => {
|
||||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
confirmButtonText: "是",
|
confirmButtonText: "是",
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// delOthequipment(id, userId.value).then((res: any) => {
|
peopleDel({peopleId:id}).then((res: any) => {
|
||||||
// if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
// ElMessage.success({
|
ElMessage.success({
|
||||||
// message: "删除成功",
|
message: "删除成功",
|
||||||
// });
|
});
|
||||||
// } else {
|
} else {
|
||||||
// ElMessage.error({
|
ElMessage.error({
|
||||||
// message: res.message,
|
message: res.message,
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// getList();
|
getList();
|
||||||
// });
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,35 @@
|
||||||
v-model="formData.nowAddress"
|
v-model="formData.nowAddress"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡状态"
|
||||||
|
prop="deathState"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择死亡状态"
|
||||||
|
v-model="formData.deathState"
|
||||||
|
>
|
||||||
|
<el-option label="正常" :value="1">正常</el-option>
|
||||||
|
<el-option label="死亡" :value="2">死亡</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formData.peopleId"
|
||||||
|
label="死亡时间"
|
||||||
|
prop="deathTime"
|
||||||
|
>
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.deathTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择死亡时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
|
@ -192,9 +221,7 @@ const ruleForm = reactive<FormRules>({
|
||||||
{ required: true, message: "请输入身份证号", trigger: "blur" },
|
{ required: true, message: "请输入身份证号", trigger: "blur" },
|
||||||
{ validator: isCardId, trigger: "blur" },
|
{ validator: isCardId, trigger: "blur" },
|
||||||
],
|
],
|
||||||
createTime: [
|
createTime: [{ required: true, message: "请选择创建时间", trigger: "blur" }],
|
||||||
{ required: true, message: "请选择创建时间", trigger: "blur" },
|
|
||||||
],
|
|
||||||
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
||||||
nowAddress: [{ required: true, message: "请输入地址", trigger: "blur" }],
|
nowAddress: [{ required: true, message: "请输入地址", trigger: "blur" }],
|
||||||
peopleTag: [{ required: true, message: "请选择人员标签", trigger: "blur" }],
|
peopleTag: [{ required: true, message: "请选择人员标签", trigger: "blur" }],
|
||||||
|
|
@ -207,6 +234,12 @@ const formData = ref<any>({});
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
formRef.value?.validate((valid) => {
|
formRef.value?.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
if (formData.value.deathState == 2 && !formData.value.deathTime) {
|
||||||
|
ElMessage.error({
|
||||||
|
message: "请选择死亡时间",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
let params = {
|
let params = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
|
|
@ -234,6 +267,7 @@ const handleSubmit = () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -253,10 +287,10 @@ const getCrTypeList = () => {
|
||||||
};
|
};
|
||||||
//查看人员详情
|
//查看人员详情
|
||||||
const getPeopleDetail = (id) => {
|
const getPeopleDetail = (id) => {
|
||||||
peopleDetail({peopleId:id}).then((res: any) => {
|
peopleDetail({ peopleId: id }).then((res: any) => {
|
||||||
formData.value = res.data;
|
formData.value = res.data;
|
||||||
formData.value.typeId = res.data.typeIds;
|
formData.value.typeId = res.data.typeIds;
|
||||||
formData.value.peopleTag = res.data.peopleTag*1;
|
formData.value.peopleTag = res.data.peopleTag * 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,13 @@
|
||||||
prop="address"
|
prop="address"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="所在地区"
|
||||||
|
prop="areaName"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -200,9 +207,17 @@
|
||||||
(cancelDialogForm = scope.row), (cancelDialogVisible = true)
|
(cancelDialogForm = scope.row), (cancelDialogVisible = true)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
<span class="func">注销</span>
|
<span class="func">注销</span>
|
||||||
</span>
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="operate"
|
||||||
|
@click="restore(scope.row.domicileId)"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="func">恢复</span>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -280,7 +295,7 @@ const getList = () => {
|
||||||
};
|
};
|
||||||
// 删除
|
// 删除
|
||||||
const del = (id) => {
|
const del = (id) => {
|
||||||
ElMessageBox.confirm("是否确认删除?", "提示", {
|
ElMessageBox.confirm("是否确认删除户籍?", "提示", {
|
||||||
confirmButtonText: "是",
|
confirmButtonText: "是",
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
|
|
@ -302,6 +317,30 @@ const del = (id) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//恢复户籍
|
||||||
|
const restore = (id) => {
|
||||||
|
ElMessageBox.confirm("是否确认恢复户籍?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let params = {
|
||||||
|
domicileId: id,
|
||||||
|
};
|
||||||
|
// domicileDel(params).then((res: any) => {
|
||||||
|
// if (res.code == 1) {
|
||||||
|
// ElMessage.success({
|
||||||
|
// message: "删除成功",
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// ElMessage.error({
|
||||||
|
// message: res.message,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// getList();
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
};
|
||||||
//调整详情
|
//调整详情
|
||||||
const toDetail = (id) => {
|
const toDetail = (id) => {
|
||||||
router.push({
|
router.push({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user