placeRegister.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  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. <van-tabs v-model:active="active" swipeable>
  11. <!-- 基础信息 -->
  12. <van-tab>
  13. <template #title> <van-icon name="orders-o" />基础信息</template>
  14. <div style="padding: 0 10px; height: 570px; overflow: auto">
  15. <van-cell-group>
  16. <van-field
  17. name="uploader"
  18. label-align="top"
  19. label-width="8em"
  20. label="场所内外景照片:"
  21. >
  22. <template #input>
  23. <van-uploader
  24. v-model="fileList"
  25. :after-read="afterRead1"
  26. :max-count="6"
  27. capture="camera"
  28. accept=""
  29. :before-delete="fjdelete"
  30. >
  31. </van-uploader>
  32. </template>
  33. </van-field>
  34. </van-cell-group>
  35. <van-cell-group>
  36. <van-field
  37. v-model="inputForm.name"
  38. center
  39. required
  40. clearable
  41. label="场所名称:"
  42. input-align="right"
  43. placeholder="请输入场所名称"
  44. />
  45. </van-cell-group>
  46. <van-cell-group>
  47. <van-field
  48. v-model="religiousType"
  49. readonly
  50. required
  51. label="宗教类型:"
  52. name="validator"
  53. placeholder="请选择教别"
  54. input-align="right"
  55. right-icon="arrow-down"
  56. @click="hs_religious = true"
  57. />
  58. </van-cell-group>
  59. <van-cell-group>
  60. <van-field
  61. v-model="inputForm.tyshxydm"
  62. center
  63. label-width="7em"
  64. clearable
  65. label="社会信用代码:"
  66. input-align="right"
  67. placeholder="请输入社会信用代码"
  68. />
  69. </van-cell-group>
  70. <van-cell-group>
  71. <van-field
  72. v-model="inputForm.contact"
  73. center
  74. label-width="7em"
  75. clearable
  76. label="场所联系人:"
  77. input-align="right"
  78. placeholder="请填写场所联系人"
  79. />
  80. </van-cell-group>
  81. <van-cell-group>
  82. <van-field
  83. v-model="inputForm.contactNumber"
  84. center
  85. label-width="7em"
  86. clearable
  87. label="联系电话:"
  88. input-align="right"
  89. placeholder="请输入联系电话"
  90. />
  91. </van-cell-group>
  92. <van-cell-group>
  93. <van-field
  94. v-model="placeAddress"
  95. center
  96. clearable
  97. readonly
  98. label="场所地点:"
  99. input-align="right"
  100. right-icon="arrow-down"
  101. placeholder="请输入场所地点"
  102. @click="showPlace1 = true"
  103. />
  104. </van-cell-group>
  105. <van-cell-group>
  106. <van-field
  107. v-model="inputForm.place"
  108. center
  109. clearable
  110. label="详细地点:"
  111. input-align="right"
  112. placeholder="请输入详细场所地点"
  113. >
  114. <template #right-icon>
  115. <van-icon name="location" @click="getLocation" />
  116. </template>
  117. </van-field>
  118. </van-cell-group>
  119. <van-cell-group>
  120. <van-field
  121. v-model="inputForm.longitude"
  122. center
  123. clearable
  124. label-width="7em"
  125. label="场所坐标-经度:"
  126. input-align="right"
  127. placeholder="请输入场所经度坐标"
  128. />
  129. </van-cell-group>
  130. <van-cell-group>
  131. <van-field
  132. v-model="inputForm.latitude"
  133. center
  134. clearable
  135. label-width="7em"
  136. label="场所坐标-纬度:"
  137. input-align="right"
  138. placeholder="请输入场所纬度坐标"
  139. />
  140. </van-cell-group>
  141. <van-cell-group>
  142. <van-field
  143. v-model="inputForm.peopleThreshold"
  144. center
  145. clearable
  146. required
  147. label="额定人数:"
  148. input-align="right"
  149. placeholder="请输入场所额定人数"
  150. />
  151. </van-cell-group>
  152. <van-cell-group>
  153. <van-field
  154. v-model="placeTypeName"
  155. center
  156. readonly
  157. clearable
  158. required
  159. label="场所类型:"
  160. input-align="right"
  161. placeholder="请选择场所类型"
  162. right-icon="arrow-down"
  163. @click="showPicker1 = true"
  164. >
  165. </van-field>
  166. </van-cell-group>
  167. <van-cell-group>
  168. <van-field
  169. v-model="propertyName"
  170. readonly
  171. required
  172. label="场所性质"
  173. placeholder="请选择场所性质"
  174. input-align="right"
  175. right-icon="arrow-down"
  176. @click="showPicker3 = true"
  177. />
  178. </van-cell-group>
  179. <van-cell-group>
  180. <van-field
  181. v-model="inputForm.protectionLevel"
  182. center
  183. clearable
  184. label-width="7em"
  185. label="文物保护级别:"
  186. input-align="right"
  187. placeholder="请输入文物保护级别"
  188. />
  189. </van-cell-group>
  190. <van-cell-group>
  191. <van-field
  192. v-model="constructionName"
  193. center
  194. required
  195. readonly
  196. clearable
  197. label-width="7em"
  198. label="场所建设阶段:"
  199. input-align="right"
  200. right-icon="arrow-down"
  201. placeholder="请选择场所建设阶段"
  202. @click="showPicker2 = true"
  203. >
  204. </van-field>
  205. </van-cell-group>
  206. <van-cell-group>
  207. <van-field
  208. v-model="inputForm.coveredArea"
  209. center
  210. clearable
  211. label="建筑面积(㎡):"
  212. input-align="right"
  213. placeholder="请输入场所建筑面积"
  214. />
  215. </van-cell-group>
  216. <van-cell-group>
  217. <van-field
  218. v-model="inputForm.floorSpace"
  219. center
  220. clearable
  221. label="占地面积(㎡):"
  222. input-align="right"
  223. placeholder="请输入场所占地面积"
  224. />
  225. </van-cell-group>
  226. <van-cell-group>
  227. <van-field
  228. v-model="inputForm.plan"
  229. center
  230. clearable
  231. label="场所规划:"
  232. input-align="right"
  233. placeholder="请填写场所规划"
  234. />
  235. </van-cell-group>
  236. <van-cell-group>
  237. <van-field
  238. v-model="inputForm.mainRoads"
  239. center
  240. clearable
  241. label-width="8em"
  242. label="出入口主要道路:"
  243. input-align="right"
  244. placeholder="请填写出入口主要道路"
  245. />
  246. </van-cell-group>
  247. <van-cell-group>
  248. <van-field
  249. v-model="inputForm.publicArea"
  250. center
  251. clearable
  252. label-width="7em"
  253. label="外围公共区域:"
  254. input-align="right"
  255. placeholder="请填写外围公共区域"
  256. />
  257. </van-cell-group>
  258. <van-cell-group>
  259. <van-field
  260. name="uploader"
  261. label-align="top"
  262. label-width="8em"
  263. label="宗教礼仪空间:"
  264. >
  265. <template #input>
  266. <van-uploader
  267. v-model="fileList"
  268. :after-read="afterRead1"
  269. :max-count="6"
  270. capture="camera"
  271. accept=""
  272. :before-delete="fjdelete"
  273. >
  274. </van-uploader>
  275. </template>
  276. </van-field>
  277. </van-cell-group>
  278. <van-cell-group>
  279. <van-field
  280. v-model="inputForm.remake"
  281. rows="1"
  282. autosize
  283. label="备注:"
  284. type="textarea"
  285. placeholder="请输入备注"
  286. />
  287. </van-cell-group>
  288. </div>
  289. </van-tab>
  290. <!-- 备案信息 -->
  291. <van-tab>
  292. <template #title> <van-icon name="bulb-o" />备案信息 </template>
  293. <div style="padding: 0 10px; height: 470px; overflow: auto">
  294. <van-cell-group>
  295. <van-field
  296. v-model="inputForm.filingNo"
  297. center
  298. clearable
  299. label="场所备案号:"
  300. input-align="right"
  301. placeholder="请输入场所备案号"
  302. />
  303. </van-cell-group>
  304. <van-cell-group>
  305. <van-field
  306. v-model="inputForm.approvedEstablishmentTime"
  307. center
  308. required
  309. clearable
  310. readonly
  311. label-width="8em"
  312. label="批准设立时间:"
  313. input-align="right"
  314. right-icon="arrow-down"
  315. placeholder="请选择批准设立时间"
  316. @click="hs_SetupTime = true"
  317. />
  318. </van-cell-group>
  319. <van-cell-group>
  320. <van-field
  321. v-model="inputForm.registrationAuthority"
  322. center
  323. required
  324. clearable
  325. label="登记机关:"
  326. input-align="right"
  327. placeholder="请输入登记机关"
  328. />
  329. </van-cell-group>
  330. <van-cell-group>
  331. <van-field
  332. v-model="inputForm.registrationDate"
  333. center
  334. required
  335. readonly
  336. clearable
  337. label="登记日期:"
  338. right-icon="arrow-down"
  339. input-align="right"
  340. placeholder="请选择登记日期"
  341. @click="hs_SignTime = true"
  342. />
  343. </van-cell-group>
  344. <van-cell-group>
  345. <van-field
  346. v-model="inputForm.teachingStaff"
  347. center
  348. required
  349. clearable
  350. label-width="7em"
  351. label="主要教职人员:"
  352. input-align="right"
  353. placeholder="请输入主要教职人员"
  354. />
  355. </van-cell-group>
  356. <van-cell-group>
  357. <van-field
  358. v-model="inputForm.approveOffice"
  359. center
  360. clearable
  361. label-width="7em"
  362. label="批准设立机关:"
  363. input-align="right"
  364. placeholder="请输入批准设立机关"
  365. />
  366. </van-cell-group>
  367. <van-cell-group>
  368. <van-field
  369. v-model="religiousDeptManaUserName"
  370. center
  371. readonly
  372. label="宗教管理人员"
  373. placeholder="请填写宗教管理人员"
  374. input-align="right"
  375. right-icon="arrow-down"
  376. @click="showPerson = true"
  377. />
  378. </van-cell-group>
  379. <van-cell-group>
  380. <van-field
  381. v-model="securityDeptManaUserName"
  382. center
  383. readonly
  384. label="公安管理人员"
  385. placeholder="请填写公安管理人员"
  386. input-align="right"
  387. right-icon="arrow-down"
  388. @click="showReport = true"
  389. />
  390. </van-cell-group>
  391. <van-cell-group>
  392. <van-field
  393. name="uploader"
  394. label-align="top"
  395. label-width="10em"
  396. label="场所建设审批手续:"
  397. >
  398. <template #input>
  399. <van-uploader
  400. v-model="fileList3"
  401. :after-read="afterRead3"
  402. :max-count="6"
  403. capture="camera"
  404. accept=""
  405. :before-delete="fjdelete3"
  406. >
  407. </van-uploader>
  408. </template>
  409. </van-field>
  410. </van-cell-group>
  411. </div>
  412. </van-tab>
  413. <!-- 互联网专区 -->
  414. <van-tab>
  415. <template #title> <van-icon name="desktop-o" />互联网专区 </template>
  416. <div style="padding: 0 10px; height: 470px; overflow: auto">
  417. <div style="overflow: hidden">
  418. <p style="font-weight: 700; font-size: 14px">
  419. 直播间<van-button
  420. type="primary"
  421. size="mini"
  422. style="margin-left: 10px; vertical-align: middle"
  423. @click="addForm('直播间')"
  424. >新增</van-button
  425. >
  426. </p>
  427. <div v-for="item in internetForm.zbjForm" :key="item.key">
  428. <van-cell-group>
  429. <van-field
  430. v-model="item.typeName"
  431. center
  432. clearable
  433. readonly
  434. label-width="7em"
  435. label="所属平台:"
  436. input-align="right"
  437. right-icon="arrow-down"
  438. placeholder="请选择所属平台"
  439. @click="showNew(item.key)"
  440. />
  441. </van-cell-group>
  442. <van-cell-group>
  443. <van-field
  444. v-model="item.account"
  445. center
  446. clearable
  447. label-width="7em"
  448. label="直播账号:"
  449. input-align="right"
  450. placeholder="请输入直播账号"
  451. />
  452. </van-cell-group>
  453. <van-cell-group>
  454. <van-field
  455. v-model="item.manager"
  456. center
  457. clearable
  458. label-width="7em"
  459. label="管理员:"
  460. input-align="right"
  461. placeholder="请填写管理员"
  462. />
  463. </van-cell-group>
  464. <van-cell-group>
  465. <van-field
  466. v-model="item.contact"
  467. center
  468. clearable
  469. label-width="7em"
  470. label="联系方式:"
  471. input-align="right"
  472. placeholder="请输入联系方式"
  473. />
  474. </van-cell-group>
  475. <van-button
  476. @click="removeForm(item, '直播间')"
  477. type="danger"
  478. size="mini"
  479. color="#e6a23c"
  480. >删除</van-button
  481. >
  482. </div>
  483. </div>
  484. <div style="overflow: hidden">
  485. <p style="font-weight: 700; font-size: 14px">
  486. 公众号<van-button
  487. type="primary"
  488. size="mini"
  489. @click="addForm('公众号')"
  490. style="margin-left: 10px; vertical-align: middle"
  491. >新增</van-button
  492. >
  493. </p>
  494. <div v-for="item in internetForm.gzhForm" :key="item.key">
  495. <van-cell-group>
  496. <van-field
  497. v-model="item.account"
  498. center
  499. clearable
  500. label-width="7em"
  501. label="公众号账号:"
  502. input-align="right"
  503. placeholder="请输入直播账号"
  504. />
  505. </van-cell-group>
  506. <van-cell-group>
  507. <van-field
  508. v-model="item.manager"
  509. center
  510. clearable
  511. label-width="7em"
  512. label="管理员:"
  513. input-align="right"
  514. placeholder="请填写管理员"
  515. />
  516. </van-cell-group>
  517. <van-cell-group>
  518. <van-field
  519. v-model="item.contact"
  520. center
  521. clearable
  522. label-width="7em"
  523. label="联系方式:"
  524. input-align="right"
  525. placeholder="请输入联系方式"
  526. />
  527. </van-cell-group>
  528. <van-button
  529. @click="removeForm(item, '公众号')"
  530. type="danger"
  531. size="mini"
  532. color="#e6a23c"
  533. >删除</van-button
  534. >
  535. </div>
  536. </div>
  537. <div style="overflow: hidden">
  538. <p style="font-weight: 700; font-size: 14px">
  539. 微信群<van-button
  540. type="primary"
  541. size="mini"
  542. style="margin-left: 10px; vertical-align: middle"
  543. @click="addForm('微信群')"
  544. >新增</van-button
  545. >
  546. </p>
  547. <div v-for="item in internetForm.wxqForm" :key="item.key">
  548. <van-cell-group>
  549. <van-field
  550. v-model="item.account"
  551. center
  552. clearable
  553. label-width="7em"
  554. label="微信群账号:"
  555. input-align="right"
  556. placeholder="请输入直播账号"
  557. />
  558. </van-cell-group>
  559. <van-cell-group>
  560. <van-field
  561. v-model="item.manager"
  562. center
  563. clearable
  564. label-width="7em"
  565. label="管理员:"
  566. input-align="right"
  567. placeholder="请填写管理员"
  568. />
  569. </van-cell-group>
  570. <van-cell-group>
  571. <van-field
  572. v-model="item.contact"
  573. center
  574. clearable
  575. label-width="7em"
  576. label="联系方式:"
  577. input-align="right"
  578. placeholder="请输入联系方式"
  579. />
  580. </van-cell-group>
  581. <van-button
  582. @click="removeForm(item, '微信群')"
  583. type="danger"
  584. size="mini"
  585. color="#e6a23c"
  586. >删除</van-button
  587. >
  588. </div>
  589. </div>
  590. <div style="overflow: hidden">
  591. <p style="font-weight: 700">网站</p>
  592. <div>
  593. <van-cell-group>
  594. <van-field
  595. v-model="inputForm.website"
  596. center
  597. clearable
  598. label-width="7em"
  599. label="网站地址:"
  600. input-align="right"
  601. placeholder="请输入网站地址"
  602. />
  603. </van-cell-group>
  604. </div>
  605. </div>
  606. </div>
  607. </van-tab>
  608. </van-tabs>
  609. <div class="btn">
  610. <van-button type="primary" @click="submit">场所添加</van-button>
  611. </div>
  612. <!-- 宗教类型 -->
  613. <van-popup v-model:show="hs_religious" round position="bottom">
  614. <van-picker
  615. title="宗教类型"
  616. :columns="religious"
  617. @cancel="hs_religious = false"
  618. @confirm="getreligious"
  619. />
  620. </van-popup>
  621. <!-- 场所地点 -->
  622. <van-popup v-model:show="showPlace1" round position="bottom">
  623. <van-picker
  624. title="场所地点"
  625. :columns="options"
  626. :columns-field-names="customFieldName"
  627. @cancel="showPlace1 = false"
  628. @confirm="getPlace1"
  629. />
  630. </van-popup>
  631. <!-- 场所类型 -->
  632. <van-popup v-model:show="showPicker1" round position="bottom">
  633. <van-picker
  634. title="场所类型"
  635. :columns="placeType"
  636. @cancel="showPicker1 = false"
  637. @confirm="getplaceType"
  638. />
  639. </van-popup>
  640. <!-- 场所性质 -->
  641. <van-popup v-model:show="showPicker3" round position="bottom">
  642. <van-picker
  643. title="场所性质选择"
  644. :columns="property"
  645. @cancel="showPicker3 = false"
  646. @confirm="getproperty"
  647. />
  648. </van-popup>
  649. <!-- 场所建设阶段 -->
  650. <van-popup v-model:show="showPicker2" round position="bottom">
  651. <van-picker
  652. title="场所建设阶段"
  653. :columns="construction"
  654. @cancel="showPicker2 = false"
  655. @confirm="getConstruction"
  656. />
  657. </van-popup>
  658. <!-- 宗教管理人员 -->
  659. <van-dialog
  660. v-model:show="showPerson"
  661. title="宗教部门管理人员"
  662. show-cancel-button
  663. @confirm="reselected"
  664. width="100%"
  665. >
  666. <manage-list @selected="selected" :type="0"></manage-list>
  667. </van-dialog>
  668. <!-- 公安部门人员 -->
  669. <van-dialog
  670. v-model:show="showReport"
  671. title="公安部门管理人员"
  672. show-cancel-button
  673. @confirm="reselected2"
  674. width="100%"
  675. >
  676. <manage-list-2 @selected2="selected2"></manage-list-2>
  677. </van-dialog>
  678. <!-- 直播类型 -->
  679. <van-popup v-model:show="showzbj" round position="bottom">
  680. <van-picker
  681. title="直播类型"
  682. :columns="zbj"
  683. @cancel="showzbj = false"
  684. @confirm="getzbj"
  685. />
  686. </van-popup>
  687. <!-- 批准设立时间 -->
  688. <van-popup v-model:show="hs_SetupTime" round position="bottom">
  689. <van-date-picker
  690. v-model="currentDate"
  691. title="选择日期"
  692. :min-date="minDate"
  693. :max-date="maxDate"
  694. @cancel="hs_SetupTime = false"
  695. @confirm="getSetupTime"
  696. />
  697. </van-popup>
  698. <!-- 登记日期 -->
  699. <van-popup v-model:show="hs_SignTime" round position="bottom">
  700. <van-date-picker
  701. v-model="currentDate"
  702. title="选择日期"
  703. :min-date="minDate"
  704. :max-date="maxDate"
  705. @cancel="hs_SignTime = false"
  706. @confirm="getSignTime"
  707. />
  708. </van-popup>
  709. </div>
  710. </template>
  711. <script>
  712. import ManageList from "../ManageList.vue";
  713. import ManageList2 from "../ManageList2.vue";
  714. import { useRouter } from "vue-router";
  715. import { onMounted, ref } from "vue";
  716. import placeRegister from "@/api/placeRegister/placeRegister";
  717. import tools from "@/api/sys/tools";
  718. export default {
  719. components: { ManageList, ManageList2 },
  720. setup() {
  721. const inputForm = ref({
  722. id: "",
  723. religiousType: "",
  724. religiousName: "",
  725. name: "",
  726. tyshxydm: "",
  727. filingNo: "",
  728. contact: "",
  729. contactNumber: "",
  730. placeSelectName: "",
  731. placeSelectId: "",
  732. placeSelectType3: "",
  733. placeSelectType4: "",
  734. placeSelectType5: "",
  735. placeSelectType6: "",
  736. placeSelectLastId: "",
  737. place: "",
  738. longitude: "",
  739. latitude: "",
  740. siteType: "",
  741. constructionStage: "",
  742. nature: "",
  743. religiousDeptManaUser: "",
  744. securityDeptManaUser: "",
  745. scenesImage: "",
  746. plan: "",
  747. etiquetteSpace: "",
  748. mainRoads: "",
  749. publicArea: "",
  750. website: "",
  751. approvalProcedures: "",
  752. peopleThreshold: "",
  753. state: "1",
  754. isEnable: "1",
  755. remake: "",
  756. approvedEstablishmentTime: "",
  757. registrationAuthority: "",
  758. registrationDate: "",
  759. teachingStaff: "",
  760. approveOffice: "",
  761. coveredArea: "",
  762. floorSpace: "",
  763. protectionLevel: "",
  764. dynamicFormJson: "",
  765. });
  766. onMounted(() => {
  767. dynamicFormDataClear();
  768. dynamicFormDataProceed();
  769. });
  770. const active = ref(0);
  771. // 导航栏颜色
  772. const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
  773. //数据接收
  774. const router = useRouter();
  775. //详细地址定位
  776. const getLocation = () => {
  777. xm.getLocation().then((data) => {
  778. inputForm.value.place = data.POIName;
  779. });
  780. };
  781. // 地区选择
  782. let placeAddress = ref("");
  783. const customFieldName = {
  784. text: "name",
  785. value: "id",
  786. };
  787. // 选项列表,children 代表子选项,支持多级嵌套
  788. const options = ref([]);
  789. // 获取地区数据树
  790. new placeRegister().treeDate().then((res) => {
  791. options.value.push(...res);
  792. });
  793. let showPlace1 = ref(false);
  794. const getPlace1 = ({ selectedOptions }) => {
  795. showPlace1.value = false;
  796. placeAddress.value =
  797. selectedOptions[0].name +
  798. "/" +
  799. selectedOptions[1].name +
  800. "/" +
  801. selectedOptions[2].name;
  802. const json = Object.assign(inputForm.value, {
  803. placeSelectName:
  804. selectedOptions[0].name +
  805. "/" +
  806. selectedOptions[1].name +
  807. "/" +
  808. selectedOptions[2].name,
  809. placeSelectId:
  810. selectedOptions[0].id +
  811. "/" +
  812. selectedOptions[1].id +
  813. "/" +
  814. selectedOptions[2].id,
  815. placeSelectType3: selectedOptions[0].id,
  816. placeSelectType4: selectedOptions[1].id,
  817. placeSelectType5: selectedOptions[2].id,
  818. placeSelectLastId: selectedOptions[2].id,
  819. });
  820. inputForm.value = json;
  821. };
  822. //宗教类型
  823. const religiousType = ref("");
  824. const religious = [
  825. { text: "伊斯兰教", value: "1" },
  826. { text: "基督教", value: "2" },
  827. { text: "天主教", value: "3" },
  828. { text: "佛教", value: "4" },
  829. { text: "道教", value: "5" },
  830. ];
  831. let hs_religious = ref(false);
  832. const getreligious = ({ selectedOptions }) => {
  833. hs_religious.value = false;
  834. const json = Object.assign(inputForm.value, {
  835. religiousType: selectedOptions[0].value,
  836. religiousName: selectedOptions[0].text,
  837. });
  838. inputForm.value = json;
  839. religiousType.value = selectedOptions[0].text;
  840. };
  841. // 场所类型
  842. const placeTypeName = ref("");
  843. const placeType = [
  844. { text: "线上", value: "0" },
  845. { text: "线下", value: "1" },
  846. ];
  847. let showPicker1 = ref(false);
  848. const getplaceType = ({ selectedOptions }) => {
  849. showPicker1.value = false;
  850. const json = Object.assign(inputForm.value, {
  851. siteType: selectedOptions[0].value,
  852. });
  853. inputForm.value = json;
  854. placeTypeName.value = selectedOptions[0].text;
  855. };
  856. // 场所性质
  857. const propertyName = ref("");
  858. const property = [
  859. { text: "固定场所", value: "0" },
  860. { text: "寺观教堂", value: "1" },
  861. ];
  862. let showPicker3 = ref(false);
  863. const getproperty = ({ selectedOptions }) => {
  864. showPicker3.value = false;
  865. const json = Object.assign(inputForm.value, {
  866. nature: selectedOptions[0].value,
  867. });
  868. inputForm.value = json;
  869. propertyName.value = selectedOptions[0].text;
  870. };
  871. // 场所建设
  872. const constructionName = ref("");
  873. const construction = [
  874. { text: "筹备", value: "0" },
  875. { text: "建设完成", value: "1" },
  876. ];
  877. let showPicker2 = ref(false);
  878. const getConstruction = ({ selectedOptions }) => {
  879. showPicker2.value = false;
  880. const json = Object.assign(inputForm.value, {
  881. constructionStage: selectedOptions[0].value,
  882. });
  883. inputForm.value = json;
  884. constructionName.value = selectedOptions[0].text;
  885. };
  886. //图片上传
  887. let fileList = ref([]);
  888. let fileImg = ref([]);
  889. const afterRead1 = (file) => {
  890. new tools()
  891. .uploadFile(file, `religioussites/siteinfo/religiousSitesInfo`)
  892. .then(({ data }) => {
  893. data.name = decodeURIComponent(
  894. data.url.substring(data.url.lastIndexOf("/") + 1)
  895. );
  896. inputForm.value.scenesImage += "" + data.url;
  897. fileImg.value.push(data);
  898. });
  899. };
  900. const fjdelete = (file) => {
  901. //删除文件操作
  902. for (let index = 0; index < fileList.value.length; index++) {
  903. if (file.file == fileList.value[index].file) {
  904. let delurl = fileImg.value[index].url;
  905. new tools().uploadFiledelete("", delurl).then(({ data }) => {});
  906. fileImg.value.splice(index, 1);
  907. fileList.value.splice(index, 1);
  908. }
  909. }
  910. };
  911. let fileList2 = ref([]);
  912. let fileImg2 = ref([]);
  913. const afterRead2 = (file) => {
  914. new tools()
  915. .uploadFile(file, `religioussites/siteinfo/religiousSitesInfo`)
  916. .then(({ data }) => {
  917. data.name = decodeURIComponent(
  918. data.url.substring(data.url.lastIndexOf("/") + 1)
  919. );
  920. inputForm.value.etiquetteSpace += "" + data.url;
  921. fileImg2.value.push(data);
  922. });
  923. };
  924. const fjdelete2 = (file) => {
  925. //删除文件操作
  926. for (let index = 0; index < fileList2.value.length; index++) {
  927. if (file.file == fileList2.value[index].file) {
  928. let delurl = fileImg2.value[index].url;
  929. new tools().uploadFiledelete("", delurl).then(({ data }) => {});
  930. fileImg2.value.splice(index, 1);
  931. fileList2.value.splice(index, 1);
  932. }
  933. }
  934. };
  935. let fileList3 = ref([]);
  936. let fileImg3 = ref([]);
  937. const afterRead3 = (file) => {
  938. new tools()
  939. .uploadFile(file, `religioussites/siteinfo/religiousSitesInfo`)
  940. .then(({ data }) => {
  941. data.name = decodeURIComponent(
  942. data.url.substring(data.url.lastIndexOf("/") + 1)
  943. );
  944. inputForm.value.approvalProcedures += "" + data.url;
  945. fileImg3.value.push(data);
  946. });
  947. };
  948. const fjdelete3 = (file) => {
  949. //删除文件操作
  950. for (let index = 0; index < fileList3.value.length; index++) {
  951. if (file.file == fileList3.value[index].file) {
  952. let delurl = fileImg3.value[index].url;
  953. new tools().uploadFiledelete("", delurl).then(({ data }) => {});
  954. fileImg3.value.splice(index, 1);
  955. fileList3.value.splice(index, 1);
  956. }
  957. }
  958. };
  959. //宗教公安人员选择
  960. const religiousDeptManaUserName = ref("");
  961. const securityDeptManaUserName = ref("");
  962. let showPerson = ref(false);
  963. let showReport = ref(false);
  964. let list = {
  965. value: [],
  966. type: "",
  967. };
  968. let list2 = {
  969. value: [],
  970. type: "",
  971. };
  972. const selected = (val) => {
  973. list.value = val;
  974. };
  975. const selected2 = (val) => {
  976. list2.value = val;
  977. };
  978. const reselected = () => {
  979. const json = Object.assign(inputForm.value, {
  980. religiousDeptManaUser: list.value.id,
  981. });
  982. inputForm.value = json;
  983. religiousDeptManaUserName.value = list.value.name;
  984. };
  985. const reselected2 = () => {
  986. const json = Object.assign(inputForm.value, {
  987. securityDeptManaUser: list2.value.id,
  988. });
  989. inputForm.value = json;
  990. securityDeptManaUserName.value = list2.value.name;
  991. };
  992. //批准设立时间
  993. let hs_SetupTime = ref(false);
  994. const getSetupTime = ({ selectedOptions }) => {
  995. hs_SetupTime.value = false;
  996. const json = Object.assign(inputForm.value,{approvedEstablishmentTime:selectedOptions[0].text +
  997. "-" +
  998. selectedOptions[1].text +
  999. "-" +
  1000. selectedOptions[2].text})
  1001. inputForm.value = json
  1002. };
  1003. //批准设立时间
  1004. let hs_SignTime = ref(false);
  1005. const getSignTime = ({ selectedOptions }) => {
  1006. hs_SignTime.value = false;
  1007. const json = Object.assign(inputForm.value,{registrationDate:selectedOptions[0].text +
  1008. "-" +
  1009. selectedOptions[1].text +
  1010. "-" +
  1011. selectedOptions[2].text})
  1012. inputForm.value = json
  1013. };
  1014. // 互联网专区
  1015. const internetForm = ref({
  1016. zbjForm: [],
  1017. gzhForm: [],
  1018. wxqForm: [],
  1019. dynamicForm: [],
  1020. });
  1021. const addForm = (type) => {
  1022. let data_add = [];
  1023. if (type == "直播间") {
  1024. data_add = internetForm.value.zbjForm;
  1025. } else if (type == "公众号") {
  1026. data_add = internetForm.value.gzhForm;
  1027. } else {
  1028. data_add = internetForm.value.wxqForm;
  1029. }
  1030. data_add.push({
  1031. key: randomString(12),
  1032. siteId: inputForm.value.id,
  1033. type: type,
  1034. typeChild: "",
  1035. account: "",
  1036. manager: "",
  1037. contact: "",
  1038. });
  1039. };
  1040. const randomString = (len) => {
  1041. len = len || 32;
  1042. var $chars =
  1043. "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678"; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
  1044. var maxPos = $chars.length;
  1045. var pwd = "";
  1046. for (let i = 0; i < len; i++) {
  1047. pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  1048. }
  1049. return pwd;
  1050. };
  1051. const removeForm = (item, type) => {
  1052. let data_add = [];
  1053. if (type == "直播间") {
  1054. data_add = internetForm.value.zbjForm;
  1055. } else if (type == "公众号") {
  1056. data_add = internetForm.value.gzhForm;
  1057. } else {
  1058. data_add = internetForm.value.wxqForm;
  1059. }
  1060. let index = data_add.indexOf(item);
  1061. if (index !== -1) {
  1062. data_add.splice(index, 1);
  1063. }
  1064. };
  1065. const hlwToSubmit = () => {
  1066. internetForm.value.dynamicForm = [];
  1067. internetForm.value.zbjForm.forEach((ele) => {
  1068. if (ele.account != "" || ele.manager != "" || ele.contact != "") {
  1069. internetForm.value.dynamicForm.push(ele);
  1070. }
  1071. });
  1072. internetForm.value.gzhForm.forEach((ele) => {
  1073. if (ele.account != "" || ele.manager != "" || ele.contact != "") {
  1074. internetForm.value.dynamicForm.push(ele);
  1075. }
  1076. });
  1077. internetForm.value.wxqForm.forEach((ele) => {
  1078. if (ele.account != "" || ele.manager != "" || ele.contact != "") {
  1079. internetForm.value.dynamicForm.push(ele);
  1080. }
  1081. });
  1082. };
  1083. const dynamicFormDataProceed = (initial_form) => {
  1084. if (!initial_form || initial_form.length == 0) {
  1085. initial_form = [
  1086. {
  1087. key: randomString(12),
  1088. siteId: inputForm.value.id,
  1089. type: "直播间",
  1090. typeChild: "",
  1091. account: "",
  1092. manager: "",
  1093. contact: "",
  1094. },
  1095. {
  1096. key: randomString(12),
  1097. siteId: inputForm.value.id,
  1098. type: "公众号",
  1099. typeChild: "",
  1100. account: "",
  1101. manager: "",
  1102. contact: "",
  1103. },
  1104. {
  1105. key: randomString(12),
  1106. siteId: inputForm.value.id,
  1107. type: "微信群",
  1108. typeChild: "",
  1109. account: "",
  1110. manager: "",
  1111. contact: "",
  1112. },
  1113. ];
  1114. }
  1115. initial_form.forEach((ele) => {
  1116. if (ele.id) {
  1117. ele.key = ele.id;
  1118. }
  1119. if (ele.type == "直播间") {
  1120. internetForm.value.zbjForm.push(ele);
  1121. } else if (ele.type == "公众号") {
  1122. internetForm.value.gzhForm.push(ele);
  1123. } else {
  1124. internetForm.value.wxqForm.push(ele);
  1125. }
  1126. });
  1127. };
  1128. const dynamicFormDataClear = () => {
  1129. internetForm.value.zbjForm = [];
  1130. internetForm.value.gzhForm = [];
  1131. internetForm.value.wxqForm = [];
  1132. internetForm.value.dynamicForm = [];
  1133. };
  1134. // 直播间类型
  1135. const zbj = [
  1136. { text: "斗鱼", value: "0" },
  1137. { text: "小红书", value: "1" },
  1138. { text: "抖音", value: "2" },
  1139. { text: "哔哩哔哩", value: "3" },
  1140. { text: "虎牙", value: "4" },
  1141. { text: "快手", value: "5" },
  1142. { text: "YY直播", value: "6" },
  1143. { text: "淘宝直播", value: "7" },
  1144. { text: "京东直播", value: "8" },
  1145. ];
  1146. const getzbjType = (type) => {
  1147. const typeObject = {
  1148. 斗鱼: 0,
  1149. 小红书: 1,
  1150. 抖音: 2,
  1151. 哔哩哔哩: 3,
  1152. 虎牙: 4,
  1153. 快手: 5,
  1154. YY直播: 6,
  1155. 淘宝直播: 7,
  1156. 京东直播: 8,
  1157. };
  1158. return typeObject[type];
  1159. };
  1160. const nowIndex = ref("");
  1161. const showNew = (key) => {
  1162. showzbj.value = true;
  1163. nowIndex.value = key;
  1164. };
  1165. let showzbj = ref(false);
  1166. const getzbj = ({ selectedOptions }) => {
  1167. showzbj.value = false;
  1168. internetForm.value.zbjForm.forEach((item) => {
  1169. if (item.key == nowIndex.value) {
  1170. item.typeName = selectedOptions[0].text;
  1171. item.typeChild = selectedOptions[0].value;
  1172. }
  1173. });
  1174. };
  1175. //返回
  1176. const onClickLeft = () => {
  1177. history.back();
  1178. };
  1179. // 数据提交
  1180. const submit = () => {
  1181. hlwToSubmit();
  1182. let dynami = JSON.stringify(internetForm.value.dynamicForm);
  1183. const json = Object.assign(inputForm.value, { dynamicFormJson: dynami });
  1184. inputForm.value = json;
  1185. new placeRegister().sava(inputForm.value).then((res) => {
  1186. if (res.status == 200) {
  1187. xm.showToast({
  1188. message: "添加成功",
  1189. });
  1190. router.push("/placeRegisterList");
  1191. } else {
  1192. xm.showToast({
  1193. message: "添加失败",
  1194. });
  1195. }
  1196. });
  1197. };
  1198. return {
  1199. inputForm,
  1200. onClickLeft,
  1201. // dataitem,
  1202. selectColor,
  1203. active,
  1204. //图片上传
  1205. fileList,
  1206. afterRead1,
  1207. fjdelete,
  1208. fileList2,
  1209. afterRead2,
  1210. fjdelete2,
  1211. fileList3,
  1212. afterRead3,
  1213. fjdelete3,
  1214. //宗教类型
  1215. religiousType,
  1216. hs_religious,
  1217. religious,
  1218. getreligious,
  1219. //场所类型
  1220. showPicker1,
  1221. placeType,
  1222. getplaceType,
  1223. placeTypeName,
  1224. //场所性质
  1225. showPicker3,
  1226. property,
  1227. getproperty,
  1228. propertyName,
  1229. //场所建设阶段
  1230. showPicker2,
  1231. construction,
  1232. getConstruction,
  1233. constructionName,
  1234. // 详细地址定位
  1235. getLocation,
  1236. // 地区选择
  1237. placeAddress,
  1238. customFieldName,
  1239. showPlace1,
  1240. getPlace1,
  1241. options,
  1242. //宗教公安人员选择
  1243. showPerson,
  1244. showReport,
  1245. selected,
  1246. selected2,
  1247. reselected,
  1248. reselected2,
  1249. religiousDeptManaUserName,
  1250. securityDeptManaUserName,
  1251. // 批准设立时间
  1252. hs_SetupTime,
  1253. getSetupTime,
  1254. // 批准设立时间
  1255. hs_SignTime,
  1256. getSignTime,
  1257. // 互联网专区
  1258. internetForm,
  1259. addForm,
  1260. removeForm,
  1261. zbj,
  1262. showzbj,
  1263. getzbj,
  1264. showNew,
  1265. //数据提交
  1266. submit,
  1267. };
  1268. },
  1269. };
  1270. </script>
  1271. <style lang="less">
  1272. .btn {
  1273. margin: 10px auto;
  1274. padding: 0 10px;
  1275. .van-button {
  1276. width: 100%;
  1277. height: 50px;
  1278. }
  1279. }
  1280. </style>