|
@@ -91,9 +91,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 农事信息弹窗 -->
|
|
<!-- 农事信息弹窗 -->
|
|
|
- <detail-dialog ref="detailDialogRef"></detail-dialog>
|
|
|
|
|
|
|
+ <detail-dialog ref="detailDialogRef" @triggerFarmWork="triggerFarmWork"></detail-dialog>
|
|
|
<!-- 新增:激活上传弹窗 -->
|
|
<!-- 新增:激活上传弹窗 -->
|
|
|
- <active-upload-popup></active-upload-popup>
|
|
|
|
|
|
|
+ <active-upload-popup @handleUploadSuccess="getFarmWorkPlan"></active-upload-popup>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -101,6 +101,7 @@ import { reactive, ref, onMounted, computed } from "vue";
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import detailDialog from "@/components/detailDialog.vue";
|
|
import detailDialog from "@/components/detailDialog.vue";
|
|
|
|
|
+import eventBus from "@/api/eventBus";
|
|
|
import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
|
|
import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
|
|
|
import { SuccessFilled, WarningFilled } from "@element-plus/icons-vue";
|
|
import { SuccessFilled, WarningFilled } from "@element-plus/icons-vue";
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -161,19 +162,6 @@ const getFarmWorkPlan = () => {
|
|
|
reproductiveList: Array.isArray(it.reproductiveList) ? it.reproductiveList : [],
|
|
reproductiveList: Array.isArray(it.reproductiveList) ? it.reproductiveList : [],
|
|
|
}))
|
|
}))
|
|
|
: [];
|
|
: [];
|
|
|
-
|
|
|
|
|
- // // 测试数据:补充完成/预警案例以展示样式
|
|
|
|
|
- // if (phenologyList.value.length > 0) {
|
|
|
|
|
- // const rlist = phenologyList.value[0]?.reproductiveList;
|
|
|
|
|
- // if (Array.isArray(rlist) && rlist.length > 0) {
|
|
|
|
|
- // const first = rlist[0];
|
|
|
|
|
- // if (!Array.isArray(first.farmWorkArrangeList)) first.farmWorkArrangeList = [];
|
|
|
|
|
- // first.farmWorkArrangeList.push(
|
|
|
|
|
- // { id: "test-complete", farmWorkName: "测试完成", farmWorkType: 5 },
|
|
|
|
|
- // { id: "test-warning", farmWorkName: "测试预警", farmWorkType: 6 }
|
|
|
|
|
- // );
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
@@ -191,9 +179,17 @@ const addNewTask = () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const triggerFarmWork = () =>{
|
|
|
|
|
+ eventBus.emit("activeUpload:show", {
|
|
|
|
|
+ gardenIdVal: route.query.farmId,
|
|
|
|
|
+ problemTitleVal: curFarmObj.value.farmWorkName,
|
|
|
|
|
+ arrangeIdVal: curFarmObj.value.id,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+const curFarmObj = ref({});
|
|
|
const handleRowClick = (item) => {
|
|
const handleRowClick = (item) => {
|
|
|
- console.log("item", item);
|
|
|
|
|
|
|
+ curFarmObj.value = item;
|
|
|
// 0:默认,1-4:正常,5:完成,6:预警
|
|
// 0:默认,1-4:正常,5:完成,6:预警
|
|
|
if (item.flowStatus === 5) {
|
|
if (item.flowStatus === 5) {
|
|
|
router.push({
|
|
router.push({
|
|
@@ -204,7 +200,7 @@ const handleRowClick = (item) => {
|
|
|
});
|
|
});
|
|
|
} else if (item.flowStatus === null) {
|
|
} else if (item.flowStatus === null) {
|
|
|
detailDialogRef.value.showDialog(item.farmWorkId);
|
|
detailDialogRef.value.showDialog(item.farmWorkId);
|
|
|
- } else if (item.flowStatus === 6 || item.flowStatus < 5 && item.flowStatus >= 0) {
|
|
|
|
|
|
|
+ } else if (item.flowStatus === 6 || (item.flowStatus < 5 && item.flowStatus >= 0)) {
|
|
|
router.push({
|
|
router.push({
|
|
|
path: "/completed_work",
|
|
path: "/completed_work",
|
|
|
query: {
|
|
query: {
|