detailDialog.vue 18 KB

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