reviewResults.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <custom-header name="复核成效"></custom-header>
  3. <div class="farm-dynamics">
  4. <div class="task-content">
  5. <div class="expert-content">
  6. <template v-if="contentData.length > 0">
  7. <List
  8. v-model:loading="loading"
  9. :finished="finished"
  10. :offset="100"
  11. loading-text="加载中..."
  12. finished-text="没有更多了"
  13. @load="onLoad"
  14. >
  15. <div v-for="(section, index) in contentData" :key="index" class="content-section">
  16. <div class="section-id" :id="section.targetId"></div>
  17. <record-item
  18. :record-item-data="section"
  19. content-mode="serviceDetail"
  20. title-mode="default"
  21. class="recipe-item"
  22. titleRightDotText="全区"
  23. titleRightType="dot"
  24. showFarmImage
  25. @click="handleClick(section, index)"
  26. >
  27. <template #footer>
  28. <div class="action-group" v-if="!section.reviewImage.length">
  29. <div class="action-l">查看详情</div>
  30. <div class="action-r">
  31. <div
  32. class="action-item warning-item"
  33. :class="{ 'has-applied': section.hasApplied }"
  34. @click.stop="handleApply(section, index)"
  35. >
  36. {{ section.hasApplied ? "已发起需求" : "发起需求" }}
  37. </div>
  38. <div class="action-item primary-item" @click.stop="handleUploadPhoto(section)">
  39. 上传照片
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. </record-item>
  45. </div>
  46. </List>
  47. </template>
  48. <empty
  49. v-else
  50. image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
  51. image-size="80"
  52. description="暂无数据"
  53. />
  54. </div>
  55. </div>
  56. </div>
  57. <!-- 需求发送成功弹窗 -->
  58. <popup v-model:show="showApplyPopup" round class="apply-popup">
  59. <img class="check-icon" src="@/assets/img/home/right.png" alt="" />
  60. <div class="apply-text">需求发送成功</div>
  61. <div class="apply-btn" @click="showApplyPopup = false">我知道了</div>
  62. </popup>
  63. <!-- 上传照片弹窗 -->
  64. <review-upload-popup v-model="showUpload" :record-id="sectionId" @success="resetAndLoad" />
  65. </template>
  66. <script setup>
  67. import { ref, onMounted } from "vue";
  68. import recordItem from "@/components/recordItem.vue";
  69. import { Popup } from "vant";
  70. import customHeader from "@/components/customHeader.vue";
  71. import { useRouter, useRoute } from "vue-router";
  72. import { Empty,List } from "vant";
  73. import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
  74. const showApplyPopup = ref(false);
  75. const showUpload = ref(false);
  76. const router = useRouter();
  77. const route = useRoute();
  78. const sectionId = ref(null);
  79. // 上传照片处理函数
  80. const handleUploadPhoto = ({id}) => {
  81. showUpload.value = true;
  82. sectionId.value = id;
  83. };
  84. const handleApply = (section, index) => {
  85. // // 更新当前项的发起需求状态
  86. // showApplyPopup.value = true;
  87. // section.hasApplied = true;
  88. };
  89. const contentData = ref([]);
  90. const loading = ref(false);
  91. const finished = ref(false);
  92. const page = ref(1);
  93. const limit = ref(10);
  94. const onLoad = () => {
  95. if (finished.value) return;
  96. loading.value = true;
  97. const params = {
  98. farmId: route.query.farmId,
  99. flowStatus: 5,
  100. page: page.value,
  101. limit: limit.value,
  102. };
  103. VE_API.user.getDetailList(params)
  104. .then((res) => {
  105. const list = res?.data || [];
  106. if (Array.isArray(list) && list.length > 0) {
  107. contentData.value = contentData.value.concat(list);
  108. page.value += 1;
  109. if (list.length < limit.value) {
  110. finished.value = true;
  111. }
  112. } else {
  113. finished.value = true;
  114. }
  115. })
  116. .finally(() => {
  117. loading.value = false;
  118. });
  119. };
  120. const resetAndLoad = () => {
  121. page.value = 1;
  122. finished.value = false;
  123. contentData.value = [];
  124. onLoad();
  125. };
  126. onMounted(() => {
  127. resetAndLoad();
  128. });
  129. const handleClick = (section) => {
  130. router.push({
  131. path: "/review_work",
  132. query: {
  133. miniJson: JSON.stringify({ id: section.id,goBack: true }),
  134. },
  135. });
  136. };
  137. </script>
  138. <style lang="scss" scoped>
  139. .farm-dynamics {
  140. width: 100%;
  141. height: 100vh;
  142. background: #f5f7fb;
  143. .task-content {
  144. display: flex;
  145. padding-top: 10px;
  146. height: calc(100% - 40px);
  147. .expert-content {
  148. width: 100%;
  149. height: 100%;
  150. overflow: auto;
  151. padding: 0 10px 10px;
  152. box-sizing: border-box;
  153. .content-section {
  154. position: relative;
  155. .section-id {
  156. position: absolute;
  157. top: 0;
  158. width: 100%;
  159. height: 1px;
  160. }
  161. }
  162. // 空状态样式
  163. :deep(.van-empty) {
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. padding: 60px 0;
  168. min-height: 200px;
  169. }
  170. .action-r {
  171. color: #1d2129;
  172. }
  173. .action-group {
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-between;
  177. padding-top: 8px;
  178. margin-top: 8px;
  179. border-top: 1px solid #f5f5f5;
  180. .action-l {
  181. font-size: 12px;
  182. }
  183. }
  184. .action-group {
  185. .action-r {
  186. display: flex;
  187. align-items: center;
  188. .action-item {
  189. padding: 0 11px;
  190. height: 30px;
  191. line-height: 30px;
  192. border-radius: 20px;
  193. font-size: 12px;
  194. &.second-item {
  195. border: 1px solid #2199f8;
  196. color: #2199f8;
  197. }
  198. &.primary-item {
  199. background: #2199f8;
  200. color: #fff;
  201. }
  202. &.warning-item {
  203. background: rgba(255, 131, 29, 0.1);
  204. color: #ff831d;
  205. &.has-applied {
  206. background: transparent;
  207. color: #afafaf;
  208. pointer-events: none;
  209. }
  210. }
  211. &.cancel-item {
  212. color: #676767;
  213. border: 1px solid rgba(103, 103, 103, 0.2);
  214. }
  215. }
  216. .action-item + .action-item {
  217. margin-left: 5px;
  218. }
  219. }
  220. .apply-action {
  221. justify-content: flex-end;
  222. .default-item {
  223. border: 1px solid rgba(0, 0, 0, 0.4);
  224. color: rgba(0, 0, 0, 0.4);
  225. }
  226. }
  227. }
  228. }
  229. }
  230. }
  231. .apply-popup {
  232. width: 75%;
  233. padding: 28px 28px 20px;
  234. display: flex;
  235. flex-direction: column;
  236. align-items: center;
  237. justify-content: center;
  238. .check-icon {
  239. width: 68px;
  240. height: 68px;
  241. margin-bottom: 12px;
  242. }
  243. .apply-text {
  244. font-size: 24px;
  245. font-weight: 500;
  246. margin-bottom: 32px;
  247. text-align: center;
  248. }
  249. .apply-btn {
  250. width: 100%;
  251. box-sizing: border-box;
  252. padding: 8px;
  253. border-radius: 25px;
  254. font-size: 16px;
  255. background: #2199f8;
  256. color: #fff;
  257. text-align: center;
  258. }
  259. }
  260. </style>