|
|
@@ -1,5 +1,13 @@
|
|
|
<template>
|
|
|
- <el-dialog v-model="winDialogVisible" lock-scroll modal-class="album-detail-modal" :showClose="false" width="86%" align-center @close="closeDialog">
|
|
|
+ <el-dialog
|
|
|
+ v-model="winDialogVisible"
|
|
|
+ lock-scroll
|
|
|
+ modal-class="album-detail-modal"
|
|
|
+ :showClose="false"
|
|
|
+ width="86%"
|
|
|
+ align-center
|
|
|
+ @close="closeDialog"
|
|
|
+ >
|
|
|
<div class="detail-log">
|
|
|
<div class="congratulation-wrap">
|
|
|
<div class="congratulation-box">
|
|
|
@@ -7,13 +15,16 @@
|
|
|
<!-- <img src="@/assets/img/weather_index/box-top.png" class="win-icon" /> -->
|
|
|
</div>
|
|
|
<div class="album-detail-box">
|
|
|
- <div class="detail-title">{{ dialogData.farmWorkName }}</div>
|
|
|
+ <div class="detail-title">{{ dialogData.name }}</div>
|
|
|
<div class="detail-desc-box">
|
|
|
- <div class="desc-item" v-if="dialogData?.conditionList && dialogData.conditionList.length">
|
|
|
+ <div class="desc-item van-ellipsis" v-if="dialogData?.conditionList && dialogData.conditionList.length">
|
|
|
<span class="item-name">触发条件</span>
|
|
|
- {{ dialogData.condition || dialogData.conditionList[0].name + dialogData.conditionList[0].value }}
|
|
|
+ {{
|
|
|
+ dialogData.condition ||
|
|
|
+ dialogData.conditionList[0].name + dialogData.conditionList[0].value
|
|
|
+ }}
|
|
|
</div>
|
|
|
- <div class="desc-item">
|
|
|
+ <div class="desc-item van-ellipsis">
|
|
|
<span class="item-name">农事编号</span>
|
|
|
{{ dialogData.code }}
|
|
|
</div>
|
|
|
@@ -21,13 +32,11 @@
|
|
|
<span class="item-name">推荐时间</span>
|
|
|
{{ dialogData.executeDate }}
|
|
|
</div>
|
|
|
- <!-- <div class="desc-item">
|
|
|
- <span class="item-name">农事宗旨</span>
|
|
|
- {{ dialogData.purpose || dialogData.condition }}
|
|
|
- </div> -->
|
|
|
<div class="desc-item">
|
|
|
- <div class="item-name">药物处方</div>
|
|
|
- <div class="item-table">
|
|
|
+ <div class="item-name">药物处方
|
|
|
+ <span class="no-prescription" v-if="!hasPrescription">暂无处方</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-table" v-if="hasPrescription">
|
|
|
<div class="table">
|
|
|
<div class="th">
|
|
|
<div class="td">功效</div>
|
|
|
@@ -35,24 +44,19 @@
|
|
|
<div class="td">配比</div>
|
|
|
<div class="td">方式</div>
|
|
|
</div>
|
|
|
- <div v-for="(prescriptionItem, prescriptionI) in dialogData.prescriptionList" :key="prescriptionI">
|
|
|
- <div class="tr" v-for="(subP, subI) in prescriptionItem.pesticideFertilizerList" :key="subI">
|
|
|
- <div class="td">{{ subP.typeName }}</div>
|
|
|
- <div class="td width">{{ subP.defaultName }}</div>
|
|
|
- <div class="td">{{ subP.ratio }}</div>
|
|
|
- <div class="td">人工</div>
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ class="tr"
|
|
|
+ v-for="(subP, subI) in dialogData.prescription?.pesticideFertilizerList"
|
|
|
+ :key="subI"
|
|
|
+ >
|
|
|
+ <div class="td">{{ subP.typeName }}</div>
|
|
|
+ <div class="td width">{{ subP.name }}</div>
|
|
|
+ <div class="td">{{ subP.ratio }}</div>
|
|
|
+ <div class="td">--</div>
|
|
|
</div>
|
|
|
- <!-- <div class="tr">
|
|
|
- <div class="td width">80%代森锰锌</div>
|
|
|
- <div class="td">山德生</div>
|
|
|
- <div class="td">1:2000</div>
|
|
|
- <div class="td">人工</div>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="card-link">
|
|
|
<img :src="dialogData.expertIcon || dialogData.expertUserIcon" />
|
|
|
<div class="expert-name">
|
|
|
@@ -79,10 +83,9 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
-
|
|
|
<Popup v-model:show="noShow" class="no-popup">
|
|
|
<div class="right-icon">
|
|
|
- <img class="right-img" src="@/assets/img/home/right.png" alt="">
|
|
|
+ <img class="right-img" src="@/assets/img/home/right.png" alt="" />
|
|
|
</div>
|
|
|
<div class="no-popup-title">
|
|
|
<span>好的,感谢您的配合</span>
|
|
|
@@ -92,7 +95,7 @@
|
|
|
</Popup>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref } from "vue";
|
|
|
+import { ref, computed } from "vue";
|
|
|
import eventBus from "@/api/eventBus";
|
|
|
import wx from "weixin-js-sdk";
|
|
|
import { Popup } from "vant";
|
|
|
@@ -101,8 +104,8 @@ import { useRoute, useRouter } from "vue-router";
|
|
|
const props = defineProps({
|
|
|
showSuccessOnly: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
- }
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
const winDialogVisible = ref(false);
|
|
|
@@ -110,237 +113,75 @@ const noShow = ref(false);
|
|
|
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
-const sampleId = route.query.sampleId
|
|
|
+const sampleId = route.query.sampleId;
|
|
|
const farmId = route.query.farmId;
|
|
|
|
|
|
const triggerClick = () => {
|
|
|
winDialogVisible.value = false;
|
|
|
-
|
|
|
+
|
|
|
// 如果只显示成功弹窗(来自 album_recognize 页面)
|
|
|
if (props.showSuccessOnly) {
|
|
|
eventBus.emit("activeUpload:success");
|
|
|
} else {
|
|
|
// 打开同级的激活上传弹窗
|
|
|
- eventBus.emit("activeUpload:show", {
|
|
|
+ eventBus.emit("activeUpload:show", {
|
|
|
gardenIdVal: dialogData.value.farmId,
|
|
|
- problemTitleVal: dialogData.value.farmWorkName
|
|
|
+ problemTitleVal: dialogData.value.farmWorkName,
|
|
|
});
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
-const dialogData = ref({
|
|
|
- targetId: "part2",
|
|
|
- title: "梢期防虫",
|
|
|
- parentTitle: "秋梢期",
|
|
|
- consequenceText: "如果不做本次农事,会导致您的产量、质量下降30%,管理得分降低10分",
|
|
|
- id: "274654",
|
|
|
- reCheckText: "本次农事复核成效优异,作物产量潜力实现大幅增长,树体营养较充足,土壤肥力增加",
|
|
|
- farmName: "荔枝博览园",
|
|
|
- farmPoint: "POINT(113.61702297075017 23.584863449735067)",
|
|
|
- orderId: "745923632567422976",
|
|
|
- area: 2.719998598098755,
|
|
|
- expert: 91356,
|
|
|
- orderStatus: 4,
|
|
|
- activeStatus: 0,
|
|
|
- farmId: 766,
|
|
|
- regionId: 2,
|
|
|
- speciesId: "1",
|
|
|
- speciesName: "荔枝",
|
|
|
- agriculturalId: 24,
|
|
|
- farmWorkId: "699343457444958208",
|
|
|
- farmWorkLibId: "699343457444958208",
|
|
|
- farmWorkLibName: "梢期营养",
|
|
|
- farmWorkName: "梢期营养",
|
|
|
- expertIcon:
|
|
|
- "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
|
|
|
- expertName: "韦帮稳",
|
|
|
- expertUserIcon: "",
|
|
|
- expertUserName: "韦帮稳",
|
|
|
- icon: 4,
|
|
|
- indexChart: [],
|
|
|
- indexName: "",
|
|
|
- beforeExecuteDate: "2025-05-26",
|
|
|
- checkDate: null,
|
|
|
- executeDate: "2025-08-01",
|
|
|
- indexJson: "",
|
|
|
- code: "BZ-YY-04-SQYY-20",
|
|
|
- expertPrescription: "",
|
|
|
- condition: "园区叶芽率大于20.0%",
|
|
|
- solarName: "",
|
|
|
- reCheck: null,
|
|
|
- executeBlueZones: [
|
|
|
- {
|
|
|
- id: "ws0y1m6x7cjz",
|
|
|
- level: null,
|
|
|
- },
|
|
|
- {
|
|
|
- id: "ws0y1md9v3ht",
|
|
|
- level: null,
|
|
|
- },
|
|
|
- {
|
|
|
- id: "ws0y1mdspbk7",
|
|
|
- level: null,
|
|
|
- },
|
|
|
- {
|
|
|
- id: "ws0y1mdvvdsz",
|
|
|
- level: null,
|
|
|
- },
|
|
|
- {
|
|
|
- id: "ws0y1me545tg",
|
|
|
- level: null,
|
|
|
- },
|
|
|
- ],
|
|
|
- menu: 1,
|
|
|
- isEdit: 0,
|
|
|
- isMaster: null,
|
|
|
- num: null,
|
|
|
- purpose: "",
|
|
|
- selfExec: null,
|
|
|
- defaultFarmWork: 0,
|
|
|
- farmWorkType: 2,
|
|
|
- farmWorkTypeName: "营养",
|
|
|
- type: 1,
|
|
|
- execute: 4,
|
|
|
- updateDate0: "2025-08-20",
|
|
|
- updateDate1: null,
|
|
|
- updateDate2: null,
|
|
|
- updateDate3: null,
|
|
|
- updateDate4: null,
|
|
|
- updateDate5: null,
|
|
|
- usageMode: "根部施",
|
|
|
- serviceMain: "广州泽秾丰农资有限公司",
|
|
|
- updateDate6: null,
|
|
|
- confirmPicture: [],
|
|
|
- executeMain: "广州泽秾丰农资有限公司",
|
|
|
- storeShortName: "泽秾丰",
|
|
|
- weatherWarningMsg: "",
|
|
|
- executeEvidence: [],
|
|
|
- userEvaluation: null,
|
|
|
- reviewDate: null,
|
|
|
- reviewDate2: null,
|
|
|
- reviewImage: [],
|
|
|
- reviewImage2: [],
|
|
|
- serviceRegion: "广州市从化区荔枝博览园",
|
|
|
- users: [
|
|
|
- {
|
|
|
- id: null,
|
|
|
- orderId: null,
|
|
|
- serviceType: null,
|
|
|
- userType: null,
|
|
|
- userId: 81881,
|
|
|
- joinStatus: null,
|
|
|
- icon: "https://birdseye-img.sysuimars.com/birdseye-look-mini/Group%201321316260.png",
|
|
|
- userName: "飞鸟种植助手",
|
|
|
- area: "",
|
|
|
- point: "",
|
|
|
- farmName: "",
|
|
|
- selected: null,
|
|
|
- },
|
|
|
- ],
|
|
|
- cost: null,
|
|
|
- prescriptionList: [
|
|
|
- {
|
|
|
- name: "营养",
|
|
|
- pesticideFertilizerList: [
|
|
|
- {
|
|
|
- defaultDroneRatio: null,
|
|
|
- defaultName: "尿素",
|
|
|
- defaultRatio: 0,
|
|
|
- id: null,
|
|
|
- muPrice: null,
|
|
|
- muUsage: 15000.0,
|
|
|
- muUsage2: 15000.0,
|
|
|
- ratio: 0,
|
|
|
- ratio2: 0,
|
|
|
- remark: "",
|
|
|
- usageMode: "",
|
|
|
- usageModeList: ["叶面施、根部施"],
|
|
|
- orderId: null,
|
|
|
- pesticideFertilizerCode: "1001",
|
|
|
- pesticideFertilizerId: "1",
|
|
|
- pesticideFertilizerName: "尿素",
|
|
|
- brand: "山东联盟",
|
|
|
- typeName: "营养",
|
|
|
- price: 132,
|
|
|
- unit: "g",
|
|
|
- executeStyle: null,
|
|
|
- },
|
|
|
- {
|
|
|
- defaultDroneRatio: null,
|
|
|
- defaultName: "15-15-15复合肥",
|
|
|
- defaultRatio: 0,
|
|
|
- id: null,
|
|
|
- muPrice: null,
|
|
|
- muUsage: 45000.0,
|
|
|
- muUsage2: 45000.0,
|
|
|
- ratio: 0,
|
|
|
- ratio2: 0,
|
|
|
- remark: "",
|
|
|
- usageMode: "",
|
|
|
- usageModeList: ["根部施"],
|
|
|
- orderId: null,
|
|
|
- pesticideFertilizerCode: "1002",
|
|
|
- pesticideFertilizerId: "2",
|
|
|
- pesticideFertilizerName: "15-15-15复合肥",
|
|
|
- brand: "金正大",
|
|
|
- typeName: "营养",
|
|
|
- price: 220,
|
|
|
- unit: "g",
|
|
|
- executeStyle: null,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- conditionList: [
|
|
|
- {
|
|
|
- index: "1-2-001-02-02-02-01-0008",
|
|
|
- name: "园区叶芽率",
|
|
|
- type: 1,
|
|
|
- value: "0.2",
|
|
|
- },
|
|
|
- ],
|
|
|
- });
|
|
|
-const currentCard = ref({});
|
|
|
-const showDialog = (pageParams) => {
|
|
|
- // dialogData.value = pageParams.card;
|
|
|
- // currentCard.value = {
|
|
|
- // activeIndex: pageParams.activeIndex,
|
|
|
- // farmWorkName: dialogData.value.farmWorkName,
|
|
|
- // farmId: farmId,
|
|
|
- // sampleId: sampleId,
|
|
|
- // };
|
|
|
- // settingData()
|
|
|
+const dialogData = ref({})
|
|
|
+const showDialog = (id) => {
|
|
|
+ if (id) {
|
|
|
+ VE_API.farm
|
|
|
+ .getFarmWorkLib({ id })
|
|
|
+ .then(({ code, data }) => {
|
|
|
+ if (code === 0 && data) {
|
|
|
+ // 将接口返回的数据更新到 dialogData
|
|
|
+ dialogData.value = data || {};
|
|
|
+ settingData();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("获取农事详情失败:", error);
|
|
|
+ });
|
|
|
+ }
|
|
|
winDialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
-defineExpose({showDialog})
|
|
|
-
|
|
|
+defineExpose({ showDialog });
|
|
|
|
|
|
//立即激活
|
|
|
-const handleAct = () =>{
|
|
|
- winDialogVisible.value = false
|
|
|
- eventBus.emit("uploadUopup:show",{gardenIdVal:dialogData.value.farmId,orderIdVal:dialogData.value.orderId,textVal:dialogData.value.consequenceText});
|
|
|
-}
|
|
|
+const handleAct = () => {
|
|
|
+ winDialogVisible.value = false;
|
|
|
+ eventBus.emit("uploadUopup:show", {
|
|
|
+ gardenIdVal: dialogData.value.farmId,
|
|
|
+ orderIdVal: dialogData.value.orderId,
|
|
|
+ textVal: dialogData.value.consequenceText,
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
+const pesticideFertilizers = ref([]);
|
|
|
+
|
|
|
+// 判断是否有处方数据
|
|
|
+const hasPrescription = computed(() => {
|
|
|
+ const pesticideFertilizerList = dialogData.value.prescription?.pesticideFertilizerList;
|
|
|
+ return pesticideFertilizerList && Array.isArray(pesticideFertilizerList) && pesticideFertilizerList.length > 0;
|
|
|
+});
|
|
|
|
|
|
-const pesticideFertilizers = ref([])
|
|
|
const settingData = () => {
|
|
|
- pesticideFertilizers.value = flattenDomains(dialogData.value.prescriptionList)
|
|
|
+ const pesticideFertilizerList = dialogData.value.prescription?.pesticideFertilizerList;
|
|
|
+ pesticideFertilizers.value = pesticideFertilizerList || [];
|
|
|
};
|
|
|
-function flattenDomains(data) {
|
|
|
- return data.reduce((acc, item) => {
|
|
|
- return acc.concat(item.pesticideFertilizerList);
|
|
|
- }, []);
|
|
|
-}
|
|
|
|
|
|
function closeDialog() {
|
|
|
- winDialogVisible.value = false
|
|
|
+ winDialogVisible.value = false;
|
|
|
}
|
|
|
|
|
|
function toPage() {
|
|
|
- router.push("/expert_list")
|
|
|
+ router.push("/expert_list");
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -370,12 +211,12 @@ function toPage() {
|
|
|
border-radius: 30px;
|
|
|
font-size: 14px;
|
|
|
&.secondary-btn {
|
|
|
- background: #FFFFFF;
|
|
|
+ background: #ffffff;
|
|
|
color: #000000;
|
|
|
}
|
|
|
&.primary-btn {
|
|
|
- background: linear-gradient(180deg, #76C3FF, #2199F8);
|
|
|
- color: #FFFFFF;
|
|
|
+ background: linear-gradient(180deg, #76c3ff, #2199f8);
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
.btn-item + .btn-item {
|
|
|
@@ -384,7 +225,7 @@ function toPage() {
|
|
|
}
|
|
|
.congratulation-box {
|
|
|
border-radius: 12px;
|
|
|
- background: url("@/assets/img/home/box-top.png") no-repeat top center /contain;
|
|
|
+ background: url("@/assets/img/home/box-top.png") no-repeat top center / contain;
|
|
|
.el-message-box__message {
|
|
|
padding: 12px 0 24px 0;
|
|
|
}
|
|
|
@@ -431,10 +272,17 @@ function toPage() {
|
|
|
position: relative;
|
|
|
.desc-item {
|
|
|
font-size: 14px;
|
|
|
+ &.van-ellipsis{
|
|
|
+ max-width: calc(100% - 86px);
|
|
|
+ }
|
|
|
.item-name {
|
|
|
color: #999999;
|
|
|
margin-right: 12px;
|
|
|
}
|
|
|
+ .no-prescription {
|
|
|
+ margin-left: 12px;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
.item-table {
|
|
|
margin-top: 8px;
|
|
|
.table {
|
|
|
@@ -442,7 +290,7 @@ function toPage() {
|
|
|
border-radius: 4px;
|
|
|
font-size: 13px;
|
|
|
.th {
|
|
|
- background: #F5F5F5;
|
|
|
+ background: #f5f5f5;
|
|
|
color: #999999;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
@@ -516,7 +364,6 @@ function toPage() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
.no-popup {
|
|
|
width: 300px;
|
|
|
border-radius: 14px;
|
|
|
@@ -533,13 +380,13 @@ function toPage() {
|
|
|
font-size: 24px;
|
|
|
font-weight: 500;
|
|
|
text-align: center;
|
|
|
- .no-popup-title-sub{
|
|
|
+ .no-popup-title-sub {
|
|
|
font-size: 14px;
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
}
|
|
|
.no-popup-btn {
|
|
|
- background-color: #2199F8;
|
|
|
+ background-color: #2199f8;
|
|
|
padding: 8px;
|
|
|
border-radius: 20px;
|
|
|
color: #fff;
|