placeRegisterInfo.vue 39 KB

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