|
@@ -79,7 +79,7 @@
|
|
|
<div class="desc">
|
|
|
{{ prescriptioData.expertPrescription || prescriptioData.weatherWarningMsg }}
|
|
|
</div>
|
|
|
- <div class="prescription-item" v-if="progress === 0 && ROLETYPE == '3' && dynamicValidateForm.prescriptionList && dynamicValidateForm.prescriptionList.length && dynamicValidateForm.prescriptionList[0].pesticideFertilizerList.length">
|
|
|
+ <div class="prescription-item" v-if="progress === 0 && ROLETYPE == '3' && !allPesticideFertilizerListsEmpty">
|
|
|
<div class="usageMode-wrap">
|
|
|
<div class="box-item">
|
|
|
<div class="form-l">施用方式</div>
|
|
@@ -263,7 +263,7 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div class="prescription-item" v-else v-show="prescriptioData.prescriptionList && prescriptioData.prescriptionList.length && prescriptioData.prescriptionList[0].pesticideFertilizerList.length">
|
|
|
+ <div class="prescription-item" v-else v-show="!allPesticideFertilizerListsEmpty">
|
|
|
<div class="sub-title">
|
|
|
<div class="sub-name">药物处方</div>
|
|
|
</div>
|
|
@@ -420,7 +420,7 @@
|
|
|
<script setup>
|
|
|
import eventBus from "@/api/eventBus";
|
|
|
import chart from "./chart.vue";
|
|
|
-import { onActivated, onMounted, reactive, ref } from "vue";
|
|
|
+import { computed, onMounted, reactive, ref } from "vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { useStore } from "vuex";
|
|
|
import ExecuteBlueRegion from "./executeBlueRegion";
|
|
@@ -468,6 +468,22 @@ onMounted(() => {
|
|
|
infoItem.value = props.prescriptioData;
|
|
|
});
|
|
|
|
|
|
+const allPesticideFertilizerListsEmpty = computed(() => {
|
|
|
+ // prescriptioData.prescriptionList[0].pesticideFertilizerList
|
|
|
+ // 遍历 prescriptionList 数组
|
|
|
+ return props.prescriptioData.prescriptionList.every((item) => {
|
|
|
+ // 检查 pesticideFertilizerList 是否为空数组或每个对象都为空
|
|
|
+ return (
|
|
|
+ !item.pesticideFertilizerList.length ||
|
|
|
+ item.pesticideFertilizerList.every(
|
|
|
+ (subItem) =>
|
|
|
+ // 假设每个子对象需要某种条件来判断是否为空,这里假设对象没有属性即为空
|
|
|
+ Object.keys(subItem).length === 0
|
|
|
+ )
|
|
|
+ );
|
|
|
+ });
|
|
|
+});
|
|
|
+
|
|
|
// 表单
|
|
|
const formRef = ref();
|
|
|
const dynamicValidateForm = reactive({
|