|
|
@@ -19,9 +19,10 @@
|
|
|
title-mode="default"
|
|
|
:title-right-text="farmServiceActiveTab === 0 ? '生成成果报告' : ''"
|
|
|
:title-right-type="farmServiceActiveTab === 1 ? 'dot' : null"
|
|
|
- :title-right-dot-text="farmServiceActiveTab === 1 ? '2区' : ''"
|
|
|
+ :title-right-dot-text="farmServiceActiveTab === 1 ? '全区' : ''"
|
|
|
class="recipe-item"
|
|
|
@titleRightClick="handleTitleRightClick"
|
|
|
+ @click="handleClick(section)"
|
|
|
/>
|
|
|
<empty
|
|
|
v-show="detailList.length === 0"
|
|
|
@@ -48,8 +49,11 @@ const farmIdVal = ref(null);
|
|
|
const router = useRouter();
|
|
|
onMounted(() => {
|
|
|
farmIdVal.value = route.query.farmId;
|
|
|
- getDetailList();
|
|
|
- getFarmPastServiceCost();
|
|
|
+ if(sessionStorage.getItem("activeSection")){
|
|
|
+ farmServiceActiveTab.value = Number(sessionStorage.getItem("activeSection"));
|
|
|
+ sessionStorage.removeItem("activeSection");
|
|
|
+ }
|
|
|
+ handleFarmServiceTabChange(farmServiceActiveTab.value);
|
|
|
});
|
|
|
|
|
|
const farmServiceTabs = ["过往服务", "未来服务"];
|
|
|
@@ -61,7 +65,6 @@ const handleFarmServiceTabChange = (index) => {
|
|
|
getFarmPastServiceCost();
|
|
|
getDetailList();
|
|
|
} else {
|
|
|
- getFutureFarmWorkList();
|
|
|
getFutureFarmWorkWarning()
|
|
|
}
|
|
|
};
|
|
|
@@ -76,26 +79,15 @@ const getFutureFarmWorkWarning = async () => {
|
|
|
{ value: totalCost || 0, unit: "元", desc: "预计成交额" },
|
|
|
{ value: data.length || 0, unit: "次", desc: "预计服务次数" },
|
|
|
];
|
|
|
+ detailList.value = data || [];
|
|
|
};
|
|
|
|
|
|
-const paramsPage = ref(1);
|
|
|
-const paramsLimit = ref(99);
|
|
|
const detailList = ref([]);
|
|
|
const getDetailList = () => {
|
|
|
VE_API.user.farmServiceRecord({ farmId: farmIdVal.value }).then(({ data }) => {
|
|
|
detailList.value = data || [];
|
|
|
});
|
|
|
};
|
|
|
-const getFutureFarmWorkList = () => {
|
|
|
- const params = {
|
|
|
- farmId: farmIdVal.value,
|
|
|
- limit: paramsLimit.value,
|
|
|
- page: paramsPage.value,
|
|
|
- };
|
|
|
- VE_API.user.getFutureFarmWorkList(params).then(({ data }) => {
|
|
|
- detailList.value = data || [];
|
|
|
- });
|
|
|
-};
|
|
|
|
|
|
const getFarmPastServiceCost = () => {
|
|
|
VE_API.user.getFarmPastServiceCost({ farmId: farmIdVal.value }).then(({ data }) => {
|
|
|
@@ -112,6 +104,21 @@ const handleTitleRightClick = (section) => {
|
|
|
query: { miniJson: JSON.stringify({ id: section.id }) },
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const handleClick = (section) => {
|
|
|
+ sessionStorage.setItem("activeSection", farmServiceActiveTab.value);
|
|
|
+ if(farmServiceActiveTab.value === 0){
|
|
|
+ router.push({
|
|
|
+ path: "/review_work",
|
|
|
+ query: { miniJson: JSON.stringify({ id: section.id }) },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ router.push({
|
|
|
+ path: "/detail_work",
|
|
|
+ query: { miniJson: JSON.stringify({ id: section.farmWorkId,arrangeId: section.arrangeId,farmId: farmIdVal.value }) },
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|