1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372 |
- <template>
- <van-nav-bar
- fixed
- title="人员档案信息"
- left-arrow
- @click-left="onClickLeft"
- :style="{ 'background-color': selectColor }"
- />
- <div class="main">
- <div class="banner">
- <img src="../../../../public/loginbg/banner.jpg" alt="" />
- </div>
- <div class="info">
- <van-form @submit="submit" @failed="failed" show-error :show-error-message="false">
- <p class="miniTitle">个人信息-{{ data.name }}</p>
- <van-row justify="space-between">
- <van-col span="14">
- <van-cell-group>
- <van-field
- v-model="data.name"
- center
- clearable
- label="姓名:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="sexName"
- readonly
- required
- :rules="[{ required: true }]"
- label="性别:"
- placeholder="请选择选择"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_sex = true"
- />
- <van-popup v-model:show="hs_sex" round position="bottom">
- <van-picker
- title="选择"
- :columns="sex"
- @cancel="hs_sex = false"
- @confirm="getsex"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="idTypeName"
- readonly
- required
- label="证件类型:"
- name="validator"
- placeholder="请选择证件类型"
- input-align="right"
- right-icon="arrow-down"
- @click="showPicker = true"
- :rules="[{ validator, message: '证件类型不能为空' }]"
- />
- <van-popup v-model:show="showPicker" round position="bottom">
- <van-picker
- title="证件类型"
- :columns="$dictUtils.getDictList('hs_cert_type')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="showPicker = false"
- @confirm="getPlace"
- />
- </van-popup>
- </van-cell-group>
- </van-col>
- <van-col span="8">
- <van-cell-group>
- <van-field name="uploader" label-align="top" label="个人照片:">
- <template #input>
- <van-uploader
- readonly
- v-model="fileList"
- :max-count="1"
- accept=""
- :preview-full-image="false"
- :before-delete="deleteRead"
- @click-upload="chooseImg"
- >
- </van-uploader>
- </template>
- </van-field>
- </van-cell-group>
- </van-col>
- </van-row>
- <div class="item">
- <van-cell-group>
- <van-field
- v-model="data.idcard"
- center
- required
- :rules="[{ required: true }]"
- label="证件号码:"
- placeholder="请填写证件号码"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.beforeUsedName"
- center
- label="曾用名:"
- placeholder="请填写曾用名"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="nationName"
- readonly
- label="民族:"
- placeholder="请选择民族"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_nation = true"
- />
- <van-popup v-model:show="hs_nation" round position="bottom">
- <van-picker
- title="民族类型"
- :columns="$dictUtils.getDictList('hs_nation')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_nation = false"
- @confirm="getnation"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.phone"
- center
- label="手机号:"
- placeholder="请填写手机号"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.nativePlace"
- readonly
- label="籍贯:"
- placeholder="请选择籍贯地区"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_nativePlace = true"
- />
- <van-popup v-model:show="hs_nativePlace" round position="bottom">
- <van-picker
- title="籍贯"
- :columns="nativePlace"
- :columns-field-names="customFieldName"
- @cancel="hs_nativePlace = false"
- @confirm="getnativePlace"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="educationName"
- readonly
- label="教育程度"
- placeholder="请选择教育程度"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_education = true"
- />
- <van-popup v-model:show="hs_education" round position="bottom">
- <van-picker
- title="教育程度"
- :columns="$dictUtils.getDictList('hs_personnel_education')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_education = false"
- @confirm="geteducation"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.graduatedFrom"
- center
- label="毕业院校:"
- placeholder="请填写毕业院校"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="religiousName"
- readonly
- label="教别:"
- name="validator"
- placeholder="请选择教别"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_religious = true"
- />
- <van-popup v-model:show="hs_religious" round position="bottom">
- <van-picker
- title="教别"
- :columns="$dictUtils.getDictList('hs_religion_type')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_religious = false"
- @confirm="getreligious"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.religiousAppellation"
- center
- label="宗教称谓:"
- placeholder="请填写宗教称谓"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="locationName"
- readonly
- label="所属场所:"
- placeholder="请选择所属场所"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_site = true"
- >
- </van-field>
- <van-dialog
- v-model:show="hs_site"
- title="所属场所"
- show-cancel-button
- >
- <div class="dialog">
- <van-list
- v-model:loading="loading"
- :finished="finished"
- finished-text="没有更多了"
- @load="onLoad"
- >
- <van-radio-group v-model="checked">
- <van-cell-group inset>
- <van-cell
- v-for="item in sitelist"
- :key="item"
- :title="item.name"
- clickable
- @click="getsite(item)"
- >
- <template #right-icon>
- <van-radio :name="item.id" @click="getsite(item)" />
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- </van-list>
- </div>
- </van-dialog>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="typeOfEmployeesName"
- readonly
- label-width="7.2em"
- label="场所任职情况:"
- placeholder="请选择场所任职情况"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_typeOfEmployees = true"
- />
- <van-popup
- v-model:show="hs_typeOfEmployees"
- round
- position="bottom"
- >
- <van-picker
- title="任职情况"
- :columns="$dictUtils.getDictList('hs_type_of_employees')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_typeOfEmployees = false"
- @confirm="gettypeOfEmployees"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.currentResidence"
- center
- required
- readonly
- :rules="[{ required: true }]"
- label="现居地:"
- placeholder="请填写现居地"
- input-align="right"
- right-icon="arrow-down"
- @click="showPlace1 = true"
- />
- <van-popup v-model:show="showPlace1" round position="bottom">
- <van-picker
- title="现居地选择"
- :columns="options"
- :columns-field-names="customFieldName"
- @cancel="showPlace1 = false"
- @confirm="getPlace1"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.currentResidenceDetail"
- center
- label="详细地址:"
- placeholder="请填写详细场所"
- input-align="right"
- >
- <template #right-icon>
- <van-icon name="location" @click="getLocation()" />
- </template>
- </van-field>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="personnalType"
- readonly
- required
- :rules="[{ required: true }]"
- label="人员类型:"
- placeholder="请选择人员类型"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_persontype = true"
- />
- <van-dialog
- v-model:show="hs_persontype"
- title="人员类型"
- show-cancel-button
- @confirm="changperson"
- >
- <div class="dialog">
- <van-list>
- <van-checkbox-group v-model="checked2">
- <van-cell-group inset>
- <van-cell
- v-for="(item, index) in $dictUtils.getDictList(
- 'hs_people_type'
- )"
- clickable
- :key="item"
- :title="`${item.label}`"
- @click="toggle(index)"
- >
- <template #right-icon>
- <van-checkbox
- :name="item.value"
- :ref="(el) => (checkboxRefs[index] = el)"
- @click.stop
- @click="toggle(index)"
- />
- </template>
- </van-cell>
- </van-cell-group>
- </van-checkbox-group>
- </van-list>
- </div>
- </van-dialog>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="tissueName"
- readonly
- label="宗教组织:"
- placeholder="请选择宗教组织"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_tissue = true"
- />
- <van-dialog
- v-model:show="hs_tissue"
- title="所属场所"
- show-cancel-button
- >
- <div class="dialog">
- <van-list
- v-model:loading="loading1"
- :finished="finished1"
- finished-text="没有更多了"
- @load="onLoad1"
- >
- <van-radio-group v-model="checked1">
- <van-cell-group inset>
- <van-cell
- v-for="item in tissuelist"
- :key="item"
- :title="item.organizationName"
- clickable
- @click="gettissue(item)"
- >
- <template #right-icon>
- <van-radio :name="item.id" @click="gettissue(item)" />
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- </van-list>
- </div>
- </van-dialog>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="data.zjzzJob"
- center
- label-width="6.5em"
- label="团体任职情况:"
- placeholder="请填写团体任职情况"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="activitytext"
- readonly
- required
- :rules="[{ required: true }]"
- label-width="7em"
- label="非法活动参加:"
- placeholder="请选择是否参加非法活动"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_activity = true"
- />
- <van-popup v-model:show="hs_activity" round position="bottom">
- <van-picker
- title="选择是否参加"
- :columns="$dictUtils.getDictList('yes_no')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_activity = false"
- @confirm="getactivity"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="Dead"
- readonly
- required
- :rules="[{ required: true }]"
- label="是否死亡:"
- placeholder="请选择人员是否死亡"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_dead = true"
- />
- <van-popup v-model:show="hs_dead" round position="bottom">
- <van-picker
- title="是否死亡"
- :columns="$dictUtils.getDictList('yes_no')"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_dead = false"
- @confirm="getdead"
- />
- </van-popup>
- </van-cell-group>
- </div>
- <p class="miniTitle">扩展信息</p>
- <van-col
- span="24"
- v-for="(item, index) in data.userManagenmetDetailsDTOList"
- :key="index"
- >
- <van-cell-group
- v-if="item.dataType === '1' && item.dataDictionary == ''"
- >
- <van-field
- v-model="item.value"
- center
- placeholder="请填写内容"
- :label="item.chineseName"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group
- v-else-if="item.dataType && item.dataDictionary != ''"
- >
- <van-field
- v-model="item.value"
- center
- :label="item.chineseName"
- placeholder="请选择"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_select[index + '_select'] = true"
- />
- <van-popup
- v-model:show="hs_select[index + '_select']"
- round
- position="bottom"
- >
- <van-picker
- :title="item.chineseName"
- :columns="$dictUtils.getDictList(item.dataDictionary)"
- :columns-field-names="{
- text: 'label',
- value: 'value',
- }"
- @cancel="hs_select[index + '_select'] = false"
- @confirm="getselect(index + '_select', $event)"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group v-else-if="item.dataType === '2'">
- <van-field
- v-model="item.value"
- center
- :label="item.chineseName"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group v-else-if="item.dataType === '3'">
- <van-field
- :v-model="item.value"
- center
- :label="item.chineseName"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group v-else-if="item.dataType === '4'">
- <van-field
- name="uploader"
- label-align="top"
- :label="item.chineseName"
- >
- <template #input>
- <van-uploader
- v-model="fileList"
- :after-read="afterRead1"
- :max-count="1"
- capture="camera"
- accept=""
- :before-delete="fjdelete"
- >
- </van-uploader>
- </template>
- </van-field>
- </van-cell-group>
- <van-cell-group v-else-if="item.dataType === '5'">
- <van-field
- v-model="item.value"
- center
- required
- readonly
- :label="item.chineseName"
- placeholder="请选择地点"
- input-align="right"
- right-icon="arrow-down"
- @click="showPlace1 = true"
- />
- <van-popup v-model:show="showPlace1" round position="bottom">
- <van-picker
- title="地点选择"
- :columns="options"
- :columns-field-names="customFieldName"
- @cancel="showPlace1 = false"
- @confirm="getPlace1"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group v-else-if="item.dataType === '6'">
- <van-field
- v-model="item.value"
- center
- :label="item.chineseName"
- label-width="6.5em"
- placeholder="请选择日期时间"
- input-align="right"
- right-icon="arrow-down"
- @click="hs_Date[index + '_Date'] = true"
- />
- <van-popup
- v-model:show="hs_Date[index + '_Date']"
- round
- position="bottom"
- >
- <van-picker-group
- title="选择时间"
- :tabs="['选择日期', '选择时间']"
- next-step-text="下一步"
- @confirm="getDate(index + '_Date', $event)"
- @cancel="hs_Date[index + '_Date'] = false"
- >
- <van-date-picker v-model="currentDate" />
- <van-time-picker
- v-model="currentTime"
- :columns-type="columnsType"
- />
- </van-picker-group>
- </van-popup>
- </van-cell-group>
- </van-col>
- <div class="subbtn">
- <van-button type="primary" native-type="submit">确认修改</van-button>
- </div>
- </van-form>
- </div>
- </div>
- </template>
- <script>
- import { useRouter } from "vue-router";
- import { onBeforeUpdate, onMounted, ref, getCurrentInstance } from "vue";
- import { useStore } from "vuex";
- import $base from "@/utils/config";
- import placePerson from "@/api/placePerson/placePerson";
- import PlaceRegister from "@/api/placeRegister/placeRegister";
- import UserManage from "@/api/user/UserManage";
- import tools from "@/api/sys/tools";
- import { formatDate, formatTime } from "@/utils/datatime";
- export default {
- setup() {
- const store = useStore();
- const data = ref({});
- const expansion = ref([]);
- // 导航栏颜色
- const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
- //数据接收
- const router = useRouter();
- const current = getCurrentInstance();
- onMounted(() => {
- var id = JSON.parse(router.currentRoute.value.query.id);
- new UserManage().queryById(id).then((res) => {
- data.value = res;
- expansion.value = res.userManagenmetDetailsDTOList;
- idTypeName.value = getidCardType(data.value.idType);
- sexName.value = getSex(data.value.sex);
- idTypeName.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "hs_cert_type",
- data.value.idType
- );
- nationName.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "hs_nation",
- data.value.nation
- );
- educationName.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "hs_personnel_education",
- data.value.nationalEducationLevel
- );
- religiousName.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "hs_religion_type",
- data.value.religion
- );
- let location = data.value.location;
- locationName.value = location.name;
- typeOfEmployeesName.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "hs_type_of_employees",
- data.value.typeOfEmployees
- );
- if(data.value.dead){
- Dead.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "yes_no",
- data.value.dead
- );
- }else{
- Dead.value = '否'
- data.value.dead = '1'
- }
- if(data.value.bkcheck){
- activitytext.value =
- current.appContext.config.globalProperties.$dictUtils.getDictLabel(
- "yes_no",
- data.value.bkcheck
- );
- }else{
- activitytext.value = '否'
- data.value.bkcheck = '1'
- }
-
- let arr = data.value.personnelType.split(",");
- personnalType.value = getValue1(arr).join(",");
- let tissid = data.value.zjzz.id;
- new placePerson().religious().then((res) => {
- res.records.forEach((item) => {
- if (item.id == tissid) {
- tissueName.value = item.organizationName;
- }
- });
- });
- data.value.workPicture.split("|").forEach((item) => {
- if (item.trim().length > 0) {
- fileImg.value.push({
- name: decodeURIComponent(
- item.substring(item.lastIndexOf("/") + 1)
- ),
- url: $base +"/"+ item.replace("程序附件//", "程序附件/"),
- id: item.replace("程序附件//", "程序附件/"),
- });
- fileList.value.push({
- name: decodeURIComponent(
- item.substring(item.lastIndexOf("/") + 1)
- ),
- url: $base +"/"+ item.replace("程序附件//", "程序附件/"),
- id: item.replace("程序附件//", "程序附件/"),
- });
- }
- });
- data.value.userManagenmetDetailsDTOList.forEach((item) => {
- if (item.chineseName === "教职身份") {
- const teachType = {
- 1: "阿訇",
- 2: "牧师",
- 3: "长老",
- 4: "传道员",
- 5: "神学生",
- 6: "道士(正一)",
- 7: "比丘",
- 8: "教师(副牧师)",
- 9: "比丘尼",
- };
- item.value = teachType[item.value];
- }
- if (item.chineseName === "宗教教育程度") {
- const Type = {
- 1: "小学",
- 2: "初中",
- 3: "中专",
- 4: "高中",
- 5: "大专",
- 6: "本科",
- 7: "硕士研究生",
- 8: "博士研究生",
- 9: "其他",
- };
- item.value = Type[item.value];
- }
- });
- });
- //籍贯接口
- new placePerson().nativePlace().then((res) => {
- nativePlace.value.push(...res);
- options.value.push(...res);
- });
- });
- const getValue = (item) => {
- if (item.chineseName === "教职身份") {
- const type = {
- 1: "阿訇",
- 2: "牧师",
- 3: "长老",
- 4: "传道员",
- 5: "神学生",
- 6: "道士(正一)",
- 7: "比丘",
- 8: "教师(副牧师)",
- 9: "比丘尼",
- };
- return type[item.value];
- }
- if (item.chineseName === "宗教教育程度") {
- const type = {
- 1: "小学",
- 2: "初中",
- 3: "中专",
- 4: "高中",
- 5: "大专",
- 6: "本科",
- 7: "硕士研究生",
- 8: "博士研究生",
- 9: "其他",
- };
- return type[item.value];
- }
- return item.value;
- };
- // 证件类型
- const idTypeName = ref("");
- let showPicker = ref(false);
- const getPlace = ({ selectedOptions }) => {
- showPicker.value = false;
- const json = Object.assign(data.value, {
- idType: selectedOptions[0].value,
- });
- data.value = json;
- idTypeName.value = selectedOptions[0].label;
- };
- const getidCardType = (item) => {
- const type = {
- 1: "身份证",
- 2: "护照",
- 3: "港澳通行证",
- 4: "其他",
- };
- return type[item];
- };
- // 性别
- const sexName = ref("");
- const sex = [
- { text: "男", value: "1" },
- { text: "女", value: "2" },
- ];
- let hs_sex = ref(false);
- const getsex = ({ selectedOptions }) => {
- hs_sex.value = false;
- const json = Object.assign(data.value, {
- sex: selectedOptions[0].value,
- });
- data.value = json;
- sexName.value = selectedOptions[0].text;
- };
- const getSex = (item) => {
- const type = {
- 1: "男",
- 2: "女",
- };
- return type[item];
- };
- // 民族
- const nationName = ref("");
- let hs_nation = ref(false);
- const getnation = ({ selectedOptions }) => {
- hs_nation.value = false;
- const json = Object.assign(data.value, {
- nation: selectedOptions[0].value,
- });
- data.value = json;
- nationName.value = selectedOptions[0].label;
- };
- // 教育程度
- const educationName = ref("");
- let hs_education = ref(false);
- const geteducation = ({ selectedOptions }) => {
- hs_education.value = false;
- const json = Object.assign(data.value, {
- nationalEducationLevel: selectedOptions[0].value,
- });
- data.value = json;
- educationName.value = selectedOptions[0].label;
- };
- // 宗教类别
- const religiousName = ref("");
- let hs_religious = ref(false);
- const getreligious = ({ selectedOptions }) => {
- hs_religious.value = false;
- const json = Object.assign(data.value, {
- religion: selectedOptions[0].value,
- });
- data.value = json;
- religiousName.value = selectedOptions[0].label;
- };
- // 宗教类别2
- const religiousName2 = ref("");
- const religioustype2 = ref("");
- const religious2 = [
- { text: "伊斯兰教", value: "1" },
- { text: "基督教", value: "2" },
- { text: "天主教", value: "3" },
- { text: "佛教", value: "4" },
- { text: "道教", value: "5" },
- ];
- let hs_religious2 = ref(false);
- const getreligious2 = ({ selectedOptions }) => {
- hs_religious2.value = false;
- religioustype2.value = selectedOptions[0].value;
- religiousName2.value = selectedOptions[0].text;
- };
- // 所属场所
- const locationName = ref("");
- const checked = ref("");
- const sitelist = ref([]);
- let hs_site = ref(false);
- const getsite = (val) => {
- console.log(val);
- let id = "";
- id = val.id;
- locationName.value = val.name;
- const json = Object.assign(data.value, {
- location: { id: id, name: val.name },
- });
- data.value = json;
- checked.value = val.id;
- };
- const loading = ref(false);
- const finished = ref(false);
- const refreshing = ref(false);
- let index = 0;
- const onLoad = () => {
- loading.value = true;
- finished.value = false;
- // 异步更新数据
- new PlaceRegister()
- .religiousList({
- current: index + 1,
- size: 10,
- })
- .then(({ records, pages }) => {
- sitelist.value = sitelist.value.concat(records);
- // 加载状态结束
- loading.value = false;
- if (index + 1 >= pages) {
- finished.value = true;
- }
- index++;
- });
- };
- // 场所任职情况
- const typeOfEmployeesName = ref("");
- let hs_typeOfEmployees = ref(false);
- const gettypeOfEmployees = ({ selectedOptions }) => {
- hs_typeOfEmployees.value = false;
- const json = Object.assign(data.value, {
- typeOfEmployees: selectedOptions[0].value,
- });
- data.value = json;
- typeOfEmployeesName.value = selectedOptions[0].label;
- };
- //籍贯
- const nativePlace = ref([]);
- let hs_nativePlace = ref(false);
- const getnativePlace = ({ selectedOptions }) => {
- hs_nativePlace.value = false;
- let str = "";
- selectedOptions.forEach((item) => {
- if (data.nativePlace) {
- str = data.nativePlace;
- }
- str += item.name + "/";
- });
- data.nativePlace = str;
- const json = Object.assign(data.value, { nativePlace: str });
- data.value = json;
- };
- //图片上传
- let fileList = ref([]);
- let fileImg = ref([]);
- const chooseImg = () => {
- if (store.state.pctoken != "") {
- xm.chooseFile({
- count: 1,
- name: "file",
- url: $base + `/sys/file/webupload/upload?uploadPath=logo`,
- headers: {
- "Content-Type": "multipart/form-data",
- "token": store.state.pctoken,
- },
- }).then((res) => {
- let data = res[0].data;
- data.name = decodeURIComponent(
- data.id.substring(data.url.lastIndexOf("/") + 1)
- );
- data.url = $base + data.url;
- fileImg.value.push(data);
- fileList.value.push(data);
- });
- }
- };
- // 删除文件
- const deleteRead = (file) => {
- //删除文件操作
- for (let index = 0; index < fileList.value.length; index++) {
- if (file.id == fileList.value[index].id) {
- fileList.value.splice(index, 1);
- if (fileImg.value[index]) {
- let delurl = fileImg.value[index].url;
- new tools().uploadFiledelete("", delurl).then(({ data }) => {});
- fileImg.value.splice(index, 1);
- }
- }
- }
- };
- //详细地址定位
- const getLocation = () => {
- xm.getLocation().then((data) => {
- inputForm.currentResidenceDetail = data.POIName;
- });
- };
- // 地区选择
- let placeAddress = ref("");
- const customFieldName = {
- text: "name",
- value: "id",
- };
- const options = ref([]);
- let showPlace1 = ref(false);
- const getPlace1 = ({ selectedOptions }) => {
- showPlace1.value = false;
- let str1 = "";
- let str2 = "";
- selectedOptions.forEach((item) => {
- if (data.currentResidence) {
- str1 = data.currentResidence;
- str2 = data.currentResidenceId;
- }
- str1 += item.name + "/";
- str2 += item.code + "/";
- });
- const json = Object.assign(data.value, {
- currentResidence: str1,
- currentResidenceId: str2,
- });
- data.value = json;
- };
- //宗教组织
- const tissueName = ref("");
- const checked1 = ref("");
- const tissuelist = ref([]);
- let hs_tissue = ref(false);
- const gettissue = (val) => {
- tissueName.value = val.organizationName;
- const json = Object.assign(data.value, { zjzz: { id: val.id } });
- data.value = json;
- checked1.value = val.id;
- };
- const loading1 = ref(false);
- const finished1 = ref(false);
- const refreshing1 = ref(false);
- let index1 = 0;
- const onLoad1 = () => {
- loading1.value = true;
- finished1.value = false;
- // 异步更新数据
- new placePerson()
- .zjzz({
- current: index1 + 1,
- size: 10,
- })
- .then(({ records, pages }) => {
- tissuelist.value = tissuelist.value.concat(records);
- // 加载状态结束
- loading1.value = false;
- if (index1 + 1 >= pages) {
- finished1.value = true;
- }
- index1++;
- });
- };
- //人员类型
- const personnalType = ref("");
- const checked2 = ref([]);
- const showZW = ref("");
- const checkboxRefs = ref([]);
- let hs_persontype = ref(false);
- const toggle = (index) => {
- checkboxRefs.value[index].toggle();
- personnalType.value = getValue1(checked2.value).join();
- showZW.value = checked2.value.join();
- };
- const changperson = () => {
- const json = Object.assign(
- { ...data.value },
- { personnelType: showZW.value }
- );
- data.value = json;
- changePersonnelType();
- };
- const changePersonnelType = () => {
- let userManagenmetDetailsDTOList = [];
- new placePerson()
- .userDTOqueryId(data.value.personnelType.toString())
- .then((res) => {
- res.forEach((item) => {
- let userManagenmetDetail = {};
- userManagenmetDetail = Object.assign(userManagenmetDetail, {
- id: "",
- chineseName: item.chineseName,
- englishName: item.englishName,
- dataType: item.dataType,
- value: "",
- orderNum: item.orderNum,
- dataDictionary: item.dataDictionary,
- dataDictionaryId: item.dataDictionaryId,
- });
- userManagenmetDetailsDTOList.push(userManagenmetDetail);
- });
- const json = Object.assign(
- { ...data.value },
- { userManagenmetDetailsDTOList: userManagenmetDetailsDTOList }
- );
- data.value = json;
- });
- };
- onBeforeUpdate(() => {
- checkboxRefs.value = [];
- });
- const getValue1 = (item) => {
- const type = {
- 1: "宗教从业人员",
- 2: "民族场所从业人员",
- 3: "教职人员",
- 4: "固定信徒",
- 5: "场所居住人员",
- 6: "境外人员",
- 7: "非本市人员",
- 8: "非本教人员",
- 9: "临时人员",
- 10: "异常人员",
- 12: "邪教人员",
- 13: "管理人员",
- 14: "全能神离家人员",
- 15: "全能神骨干人员",
- 16: "网络运营人员",
- 17: "涉政有害活动人员",
- 18: "境内外记者",
- 19: "境外法轮功骨干人员",
- 20: "其他邪教骨干人员",
- 21: "心灵法门骨干人员",
- 22: "“精神控制”有害培训骨干人员",
- 23: "重点人员",
- };
- let Array = [];
- item.forEach((chilr) => {
- Array.push(type[chilr]);
- });
- return Array;
- };
- // 扩展信息选择
- let hs_select = ref({});
- const getselect = (index, { selectedOptions }) => {
- hs_select.value[index] = false;
- let inputIndex = index.split("_")[0];
- data.value.userManagenmetDetailsDTOList[inputIndex].value =
- selectedOptions[0].label;
- };
- // 扩展信息的时间
- let hs_Date = ref({});
- let currentDate = ref(formatDate(new Date()));
- let currentTime = ref(formatTime(new Date()));
- const columnsType = ["hour", "minute", "second"];
- const getDate = (index, { selectedOptions }) => {
- hs_Date.value[index] = false;
- let inputIndex = index.split("_")[0];
- data.value.userManagenmetDetailsDTOList[
- inputIndex
- ].value = `${currentDate.value.join("-")} ${currentTime.value.join(":")}`;
- hs_Date.value[index] = false;
- };
- // 是否参加非法活动
- const activitytext = ref("");
- let hs_activity = ref(false);
- const getactivity = ({ selectedOptions }) => {
- hs_activity.value = false;
- const json = Object.assign(data.value, {
- bkcheck: selectedOptions[0].value,
- });
- data.value = json;
- activitytext.value = selectedOptions[0].label;
- };
- // 是否死亡
- const Dead = ref("否");
- let hs_dead = ref(false);
- const getdead = ({ selectedOptions }) => {
- hs_dead.value = false;
- const json = Object.assign(data.value, {
- dead: selectedOptions[0].value,
- });
- data.value = json;
- Dead.value = selectedOptions[0].label;
- };
- //返回
- const onClickLeft = () => {
- history.back();
- };
- //校验
- const failed = () => {
- xm.showToast({
- message: "请检查表单必填项是否存在填写遗漏!",
- });
- };
- //数据提交
- const submit = () => {
- //保存前附件处理
- data.value.workPicture = fileImg.value
- .map((option) => option.id)
- .join("|");
- data.value.userManagenmetDetailsDTOList.forEach((item) => {
- if (item.chineseName === "教职身份") {
- const teachType = {
- 阿訇: 1,
- 牧师: 2,
- 长老: 3,
- 传道员: 4,
- 神学生: 5,
- "道士(正一)": 6,
- 比丘: 7,
- "教师(副牧师)": 8,
- 比丘尼: 9,
- };
- item.value = teachType[item.value];
- }
- if (item.chineseName === "宗教教育程度") {
- const Type = {
- 小学: 1,
- 初中: 2,
- 中专: 3,
- 高中: 4,
- 大专: 5,
- 本科: 6,
- 硕士研究生: 7,
- 博士研究生: 8,
- 其他: 9,
- };
- item.value = Type[item.value];
- }
- });
- new placePerson().save(data.value).then((res) => {
- if (res.status == 200) {
- xm.showToast({
- message: "人员修改成功",
- });
- router.push({
- path: "/placePerson",
- });
- } else {
- xm.showToast({
- message: "人员修改失败",
- });
- console.log(res);
- }
- });
- };
- return {
- onClickLeft,
- data,
- selectColor,
- expansion,
- getValue,
- // 证件类型
- idTypeName,
- showPicker,
- getPlace,
- //性别
- sexName,
- hs_sex,
- sex,
- getsex,
- //民族
- nationName,
- hs_nation,
- getnation,
- // 教育程度
- educationName,
- hs_education,
- geteducation,
- // 宗教类别
- religiousName,
- hs_religious,
- getreligious,
- // 宗教类别2
- religiousName2,
- religioustype2,
- hs_religious2,
- religious2,
- getreligious2,
- //所属场所
- locationName,
- checked,
- hs_site,
- getsite,
- sitelist,
- loading,
- finished,
- onLoad,
- refreshing,
- //场所任职情况
- typeOfEmployeesName,
- hs_typeOfEmployees,
- gettypeOfEmployees,
- //籍贯
- nativePlace,
- hs_nativePlace,
- getnativePlace,
- //宗教组织
- tissueName,
- checked1,
- hs_tissue,
- gettissue,
- tissuelist,
- loading1,
- finished1,
- onLoad1,
- refreshing1,
- //人员类型
- checked2,
- personnalType,
- hs_persontype,
- toggle,
- checkboxRefs,
- showZW,
- changperson,
- // 是否参加非法活动
- hs_activity,
- getactivity,
- activitytext,
- //是否死亡
- Dead,
- hs_dead,
- getdead,
- // 地区选择
- placeAddress,
- customFieldName,
- showPlace1,
- getPlace1,
- options,
- getLocation,
- //扩展信息选择
- hs_select,
- getselect,
- //扩展信息时间
- currentDate,
- currentTime,
- columnsType,
- hs_Date,
- getDate,
- //图片上传
- fileList,
- chooseImg,
- deleteRead,
- submit,
- //校验
- failed,
- };
- },
- };
- </script>
- <style lang="less" scoped>
- .dialog {
- width: 100%;
- height: 400px;
- overflow: auto;
- }
- .subbtn {
- margin: 20px;
- text-align: center;
- }
- .subbtn .van-button {
- width: 100%;
- margin: 5px;
- }
- .van-uploader .van-button {
- border: none;
- color: #36a7f3;
- top: -4px;
- }
- </style>
|