siteInspectionInfo.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <van-loading size="16px" v-if="isLoading">加载中...</van-loading>
  3. <div class="main" v-if="!isLoading">
  4. <div class="banner">
  5. <h2>扎实提升“三力”</h2>
  6. <h2>深入推进“三化”</h2>
  7. <h2>坚持“三个思维”</h2>
  8. </div>
  9. <div class="info">
  10. <p>场所名称:{{ info.siteName.name }}</p>
  11. <p>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点:{{ info.place }}</p>
  12. <p>详细地址:{{ info.placeDel }}</p>
  13. <p>督查时间:{{ info.supervisionTime }}</p>
  14. <p>
  15. 附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件:
  16. <span v-if="fileList.length != 0" style="color: #6892ff">{{
  17. fileList[0].name
  18. }}</span>
  19. <span v-else style="color: red">无</span>
  20. </p>
  21. <p>督查内容:{{ info.supervisionContent }}</p>
  22. </div>
  23. <van-button v-if="canAudit" type="primary" class="btn-sub" @click="update">审核</van-button>
  24. </div>
  25. </template>
  26. <script>
  27. import { ref } from "vue";
  28. import siteInspectionService from "@/api/siteInspection/siteInspectionService";
  29. import UserManage from "@/api/user/UserManage";
  30. import { useRoute } from "vue-router";
  31. export default {
  32. setup() {
  33. //window.xm.setNavigationBarTitle({ title: '场所检查详情'})
  34. let isLoading = ref(true);
  35. let canAudit = ref(false);
  36. // 活动信息
  37. const info = ref({
  38. });
  39. let fileList = ref([]);
  40. let route = useRoute();
  41. new siteInspectionService().queryById(route.query.id).then((data) => {
  42. info.value = data;
  43. if(data.assessment=="0"){
  44. canAudit.value = true;
  45. }else{
  46. canAudit.value = false;
  47. }
  48. info.value.enclosure.split("|").forEach((item) => {
  49. if (item.trim().length > 0) {
  50. fileList.value.push({
  51. name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
  52. url: item,
  53. });
  54. }
  55. });
  56. isLoading.value = false;
  57. });
  58. // 审核通过
  59. const update = () => {
  60. isLoading.value = true;
  61. info.value.assessment = 1;
  62. new siteInspectionService().save(info.value).then((res) => {
  63. console.log(res);
  64. isLoading.value = false;
  65. window.xm.showToast({
  66. message:"审核成功!"
  67. })
  68. history.back();
  69. });
  70. };
  71. return {
  72. info,
  73. isLoading,
  74. update,
  75. fileList,
  76. canAudit,
  77. };
  78. },
  79. };
  80. </script>
  81. <style lang="less">
  82. .main {
  83. background: #fff;
  84. position: relative;
  85. top: 40px;
  86. }
  87. .banner {
  88. background-color: #36a7f3;
  89. padding: 20px 50px 40px 50px;
  90. color: #fff;
  91. h2 {
  92. &:nth-child(1) {
  93. margin-top: 0px;
  94. text-align: left;
  95. }
  96. &:nth-child(2) {
  97. text-align: center;
  98. }
  99. &:nth-child(3) {
  100. text-align: right;
  101. }
  102. }
  103. }
  104. .info {
  105. position: relative;
  106. width: 86vw;
  107. margin: 10px auto;
  108. padding: 10px;
  109. background: #fff;
  110. border-radius: 20px;
  111. top: -50px;
  112. font-size: 14px;
  113. }
  114. .btn-sub {
  115. width: 90%;
  116. border-radius: 20px;
  117. margin-left: 5%;
  118. }
  119. .van-loading {
  120. text-align: center;
  121. margin-top: 80px;
  122. }
  123. </style>