securityFacilitiesErrInfo.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <van-nav-bar
  3. fixed
  4. title="安防设施异常情况"
  5. left-text=""
  6. left-arrow
  7. @click-left="onClickLeft"
  8. :style="{ 'background-color': selectColor }"
  9. />
  10. <van-loading size="16px" v-show="isLoading">加载中...</van-loading>
  11. <div class="main" v-show="!isLoading">
  12. <div class="banner">
  13. <img src="../../../../public/loginbg/banner.jpg" alt="" />
  14. </div>
  15. <div class="info">
  16. <p class="miniTitle">详细信息</p>
  17. <van-cell-group>
  18. <van-field
  19. v-model="info.siteName.name"
  20. readonly
  21. label="场所名称:"
  22. input-align="right"
  23. />
  24. </van-cell-group>
  25. <van-cell-group>
  26. <van-field
  27. v-model="info.facilityTypeName"
  28. center
  29. readonly
  30. label="设施类型:"
  31. input-align="right"
  32. />
  33. </van-cell-group>
  34. <van-cell-group v-if="info.facilityType=='1'">
  35. <van-field
  36. v-model="info.siteFireProtection.name"
  37. center
  38. readonly
  39. label="场所消防点位:"
  40. input-align="right"
  41. />
  42. </van-cell-group>
  43. <van-cell-group v-else>
  44. <van-field
  45. v-model="info.videoAudioPoint.name"
  46. center
  47. readonly
  48. label="视频音频点位:"
  49. input-align="right"
  50. />
  51. </van-cell-group>
  52. <van-cell-group>
  53. <van-field
  54. v-model="info.position"
  55. center
  56. readonly
  57. clearable
  58. label="位置:"
  59. input-align="right"
  60. />
  61. <template #right-icon>
  62. <van-icon name="location" />
  63. </template>
  64. </van-cell-group>
  65. <van-cell-group>
  66. <van-field
  67. name="uploader"
  68. readonly
  69. label="附件:"
  70. input-align="right"
  71. >
  72. <template #input>
  73. <span v-show="fileList.length == 0">无</span>
  74. <van-uploader
  75. v-show="fileList.length != 0"
  76. v-model="fileList"
  77. :max-count="fileList.length"
  78. capture="camera"
  79. accept=""
  80. >
  81. </van-uploader>
  82. </template>
  83. </van-field>
  84. </van-cell-group>
  85. <van-cell-group>
  86. <van-field
  87. v-model="info.abnormalContent"
  88. center
  89. readonly
  90. label="异常内容:"
  91. input-align="right"
  92. />
  93. </van-cell-group>
  94. </div>
  95. <van-button
  96. v-if="info.assessment == 0"
  97. type="primary"
  98. class="btn-sub"
  99. @click="update"
  100. >审核</van-button
  101. >
  102. </div>
  103. </template>
  104. <script>
  105. import { ref, onMounted } from "vue";
  106. import securityFacilitiesErrService from "@/api/securityFacilitiesErr/securityFacilitiesErrService";
  107. import UserManage from "@/api/user/UserManage";
  108. import { useRoute } from "vue-router";
  109. import $base from "@/utils/config";
  110. export default {
  111. setup() {
  112. // 导航栏颜色
  113. const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
  114. const onClickLeft = () => {
  115. history.back();
  116. };
  117. // 加载
  118. let isLoading = ref(true);
  119. // 活动信息
  120. const info = ref({
  121. siteName:{id:'',name:""},
  122. siteFireProtection:{id:'',name:""},
  123. videoAudioPoint:{id:'',name:""}
  124. });
  125. // 文件
  126. let fileList = ref([]);
  127. let route = useRoute();
  128. onMounted(() => {
  129. new securityFacilitiesErrService().queryById(route.query.id).then((data) => {
  130. info.value = data;
  131. if(info.value.facilityType=='1'){
  132. info.value.facilityTypeName="消防设备";
  133. }else{
  134. info.value.facilityTypeName="监控、音频";
  135. }
  136. info.value.enclosure.split("|").forEach((item) => {
  137. if (item.trim().length > 0) {
  138. fileList.value.push({
  139. name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
  140. url: $base + item.replace('程序附件//','程序附件/'),
  141. });
  142. }
  143. });
  144. isLoading.value = false;
  145. });
  146. });
  147. // 审核通过
  148. const update = () => {
  149. isLoading.value = true;
  150. info.value.assessment = 1;
  151. new securityFacilitiesErrService().save(info.value).then((res) => {
  152. isLoading.value = false;
  153. window.xm.showToast({
  154. message:"审核成功!"
  155. })
  156. history.back();
  157. });
  158. };
  159. return {
  160. // 导航栏颜色
  161. selectColor,
  162. onClickLeft,
  163. info,
  164. fileList,
  165. isLoading,
  166. update,
  167. };
  168. },
  169. };
  170. </script>
  171. <style lang="less">
  172. .van-cell__value .van-field__right-icon .van-icon-location {
  173. color: #36a7f3 !important;
  174. }
  175. .btn-sub {
  176. width: 90%;
  177. border-radius: 20px;
  178. margin-left: 5%;
  179. margin-bottom: 40px;
  180. margin-top: -100px;
  181. }
  182. .van-loading {
  183. text-align: center;
  184. margin-top: 80px;
  185. }
  186. .van-popup--center {
  187. width: 98% !important;
  188. }
  189. </style>