|
@@ -21,29 +21,36 @@
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<span @click="handleDetail('farm_list')">查看详情</span>
|
|
<span @click="handleDetail('farm_list')">查看详情</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="question-header">
|
|
|
|
|
- <img class="question-icon" src="@/assets/img/home/ask-icon.png" alt="" />
|
|
|
|
|
- <div class="question-title">{{ farmWorkData.quest }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <template v-if="isImg">
|
|
|
|
|
- <div class="answer-content">
|
|
|
|
|
- 答:{{ farmWorkData.agriDate }} {{ farmWorkData.answerLabel }}出现{{
|
|
|
|
|
- farmWorkData.indicatorName
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ <template v-if="farmWorkData.quest">
|
|
|
|
|
+ <div class="question-header">
|
|
|
|
|
+ <img class="question-icon" src="@/assets/img/home/ask-icon.png" alt="" />
|
|
|
|
|
+ <div class="question-title">{{ farmWorkData.quest }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="answer-img">
|
|
|
|
|
- <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" alt="" />
|
|
|
|
|
- <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" alt="" />
|
|
|
|
|
- <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" alt="" />
|
|
|
|
|
|
|
+ <template v-if="farmWorkData.images.length">
|
|
|
|
|
+ <div class="answer-content">
|
|
|
|
|
+ 答:{{ farmWorkData.agriDate }} {{ farmWorkData.answerLabel }}出现{{
|
|
|
|
|
+ farmWorkData.indicatorName
|
|
|
|
|
+ }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="answer-img">
|
|
|
|
|
+ <img v-for="image in farmWorkData.images" :key="image" :src="config.base_img_url2 + image.cloudFilename" alt="" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <div v-else class="answer-btn">
|
|
|
|
|
+ <div class="answer-btn-item">转发给客户</div>
|
|
|
|
|
+ <div class="answer-btn-item-group">
|
|
|
|
|
+ <div class="answer-btn-item">否</div>
|
|
|
|
|
+ <div class="answer-btn-item primary">是</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <div v-else class="answer-btn">
|
|
|
|
|
- <div class="answer-btn-item">转发给客户</div>
|
|
|
|
|
- <div class="answer-btn-item-group">
|
|
|
|
|
- <div class="answer-btn-item">否</div>
|
|
|
|
|
- <div class="answer-btn-item primary">是</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <empty
|
|
|
|
|
+ v-else
|
|
|
|
|
+ image="https://fastly.jsdelivr.net/npm/@vant/assets/custom-empty-image.png"
|
|
|
|
|
+ image-size="80"
|
|
|
|
|
+ description="暂无数据"
|
|
|
|
|
+ class="empty-state"
|
|
|
|
|
+ />
|
|
|
</common-box>
|
|
</common-box>
|
|
|
</tab>
|
|
</tab>
|
|
|
<tab title="农事服务" class="tab-item">
|
|
<tab title="农事服务" class="tab-item">
|
|
@@ -70,6 +77,13 @@
|
|
|
class="recipe-item"
|
|
class="recipe-item"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <empty
|
|
|
|
|
+ v-if="detailList.length === 0"
|
|
|
|
|
+ image="https://fastly.jsdelivr.net/npm/@vant/assets/custom-empty-image.png"
|
|
|
|
|
+ image-size="80"
|
|
|
|
|
+ description="暂无数据"
|
|
|
|
|
+ class="empty-state"
|
|
|
|
|
+ />
|
|
|
</common-box>
|
|
</common-box>
|
|
|
</tab>
|
|
</tab>
|
|
|
<tab title="农场报告" class="tab-item">
|
|
<tab title="农场报告" class="tab-item">
|
|
@@ -87,8 +101,14 @@
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<span @click="handleDetail('agricultural_plan')">查看更多</span>
|
|
<span @click="handleDetail('agricultural_plan')">查看更多</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <record-item :record-item-data="detailList[0]" title-mode="default" class="recipe-item" />
|
|
|
|
|
- <!-- <plan-list :farm-id="93301" :container-id="route.query.containerId || 2" class="plan-list-wrapper" /> -->
|
|
|
|
|
|
|
+ <record-item v-if="detailList.length > 0" :record-item-data="detailList[0]" title-mode="default" class="recipe-item" />
|
|
|
|
|
+ <empty
|
|
|
|
|
+ v-else
|
|
|
|
|
+ image="https://fastly.jsdelivr.net/npm/@vant/assets/custom-empty-image.png"
|
|
|
|
|
+ image-size="80"
|
|
|
|
|
+ description="暂无数据"
|
|
|
|
|
+ class="empty-state"
|
|
|
|
|
+ />
|
|
|
</common-box>
|
|
</common-box>
|
|
|
</tab>
|
|
</tab>
|
|
|
</tabs>
|
|
</tabs>
|
|
@@ -103,18 +123,17 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
|
|
+import { ref, onMounted} from "vue";
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
-import { Tab, Tabs } from "vant";
|
|
|
|
|
|
|
+import { Tab, Tabs, Empty } from "vant";
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
import FarmInfoCard from "@/components/pageComponents/FarmInfoCard.vue";
|
|
import FarmInfoCard from "@/components/pageComponents/FarmInfoCard.vue";
|
|
|
import tabList from "@/components/pageComponents/TabList.vue";
|
|
import tabList from "@/components/pageComponents/TabList.vue";
|
|
|
import commonBox from "@/components/pageComponents/CommonBox.vue";
|
|
import commonBox from "@/components/pageComponents/CommonBox.vue";
|
|
|
import StatsBox from "@/components/pageComponents/StatsBox.vue";
|
|
import StatsBox from "@/components/pageComponents/StatsBox.vue";
|
|
|
import recordItem from "@/components/recordItem.vue";
|
|
import recordItem from "@/components/recordItem.vue";
|
|
|
-import PlanList from "@/components/pageComponents/PlanList.vue";
|
|
|
|
|
import farmInfoPopup from "../home/components/farmInfoPopup.vue";
|
|
import farmInfoPopup from "../home/components/farmInfoPopup.vue";
|
|
|
-
|
|
|
|
|
|
|
+import config from "@/api/config";
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const activeTab = ref(0);
|
|
const activeTab = ref(0);
|
|
@@ -127,13 +146,8 @@ const handleFarmInfo = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleFarmServiceTabChange = (index) => {
|
|
const handleFarmServiceTabChange = (index) => {
|
|
|
- console.log("切换到标签页:", index, farmServiceTabs[index]);
|
|
|
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
|
- serviceStatsData.value = [
|
|
|
|
|
- { value: "1258", unit: "元", desc: "总收益" },
|
|
|
|
|
- { value: "1258", unit: "元", desc: "投入成本" },
|
|
|
|
|
- { value: "118", unit: "次", desc: "服务次数" },
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ getFarmPastServiceCost();
|
|
|
getDetailList();
|
|
getDetailList();
|
|
|
} else {
|
|
} else {
|
|
|
getFutureFarmWorkList();
|
|
getFutureFarmWorkList();
|
|
@@ -144,13 +158,7 @@ const handleFarmServiceTabChange = (index) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const serviceStatsData = ref([
|
|
|
|
|
- { value: "1258", unit: "元", desc: "总收益" },
|
|
|
|
|
- { value: "1258", unit: "元", desc: "投入成本" },
|
|
|
|
|
- { value: "118", unit: "次", desc: "服务次数" },
|
|
|
|
|
-]);
|
|
|
|
|
-
|
|
|
|
|
-const isImg = ref(true);
|
|
|
|
|
|
|
+const serviceStatsData = ref([]);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
farmIdVal.value = route.query.farmId;
|
|
farmIdVal.value = route.query.farmId;
|
|
@@ -162,7 +170,9 @@ onMounted(() => {
|
|
|
getFarmDetail();
|
|
getFarmDetail();
|
|
|
getFarmWorkList();
|
|
getFarmWorkList();
|
|
|
getDetailList();
|
|
getDetailList();
|
|
|
|
|
+ getFarmPastServiceCost();
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
const farmIdVal = ref(null);
|
|
const farmIdVal = ref(null);
|
|
|
const farmDetail = ref({});
|
|
const farmDetail = ref({});
|
|
|
const paramsPage = ref({});
|
|
const paramsPage = ref({});
|
|
@@ -184,10 +194,8 @@ const getFarmWorkList = () => {
|
|
|
const detailList = ref([]);
|
|
const detailList = ref([]);
|
|
|
const getDetailList = () => {
|
|
const getDetailList = () => {
|
|
|
const params = {
|
|
const params = {
|
|
|
- farmId: 766,
|
|
|
|
|
- flowStatus: 0,
|
|
|
|
|
- limit: 1,
|
|
|
|
|
- page: 1,
|
|
|
|
|
|
|
+ ...paramsPage.value,
|
|
|
|
|
+ flowStatus: '4,5',
|
|
|
};
|
|
};
|
|
|
VE_API.user.getDetailList(params).then(({ data }) => {
|
|
VE_API.user.getDetailList(params).then(({ data }) => {
|
|
|
detailList.value = data || [];
|
|
detailList.value = data || [];
|
|
@@ -199,6 +207,15 @@ const getFutureFarmWorkList = () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const getFarmPastServiceCost = () => {
|
|
|
|
|
+ VE_API.user.getFarmPastServiceCost({ farmId: farmIdVal.value }).then(({ data }) => {
|
|
|
|
|
+ serviceStatsData.value = [
|
|
|
|
|
+ { value: data.totalCost, unit: "元", desc: "总收益" },
|
|
|
|
|
+ { value: data.totalCost, unit: "元", desc: "投入成本" },
|
|
|
|
|
+ { value: data.serviceCount, unit: "次", desc: "服务次数" },
|
|
|
|
|
+ ];
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
const handleDetail = (path) => {
|
|
const handleDetail = (path) => {
|
|
|
router.push(`/${path}?farmId=${farmIdVal.value}`);
|
|
router.push(`/${path}?farmId=${farmIdVal.value}`);
|
|
|
};
|
|
};
|
|
@@ -266,8 +283,10 @@ const handleDetail = (path) => {
|
|
|
gap: 5px;
|
|
gap: 5px;
|
|
|
img {
|
|
img {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
|
+ max-width: 105px;
|
|
|
height: 105px;
|
|
height: 105px;
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
|
|
|
+ object-fit: cover;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.content-section {
|
|
.content-section {
|
|
@@ -312,6 +331,11 @@ const handleDetail = (path) => {
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .empty-state {
|
|
|
|
|
+ ::v-deep .van-empty {
|
|
|
|
|
+ padding: 40px 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|