servicesIndex.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <div class="completed-work">
  3. <custom-header name="农事详情"></custom-header>
  4. <div class="work-content" :class="{ hasBottom: curRole == 0 }">
  5. <div class="step-wrap">
  6. <farm-steps :currentStep="0" />
  7. </div>
  8. <div class="content-status">
  9. <div class="status-l" v-if="status === 0">
  10. <div class="stauts-text">待完成</div>
  11. <div class="stauts-sub-text">距离预计执行时间还差 <span class="time-text">3</span> 天</div>
  12. </div>
  13. <div class="status-l" v-if="status === 1">
  14. <div class="stauts-text">
  15. <el-icon color="#2199F8" size="16" class="status-icon"><Select /></el-icon>
  16. 该农事已完成
  17. </div>
  18. </div>
  19. </div>
  20. <div class="work-wrap">
  21. <div class="box-wrap farm-info">
  22. <div class="info-title">
  23. <div class="sub-title">药肥费用</div>
  24. <div class="info-more">1582<span class="unit-text">元</span></div>
  25. </div>
  26. <div class="info-content">
  27. <price-table>
  28. <template #bottomContent>
  29. <div class="price-bottom">
  30. <div class="info-title">
  31. <div class="sub-title">服务费用</div>
  32. <div class="info-more">1582<span class="unit-text">元</span></div>
  33. </div>
  34. <div class="price-info">
  35. <div class="info-l">执行方式<span class="main-text">无人机</span></div>
  36. <div class="info-c">亩单价<span class="main-text">500元/亩</span></div>
  37. <div class="info-r">亩数<span class="main-text">10亩</span></div>
  38. </div>
  39. <div class="price-total">报价合计:<span class="main-val">1258</span>元</div>
  40. <div class="bottom-btn">
  41. <div class="btn second" @click="toPage">编辑报价</div>
  42. <div class="btn primary">确定报价</div>
  43. </div>
  44. </div>
  45. </template>
  46. </price-table>
  47. </div>
  48. </div>
  49. <div class="box-wrap work-map">
  50. <div class="map-content">
  51. <div class="map-dom" ref="areaRef"></div>
  52. </div>
  53. <div class="info-content">
  54. <div class="title-wrap">
  55. <div class="title-l">
  56. <div class="item-title">未命名农场</div>
  57. <div class="setting-text">设为特别关注</div>
  58. </div>
  59. <div class="title-r">最近服务过</div>
  60. </div>
  61. <div class="item-desc">
  62. <div class="desc-info">
  63. <div class="desc-info-item">
  64. <span>农场品种:</span>
  65. <span class="value">荔枝-桂味</span>
  66. </div>
  67. <div class="desc-info-item">
  68. <span>农场面积:</span>
  69. <span class="value">500亩</span>
  70. </div>
  71. </div>
  72. <div class="desc-info copy-info">
  73. <div class="address van-ellipsis">
  74. <span>农场位置:</span>
  75. <span class="value">广东省广州市从化区市从化区从广东省广州市从化区市从化区从</span>
  76. </div>
  77. <span class="copy-text">点击复制</span>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <info-text></info-text>
  83. <prescription-table> </prescription-table>
  84. </div>
  85. <div class="fixed-btn" v-if="curRole == 0">{{ status === 0 ? "确认完成" : "立即复核" }}</div>
  86. </div>
  87. </div>
  88. </template>
  89. <script setup>
  90. import customHeader from "@/components/customHeader.vue";
  91. import { onMounted, ref } from "vue";
  92. import NewFarmMap from "./newFarmMap";
  93. import { useStore } from "vuex";
  94. import infoText from "./components/infoText.vue";
  95. import prescriptionTable from "./components/prescriptionTable.vue";
  96. import priceTable from "./components/priceTable.vue";
  97. import farmSteps from "@/components/farmSteps.vue";
  98. import { useRouter } from "vue-router";
  99. const router = useRouter();
  100. const store = useStore();
  101. // 角色
  102. // const curRole = store.state.app.curRole
  103. const curRole = 1;
  104. // 0:执行, 1: 复核
  105. const status = ref(0);
  106. // 地图
  107. const areaRef = ref(null);
  108. let newFarmMap = new NewFarmMap();
  109. onMounted(() => {
  110. const point = store.state.home.miniUserLocationPoint;
  111. newFarmMap.initMap(point, areaRef.value, false);
  112. newFarmMap.setMapPoint([113.6142086995688, 23.585836479509055])
  113. getAreaList(() => {
  114. console.log("areaList.value", areaList.value);
  115. newFarmMap.initArea(areaList.value);
  116. });
  117. });
  118. // 农场分区列表
  119. const areaList = ref([]);
  120. const regionId = ref(null);
  121. const getAreaList = (callback) => {
  122. const data = [
  123. {
  124. farmCode: "LBY",
  125. farmId: "766",
  126. id: 2,
  127. isGenerateReport: 1,
  128. name: "",
  129. pointCount: 131,
  130. pointWkt: "POINT (113.6142086995688 23.585836479509055)",
  131. regionCode: "LBY-MR-2",
  132. wkt: "MULTIPOLYGON (((113.61348988377155 23.58617369800422, 113.61395837633405 23.58622555407246, 113.61414076654707 23.58622555407246, 113.61436964832843 23.5862774101407, 113.61478628474084 23.586468741036786, 113.61491681896747 23.58652417337007, 113.61512424307672 23.586449071517652, 113.61491503077356 23.585742756367924, 113.61479880177082 23.585596129050916, 113.61473800497858 23.585451289764112, 113.61438931780664 23.585286780835393, 113.61410858003889 23.585299297865365, 113.61385645239149 23.585249229909184, 113.61378135053907 23.585288569029306, 113.61357571446003 23.585283204611276, 113.61347200232355 23.585342213209604, 113.61338080721704 23.585506721974614, 113.61335934954492 23.585665866485304, 113.61342193444922 23.58616296916816, 113.61348988377155 23.58617369800422)))",
  133. },
  134. ];
  135. areaList.value = data;
  136. regionId.value = (data && data.length && data[0].id) || "";
  137. changeRegion(regionId.value);
  138. callback && callback();
  139. // VE_API.region.list({ farmId: gardenId.value }).then(({ data, code }) => {
  140. // });
  141. };
  142. // 切换分区
  143. const gardenId = ref(null);
  144. const changeRegion = (e) => {
  145. newFarmMap.getBlueRegion({ gardenId: gardenId.value, regionId: e }, () => {
  146. // newFarmMap.setBlueRegion([{id: "ws0y1me7h94u"}, {id: "ws0y1me545tg"}])
  147. // serveArea.value = "3.72亩"
  148. });
  149. };
  150. function toPage() {
  151. router.push("/price_detail")
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .completed-work {
  156. height: 100vh;
  157. position: relative;
  158. overflow: auto;
  159. font-size: 14px;
  160. background: #f2f3f5;
  161. .work-content {
  162. height: calc(100% - 40px);
  163. overflow: auto;
  164. box-sizing: border-box;
  165. &.hasBottom {
  166. padding-bottom: 60px;
  167. }
  168. .work-wrap {
  169. position: relative;
  170. z-index: 3;
  171. padding: 0 12px;
  172. top: -16px;
  173. }
  174. .fixed-btn {
  175. position: absolute;
  176. z-index: 10;
  177. bottom: 26px;
  178. left: 50%;
  179. transform: translateX(-50%);
  180. padding: 0 60px;
  181. height: 42px;
  182. line-height: 42px;
  183. background: linear-gradient(180deg, #70bffe, #2199f8);
  184. border-radius: 20px;
  185. color: #fff;
  186. font-size: 16px;
  187. }
  188. .card-title {
  189. font-size: 16px;
  190. font-weight: bold;
  191. color: #000;
  192. display: flex;
  193. align-items: center;
  194. .type-tag {
  195. margin-left: 5px;
  196. font-size: 12px;
  197. color: #000000;
  198. padding: 0 10px;
  199. background: rgba(119, 119, 119, 0.1);
  200. border-radius: 20px;
  201. font-weight: normal;
  202. height: 26px;
  203. line-height: 26px;
  204. }
  205. }
  206. .box-wrap {
  207. background: #fff;
  208. padding: 10px;
  209. border-radius: 8px;
  210. }
  211. .step-wrap {
  212. padding: 18px 0;
  213. }
  214. .content-status {
  215. position: relative;
  216. padding: 26px 12px 20px 12px;
  217. color: #fff;
  218. z-index: 2;
  219. display: flex;
  220. justify-content: space-between;
  221. align-items: center;
  222. &::after {
  223. content: "";
  224. z-index: -1;
  225. position: absolute;
  226. left: 0;
  227. top: 0;
  228. height: 144px;
  229. background: #2199f8;
  230. width: 100%;
  231. }
  232. .status-l {
  233. .stauts-text {
  234. font-size: 22px;
  235. display: flex;
  236. align-items: center;
  237. .status-icon {
  238. width: 24px;
  239. height: 24px;
  240. background: #ffffff;
  241. border-radius: 50%;
  242. margin-right: 8px;
  243. }
  244. }
  245. .stauts-sub-text {
  246. color: rgba(255, 255, 255, 0.51);
  247. font-size: 14px;
  248. }
  249. .time-text {
  250. color: #ffff;
  251. }
  252. }
  253. .status-r {
  254. height: 32px;
  255. line-height: 32px;
  256. padding: 0 16px;
  257. color: #2199f8;
  258. font-size: 16px;
  259. background: #fff;
  260. border-radius: 20px;
  261. }
  262. }
  263. .info-content {
  264. padding-top: 8px;
  265. position: relative;
  266. .price-bottom {
  267. padding-top: 8px;
  268. .price-info {
  269. padding: 8px 0;
  270. display: flex;
  271. align-items: center;
  272. justify-content: space-between;
  273. color: rgba(0, 0, 0, 0.2);
  274. .main-text {
  275. padding-left: 6px;
  276. color: rgba(0, 0, 0, 0.8);
  277. }
  278. .info-c {
  279. flex: 1;
  280. text-align: center;
  281. }
  282. }
  283. .price-total {
  284. height: 38px;
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. border: 1px solid rgba(33, 153, 248, 0.5);
  289. background: rgba(33, 153, 248, 0.1);
  290. color: #000000;
  291. border-radius: 4px;
  292. .main-val {
  293. font-size: 20px;
  294. font-weight: bold;
  295. color: #2199f8;
  296. padding-right: 2px;
  297. }
  298. }
  299. .bottom-btn {
  300. padding-top: 16px;
  301. display: flex;
  302. align-items: center;
  303. .btn {
  304. flex: 1;
  305. border-radius: 20px;
  306. height: 40px;
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. font-size: 16px;
  311. box-sizing: border-box;
  312. &.second {
  313. border: 1px solid #999999;
  314. color: #666666;
  315. }
  316. &.primary {
  317. background: #2199f8;
  318. color: #fff;
  319. }
  320. }
  321. .btn + .btn {
  322. margin-left: 12px;
  323. }
  324. }
  325. }
  326. }
  327. .farm-info {
  328. color: rgba(0, 0, 0, 0.6);
  329. font-size: 14px;
  330. margin-top: 14px;
  331. .info-title {
  332. display: flex;
  333. align-items: center;
  334. justify-content: space-between;
  335. color: #000;
  336. .sub-title {
  337. font-size: 14px;
  338. font-weight: bold;
  339. }
  340. .info-more {
  341. display: flex;
  342. align-items: center;
  343. font-size: 16px;
  344. font-weight: bold;
  345. .unit-text {
  346. font-size: 12px;
  347. }
  348. }
  349. }
  350. }
  351. .farm-photo {
  352. margin-top: 10px;
  353. .photo-list {
  354. display: flex;
  355. align-items: center;
  356. width: 100%;
  357. overflow: auto;
  358. padding-bottom: 10px;
  359. .photo-item {
  360. width: 92px;
  361. height: 92px;
  362. border-radius: 8px;
  363. object-fit: cover;
  364. }
  365. .img-item + .img-item {
  366. margin-left: 12px;
  367. }
  368. }
  369. .list-text {
  370. text-align: center;
  371. color: rgba(0, 0, 0, 0.5);
  372. padding-top: 2px;
  373. }
  374. }
  375. .farm-data {
  376. margin-top: 10px;
  377. .data-content {
  378. margin-top: 8px;
  379. border-top: 1px solid #f5f5f5;
  380. padding: 8px 0;
  381. }
  382. }
  383. .form-item {
  384. display: flex;
  385. align-items: center;
  386. font-size: 14px;
  387. color: #767676;
  388. height: 24px;
  389. .item-name {
  390. width: 80px;
  391. color: rgba(0, 0, 0, 0.2);
  392. }
  393. }
  394. .form-item + .form-item {
  395. padding-top: 2px;
  396. }
  397. .farm-table {
  398. .table-item {
  399. padding: 10px 0 12px 0;
  400. }
  401. }
  402. .work-map {
  403. margin-top: 10px;
  404. padding: 0 10px 10px;
  405. .map-content {
  406. padding-top: 8px;
  407. .map-dom {
  408. height: 166px;
  409. width: 100%;
  410. clip-path: inset(0px round 8px);
  411. }
  412. }
  413. .info-content {
  414. .title-wrap {
  415. display: flex;
  416. align-items: center;
  417. justify-content: space-between;
  418. .title-l {
  419. display: flex;
  420. align-items: center;
  421. .setting-text {
  422. padding-left: 11px;
  423. font-size: 12px;
  424. color: #2199f8;
  425. }
  426. }
  427. .item-title {
  428. font-size: 16px;
  429. font-weight: 500;
  430. margin: 2px 0 5px 0;
  431. }
  432. .title-r {
  433. color: rgba(255, 131, 29, 0.36);
  434. font-size: 12px;
  435. }
  436. }
  437. .item-desc {
  438. font-size: 13px;
  439. color: #bbbbbb;
  440. line-height: 18px;
  441. .desc-info {
  442. display: flex;
  443. .desc-info-item {
  444. flex: 1;
  445. .value {
  446. color: #666666;
  447. }
  448. }
  449. }
  450. .copy-info {
  451. margin-top: 4px;
  452. .address {
  453. max-width: 80%;
  454. .value {
  455. color: #666666;
  456. }
  457. }
  458. .copy-text {
  459. margin-left: 8px;
  460. color: #2199f8;
  461. }
  462. }
  463. .report-text {
  464. margin-top: 10px;
  465. color: #ff953d;
  466. font-size: 12px;
  467. height: 32px;
  468. line-height: 32px;
  469. border-radius: 5px;
  470. display: flex;
  471. align-items: center;
  472. padding-left: 11px;
  473. background: linear-gradient(90deg, rgba(255, 149, 61, 0.1), rgba(255, 149, 61, 0));
  474. .done-icon {
  475. background: #ff953d;
  476. width: 10px;
  477. height: 10px;
  478. border-radius: 50%;
  479. margin-right: 5px;
  480. }
  481. .right-icon {
  482. margin-left: 10px;
  483. }
  484. }
  485. }
  486. }
  487. }
  488. }
  489. }
  490. </style>