|
|
@@ -1,28 +1,32 @@
|
|
|
<template>
|
|
|
<div class="work-detail">
|
|
|
- <custom-header :name="$t('workDetail.title')" v-if="!miniJson?.hideDraw" :showClose="false" isGoBack @goback="handleBack" />
|
|
|
+ <custom-header :name="$t('workDetail.title')" v-if="!miniJson?.hideDraw" :showClose="false" isGoBack
|
|
|
+ @goback="handleBack" />
|
|
|
|
|
|
<div class="work-detail-content">
|
|
|
<!-- 顶部状态 -->
|
|
|
- <div class="content-status" :class="['status-' + farmData?.work_status]">
|
|
|
+ <div class="content-status" :style="getContentStatusStyle(farmData)">
|
|
|
<div class="status-l">
|
|
|
- <div class="status-title">{{ farmData.work_name }}</div>
|
|
|
- <!-- <div class="status-sub" v-if="triggerDateText && (detail?.flowStatus == -1 || detail?.flowStatus == -2)">
|
|
|
- 执行时间已经过去 {{ Math.abs(daysDiff) }} 天了
|
|
|
+ <div class="status-title">
|
|
|
+ <span>{{ farmData.work_name }}</span>
|
|
|
+ <div class="status-tag" :style="statusTagStyle[farmData?.farm_work_type]">{{ farmWorkTypeObj[farmData?.farm_work_type] }}</div>
|
|
|
</div>
|
|
|
- <div class="status-sub" v-if="detail?.flowStatus === 3 && getAuditStatusPriority(detail?.executeEvidenceAuditStatus) !== 2">
|
|
|
- 04/19 执行最佳
|
|
|
+ <div class="status-hint-card" v-if="farmData?.work_status === 0">
|
|
|
+ <div class="status-hint-text">{{ farmData?.best_time }}</div>
|
|
|
+ <div class="status-hint-question">
|
|
|
+ <el-icon class="status-hint-link-icon">
|
|
|
+ <Link />
|
|
|
+ </el-icon>
|
|
|
+ <span class="status-hint-question-text">{{ farmData.interaction_issue }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="status-sub" v-if="!detail?.flowStatus || detail?.flowStatus === 0">
|
|
|
- 预计{{ detail?.executeDate || "--" }}执行,执行时间需巡园校准
|
|
|
- </div> -->
|
|
|
- <div class="status-sub">
|
|
|
+ <div class="status-sub" :style="getFarmWorkTypeColorStyle(farmData)" v-else>
|
|
|
{{ farmData.best_time }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="work-wrap has-bottom warning-info-show">
|
|
|
+ <div class="work-wrap has-bottom" :style="farmData.work_status === 0 ? 'margin-top: 35px;' : ''">
|
|
|
<!-- 农事组信息 -->
|
|
|
<div class="group-info group-box" v-if="farmData.interaction_reason">
|
|
|
<div class="group-name">
|
|
|
@@ -30,131 +34,22 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 每一段农事 -->
|
|
|
- <!-- <div v-for="(prescription, index) in stageList" :key="index" class="box-wrap stage-card">
|
|
|
- <div class="work-info">
|
|
|
- <div class="stage-header">
|
|
|
- <div class="stage-title">{{ detail.farmWorkName }}</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="stage-info">
|
|
|
- <div class="form-item">
|
|
|
- <div class="item-name">{{ $t('workDetail.purpose') }}</div>
|
|
|
- <div class="item-text">
|
|
|
- {{ prescription.purpose || prescription.purposeName || "--" }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-item">
|
|
|
- <div class="item-name">{{ $t('农事时间') }}</div>
|
|
|
- <div class="item-text">
|
|
|
- {{ detail.executeDate || "--" }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-item">
|
|
|
- <div class="item-name">{{ $t('执行区域') }}</div>
|
|
|
- <div class="item-text light-text area-text">
|
|
|
- {{ detail?.executionRegion?.regionName }}种植区域
|
|
|
- <div class="area-btn" v-if="detail?.executionRegion?.regionRange" @click="handleViewArea">{{ $t('查看区域') }}</div>
|
|
|
- <div class="area-btn area-btn-right" @click="toDraw" v-if="!detail?.executionRegion?.regionRange && !miniJson?.hideDraw">{{ $t('建议勾选') }}<el-icon><ArrowRight /></el-icon></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-item">
|
|
|
- <div class="item-name">{{ $t('workDetail.notes') }}</div>
|
|
|
- <div class="item-text">
|
|
|
- {{ detail.remark || "--" }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-item" v-if="hasAnyAvailableExecutionMethod(prescription)">
|
|
|
- <div class="item-name">{{ $t('药肥处方') }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="stage-tabs" v-if="hasAnyAvailableExecutionMethod(prescription)">
|
|
|
- <div v-for="tab in getAvailableExecutionTabs(prescription)" :key="tab.value" class="tab-pill"
|
|
|
- :class="{ active: getStageExecutionMethod(index) === tab.value }"
|
|
|
- @click="changeExecutionMethod(index, tab.value)">
|
|
|
- {{ tab.label }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="prescription-wrap"
|
|
|
- v-if="prescription.pesticideList && prescription.pesticideList.length && hasAnyAvailableExecutionMethod(prescription)">
|
|
|
- <div class="prescription-table">
|
|
|
- <div class="table-header">
|
|
|
- <div class="col col-type">{{ $t('使用功效') }}</div>
|
|
|
- <div class="col col-name">{{ $t('药肥名称') }}</div>
|
|
|
- <div class="col col-ratio">{{ $t('药肥配比') }}</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-for="(item, i) in prescription.pesticideList" :key="i" class="table-row">
|
|
|
- <div class="col col-type">
|
|
|
- {{ item.typeName || "--" }}
|
|
|
- </div>
|
|
|
- <div class="col col-name">
|
|
|
- {{ item.name || item.pesticideFertilizerName || "--" }}
|
|
|
- </div>
|
|
|
- <div class="col col-ratio">
|
|
|
- {{ getPesticideParam(item, index)?.ratio || "--" }}倍
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-if="hasRemark(prescription, index)" class="prescription-remark">
|
|
|
- <span v-for="(item, idx) in [prescription.pesticideList[0]]" :key="idx">
|
|
|
- <template v-if="getParamRemark(item, index)">
|
|
|
- {{ getParamRemark(item, index) }}
|
|
|
- <br />
|
|
|
- </template>
|
|
|
-</span>
|
|
|
-</div>
|
|
|
-</div>
|
|
|
-</div>
|
|
|
-
|
|
|
-
|
|
|
-<div class="work-info photo-box" v-if="prescription.cropAlbum && prescription.cropAlbum.length">
|
|
|
- <div class="photo-title">{{ $t('农事凭证') }}</div>
|
|
|
- <div class="tips-text" v-if="detail?.imageAuditRejectReason">{{ detail?.imageAuditRejectReason }}</div>
|
|
|
- <div class="photo-sub-title" v-if="info?.appType === 1">来自于 {{ detail?.executorOrganizationName || "--" }}</div>
|
|
|
- <div class="photo-img-wrap">
|
|
|
- <photo-provider :photo-closable="true">
|
|
|
- <photo-consumer v-for="(src, index) in prescription.cropAlbum" intro="农事凭证" :key="index"
|
|
|
- :src="base_img_url2 + src.filename">
|
|
|
- <div class="photo-img">
|
|
|
- <img :src="base_img_url2 + src.filename" />
|
|
|
- <div class="fail-icon" v-if="failIndex(index) === 2">
|
|
|
- <el-icon size="24" color="#FF953D">
|
|
|
- <WarningFilled />
|
|
|
- </el-icon>
|
|
|
- <div class="fail-icon-text">{{ $t('审核失败') }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </photo-consumer>
|
|
|
- </photo-provider>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-</div> -->
|
|
|
-
|
|
|
-
|
|
|
<div class="box-wrap stage-card">
|
|
|
<div class="work-info">
|
|
|
- <div class="map-box">
|
|
|
+ <div class="map-box" @click="handleViewArea">
|
|
|
<div class="map-title">{{ $t('workDetail.executionArea') }}</div>
|
|
|
<div class="map-container" ref="mapContainer"></div>
|
|
|
</div>
|
|
|
<div class="area-list">
|
|
|
- <div
|
|
|
- v-for="(zone, zoneIndex) in farmZones"
|
|
|
- :key="`${zone.zone_name || 'zone'}-${zoneIndex}`"
|
|
|
- class="area-item"
|
|
|
- >
|
|
|
+ <div v-for="(zone, zoneIndex) in farmZones"
|
|
|
+ :key="`${zone.zone_name || 'zone'}-${zoneIndex}`" class="area-item">
|
|
|
<div class="area-l">
|
|
|
{{ zone.zone_name }}
|
|
|
<span> {{ zone.execute_time }}</span>
|
|
|
- <span
|
|
|
- class="area-tag"
|
|
|
- :style="backgroundFarmWorkStatus(farmData.work_status)"
|
|
|
- >{{ workStatusObj[farmData.work_status] }}</span>
|
|
|
+ <span class="area-tag" :style="backgroundFarmWorkStatus(farmData.work_status)">{{
|
|
|
+ workStatusObj[farmData.work_status] }}</span>
|
|
|
</div>
|
|
|
+ <div class="area-r" :style="{background:farmData?.work_status === 6 ? '#37C11B' : '#2199F8'}">{{ farmData?.work_status === 6 ? '溯源认证' : '我已完成' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <div class="ecological-plant-card">
|
|
|
@@ -181,7 +76,8 @@
|
|
|
<div class="info-value">{{ farmData.work_reason_detail }}</div>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
|
- <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.purpose') }}</div>
|
|
|
+ <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.purpose') }}
|
|
|
+ </div>
|
|
|
<div class="info-value">{{ farmData.work_purpose }}</div>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
|
@@ -189,11 +85,13 @@
|
|
|
<div class="info-value">{{ farmData.precautions }}</div>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
|
- <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.prescription') }}</div>
|
|
|
+ <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.prescription') }}
|
|
|
+ </div>
|
|
|
<div class="info-value">{{ farmData.drug_prescription }}</div>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
|
- <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.executionMethod') }}</div>
|
|
|
+ <div class="info-title"><span class="title-block"></span>{{ $t('workDetail.executionMethod')
|
|
|
+ }}</div>
|
|
|
<div class="info-value">{{ farmData.execution_method }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -211,26 +109,16 @@
|
|
|
</div> -->
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
- <!-- <div class="fixed-btn-wrap center-btn" v-if="info?.appType === 2">
|
|
|
- <div class="fixed-btn" @click="handleConvert">
|
|
|
- 转发农事
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="fixed-btn-wrap execute-action">
|
|
|
+ <!-- <div class="fixed-btn-wrap execute-action">
|
|
|
<div class="action-item second" v-if="!miniJson?.hideDraw" @click="handleConvert">{{ $t('转发给执行人员') }}</div>
|
|
|
</div> -->
|
|
|
+
|
|
|
<!-- <div class="action-item primary" @click="handleExecute">{{ $t('溯源认证') }}</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<ExecutePopup ref="executePopupRef" @executeSuccess="getDetail" />
|
|
|
-
|
|
|
<upload-tips v-model:show="showUploadTipsPopup" />
|
|
|
</div>
|
|
|
- <!-- 执行区域地图弹窗 -->
|
|
|
- <popup v-model:show="showMapPopup" closeable class="map-popup">
|
|
|
- <map-info :rangeWkt="detail?.executionRegion?.regionRange" />
|
|
|
- </popup>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -244,23 +132,14 @@ import { formatDate } from "@/common/commonFun";
|
|
|
import ExecutePopup from "./components/executePopup.vue";
|
|
|
import { base_img_url2 } from "@/api/config";
|
|
|
import UploadTips from "@/components/popup/uploadTips.vue";
|
|
|
-import { Popup } from "vant";
|
|
|
-import MapInfo from "./components/mapInfo.vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import AreaMap from "./components/areaMap.js";
|
|
|
import WKT from "ol/format/WKT.js";
|
|
|
import { time } from "echarts";
|
|
|
-import imgFq1 from "@/assets/img/common/fq-1.png";
|
|
|
-import imgFq2 from "@/assets/img/common/fq-2.png";
|
|
|
-import imgYz1 from "@/assets/img/common/yz-1.png";
|
|
|
-import imgYz2 from "@/assets/img/common/yz-2.png";
|
|
|
-import imgJf1 from "@/assets/img/common/jf-1.png";
|
|
|
-import imgJf2 from "@/assets/img/common/jf-2.png";
|
|
|
|
|
|
const route = useRoute();
|
|
|
const { locale } = useI18n();
|
|
|
const showUploadTipsPopup = ref(false);
|
|
|
-const headerTitle = ref('');
|
|
|
const router = useRouter();
|
|
|
// const info = JSON.parse(localStorage.getItem("localUserInfo") || "{}");
|
|
|
const info = { appType: 1 };
|
|
|
@@ -318,13 +197,6 @@ onMounted(() => {
|
|
|
});
|
|
|
|
|
|
const miniJson = ref(null);
|
|
|
-/** 生态种植卡片:方式文案(可后续接接口字段) */
|
|
|
-const ecologicalPlantingMethodText = ref("某某方式");
|
|
|
-/** 与设计稿一致的四宫格示例图 */
|
|
|
-const ecologicalPlantThumbUrls = ref([imgFq1, imgFq2]);
|
|
|
-const ecologicalExecutorOrg = computed(
|
|
|
- () => detail.value?.executorOrganizationName || "某某某农资机构"
|
|
|
-);
|
|
|
const farmData = ref({});
|
|
|
|
|
|
const wktFmt = new WKT();
|
|
|
@@ -377,26 +249,12 @@ onBeforeUnmount(() => {
|
|
|
});
|
|
|
|
|
|
onActivated(() => {
|
|
|
- headerTitle.value = route.query?.title || '返青追肥';
|
|
|
- if (headerTitle.value === '返青追肥') {
|
|
|
- ecologicalPlantThumbUrls.value = [imgFq1, imgFq2]
|
|
|
- } else if (headerTitle.value === '移栽防治') {
|
|
|
- ecologicalPlantThumbUrls.value = [imgYz1, imgYz2]
|
|
|
- } else {
|
|
|
- ecologicalPlantThumbUrls.value = [imgJf1, imgJf2]
|
|
|
- }
|
|
|
- // if (route.query?.miniJson) {
|
|
|
- // const miniJsonObj = JSON.parse(route.query.miniJson);
|
|
|
- // miniJson.value = JSON.parse(miniJsonObj.paramsPage);
|
|
|
- // } else {
|
|
|
- // miniJson.value = null;
|
|
|
- // }
|
|
|
getDetail();
|
|
|
});
|
|
|
|
|
|
const workStatusObj = {
|
|
|
- 0: "待校准",
|
|
|
- 1: "机动执行",
|
|
|
+ 0: "时间待校准",
|
|
|
+ 1: "触发待巡园",
|
|
|
2: "待执行",
|
|
|
3: "未激活",
|
|
|
4: "已认证",
|
|
|
@@ -404,16 +262,24 @@ const workStatusObj = {
|
|
|
6: "已执行",
|
|
|
}
|
|
|
|
|
|
+const farmWorkTypeObj = {
|
|
|
+ 1: "标准农事",
|
|
|
+ 2: "机动农事",
|
|
|
+ 3: "气象预警农事",
|
|
|
+ 4: "气象恢复农事",
|
|
|
+ 5: "异常农事",
|
|
|
+ 6: "标准施肥类",
|
|
|
+ 7: "标准防治类",
|
|
|
+ 8: "标准调节类",
|
|
|
+}
|
|
|
+
|
|
|
const backgroundFarmWorkStatus = (status) => {
|
|
|
let background = 'rgba(33, 153, 248, 0.1)';
|
|
|
let color = '#2199F8';
|
|
|
- if (status === 0 || status === 1) {
|
|
|
- background = 'rgba(255, 149, 61, 0.1)';
|
|
|
- color = '#FF953D';
|
|
|
- }else if (status === 4) {
|
|
|
+ if (status === 6 || status === 4) {
|
|
|
background = 'rgba(55, 193, 27, 0.1)';
|
|
|
color = '#37C11B';
|
|
|
- }else if (status === 3 || status === 5) {
|
|
|
+ } else if (status === 3 || status === 5) {
|
|
|
background = 'rgba(98, 98, 98, 0.1)';
|
|
|
color = '#626262';
|
|
|
}
|
|
|
@@ -431,51 +297,45 @@ const getDetail = () => {
|
|
|
initWorkDetailMap();
|
|
|
}
|
|
|
})
|
|
|
- // if (!miniJson.value) return;
|
|
|
- // const { farmWorkLibId, farmId, recordId, reproductiveId } = miniJson.value;
|
|
|
- // VE_API.z_farm_work_record
|
|
|
- // .getDetailById({ farmWorkLibId, farmId, farmWorkRecordId: recordId, reproductiveId })
|
|
|
- // .then(({ data }) => {
|
|
|
- // const inner =
|
|
|
- // data?.detail && typeof data.detail === "object"
|
|
|
- // ? { ...data.detail }
|
|
|
- // : {};
|
|
|
- // detail.value = {
|
|
|
- // ...inner,
|
|
|
- // post: data?.post ?? null,
|
|
|
- // executionRegion: data?.executionRegion ?? null,
|
|
|
- // expertNameFromFarmBasicInfo:
|
|
|
- // data?.expertNameFromFarmBasicInfo ?? "",
|
|
|
- // rangeWkt: data?.rangeWkt ?? null,
|
|
|
- // };
|
|
|
-
|
|
|
- // // 地图
|
|
|
- // areaMap.initMap("POINT(113.1093017627431 22.57454083668)", mapContainer.value);
|
|
|
- // });
|
|
|
};
|
|
|
|
|
|
-watch(locale, () => {
|
|
|
- getDetail();
|
|
|
-});
|
|
|
-
|
|
|
-// 计算距离执行时间的天数差
|
|
|
-const daysDiff = computed(() => {
|
|
|
- if (!detail.value?.executeDate) {
|
|
|
- return '--';
|
|
|
- }
|
|
|
-
|
|
|
- const executeDate = new Date(detail.value.executeDate);
|
|
|
- const today = new Date();
|
|
|
-
|
|
|
- // 将时间设置为 00:00:00,只比较日期
|
|
|
- executeDate.setHours(0, 0, 0, 0);
|
|
|
- today.setHours(0, 0, 0, 0);
|
|
|
+const handleExecute = () => {
|
|
|
+ // const today = new Date();
|
|
|
+ // const executeDate = new Date(detail.value.executeDate);
|
|
|
+ // if (executeDate.getTime() > today.getTime()) {
|
|
|
+ // ElMessage.warning('未到农事执行时间,无法溯源认证');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ const evidenceList = normalizeCropAlbum(
|
|
|
+ detail.value?.confirmPicture?.length
|
|
|
+ ? detail.value.confirmPicture
|
|
|
+ : detail.value.executeEvidence
|
|
|
+ ).map((item) => item.filename);
|
|
|
+ const auditStatusList = Array.isArray(detail.value?.executeEvidenceAuditStatus)
|
|
|
+ ? detail.value.executeEvidenceAuditStatus
|
|
|
+ : [];
|
|
|
|
|
|
- // 计算天数差(毫秒转天数)
|
|
|
- const diffTime = executeDate.getTime() - today.getTime();
|
|
|
- const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
|
|
+ let imgs = []
|
|
|
+ evidenceList.forEach((item, index) => {
|
|
|
+ imgs.push({
|
|
|
+ url: base_img_url2 + item,
|
|
|
+ filePath: item,
|
|
|
+ status: auditStatusList[index] === 2 ? 'failed' : 'success',
|
|
|
+ message: auditStatusList[index] === 2 ? '审核失败' : '审核成功',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ console.log("evideimgsnceList", imgs);
|
|
|
+ const isEdit = evidenceList?.length > 0 ? true : false;
|
|
|
+ executePopupRef.value.openPopup(miniJson.value.recordId, {
|
|
|
+ evidenceList: imgs,
|
|
|
+ isEdit: isEdit,
|
|
|
+ executeDate: detail.value.executeDate,
|
|
|
+ executorOrganizationName: detail.value.executorOrganizationName,
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
- return diffDays;
|
|
|
+watch(locale, () => {
|
|
|
+ getDetail();
|
|
|
});
|
|
|
|
|
|
// 执行方式 Tab 配置
|
|
|
@@ -510,16 +370,59 @@ const getAvailableExecutionTabs = (prescription) => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-const hasAnyAvailableExecutionMethod = (prescription) => {
|
|
|
- return getAvailableExecutionTabs(prescription).length > 0;
|
|
|
+const statusTagStyle = {
|
|
|
+ 3: {
|
|
|
+ color: '#FF953D',
|
|
|
+ },
|
|
|
+ 4: {
|
|
|
+ color: '#FF953D',
|
|
|
+ },
|
|
|
+ 5: {
|
|
|
+ color: '#FF6A6A',
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
+const getFarmWorkTypeColorStyle = (farmData) => {
|
|
|
+ const type = Number(farmData?.farm_work_type);
|
|
|
+ const status = Number(farmData?.work_status);
|
|
|
+ let color = '#2199F8';
|
|
|
+ if (status === 2) {
|
|
|
+ if(type === 3 || type === 4) {
|
|
|
+ color = '#FF943D';
|
|
|
+ } else if(type === 5) {
|
|
|
+ color = '#FF6A6A';
|
|
|
+ } else {
|
|
|
+ color = '#2199F8';
|
|
|
+ }
|
|
|
+ }else if (status === 3) {
|
|
|
+ color = 'rgba(62, 61, 61, 0.8)';
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ color,
|
|
|
+ };
|
|
|
+};
|
|
|
|
|
|
-const triggerDateText = computed(() => {
|
|
|
- if (!detail.value.executeDate) return "";
|
|
|
- const d = formatDate(detail.value.executeDate);
|
|
|
- return d.replace(/-/g, ".");
|
|
|
-});
|
|
|
+/** 顶部 content-status 背景色(::after 通过 CSS 变量读取) */
|
|
|
+const getContentStatusStyle = (farmData) => {
|
|
|
+ const type = Number(farmData?.farm_work_type);// 农事类型
|
|
|
+ const status = Number(farmData?.work_status);// 农事状态
|
|
|
+ let background = '#2199F8';
|
|
|
+
|
|
|
+ if (status === 2) {
|
|
|
+ if(type === 3 || type === 4) {
|
|
|
+ background = '#FF943D';
|
|
|
+ } else if(type === 5) {
|
|
|
+ background = '#FF6A6A';
|
|
|
+ } else {
|
|
|
+ background = '#2199F8';
|
|
|
+ }
|
|
|
+ } else if (status === 3) {
|
|
|
+ background = '#C7C7C7';
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ "--content-status-bg": background,
|
|
|
+ };
|
|
|
+};
|
|
|
|
|
|
/**
|
|
|
* 展示用「分段」列表:detail.pesticideList 或 prescriptionList 推导
|
|
|
@@ -546,103 +449,13 @@ const stageList = computed(() => {
|
|
|
});
|
|
|
|
|
|
|
|
|
-const hasRemark = (prescription, stageIndex) => {
|
|
|
- if (!prescription?.pesticideList || !Array.isArray(prescription.pesticideList)) return false;
|
|
|
- const currentMethod = getStageExecutionMethod(stageIndex);
|
|
|
- return prescription.pesticideList.some((item) => {
|
|
|
- if (!item.params || !Array.isArray(item.params)) return false;
|
|
|
- const p = item.params.find((param) => param.executionMethod === currentMethod);
|
|
|
- return !!(p && p.remark);
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-const handleTagType = (tagType) => {
|
|
|
- if (tagType == 0) return "待触发";
|
|
|
- if (tagType == -1) return "已过期";
|
|
|
- if (tagType == -2) return "已过期";
|
|
|
- if (tagType == 3) {
|
|
|
- const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
|
|
|
- if (status === 2) {
|
|
|
- return "审核失败";
|
|
|
- }
|
|
|
- return "待认证"
|
|
|
- }
|
|
|
- if (tagType == 5) {
|
|
|
- const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
|
|
|
- if (status === 2) {
|
|
|
- return "审核失败";
|
|
|
- }
|
|
|
- if (status === 0) {
|
|
|
- return "审核中";
|
|
|
- }
|
|
|
- return "已认证";
|
|
|
- }
|
|
|
- return "待触发"
|
|
|
-}
|
|
|
-
|
|
|
-// 审核状态优先级:2 > 0 > 1
|
|
|
-const getAuditStatusPriority = (auditStatusList) => {
|
|
|
- if (!Array.isArray(auditStatusList) || !auditStatusList.length) return 1;
|
|
|
- const normalized = auditStatusList.map((x) => Number(x)).filter((x) => [0, 1, 2].includes(x));
|
|
|
- if (!normalized.length) return 1;
|
|
|
- if (normalized.includes(0)) return 0;
|
|
|
- if (normalized.includes(2)) return 2;
|
|
|
- return 1;
|
|
|
-};
|
|
|
-
|
|
|
-// 审核是否失败
|
|
|
-const failIndex = (index) => {
|
|
|
- return detail.value?.executeEvidenceAuditStatus[index]
|
|
|
-}
|
|
|
-
|
|
|
-const handleExecute = () => {
|
|
|
- // const today = new Date();
|
|
|
- // const executeDate = new Date(detail.value.executeDate);
|
|
|
- // if (executeDate.getTime() > today.getTime()) {
|
|
|
- // ElMessage.warning('未到农事执行时间,无法溯源认证');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- const evidenceList = normalizeCropAlbum(
|
|
|
- detail.value?.confirmPicture?.length
|
|
|
- ? detail.value.confirmPicture
|
|
|
- : detail.value.executeEvidence
|
|
|
- ).map((item) => item.filename);
|
|
|
- const auditStatusList = Array.isArray(detail.value?.executeEvidenceAuditStatus)
|
|
|
- ? detail.value.executeEvidenceAuditStatus
|
|
|
- : [];
|
|
|
-
|
|
|
- let imgs = []
|
|
|
- evidenceList.forEach((item, index) => {
|
|
|
- imgs.push({
|
|
|
- url: base_img_url2 + item,
|
|
|
- filePath: item,
|
|
|
- status: auditStatusList[index] === 2 ? 'failed' : 'success',
|
|
|
- message: auditStatusList[index] === 2 ? '审核失败' : '审核成功',
|
|
|
- });
|
|
|
- });
|
|
|
- console.log("evideimgsnceList", imgs);
|
|
|
- const isEdit = evidenceList?.length > 0 ? true : false;
|
|
|
- executePopupRef.value.openPopup(miniJson.value.recordId, {
|
|
|
- evidenceList: imgs,
|
|
|
- isEdit: isEdit,
|
|
|
- executeDate: detail.value.executeDate,
|
|
|
- executorOrganizationName: detail.value.executorOrganizationName,
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-const showMapPopup = ref(false);
|
|
|
|
|
|
const handleViewArea = () => {
|
|
|
- showMapPopup.value = true;
|
|
|
-}
|
|
|
-
|
|
|
-const toDraw = () => {
|
|
|
router.push({
|
|
|
- path: "/draw_area",
|
|
|
+ path: "/view_area",
|
|
|
query: {
|
|
|
subjectId: localStorage.getItem('selectedFarmId'),
|
|
|
- varietyId: miniJson.value.typeId,
|
|
|
+ varietyId: 2,
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
@@ -686,27 +499,7 @@ const getPesticideParam = (item, stageIndex) => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-const getParamRemark = (item, stageIndex) => {
|
|
|
- const param = getPesticideParam(item, stageIndex);
|
|
|
- return param?.remark || item.remark || "";
|
|
|
-};
|
|
|
-
|
|
|
-const changeExecutionMethod = (stageIndex, value) => {
|
|
|
- const stage = stageList.value?.[stageIndex];
|
|
|
- const availableTabs = getAvailableExecutionTabs(stage);
|
|
|
- const isAllowed = availableTabs.some(
|
|
|
- (tab) => Number(tab.value) === Number(value)
|
|
|
- );
|
|
|
- if (!isAllowed) return;
|
|
|
-
|
|
|
- stageExecutionMethods.value = {
|
|
|
- ...stageExecutionMethods.value,
|
|
|
- [stageIndex]: value
|
|
|
- };
|
|
|
-};
|
|
|
-
|
|
|
// 地图
|
|
|
-
|
|
|
const mapContainer = ref(null);
|
|
|
const areaMap = new AreaMap();
|
|
|
</script>
|
|
|
@@ -739,70 +532,74 @@ const areaMap = new AreaMap();
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
height: 140px;
|
|
|
- background: #C7C7C7;
|
|
|
+ background: var(--content-status-bg, #2199F8);
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
.status-l {
|
|
|
.status-title {
|
|
|
- font-size: 22px;
|
|
|
+ font-size: 21px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 9px;
|
|
|
+
|
|
|
+ .status-tag {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #2199F8;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 2px;
|
|
|
+ padding: 2px 5px;
|
|
|
+ min-width: fit-content;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.status-sub {
|
|
|
margin-top: 10px;
|
|
|
- font-size: 12px;
|
|
|
- padding: 0 8px;
|
|
|
+ font-size: 13px;
|
|
|
+ padding: 2px 8px;
|
|
|
background: #fff;
|
|
|
- color: rgba(62, 61, 61, 0.8);
|
|
|
+ color: #2199F8;
|
|
|
width: fit-content;
|
|
|
- height: 26px;
|
|
|
- line-height: 26px;
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- &.status-5 {
|
|
|
- &::after {
|
|
|
- background: #C7C7C7;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &.status-0, &.status-1 {
|
|
|
- &::after {
|
|
|
- background: #FF953D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &.status-2 {
|
|
|
- &::after {
|
|
|
- background: #2199F8;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &.status-6 {
|
|
|
- &::after {
|
|
|
- background: #2199F8;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- &.audit-2,
|
|
|
- &.audit-0 {
|
|
|
- &::after {
|
|
|
- background: #FF953D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &.audit-2 {
|
|
|
- padding-top: 30px;
|
|
|
- }
|
|
|
+ .status-hint-card {
|
|
|
+ margin-top: 10px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 2px;
|
|
|
+ padding: 5px 8px;
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
|
- &.status-4 {
|
|
|
- &::after {
|
|
|
- background: #37C11B;
|
|
|
- }
|
|
|
+ .status-hint-text {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #626262;
|
|
|
+ }
|
|
|
|
|
|
- .status-sub {
|
|
|
- color: #37C11B;
|
|
|
+ .status-hint-question {
|
|
|
+ margin-top: 8px;
|
|
|
+ background: #2199f8;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 6px 8px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ .status-hint-link-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .status-hint-question-text {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ text-decoration: underline;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -812,7 +609,6 @@ const areaMap = new AreaMap();
|
|
|
top: 0;
|
|
|
padding: 0 12px 12px;
|
|
|
z-index: 2;
|
|
|
-
|
|
|
// &.has-bottom {
|
|
|
// margin-bottom: 88px;
|
|
|
// }
|
|
|
@@ -976,9 +772,10 @@ const areaMap = new AreaMap();
|
|
|
border-radius: 6px;
|
|
|
|
|
|
.area-l {
|
|
|
- color: #000000;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 5px;
|
|
|
|
|
|
- // font-weight: 500;
|
|
|
.area-tag {
|
|
|
background: rgba(98, 98, 98, 0.1);
|
|
|
color: #626262;
|
|
|
@@ -991,7 +788,6 @@ const areaMap = new AreaMap();
|
|
|
display: inline-block;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.area-r {
|
|
|
background: #2199F8;
|
|
|
color: #fff;
|
|
|
@@ -1003,13 +799,12 @@ const areaMap = new AreaMap();
|
|
|
padding: 0 10px;
|
|
|
border-radius: 20px;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.ecological-plant-card {
|
|
|
margin-top: 10px;
|
|
|
- // padding: 10px;
|
|
|
- // background: rgba(244, 244, 244, 0.8);
|
|
|
border-radius: 8px;
|
|
|
text-align: left;
|
|
|
}
|