index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <div class="base-container">
  3. <fnHeader :hideSwitch="true" :hideShadow="true" showDate></fnHeader>
  4. <div class="content">
  5. <div class="content-left">
  6. <div class="btn" @click="goBack">
  7. <img src="@/assets/images/common/back-icon.png" alt="" />
  8. 返回
  9. </div>
  10. <chart-box class="left-cont" v-if="workList && workList.length" :name="workList[0].farmWorkName" color="yellow">
  11. <div class="box">
  12. <div class="box-item">
  13. <div class="box-title">
  14. 专家处方
  15. <!-- <el-icon class="icon-arrow" size="18"><ArrowUpBold /></el-icon> -->
  16. </div>
  17. <component v-if="workList && workList.length" :is="components[currentComponent]" :prescriptioData="workList[0]" />
  18. </div>
  19. <!-- <div class="button">确认下发</div> -->
  20. <div class="box-item" v-if="workList && workList.length">
  21. <div class="box-title">
  22. 农资报价
  23. <!-- <el-icon class="icon-arrow" size="18"><ArrowUpBold /></el-icon> -->
  24. </div>
  25. <!-- <custom-table type="0" :tableHeader="tableHeader" :tableData="tableData" hideText></custom-table> -->
  26. <service-box
  27. :boxId="workList[0].farmWorkLibId"
  28. :progress="workList[0].orderStatus"
  29. :prescriptionList="workList[0].prescriptionList"
  30. :users="workList[0].users"
  31. :serviceData="workList[0]"
  32. :executeDate="workList[0].executeDate">
  33. </service-box>
  34. </div>
  35. <div class="box-item">
  36. <div class="box-title">
  37. 农事对比
  38. </div>
  39. <recheck-box2 v-if="workList[0].farmWorkLibId ==='699268027270565895'"></recheck-box2>
  40. <recheck-box3 v-if="workList[0].farmWorkLibId ==='699268027274760192'"></recheck-box3>
  41. </div>
  42. </div>
  43. </chart-box>
  44. </div>
  45. <div class="content-right">
  46. <div class="map-header">
  47. <div class="title">
  48. <img src="@/assets/images/common/area-icon.png" alt="" />
  49. 执行农事区域
  50. </div>
  51. </div>
  52. <div ref="mapRef" class="map">
  53. <!-- <div class="map-bg map-btn">查看巡园照片</div> -->
  54. <div class="map-bg map-legend">
  55. <div class="item">
  56. <img src="@/assets/images/map/status/status-zc.png" alt="" />
  57. 正常
  58. </div>
  59. <div class="item">
  60. <img src="@/assets/images/map/status/status-szyc.png" alt="" />
  61. 生长异常
  62. </div>
  63. <div class="item">
  64. <img src="@/assets/images/map/status/status-bh.png" alt="" />
  65. 病害异常
  66. </div>
  67. <div class="item">
  68. <img src="@/assets/images/map/status/status-ch.png" alt="" />
  69. 虫害异常
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script setup>
  78. import { onMounted, ref } from "vue";
  79. import { ElMessage } from "element-plus";
  80. import fnHeader from "@/components/fnHeader.vue";
  81. import customTable from "./components/table.vue";
  82. import prescriptionBox from './components/prescriptionBox'
  83. import serviceBox from './components/serviceBox'
  84. import FarmMap from "@/views/addFarm/farmMap";
  85. import chartBox from "@/components/chartBox.vue";
  86. import { useRouter, useRoute } from "vue-router";
  87. import { useStore } from "vuex";
  88. import RecheckBox2 from "./components/recheckBox2";
  89. import RecheckBox3 from "./components/recheckBox3";
  90. const components = {
  91. prescriptionBox,
  92. };
  93. const currentComponent = ref("prescriptionBox");
  94. let store = useStore();
  95. let farmMap = new FarmMap();
  96. const router = useRouter();
  97. const route = useRoute();
  98. const mapRef = ref(null);
  99. const workList = ref({})
  100. const getList = () => {
  101. VE_API.farm.fetchFarmWorkList({ farmId, libId, id }).then(({data}) => {
  102. // data[0].orderStatus = data[0].orderStatus + 1
  103. workList.value = data
  104. let itemData = data && data.length && data[0]
  105. farmMap.initData(itemData.farmId, itemData.regionId)
  106. farmMap.getBlueRegion({gardenId: itemData.farmId, regionId: itemData.regionId}, (e) => {
  107. farmMap.setBlueRegion(itemData.executeBlueZones)
  108. });
  109. })
  110. }
  111. let farmId = route.query.farmId
  112. let libId = route.query.libId
  113. let id = route.query.id
  114. onMounted(() => {
  115. farmMap.initMap("POINT(113.61448114737868 23.585550924763083)", mapRef.value);
  116. getList();
  117. });
  118. const goBack = () => {
  119. router.go(-1);
  120. };
  121. </script>
  122. <style lang="scss" scoped>
  123. .base-container {
  124. width: 100%;
  125. height: 100vh;
  126. color: #fff;
  127. position: relative;
  128. box-sizing: border-box;
  129. z-index: 1;
  130. background: #000;
  131. .content {
  132. width: 100%;
  133. height: calc(100% - 74px);
  134. display: flex;
  135. justify-content: space-between;
  136. box-sizing: border-box;
  137. padding: 20px;
  138. .content-left {
  139. width: 473px;
  140. height: 100%;
  141. box-sizing: border-box;
  142. .btn {
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. border: 1px solid rgba(255, 255, 255, 0.78);
  147. border-radius: 4px;
  148. padding: 9px;
  149. margin-bottom: 13px;
  150. width: 104px;
  151. cursor: pointer;
  152. img {
  153. width: 14px;
  154. margin-right: 5px;
  155. }
  156. }
  157. .left-cont {
  158. width: 100%;
  159. height: calc(100% - 48px - 4px);
  160. .icon-arrow{
  161. cursor: pointer;
  162. }
  163. .box {
  164. width: 100%;
  165. height: 100%;
  166. padding: 16px 12px;
  167. box-sizing: border-box;
  168. overflow-y: auto;
  169. .box-item {
  170. background: rgba(255, 255, 255, 0.04);
  171. border: 1px solid #444444;
  172. border-radius: 8px;
  173. padding: 16px 12px;
  174. box-sizing: border-box;
  175. width: 100%;
  176. .box-title {
  177. font-size: 20px;
  178. border-bottom: 1px solid #333333;
  179. padding: 0 0 12px 13px;
  180. margin-bottom: 12px;
  181. position: relative;
  182. display: flex;
  183. align-items: center;
  184. justify-content: space-between;
  185. &::before {
  186. content: "";
  187. position: absolute;
  188. left: 0;
  189. top: 6px;
  190. width: 3px;
  191. height: 16px;
  192. background: #fff;
  193. border-radius: 11px;
  194. }
  195. }
  196. }
  197. .box-item + .box-item {
  198. margin-top: 12px;
  199. }
  200. }
  201. .button {
  202. font-size: 16px;
  203. padding: 10px;
  204. background: #ffd489;
  205. border-radius: 4px;
  206. color: #000;
  207. margin: 16px 0;
  208. cursor: pointer;
  209. text-align: center;
  210. }
  211. }
  212. }
  213. .content-right {
  214. width: calc(100% - 473px - 18px);
  215. margin-left: 18px;
  216. height: 100%;
  217. background: #191919;
  218. border: 0.6px solid #444444;
  219. padding: 20px;
  220. box-sizing: border-box;
  221. border-radius: 8px;
  222. .map-header {
  223. display: flex;
  224. justify-content: space-between;
  225. .title {
  226. font-size: 22px;
  227. display: flex;
  228. align-items: flex-end;
  229. font-family: "PangMenZhengDao";
  230. margin-bottom: 16px;
  231. img {
  232. margin-right: 8px;
  233. }
  234. }
  235. }
  236. .map {
  237. width: 100%;
  238. clip-path: inset(0px round 4px);
  239. height: calc(100% - 31px - 16px);
  240. position: relative;
  241. .map-bg {
  242. position: absolute;
  243. z-index: 2;
  244. background: rgba(0, 0, 0, 0.6);
  245. border-radius: 18px;
  246. padding: 7px 16px;
  247. right: 20px;
  248. }
  249. .map-btn {
  250. top: 19px;
  251. cursor: pointer;
  252. }
  253. .map-legend {
  254. bottom: 21px;
  255. .item {
  256. display: flex;
  257. align-items: center;
  258. font-size: 14px;
  259. img {
  260. width: 16px;
  261. margin-right: 6px;
  262. }
  263. }
  264. .item + .item {
  265. padding-top: 10px;
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. </style>