index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. <!-- <el-icon class="icon-arrow" size="18"><ArrowUpBold /></el-icon> -->
  39. </div>
  40. <recheck-box2></recheck-box2>
  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. const components = {
  90. prescriptionBox,
  91. };
  92. const currentComponent = ref("prescriptionBox");
  93. let store = useStore();
  94. let farmMap = new FarmMap();
  95. const router = useRouter();
  96. const route = useRoute();
  97. const mapRef = ref(null);
  98. const workList = ref({})
  99. const getList = () => {
  100. VE_API.farm.fetchFarmWorkList({ farmId, libId, id }).then(({data}) => {
  101. // data[0].orderStatus = data[0].orderStatus + 1
  102. workList.value = data
  103. let itemData = data && data.length && data[0]
  104. farmMap.initData(itemData.farmId, itemData.regionId)
  105. farmMap.getBlueRegion({gardenId: itemData.farmId, regionId: itemData.regionId}, (e) => {
  106. farmMap.setBlueRegion(itemData.executeBlueZones)
  107. });
  108. })
  109. }
  110. let farmId = route.query.farmId
  111. let libId = route.query.libId
  112. let id = route.query.id
  113. onMounted(() => {
  114. farmMap.initMap("POINT(113.61448114737868 23.585550924763083)", mapRef.value);
  115. getList();
  116. });
  117. const goBack = () => {
  118. router.go(-1);
  119. };
  120. </script>
  121. <style lang="scss" scoped>
  122. .base-container {
  123. width: 100%;
  124. height: 100vh;
  125. color: #fff;
  126. position: relative;
  127. box-sizing: border-box;
  128. z-index: 1;
  129. background: #000;
  130. .content {
  131. width: 100%;
  132. height: calc(100% - 74px);
  133. display: flex;
  134. justify-content: space-between;
  135. box-sizing: border-box;
  136. padding: 20px;
  137. .content-left {
  138. width: 473px;
  139. height: 100%;
  140. box-sizing: border-box;
  141. .btn {
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. border: 1px solid rgba(255, 255, 255, 0.78);
  146. border-radius: 4px;
  147. padding: 9px;
  148. margin-bottom: 13px;
  149. width: 104px;
  150. cursor: pointer;
  151. img {
  152. width: 14px;
  153. margin-right: 5px;
  154. }
  155. }
  156. .left-cont {
  157. width: 100%;
  158. height: calc(100% - 48px - 4px);
  159. .icon-arrow{
  160. cursor: pointer;
  161. }
  162. .box {
  163. width: 100%;
  164. height: 100%;
  165. padding: 16px 12px;
  166. box-sizing: border-box;
  167. overflow-y: auto;
  168. .box-item {
  169. background: rgba(255, 255, 255, 0.04);
  170. border: 1px solid #444444;
  171. border-radius: 8px;
  172. padding: 16px 12px;
  173. box-sizing: border-box;
  174. width: 100%;
  175. .box-title {
  176. font-size: 20px;
  177. border-bottom: 1px solid #333333;
  178. padding: 0 0 12px 13px;
  179. margin-bottom: 12px;
  180. position: relative;
  181. display: flex;
  182. align-items: center;
  183. justify-content: space-between;
  184. &::before {
  185. content: "";
  186. position: absolute;
  187. left: 0;
  188. top: 6px;
  189. width: 3px;
  190. height: 16px;
  191. background: #fff;
  192. border-radius: 11px;
  193. }
  194. }
  195. }
  196. .box-item + .box-item {
  197. margin-top: 12px;
  198. }
  199. }
  200. .button {
  201. font-size: 16px;
  202. padding: 10px;
  203. background: #ffd489;
  204. border-radius: 4px;
  205. color: #000;
  206. margin: 16px 0;
  207. cursor: pointer;
  208. text-align: center;
  209. }
  210. }
  211. }
  212. .content-right {
  213. width: calc(100% - 473px - 18px);
  214. margin-left: 18px;
  215. height: 100%;
  216. background: #191919;
  217. border: 0.6px solid #444444;
  218. padding: 20px;
  219. box-sizing: border-box;
  220. border-radius: 8px;
  221. .map-header {
  222. display: flex;
  223. justify-content: space-between;
  224. .title {
  225. font-size: 22px;
  226. display: flex;
  227. align-items: flex-end;
  228. font-family: "PangMenZhengDao";
  229. margin-bottom: 16px;
  230. img {
  231. margin-right: 8px;
  232. }
  233. }
  234. }
  235. .map {
  236. width: 100%;
  237. clip-path: inset(0px round 4px);
  238. height: calc(100% - 31px - 16px);
  239. position: relative;
  240. .map-bg {
  241. position: absolute;
  242. z-index: 2;
  243. background: rgba(0, 0, 0, 0.6);
  244. border-radius: 18px;
  245. padding: 7px 16px;
  246. right: 20px;
  247. }
  248. .map-btn {
  249. top: 19px;
  250. cursor: pointer;
  251. }
  252. .map-legend {
  253. bottom: 21px;
  254. .item {
  255. display: flex;
  256. align-items: center;
  257. font-size: 14px;
  258. img {
  259. width: 16px;
  260. margin-right: 6px;
  261. }
  262. }
  263. .item + .item {
  264. padding-top: 10px;
  265. }
  266. }
  267. }
  268. }
  269. }
  270. }
  271. </style>