placePersonAdd.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228
  1. <template>
  2. <van-nav-bar
  3. fixed
  4. title="人员信息录入"
  5. left-arrow
  6. @click-left="onClickLeft"
  7. :style="{ 'background-color': selectColor }"
  8. />
  9. <div class="main">
  10. <div class="formArea">
  11. <van-cell-group>
  12. <van-field
  13. v-model="idTypeName"
  14. readonly
  15. required
  16. label="证件类型:"
  17. name="validator"
  18. placeholder="请选择证件类型"
  19. input-align="right"
  20. right-icon="arrow-down"
  21. @click="showPicker = true"
  22. :rules="[{ validator, message: '证件类型不能为空' }]"
  23. />
  24. <van-popup v-model:show="showPicker" round position="bottom">
  25. <van-picker
  26. title="证件类型"
  27. :columns="places"
  28. @cancel="showPicker = false"
  29. @confirm="getPlace"
  30. />
  31. </van-popup>
  32. </van-cell-group>
  33. <van-cell-group>
  34. <van-field
  35. v-model="inputForm.idcard"
  36. center
  37. required
  38. label="证件号码:"
  39. placeholder="请填写证件号码"
  40. input-align="right"
  41. />
  42. </van-cell-group>
  43. <van-cell-group>
  44. <van-field
  45. v-model="inputForm.name"
  46. center
  47. required
  48. label="姓名:"
  49. placeholder="请填写姓名"
  50. input-align="right"
  51. />
  52. </van-cell-group>
  53. <van-cell-group>
  54. <van-field name="uploader" label-align="top" label="工作照片:">
  55. <template #input>
  56. <van-uploader
  57. v-model="fileList"
  58. :after-read="afterRead1"
  59. :max-count="1"
  60. capture="camera"
  61. accept=""
  62. :before-delete="fjdelete"
  63. >
  64. </van-uploader>
  65. </template>
  66. </van-field>
  67. </van-cell-group>
  68. <van-cell-group>
  69. <van-field
  70. v-model="inputForm.beforeUsedName"
  71. center
  72. label="曾用名:"
  73. placeholder="请填写曾用名"
  74. input-align="right"
  75. />
  76. </van-cell-group>
  77. <van-cell-group>
  78. <van-field
  79. v-model="nationName"
  80. readonly
  81. label="民族:"
  82. placeholder="请选择民族"
  83. input-align="right"
  84. right-icon="arrow-down"
  85. @click="hs_nation = true"
  86. />
  87. <van-popup v-model:show="hs_nation" round position="bottom">
  88. <van-picker
  89. title="民族类型"
  90. :columns="nation"
  91. @cancel="hs_nation = false"
  92. @confirm="getnation"
  93. />
  94. </van-popup>
  95. </van-cell-group>
  96. <van-cell-group>
  97. <van-field
  98. v-model="sexName"
  99. readonly
  100. required
  101. label="性别:"
  102. placeholder="请选择选择"
  103. input-align="right"
  104. right-icon="arrow-down"
  105. @click="hs_sex = true"
  106. />
  107. <van-popup v-model:show="hs_sex" round position="bottom">
  108. <van-picker
  109. title="选择"
  110. :columns="sex"
  111. @cancel="hs_sex = false"
  112. @confirm="getsex"
  113. />
  114. </van-popup>
  115. </van-cell-group>
  116. <van-cell-group>
  117. <van-field
  118. v-model="inputForm.phone"
  119. center
  120. label="手机号:"
  121. placeholder="请填写手机号"
  122. input-align="right"
  123. />
  124. </van-cell-group>
  125. <van-cell-group>
  126. <van-field
  127. v-model="inputForm.nativePlace"
  128. readonly
  129. label="籍贯:"
  130. placeholder="请选择籍贯地区"
  131. input-align="right"
  132. right-icon="arrow-down"
  133. @click="hs_nativePlace = true"
  134. />
  135. <van-popup v-model:show="hs_nativePlace" round position="bottom">
  136. <van-picker
  137. title="籍贯"
  138. :columns="nativePlace"
  139. :columns-field-names="customFieldName"
  140. @cancel="hs_nativePlace = false"
  141. @confirm="getnativePlace"
  142. />
  143. </van-popup>
  144. </van-cell-group>
  145. <van-cell-group>
  146. <van-field
  147. v-model="educationName"
  148. readonly
  149. label="教育程度"
  150. placeholder="请选择教育程度"
  151. input-align="right"
  152. right-icon="arrow-down"
  153. @click="hs_education = true"
  154. />
  155. <van-popup v-model:show="hs_education" round position="bottom">
  156. <van-picker
  157. title="教育程度"
  158. :columns="education"
  159. @cancel="hs_education = false"
  160. @confirm="geteducation"
  161. />
  162. </van-popup>
  163. </van-cell-group>
  164. <van-cell-group>
  165. <van-field
  166. v-model="inputForm.graduatedFrom"
  167. center
  168. label="毕业院校:"
  169. placeholder="请填写毕业院校"
  170. input-align="right"
  171. />
  172. </van-cell-group>
  173. <van-cell-group>
  174. <van-field
  175. v-model="religiousName"
  176. readonly
  177. label="教别:"
  178. name="validator"
  179. placeholder="请选择教别"
  180. input-align="right"
  181. right-icon="arrow-down"
  182. @click="hs_religious = true"
  183. />
  184. <van-popup v-model:show="hs_religious" round position="bottom">
  185. <van-picker
  186. title="教别"
  187. :columns="religious"
  188. @cancel="hs_religious = false"
  189. @confirm="getreligious"
  190. />
  191. </van-popup>
  192. </van-cell-group>
  193. <van-cell-group>
  194. <van-field
  195. v-model="inputForm.religiousAppellation"
  196. center
  197. label="宗教称谓:"
  198. placeholder="请填写宗教称谓"
  199. input-align="right"
  200. />
  201. </van-cell-group>
  202. <van-cell-group>
  203. <van-field
  204. v-model="locationName"
  205. readonly
  206. label="所属场所:"
  207. placeholder="请选择所属场所"
  208. input-align="right"
  209. right-icon="arrow-down"
  210. @click="hs_site = true"
  211. >
  212. </van-field>
  213. <van-dialog v-model:show="hs_site" title="所属场所" show-cancel-button>
  214. <div class="dialog">
  215. <van-list
  216. v-model:loading="loading"
  217. :finished="finished"
  218. finished-text="没有更多了"
  219. @load="onLoad"
  220. >
  221. <van-radio-group v-model="checked">
  222. <van-cell-group inset>
  223. <van-cell
  224. v-for="item in sitelist"
  225. :key="item"
  226. :title="item.name"
  227. clickable
  228. @click="getsite(item)"
  229. >
  230. <template #right-icon>
  231. <van-radio :name="item.id" @click="getsite(item)" />
  232. </template>
  233. </van-cell>
  234. </van-cell-group>
  235. </van-radio-group>
  236. </van-list>
  237. </div>
  238. </van-dialog>
  239. </van-cell-group>
  240. <van-cell-group>
  241. <van-field
  242. v-model="typeOfEmployeesName"
  243. readonly
  244. label-width="7.2em"
  245. label="场所任职情况:"
  246. placeholder="请选择场所任职情况"
  247. input-align="right"
  248. right-icon="arrow-down"
  249. @click="hs_typeOfEmployees = true"
  250. />
  251. <van-popup v-model:show="hs_typeOfEmployees" round position="bottom">
  252. <van-picker
  253. title="任职情况"
  254. :columns="typeOfEmployees"
  255. @cancel="hs_typeOfEmployees = false"
  256. @confirm="gettypeOfEmployees"
  257. />
  258. </van-popup>
  259. </van-cell-group>
  260. <van-cell-group>
  261. <van-field
  262. v-model="inputForm.currentResidence"
  263. center
  264. required
  265. readonly
  266. label="现居地:"
  267. placeholder="请填写现居地"
  268. input-align="right"
  269. right-icon="arrow-down"
  270. @click="showPlace1 = true"
  271. />
  272. <van-popup v-model:show="showPlace1" round position="bottom">
  273. <van-picker
  274. title="现居地选择"
  275. :columns="options"
  276. :columns-field-names="customFieldName"
  277. @cancel="showPlace1 = false"
  278. @confirm="getPlace1"
  279. />
  280. </van-popup>
  281. </van-cell-group>
  282. <van-cell-group>
  283. <van-field
  284. v-model="inputForm.place"
  285. center
  286. label="详细地址:"
  287. placeholder="请填写详细场所"
  288. input-align="right"
  289. >
  290. <template #right-icon>
  291. <van-icon name="location" @click="getLocation()" />
  292. </template>
  293. </van-field>
  294. </van-cell-group>
  295. <van-cell-group>
  296. <van-field
  297. v-model="personnalType"
  298. readonly
  299. required
  300. label="人员类型:"
  301. placeholder="请选择人员类型"
  302. input-align="right"
  303. right-icon="arrow-down"
  304. @click="hs_persontype = true"
  305. />
  306. <van-dialog
  307. v-model:show="hs_persontype"
  308. title="人员类型"
  309. show-cancel-button
  310. @confirm = "changperson"
  311. >
  312. <div class="dialog">
  313. <van-list>
  314. <van-checkbox-group v-model="checked2">
  315. <van-cell-group inset>
  316. <van-cell
  317. v-for="(item, index) in persontype"
  318. clickable
  319. :key="item"
  320. :title="`${item.text}`"
  321. @click="toggle(index)"
  322. >
  323. <template #right-icon>
  324. <van-checkbox
  325. :name="item.value"
  326. :ref="(el) => (checkboxRefs[index] = el)"
  327. @click.stop
  328. />
  329. </template>
  330. </van-cell>
  331. </van-cell-group>
  332. </van-checkbox-group>
  333. </van-list>
  334. </div>
  335. </van-dialog>
  336. </van-cell-group>
  337. <van-cell-group>
  338. <van-field
  339. v-model="tissueName"
  340. readonly
  341. label="宗教组织:"
  342. placeholder="请选择宗教组织"
  343. input-align="right"
  344. right-icon="arrow-down"
  345. @click="hs_tissue = true"
  346. />
  347. <van-dialog
  348. v-model:show="hs_tissue"
  349. title="宗教组织"
  350. show-cancel-button
  351. >
  352. <div class="dialog">
  353. <van-list
  354. v-model:loading="loading1"
  355. :finished="finished1"
  356. finished-text="没有更多了"
  357. @load="onLoad1"
  358. >
  359. <van-radio-group v-model="checked1">
  360. <van-cell-group inset>
  361. <van-cell
  362. v-for="item in tissuelist"
  363. :key="item"
  364. :title="item.organizationName"
  365. clickable
  366. @click="gettissue(item)"
  367. >
  368. <template #right-icon>
  369. <van-radio :name="item.id" />
  370. </template>
  371. </van-cell>
  372. </van-cell-group>
  373. </van-radio-group>
  374. </van-list>
  375. </div>
  376. </van-dialog>
  377. </van-cell-group>
  378. <van-cell-group>
  379. <van-field
  380. v-model="inputForm.zjzzJob"
  381. center
  382. label-width="6.5em"
  383. label="团体任职情况:"
  384. placeholder="请填写团体任职情况"
  385. input-align="right"
  386. />
  387. </van-cell-group>
  388. <van-cell-group>
  389. <van-field
  390. v-model="activitytext"
  391. readonly
  392. required
  393. label-width="7em"
  394. label="非法活动参加:"
  395. placeholder="请选择是否参加非法活动"
  396. input-align="right"
  397. right-icon="arrow-down"
  398. @click="hs_activity = true"
  399. />
  400. <van-popup v-model:show="hs_activity" round position="bottom">
  401. <van-picker
  402. title="选择是否参加"
  403. :columns="activity"
  404. @cancel="hs_activity = false"
  405. @confirm="getactivity"
  406. />
  407. </van-popup>
  408. </van-cell-group>
  409. <p class="miniTitle">扩展信息</p>
  410. <van-col
  411. span="24"
  412. v-for="(item, index) in inputForm.userManagenmetDetailsDTOList"
  413. :key="index"
  414. >
  415. <van-cell-group
  416. v-if="item.dataType === '1' && item.dataDictionary == ''"
  417. >
  418. <van-field
  419. v-model="item.value"
  420. center
  421. placeholder="请填写内容"
  422. :label="item.chineseName"
  423. input-align="right"
  424. />
  425. </van-cell-group>
  426. <van-cell-group v-else-if="item.dataType && item.dataDictionary != ''">
  427. vhsjhf{{item.value}}
  428. <van-field
  429. v-model="teachPosition"
  430. center
  431. :label="item.chineseName"
  432. placeholder="请选择"
  433. input-align="right"
  434. right-icon="arrow-down"
  435. @click="hs_select = true"
  436. />
  437. <van-popup v-model:show="hs_select" round position="bottom" >
  438. <van-picker
  439. :columns="$dictUtils.getDictList(item.dataDictionary)"
  440. :columns-field-names="{
  441. text: 'label',
  442. value: 'value',
  443. }"
  444. @cancel="hs_select = false"
  445. @confirm="getselect"
  446. />
  447. </van-popup>
  448. </van-cell-group>
  449. <van-cell-group v-else-if="item.dataType === '2'">
  450. <van-field
  451. v-model="item.value"
  452. center
  453. :label="item.chineseName"
  454. input-align="right"
  455. />
  456. </van-cell-group>
  457. <van-cell-group v-else-if="item.dataType === '3'">
  458. <van-field
  459. :v-model="item.value"
  460. center
  461. :label="item.chineseName"
  462. input-align="right"
  463. />
  464. </van-cell-group>
  465. <van-cell-group v-else-if="item.dataType === '4'">
  466. <van-field
  467. name="uploader"
  468. label-align="top"
  469. :label="item.chineseName"
  470. >
  471. <template #input>
  472. <van-uploader
  473. v-model="fileList"
  474. :after-read="afterRead1"
  475. :max-count="1"
  476. capture="camera"
  477. accept=""
  478. :before-delete="fjdelete"
  479. >
  480. </van-uploader>
  481. </template>
  482. </van-field>
  483. </van-cell-group>
  484. <van-cell-group v-else-if="item.dataType === '5'">
  485. <van-field
  486. v-model="item.value"
  487. center
  488. required
  489. readonly
  490. :label="item.chineseName"
  491. placeholder="请选择地点"
  492. input-align="right"
  493. right-icon="arrow-down"
  494. @click="showPlace1 = true"
  495. />
  496. <van-popup v-model:show="showPlace1" round position="bottom">
  497. <van-picker
  498. title="地点选择"
  499. :columns="options"
  500. :columns-field-names="customFieldName"
  501. @cancel="showPlace1 = false"
  502. @confirm="getPlace1"
  503. />
  504. </van-popup>
  505. </van-cell-group>
  506. <van-cell-group v-else-if="item.dataType === '6'">
  507. <van-field
  508. v-model="item.value"
  509. center
  510. :label="item.chineseName"
  511. label-width="6.5em"
  512. placeholder="请选择日期时间"
  513. input-align="right"
  514. right-icon="arrow-down"
  515. @click="hs_Date = true"
  516. />
  517. <van-popup v-model:show="hs_Date" round position="bottom">
  518. <van-date-picker
  519. title="选择日期"
  520. :min-date="minDate"
  521. :max-date="maxDate"
  522. @cancel="hs_Date = false"
  523. @confirm="getDate"
  524. />
  525. </van-popup>
  526. </van-cell-group>
  527. </van-col>
  528. </div>
  529. <div class="subbtn">
  530. <van-button type="primary" @click="submit">提交</van-button>
  531. <van-button @click="onClickLeft" type="default" hairline>取消</van-button>
  532. </div>
  533. </div>
  534. </template>
  535. <script>
  536. import { onBeforeUpdate, onMounted, ref } from "vue";
  537. import placePerson from "@/api/placePerson/placePerson";
  538. import PlaceRegister from "@/api/placeRegister/placeRegister";
  539. import { useRouter } from "vue-router";
  540. import tools from "@/api/sys/tools";
  541. export default {
  542. setup() {
  543. const onClickLeft = () => {
  544. history.back();
  545. };
  546. // 导航栏颜色
  547. const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
  548. //人员添加
  549. const inputForm = ref({
  550. id: "",
  551. userManagenmetDetailsDTOList: [],
  552. name: "",
  553. sex: "",
  554. idType: "",
  555. idcard: "",
  556. phone: "",
  557. location: {
  558. id: "",
  559. },
  560. typeOfEmployees: "",
  561. workPicture: "",
  562. nativePlace: "",
  563. currentResidence: "",
  564. currentResidenceDetail: "",
  565. personnelType: "",
  566. currentResidenceId: "100000/320000/320900",
  567. currentResidenceLevel1: "100000",
  568. currentResidenceLevel2: "320000",
  569. currentResidenceLevel3: "320900",
  570. currentResidenceLevel4: "",
  571. currentResidenceLevel5: "",
  572. currentResidenceLevel6: "",
  573. beforeUsedName: "",
  574. nation: "",
  575. religion: "",
  576. religiousAppellation: "",
  577. nationalEducationLevel: "",
  578. graduatedFrom: "",
  579. zjzzJob: "",
  580. zjzz: {
  581. id: "",
  582. },
  583. bkcheck: "",
  584. });
  585. onMounted(() => {
  586. //籍贯接口
  587. new placePerson().nativePlace().then((res) => {
  588. nativePlace.value.push(...res);
  589. options.value.push(...res);
  590. });
  591. });
  592. // 证件类型
  593. const places = [
  594. { text: "身份证", value: " 1" },
  595. { text: "护照", value: "2" },
  596. { text: "港澳通行证", value: "3" },
  597. { text: "其他", value: "4" },
  598. ];
  599. const idTypeName = ref("");
  600. let showPicker = ref(false);
  601. const getPlace = ({ selectedOptions }) => {
  602. showPicker.value = false;
  603. const json = Object.assign(inputForm.value, {
  604. idType: selectedOptions[0].value,
  605. });
  606. inputForm.value = json;
  607. idTypeName.value = selectedOptions[0].text;
  608. };
  609. // 民族
  610. const nationName = ref("");
  611. const nation = [
  612. { text: "汉族", value: " 1" },
  613. { text: "阿昌族", value: "2" },
  614. { text: "白族", value: "3" },
  615. { text: "保安族", value: "4" },
  616. { text: "布朗族", value: "5" },
  617. { text: "布依族", value: " 6" },
  618. { text: "朝鲜族", value: "7" },
  619. { text: "达斡尔族", value: "8" },
  620. { text: "傣族", value: "9" },
  621. { text: "德昂族", value: "10" },
  622. { text: "东乡族", value: " 11" },
  623. { text: "侗族", value: "12" },
  624. { text: "独龙族", value: "13" },
  625. { text: "俄罗斯族", value: "14" },
  626. { text: "鄂伦春族", value: "15" },
  627. { text: "鄂温克族", value: " 16" },
  628. { text: "高山族", value: "17" },
  629. { text: "仡佬族", value: "18" },
  630. { text: "哈尼族", value: "19" },
  631. { text: "哈萨克族", value: "20" },
  632. { text: "赫哲族", value: " 21" },
  633. { text: "回族", value: "22" },
  634. { text: "基诺族", value: "23" },
  635. { text: "京族", value: "24" },
  636. { text: "景颇族", value: "25" },
  637. { text: "柯尔克孜族", value: " 26" },
  638. { text: "拉祜族", value: "27" },
  639. { text: "黎族", value: "28" },
  640. { text: "傈僳族", value: "29" },
  641. { text: "珞巴族", value: "30" },
  642. { text: "满族", value: " 31" },
  643. { text: "毛南族", value: "32" },
  644. { text: "门巴族", value: "33" },
  645. { text: "蒙古族", value: "34" },
  646. { text: "苗族", value: "35" },
  647. { text: "仫佬族", value: " 36" },
  648. { text: "纳西族", value: "37" },
  649. { text: "怒族", value: "38" },
  650. { text: "普米族", value: "39" },
  651. { text: "羌族", value: "40" },
  652. { text: "撒拉族", value: " 41" },
  653. { text: "畲族", value: "42" },
  654. { text: "水族", value: "43" },
  655. { text: "塔吉克族", value: "44" },
  656. { text: "塔塔尔族", value: "45" },
  657. { text: "土家族", value: " 46" },
  658. { text: "土族", value: "47" },
  659. { text: "佤族", value: "48" },
  660. { text: "维吾尔族", value: "49" },
  661. { text: "乌孜别克族", value: "50" },
  662. { text: "锡伯族", value: " 51" },
  663. { text: "瑶族", value: "52" },
  664. { text: "彝族", value: "53" },
  665. { text: "裕固族", value: "54" },
  666. { text: "藏族", value: "55" },
  667. { text: "壮族", value: "56" },
  668. { text: "其他", value: "57" },
  669. ];
  670. let hs_nation = ref(false);
  671. const getnation = ({ selectedOptions }) => {
  672. hs_nation.value = false;
  673. const json = Object.assign(inputForm.value, {
  674. nation: selectedOptions[0].value,
  675. });
  676. inputForm.value = json;
  677. nationName.value = selectedOptions[0].text;
  678. };
  679. // 性别
  680. const sexName = ref("");
  681. const sex = [
  682. { text: "男", value: "1" },
  683. { text: "女", value: "2" },
  684. ];
  685. let hs_sex = ref(false);
  686. const getsex = ({ selectedOptions }) => {
  687. hs_sex.value = false;
  688. const json = Object.assign(inputForm.value, {
  689. sex: selectedOptions[0].value,
  690. });
  691. inputForm.value = json;
  692. sexName.value = selectedOptions[0].text;
  693. };
  694. // 教育程度
  695. const educationName = ref("");
  696. const education = [
  697. { text: "小学", value: "1" },
  698. { text: "初中", value: "2" },
  699. { text: "中专", value: "3" },
  700. { text: "高中", value: "4" },
  701. { text: "大专", value: "5" },
  702. { text: "本科", value: "6" },
  703. { text: "硕士研究生", value: "7" },
  704. { text: "博士研究生", value: "8" },
  705. { text: "其他", value: "9" },
  706. ];
  707. let hs_education = ref(false);
  708. const geteducation = ({ selectedOptions }) => {
  709. hs_education.value = false;
  710. const json = Object.assign(inputForm.value, {
  711. nationalEducationLevel: selectedOptions[0].value,
  712. });
  713. inputForm.value = json;
  714. educationName.value = selectedOptions[0].text;
  715. };
  716. // 宗教类别
  717. const religiousName = ref("");
  718. const religious = [
  719. { text: "伊斯兰教", value: "1" },
  720. { text: "基督教", value: "2" },
  721. { text: "天主教", value: "3" },
  722. { text: "佛教", value: "4" },
  723. { text: "道教", value: "5" },
  724. ];
  725. let hs_religious = ref(false);
  726. const getreligious = ({ selectedOptions }) => {
  727. hs_religious.value = false;
  728. const json = Object.assign(inputForm.value, {
  729. religion: selectedOptions[0].value,
  730. });
  731. inputForm.value = json;
  732. religiousName.value = selectedOptions[0].text;
  733. };
  734. // 宗教类别2
  735. const religiousName2 = ref("");
  736. const religioustype2 = ref("");
  737. const religious2 = [
  738. { text: "伊斯兰教", value: "1" },
  739. { text: "基督教", value: "2" },
  740. { text: "天主教", value: "3" },
  741. { text: "佛教", value: "4" },
  742. { text: "道教", value: "5" },
  743. ];
  744. let hs_religious2 = ref(false);
  745. const getreligious2 = ({ selectedOptions }) => {
  746. hs_religious2.value = false;
  747. religioustype2.value = selectedOptions[0].value;
  748. religiousName2.value = selectedOptions[0].text;
  749. };
  750. // 所属场所
  751. const locationName = ref('');
  752. const checked = ref("");
  753. const sitelist = ref([]);
  754. let hs_site = ref(false);
  755. const getsite = (val) => {
  756. console.log(val);
  757. let id = "";
  758. id = val.id;
  759. locationName.value = val.name;
  760. const json = Object.assign(inputForm.value, { location: { id: id } });
  761. inputForm.value = json;
  762. checked.value = val.id;
  763. };
  764. const loading = ref(false);
  765. const finished = ref(false);
  766. const refreshing = ref(false);
  767. let index = 0;
  768. const onLoad = () => {
  769. loading.value = true;
  770. finished.value = false;
  771. // 异步更新数据
  772. new PlaceRegister()
  773. .religiousList({
  774. current: index + 1,
  775. size: 10,
  776. })
  777. .then(({ records, pages }) => {
  778. sitelist.value = sitelist.value.concat(records);
  779. // 加载状态结束
  780. loading.value = false;
  781. if (index + 1 >= pages) {
  782. finished.value = true;
  783. }
  784. index++;
  785. });
  786. };
  787. // 场所任职情况
  788. const typeOfEmployeesName = ref("");
  789. const typeOfEmployees = [
  790. { text: "场所负责人", value: "1" },
  791. { text: "堂委", value: "2" },
  792. { text: "主要教职人员", value: "3" },
  793. { text: "财会", value: "4" },
  794. { text: "传道(已退休)", value: "5" },
  795. { text: "保安", value: "6" },
  796. { text: "信息审核员", value: "7" },
  797. { text: "常住", value: "8" },
  798. { text: "传道", value: "9" },
  799. { text: "道士", value: "10" },
  800. { text: "法人", value: "11" },
  801. { text: "法务", value: "12" },
  802. { text: "副主任", value: "13" },
  803. { text: "副组长", value: "14" },
  804. { text: "监院", value: "15" },
  805. { text: "清众", value: "16" },
  806. { text: "僧职", value: "17" },
  807. { text: "僧值", value: "18" },
  808. { text: "退居", value: "19" },
  809. { text: "维那", value: "20" },
  810. { text: "长老", value: "21" },
  811. { text: "知客", value: "22" },
  812. { text: "住持", value: "23" },
  813. { text: "组长", value: "24" },
  814. { text: "组长及讲道", value: "25" },
  815. ];
  816. let hs_typeOfEmployees = ref(false);
  817. const gettypeOfEmployees = ({ selectedOptions }) => {
  818. hs_typeOfEmployees.value = false;
  819. // inputForm.typeOfEmployees = selectedOptions[0].value;
  820. const json = Object.assign(inputForm.value, {
  821. typeOfEmployees: selectedOptions[0].value,
  822. });
  823. inputForm.value = json;
  824. typeOfEmployeesName.value = selectedOptions[0].text;
  825. };
  826. //籍贯
  827. const nativePlace = ref([]);
  828. let hs_nativePlace = ref(false);
  829. const getnativePlace = ({ selectedOptions }) => {
  830. hs_nativePlace.value = false;
  831. let str = "";
  832. selectedOptions.forEach((item) => {
  833. if (inputForm.nativePlace) {
  834. str = inputForm.nativePlace;
  835. }
  836. str += item.name + "/";
  837. });
  838. inputForm.nativePlace = str;
  839. const json = Object.assign(inputForm.value, { nativePlace: str });
  840. inputForm.value = json;
  841. };
  842. //图片上传
  843. let fileList = ref([]);
  844. let fileImg = ref([]);
  845. let workpic = ref("");
  846. const afterRead1 = (file) => {
  847. new tools()
  848. .uploadFile(file, `logo`)
  849. .then(({ data }) => {
  850. data.name = decodeURIComponent(
  851. data.url.substring(data.url.lastIndexOf("/") + 1)
  852. );
  853. workpic.value += "" + data.url;
  854. const json = Object.assign(inputForm.value, {
  855. workPicture: workpic.value,
  856. });
  857. inputForm.value = json;
  858. fileImg.value.push(data);
  859. });
  860. };
  861. const fjdelete = (file) => {
  862. //删除文件操作
  863. for (let index = 0; index < fileList.value.length; index++) {
  864. if (file.file == fileList.value[index].file) {
  865. let delurl = fileImg.value[index].url;
  866. new tools().uploadFiledelete("", delurl).then(({ data }) => {});
  867. fileImg.value.splice(index, 1);
  868. fileList.value.splice(index, 1);
  869. }
  870. }
  871. };
  872. //详细地址定位
  873. const getLocation = () => {
  874. xm.getLocation().then((data) => {
  875. inputForm.currentResidenceDetail = data.POIName;
  876. });
  877. };
  878. // 地区选择
  879. let placeAddress = ref("");
  880. const customFieldName = {
  881. text: "name",
  882. value: "id",
  883. };
  884. const options = ref([]);
  885. let showPlace1 = ref(false);
  886. const getPlace1 = ({ selectedOptions }) => {
  887. showPlace1.value = false;
  888. let str1 = "";
  889. let str2 = "";
  890. selectedOptions.forEach((item) => {
  891. if (inputForm.currentResidence) {
  892. str1 = inputForm.currentResidence;
  893. str2 = inputForm.currentResidenceId;
  894. }
  895. str1 += item.name + "/";
  896. str2 += item.code + "/";
  897. });
  898. const json = Object.assign(inputForm.value, {
  899. currentResidence: str1,
  900. currentResidenceId: str2,
  901. });
  902. inputForm.value = json;
  903. };
  904. //宗教组织
  905. const tissueName = ref("");
  906. const checked1 = ref("");
  907. const tissuelist = ref([]);
  908. let hs_tissue = ref(false);
  909. const gettissue = (val) => {
  910. tissueName.value = val.organizationName;
  911. const json = Object.assign(inputForm.value, { zjzz: { id: val.id } });
  912. inputForm.value = json;
  913. checked1.value = val.id;
  914. };
  915. const loading1 = ref(false);
  916. const finished1 = ref(false);
  917. const refreshing1 = ref(false);
  918. let index1 = 0;
  919. const onLoad1 = () => {
  920. loading1.value = true;
  921. finished1.value = false;
  922. // 异步更新数据
  923. new placePerson()
  924. .zjzz({
  925. current: index1 + 1,
  926. size: 10,
  927. })
  928. .then(({ records, pages }) => {
  929. tissuelist.value = tissuelist.value.concat(records);
  930. // 加载状态结束
  931. loading1.value = false;
  932. if (index1 + 1 >= pages) {
  933. finished1.value = true;
  934. }
  935. index1++;
  936. });
  937. };
  938. //人员类型
  939. const personnalType = ref("");
  940. const checked2 = ref([]);
  941. const persontype = [
  942. { text: "宗教从业人员", value: "1" },
  943. { text: "民族场所从业人员", value: "2" },
  944. { text: "教职人员", value: "3" },
  945. { text: "固定信徒", value: "4" },
  946. { text: "场所居住人员", value: "5" },
  947. { text: "境外人员", value: "6" },
  948. { text: "非本市人员", value: "7" },
  949. { text: "非本教人员", value: "8" },
  950. { text: "临时人员", value: "9" },
  951. { text: "异常人员", value: "10" },
  952. { text: "邪教人员", value: "12" },
  953. { text: "管理人员", value: "13" },
  954. { text: "全能神离家人员", value: "14" },
  955. { text: "全能神骨干人员", value: "15" },
  956. { text: "网络运营人员", value: "16" },
  957. { text: "涉政有害活动人员", value: "17" },
  958. { text: "境内外记者", value: "18" },
  959. { text: "境外法轮功骨干人员", value: "19" },
  960. { text: "其他邪教骨干人员", value: "20" },
  961. { text: "心灵法门骨干人员", value: "21" },
  962. { text: "“精神控制”有害培训骨干人员", value: "22" },
  963. { text: "重点人员", value: "23" },
  964. ];
  965. const showZW = ref("");
  966. const checkboxRefs = ref([]);
  967. let hs_persontype = ref(false);
  968. const toggle = (index) => {
  969. checkboxRefs.value[index].toggle();
  970. personnalType.value = getValue(checked2.value).join();
  971. showZW.value = checked2.value.join();;
  972. };
  973. const changperson = ()=>{
  974. const json = Object.assign(
  975. { ...inputForm.value },
  976. { personnelType: showZW.value }
  977. );
  978. inputForm.value = json;
  979. changePersonnelType();
  980. }
  981. const changePersonnelType = () => {
  982. let userManagenmetDetailsDTOList = [];
  983. new placePerson().userDTOqueryId(inputForm.value.personnelType.toString()).then((data) => {
  984. data.forEach((item) => {
  985. let userManagenmetDetail = {};
  986. userManagenmetDetail = Object.assign(userManagenmetDetail, {
  987. id: "",
  988. chineseName: item.chineseName,
  989. englishName: item.englishName,
  990. dataType: item.dataType,
  991. value: "",
  992. orderNum: item.orderNum,
  993. dataDictionary: item.dataDictionary,
  994. dataDictionaryId: item.dataDictionaryId,
  995. });
  996. userManagenmetDetailsDTOList.push(userManagenmetDetail);
  997. });
  998. inputForm.value.userManagenmetDetailsDTOList = userManagenmetDetailsDTOList
  999. console.log(inputForm.value.userManagenmetDetailsDTOList,'================================>inputForm.value.userManagenmetDetailsDTOList');
  1000. });
  1001. };
  1002. onBeforeUpdate(() => {
  1003. checkboxRefs.value = [];
  1004. });
  1005. const getValue = (item) => {
  1006. const type = {
  1007. 1: "宗教从业人员",
  1008. 2: "民族场所从业人员",
  1009. 3: "教职人员",
  1010. 4: "固定信徒",
  1011. 5: "场所居住人员",
  1012. 6: "境外人员",
  1013. 7: "非本市人员",
  1014. 8: "非本教人员",
  1015. 9: "临时人员",
  1016. 10: "异常人员",
  1017. 12: "邪教人员",
  1018. 13: "管理人员",
  1019. 14: "全能神离家人员",
  1020. 15: "全能神骨干人员",
  1021. 16: "网络运营人员",
  1022. 17: "涉政有害活动人员",
  1023. 18: "境内外记者",
  1024. 19: "境外法轮功骨干人员",
  1025. 20: "其他邪教骨干人员",
  1026. 21: "心灵法门骨干人员",
  1027. 22: "“精神控制”有害培训骨干人员",
  1028. 23: "重点人员",
  1029. };
  1030. let Array = [];
  1031. item.forEach((chilr) => {
  1032. Array.push(type[chilr]);
  1033. });
  1034. return Array;
  1035. };
  1036. // 是否参加非法活动
  1037. const activitytext = ref("");
  1038. const activity = [
  1039. { text: "是", value: "0" },
  1040. { text: "否", value: "1" },
  1041. ];
  1042. let hs_activity = ref(false);
  1043. const getactivity = ({ selectedOptions }) => {
  1044. hs_activity.value = false;
  1045. const json = Object.assign(inputForm.value, {
  1046. bkcheck: selectedOptions[0].value,
  1047. });
  1048. inputForm.value = json;
  1049. activitytext.value = selectedOptions[0].text;
  1050. };
  1051. // 扩展信息选择
  1052. const teachPosition = ref("");
  1053. let hs_select = ref(false);
  1054. const getselect = ({selectedOptions,selectedIndexes}) => {
  1055. hs_select.value = false;
  1056. teachPosition.value = selectedOptions[0].value;
  1057. };
  1058. // 扩展信息的时间
  1059. const issueDate = ref("");
  1060. let hs_Date = ref(false);
  1061. const getDate = ({ selectedOptions }) => {
  1062. hs_Date.value = false;
  1063. issueDate.value =
  1064. selectedOptions[0].text +
  1065. "-" +
  1066. selectedOptions[1].text +
  1067. "-" +
  1068. selectedOptions[2].text;
  1069. };
  1070. //跳转
  1071. let router = useRouter();
  1072. const handleAvatarSuccess1 = (row, res, file, filelist) => {
  1073. row.value = res.url;
  1074. };
  1075. //数据提交
  1076. const submit = () => {
  1077. new placePerson().save(inputForm.value).then((res) => {
  1078. console.log(res);
  1079. if (res.status == 200) {
  1080. xm.showToast({
  1081. message: "人员添加成功",
  1082. });
  1083. router.push({
  1084. path: "/placePerson",
  1085. });
  1086. } else {
  1087. xm.showToast({
  1088. message: "人员添加失败",
  1089. });
  1090. console.log(res);
  1091. }
  1092. });
  1093. };
  1094. return {
  1095. //人员添加
  1096. inputForm,
  1097. // 证件类型
  1098. idTypeName,
  1099. showPicker,
  1100. places,
  1101. getPlace,
  1102. //民族
  1103. nationName,
  1104. hs_nation,
  1105. nation,
  1106. getnation,
  1107. //性别
  1108. sexName,
  1109. hs_sex,
  1110. sex,
  1111. getsex,
  1112. // 教育程度
  1113. educationName,
  1114. hs_education,
  1115. education,
  1116. geteducation,
  1117. // 宗教类别
  1118. religiousName,
  1119. hs_religious,
  1120. religious,
  1121. getreligious,
  1122. // 宗教类别2
  1123. religiousName2,
  1124. religioustype2,
  1125. hs_religious2,
  1126. religious2,
  1127. getreligious2,
  1128. //所属场所
  1129. locationName,
  1130. checked,
  1131. hs_site,
  1132. getsite,
  1133. sitelist,
  1134. loading,
  1135. finished,
  1136. onLoad,
  1137. refreshing,
  1138. //场所任职情况
  1139. typeOfEmployeesName,
  1140. hs_typeOfEmployees,
  1141. typeOfEmployees,
  1142. gettypeOfEmployees,
  1143. //籍贯
  1144. nativePlace,
  1145. hs_nativePlace,
  1146. getnativePlace,
  1147. //宗教组织
  1148. tissueName,
  1149. checked1,
  1150. hs_tissue,
  1151. gettissue,
  1152. tissuelist,
  1153. loading1,
  1154. finished1,
  1155. onLoad1,
  1156. refreshing1,
  1157. //人员类型
  1158. checked2,
  1159. personnalType,
  1160. persontype,
  1161. hs_persontype,
  1162. toggle,
  1163. changperson,
  1164. checkboxRefs,
  1165. showZW,
  1166. // 是否参加非法活动
  1167. activity,
  1168. hs_activity,
  1169. getactivity,
  1170. activitytext,
  1171. //教职身份
  1172. teachPosition,
  1173. hs_select,
  1174. getselect,
  1175. //证书颁发时间
  1176. hs_Date,
  1177. issueDate,
  1178. getDate,
  1179. //图片上传
  1180. fileList,
  1181. afterRead1,
  1182. //图片删除
  1183. fjdelete,
  1184. // 返回
  1185. onClickLeft,
  1186. // 详细地址定位
  1187. getLocation,
  1188. // 地区选择
  1189. placeAddress,
  1190. customFieldName,
  1191. showPlace1,
  1192. getPlace1,
  1193. options,
  1194. //数据提交
  1195. submit,
  1196. selectColor,
  1197. };
  1198. },
  1199. };
  1200. </script>
  1201. <style lang="less">
  1202. .subbtn {
  1203. margin: 20px;
  1204. text-align: center;
  1205. }
  1206. .subbtn .van-button {
  1207. width: 40%;
  1208. margin: 5px;
  1209. }
  1210. .van-uploader .van-button {
  1211. border: none;
  1212. color: #36a7f3;
  1213. top: -4px;
  1214. }
  1215. .van-radio {
  1216. margin-right: 10px;
  1217. }
  1218. .dialog {
  1219. width: 100%;
  1220. height: 400px;
  1221. overflow: auto;
  1222. }
  1223. </style>