index.vue 9.8 KB

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