placePersoninfo.vue 42 KB

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