siteInspectionInfo.vue 4.3 KB

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