placeRegisterInfo.vue 40 KB

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