|
|
@@ -60,8 +60,8 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 勾选区域引导弹窗 -->
|
|
|
- <select-region-popup v-model:show="showSelectRegionPopup" :image="selectRegionImage" :title="titlePopup"
|
|
|
- sub-title="精准匹配农情信息,高效管理分区" @confirm="handleGoSelectRegion" @skip="handleSkipSelectRegion" />
|
|
|
+ <select-region-popup v-model:show="showSelectRegionPopup" :title="titlePopup" @confirm="handleGoSelectRegion"
|
|
|
+ @skip="handleSkipSelectRegion" />
|
|
|
|
|
|
<!-- 农事执行弹窗 -->
|
|
|
<agri-execute-popup ref="agriExecutePopupRef" />
|
|
|
@@ -94,7 +94,7 @@ const agriExecutePopupRef = ref(null);
|
|
|
const varietyTabs = ref([]);
|
|
|
const activeVariety = ref(0);
|
|
|
|
|
|
-const getVarietyTabs = async () => {
|
|
|
+const getVarietyTabs = async (isShowPopup = true) => {
|
|
|
if (!gardenId.value) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -104,8 +104,10 @@ const getVarietyTabs = async () => {
|
|
|
});
|
|
|
varietyTabs.value = res.data || []
|
|
|
if (varietyTabs.value.length > 0) {
|
|
|
- handleVarietyClick(varietyTabs.value[0], 0)
|
|
|
- agriExecutePopupRef.value.showPopup(varietyTabs.value[activeVariety.value].farmId);
|
|
|
+ handleVarietyClick(varietyTabs.value[activeVariety.value], activeVariety.value)
|
|
|
+ if(isShowPopup) {
|
|
|
+ agriExecutePopupRef.value.showPopup(varietyTabs.value[activeVariety.value].farmId);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error("获取主体分区列表失败:", error);
|
|
|
@@ -115,12 +117,13 @@ const getVarietyTabs = async () => {
|
|
|
const farmIdData = ref(null);
|
|
|
const regionData = ref(null);
|
|
|
const titlePopup = ref("");
|
|
|
+const currentVariety = ref(null);
|
|
|
const handleVarietyClick = (tab, index) => {
|
|
|
- console.log(tab, 'tab');
|
|
|
activeVariety.value = index;
|
|
|
farmIdData.value = tab.farmId;
|
|
|
regionData.value = tab.regionId;
|
|
|
- if(tab.lastViewTime == null) {
|
|
|
+ currentVariety.value = tab;
|
|
|
+ if (tab.lastViewTime == null) {
|
|
|
titlePopup.value = `勾选 ${tab.regionName} 区域`;
|
|
|
showSelectRegionPopup.value = true;
|
|
|
}
|
|
|
@@ -129,19 +132,29 @@ const handleVarietyClick = (tab, index) => {
|
|
|
const date = ref(new Date());
|
|
|
|
|
|
const showSelectRegionPopup = ref(false);
|
|
|
-const selectRegionImage = ref("");
|
|
|
|
|
|
const handleAddVariety = () => {
|
|
|
router.push("/interaction?addVariety=true&subjectId=" + gardenId.value);
|
|
|
};
|
|
|
|
|
|
const handleSkipSelectRegion = () => {
|
|
|
- showSelectRegionPopup.value = false;
|
|
|
+ VE_API.basic_farm.updateLastViewTime({
|
|
|
+ regionId: currentVariety.value.regionId,
|
|
|
+ }).then(() => {
|
|
|
+ showSelectRegionPopup.value = false;
|
|
|
+ getVarietyTabs(false);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleGoSelectRegion = () => {
|
|
|
showSelectRegionPopup.value = false;
|
|
|
- router.push("/draw_area");
|
|
|
+ router.push({
|
|
|
+ path: "/draw_area",
|
|
|
+ query: {
|
|
|
+ subjectId: gardenId.value,
|
|
|
+ varietyId: currentVariety.value.typeId
|
|
|
+ },
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const showFarmPopup = ref(false); // 农场领取成功弹窗
|