detailDialog.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <el-dialog v-model="winDialogVisible" lock-scroll modal-class="album-detail-modal" :showClose="false" width="86%" align-center @close="closeDialog">
  3. <div class="detail-log">
  4. <div class="congratulation-wrap">
  5. <div class="congratulation-box">
  6. <div class="win-des">
  7. <!-- <img src="@/assets/img/weather_index/box-top.png" class="win-icon" /> -->
  8. </div>
  9. <div class="album-detail-box">
  10. <div class="detail-title">{{ dialogData.farmWorkName }}</div>
  11. <div class="detail-desc-box">
  12. <div class="desc-item" v-if="dialogData?.conditionList && dialogData.conditionList.length">
  13. <span class="item-name">触发条件</span>
  14. {{ dialogData.condition || dialogData.conditionList[0].name + dialogData.conditionList[0].value }}
  15. </div>
  16. <div class="desc-item">
  17. <span class="item-name">农事编号</span>
  18. {{ dialogData.code }}
  19. </div>
  20. <div class="desc-item">
  21. <span class="item-name">推荐时间</span>
  22. {{ dialogData.executeDate }}
  23. </div>
  24. <!-- <div class="desc-item">
  25. <span class="item-name">农事宗旨</span>
  26. {{ dialogData.purpose || dialogData.condition }}
  27. </div> -->
  28. <div class="desc-item">
  29. <div class="item-name">药物处方</div>
  30. <div class="item-table">
  31. <div class="table">
  32. <div class="th">
  33. <div class="td">功效</div>
  34. <div class="td width">名称</div>
  35. <div class="td">配比</div>
  36. <div class="td">方式</div>
  37. </div>
  38. <div v-for="(prescriptionItem, prescriptionI) in dialogData.prescriptionList" :key="prescriptionI">
  39. <div class="tr" v-for="(subP, subI) in prescriptionItem.pesticideFertilizerList" :key="subI">
  40. <div class="td">{{ subP.typeName }}</div>
  41. <div class="td width">{{ subP.defaultName }}</div>
  42. <div class="td">{{ subP.ratio }}</div>
  43. <div class="td">人工</div>
  44. </div>
  45. </div>
  46. <!-- <div class="tr">
  47. <div class="td width">80%代森锰锌</div>
  48. <div class="td">山德生</div>
  49. <div class="td">1:2000</div>
  50. <div class="td">人工</div>
  51. </div> -->
  52. </div>
  53. </div>
  54. </div>
  55. <div class="card-link">
  56. <img :src="dialogData.expertIcon || dialogData.expertUserIcon" />
  57. <div class="expert-name">
  58. {{ dialogData.expertUserName || dialogData.expertName }}
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="bottom-btn">
  66. <div class="btn-item secondary-btn" @click="toPage">咨询专家</div>
  67. <div class="btn-item primary-btn" @click="triggerClick">触发农事</div>
  68. </div>
  69. </div>
  70. <template #footer>
  71. <div class="dialog-footer">
  72. <div class="close-btn">
  73. <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
  74. <!-- <el-button type="primary" class="one-btn" @click="toShare"> 立即分享 </el-button> -->
  75. </div>
  76. </div>
  77. </template>
  78. </el-dialog>
  79. <Popup v-model:show="noShow" class="no-popup">
  80. <div class="right-icon">
  81. <img class="right-img" src="@/assets/img/home/right.png" alt="">
  82. </div>
  83. <div class="no-popup-title">
  84. <span>农事已触发成功</span>
  85. <div class="no-popup-title-sub">您可以在 农场监测-农事任务 看到农事状态</div>
  86. </div>
  87. <div class="no-popup-btn" @click="noShow = false">我知道了</div>
  88. </Popup>
  89. </template>
  90. <script setup>
  91. import { ref } from "vue";
  92. import eventBus from "@/api/eventBus";
  93. import wx from "weixin-js-sdk";
  94. import { Popup } from "vant";
  95. import { useRoute, useRouter } from "vue-router";
  96. const winDialogVisible = ref(false);
  97. const noShow = ref(false);
  98. const route = useRoute();
  99. const router = useRouter();
  100. const sampleId = route.query.sampleId
  101. const farmId = route.query.farmId;
  102. const triggerClick = () => {
  103. winDialogVisible.value = false;
  104. noShow.value = true;
  105. }
  106. const dialogData = ref({
  107. targetId: "part2",
  108. title: "梢期防虫",
  109. parentTitle: "秋梢期",
  110. consequenceText: "如果不做本次农事,会导致您的产量、质量下降30%,管理得分降低10分",
  111. id: "274654",
  112. reCheckText: "本次农事复核成效优异,作物产量潜力实现大幅增长,树体营养较充足,土壤肥力增加",
  113. farmName: "荔枝博览园",
  114. farmPoint: "POINT(113.61702297075017 23.584863449735067)",
  115. orderId: "745923632567422976",
  116. area: 2.719998598098755,
  117. expert: 91356,
  118. orderStatus: 4,
  119. activeStatus: 0,
  120. farmId: 766,
  121. regionId: 2,
  122. speciesId: "1",
  123. speciesName: "荔枝",
  124. agriculturalId: 24,
  125. farmWorkId: "699343457444958208",
  126. farmWorkLibId: "699343457444958208",
  127. farmWorkLibName: "梢期营养",
  128. farmWorkName: "梢期营养",
  129. expertIcon:
  130. "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
  131. expertName: "韦帮稳",
  132. expertUserIcon: "",
  133. expertUserName: "韦帮稳",
  134. icon: 4,
  135. indexChart: [],
  136. indexName: "",
  137. beforeExecuteDate: "2025-05-26",
  138. checkDate: null,
  139. executeDate: "2025-08-01",
  140. indexJson: "",
  141. code: "BZ-YY-04-SQYY-20",
  142. expertPrescription: "",
  143. condition: "园区叶芽率大于20.0%",
  144. solarName: "",
  145. reCheck: null,
  146. executeBlueZones: [
  147. {
  148. id: "ws0y1m6x7cjz",
  149. level: null,
  150. },
  151. {
  152. id: "ws0y1md9v3ht",
  153. level: null,
  154. },
  155. {
  156. id: "ws0y1mdspbk7",
  157. level: null,
  158. },
  159. {
  160. id: "ws0y1mdvvdsz",
  161. level: null,
  162. },
  163. {
  164. id: "ws0y1me545tg",
  165. level: null,
  166. },
  167. ],
  168. menu: 1,
  169. isEdit: 0,
  170. isMaster: null,
  171. num: null,
  172. purpose: "",
  173. selfExec: null,
  174. defaultFarmWork: 0,
  175. farmWorkType: 2,
  176. farmWorkTypeName: "营养",
  177. type: 1,
  178. execute: 4,
  179. updateDate0: "2025-08-20",
  180. updateDate1: null,
  181. updateDate2: null,
  182. updateDate3: null,
  183. updateDate4: null,
  184. updateDate5: null,
  185. usageMode: "根部施",
  186. serviceMain: "广州泽秾丰农资有限公司",
  187. updateDate6: null,
  188. confirmPicture: [],
  189. executeMain: "广州泽秾丰农资有限公司",
  190. storeShortName: "泽秾丰",
  191. weatherWarningMsg: "",
  192. executeEvidence: [],
  193. userEvaluation: null,
  194. reviewDate: null,
  195. reviewDate2: null,
  196. reviewImage: [],
  197. reviewImage2: [],
  198. serviceRegion: "广州市从化区荔枝博览园",
  199. users: [
  200. {
  201. id: null,
  202. orderId: null,
  203. serviceType: null,
  204. userType: null,
  205. userId: 81881,
  206. joinStatus: null,
  207. icon: "https://birdseye-img.sysuimars.com/birdseye-look-mini/Group%201321316260.png",
  208. userName: "飞鸟种植助手",
  209. area: "",
  210. point: "",
  211. farmName: "",
  212. selected: null,
  213. },
  214. ],
  215. cost: null,
  216. prescriptionList: [
  217. {
  218. name: "营养",
  219. pesticideFertilizerList: [
  220. {
  221. defaultDroneRatio: null,
  222. defaultName: "尿素",
  223. defaultRatio: 0,
  224. id: null,
  225. muPrice: null,
  226. muUsage: 15000.0,
  227. muUsage2: 15000.0,
  228. ratio: 0,
  229. ratio2: 0,
  230. remark: "",
  231. usageMode: "",
  232. usageModeList: ["叶面施、根部施"],
  233. orderId: null,
  234. pesticideFertilizerCode: "1001",
  235. pesticideFertilizerId: "1",
  236. pesticideFertilizerName: "尿素",
  237. brand: "山东联盟",
  238. typeName: "营养",
  239. price: 132,
  240. unit: "g",
  241. executeStyle: null,
  242. },
  243. {
  244. defaultDroneRatio: null,
  245. defaultName: "15-15-15复合肥",
  246. defaultRatio: 0,
  247. id: null,
  248. muPrice: null,
  249. muUsage: 45000.0,
  250. muUsage2: 45000.0,
  251. ratio: 0,
  252. ratio2: 0,
  253. remark: "",
  254. usageMode: "",
  255. usageModeList: ["根部施"],
  256. orderId: null,
  257. pesticideFertilizerCode: "1002",
  258. pesticideFertilizerId: "2",
  259. pesticideFertilizerName: "15-15-15复合肥",
  260. brand: "金正大",
  261. typeName: "营养",
  262. price: 220,
  263. unit: "g",
  264. executeStyle: null,
  265. },
  266. ],
  267. },
  268. ],
  269. conditionList: [
  270. {
  271. index: "1-2-001-02-02-02-01-0008",
  272. name: "园区叶芽率",
  273. type: 1,
  274. value: "0.2",
  275. },
  276. ],
  277. });
  278. const currentCard = ref({});
  279. const showDialog = (pageParams) => {
  280. // dialogData.value = pageParams.card;
  281. // currentCard.value = {
  282. // activeIndex: pageParams.activeIndex,
  283. // farmWorkName: dialogData.value.farmWorkName,
  284. // farmId: farmId,
  285. // sampleId: sampleId,
  286. // };
  287. // settingData()
  288. winDialogVisible.value = true;
  289. };
  290. defineExpose({showDialog})
  291. //立即激活
  292. const handleAct = () =>{
  293. winDialogVisible.value = false
  294. eventBus.emit("uploadUopup:show",{gardenIdVal:dialogData.value.farmId,orderIdVal:dialogData.value.orderId,textVal:dialogData.value.consequenceText});
  295. }
  296. const pesticideFertilizers = ref([])
  297. const settingData = () => {
  298. pesticideFertilizers.value = flattenDomains(dialogData.value.prescriptionList)
  299. };
  300. function flattenDomains(data) {
  301. return data.reduce((acc, item) => {
  302. return acc.concat(item.pesticideFertilizerList);
  303. }, []);
  304. }
  305. function closeDialog() {
  306. winDialogVisible.value = false
  307. }
  308. function toPage() {
  309. router.push("/expert_list")
  310. }
  311. </script>
  312. <style lang="scss" scoped>
  313. .congratulation-wrap {
  314. border-radius: 12px;
  315. background: #f4f5f4;
  316. width: 100%;
  317. }
  318. .detail-log {
  319. width: 100%;
  320. }
  321. .close-btn {
  322. text-align: center;
  323. margin-top: 20px;
  324. }
  325. .bottom-btn {
  326. position: absolute;
  327. width: 100%;
  328. text-align: center;
  329. margin-top: 20px;
  330. display: flex;
  331. .btn-item {
  332. flex: 1;
  333. text-align: center;
  334. height: 38px;
  335. line-height: 38px;
  336. border-radius: 30px;
  337. font-size: 14px;
  338. &.secondary-btn {
  339. background: #FFFFFF;
  340. color: #000000;
  341. }
  342. &.primary-btn {
  343. background: linear-gradient(180deg, #76C3FF, #2199F8);
  344. color: #FFFFFF;
  345. }
  346. }
  347. .btn-item + .btn-item {
  348. margin-left: 12px;
  349. }
  350. }
  351. .congratulation-box {
  352. border-radius: 12px;
  353. background: url("@/assets/img/home/box-top.png") no-repeat top center /contain;
  354. .el-message-box__message {
  355. padding: 12px 0 24px 0;
  356. }
  357. .win-title {
  358. color: #1d1e1f;
  359. font-family: "PangMenZhengDao", sans-serif; /* 使用自定义字体 */
  360. text-align: center;
  361. font-size: 24px;
  362. line-height: 32px;
  363. }
  364. .win-detail {
  365. text-align: center;
  366. color: #252525;
  367. padding-top: 6px;
  368. font-size: 16px;
  369. span {
  370. font-size: 22px;
  371. color: #2199f8;
  372. padding: 0 6px;
  373. font-weight: bold;
  374. }
  375. }
  376. .win-des {
  377. height: 180px;
  378. text-align: center;
  379. }
  380. .win-icon {
  381. width: 100%;
  382. border-radius: 12px 12px 0 0;
  383. }
  384. }
  385. .album-detail-box {
  386. padding: 0 10px 16px 10px;
  387. color: #000;
  388. position: relative;
  389. // top: -58px;
  390. .detail-title {
  391. font-size: 24px;
  392. font-weight: bold;
  393. padding-bottom: 8px;
  394. letter-spacing: 1.6px;
  395. }
  396. .detail-desc-box {
  397. position: relative;
  398. .desc-item {
  399. font-size: 14px;
  400. .item-name {
  401. color: #999999;
  402. margin-right: 12px;
  403. }
  404. .item-table {
  405. margin-top: 8px;
  406. .table {
  407. border: 1px solid rgba(196, 196, 196, 0.8);
  408. border-radius: 4px;
  409. font-size: 13px;
  410. .th {
  411. background: #F5F5F5;
  412. color: #999999;
  413. display: flex;
  414. justify-content: space-between;
  415. border-radius: 4px 4px 0 0;
  416. padding: 4px 0;
  417. }
  418. .tr {
  419. display: flex;
  420. justify-content: space-between;
  421. align-items: center;
  422. color: #333333;
  423. padding: 6px 0;
  424. }
  425. .tr + .tr {
  426. border-top: 1px solid rgba(0, 0, 0, 0.08);
  427. }
  428. .td {
  429. width: 25%;
  430. padding: 0 2px;
  431. text-align: center;
  432. }
  433. .width {
  434. width: 55%;
  435. }
  436. }
  437. }
  438. }
  439. .desc-item + .desc-item {
  440. padding-top: 4px;
  441. }
  442. .card-link {
  443. display: flex;
  444. flex-direction: column;
  445. align-items: center;
  446. justify-content: center;
  447. color: #2199f8;
  448. font-size: 12px;
  449. position: absolute;
  450. right: 6px;
  451. top: 0px;
  452. .expert-name {
  453. background: #d3e8ff;
  454. border-radius: 4px;
  455. padding: 1px 12px;
  456. margin-top: 4px;
  457. display: flex;
  458. align-items: center;
  459. }
  460. img {
  461. width: 62px;
  462. height: 62px;
  463. border-radius: 50%;
  464. object-fit: cover;
  465. }
  466. .icon {
  467. padding-right: 2px;
  468. }
  469. }
  470. }
  471. }
  472. .dialog-footer {
  473. position: relative;
  474. .close-btn {
  475. position: absolute;
  476. bottom: -58px;
  477. left: 0;
  478. right: 0;
  479. margin: 0 auto;
  480. text-align: center;
  481. }
  482. }
  483. .no-popup {
  484. width: 300px;
  485. border-radius: 14px;
  486. padding: 28px 15px 20px;
  487. box-sizing: border-box;
  488. .right-icon {
  489. text-align: center;
  490. padding-bottom: 12px;
  491. .right-img {
  492. width: 68px;
  493. }
  494. }
  495. .no-popup-title {
  496. font-size: 24px;
  497. font-weight: 500;
  498. text-align: center;
  499. .no-popup-title-sub{
  500. font-size: 14px;
  501. margin-top: 8px;
  502. }
  503. }
  504. .no-popup-btn {
  505. background-color: #2199F8;
  506. padding: 8px;
  507. border-radius: 20px;
  508. color: #fff;
  509. font-size: 16px;
  510. margin-top: 32px;
  511. text-align: center;
  512. }
  513. }
  514. </style>
  515. <style lang="scss">
  516. .album-detail-modal {
  517. .el-overlay-dialog {
  518. .el-dialog {
  519. padding: 0;
  520. border-radius: 12px;
  521. background: none;
  522. box-shadow: none;
  523. margin-bottom: 70px;
  524. margin-top: 10px;
  525. overflow: auto;
  526. scrollbar-width: none;
  527. display: flex;
  528. flex-direction: column;
  529. align-items: center;
  530. justify-content: center;
  531. pointer-events: none;
  532. .el-dialog__header {
  533. padding: 0;
  534. }
  535. .el-dialog__body {
  536. pointer-events: all;
  537. width: 100%;
  538. }
  539. }
  540. .one-btn {
  541. width: 210px;
  542. height: 40px;
  543. line-height: 40px;
  544. }
  545. }
  546. }
  547. </style>