|
|
@@ -7,13 +7,13 @@
|
|
|
<div class="content-status" :class="'status-' + detail?.flowStatus">
|
|
|
<div class="status-l">
|
|
|
<div class="status-title">{{ handleTagType(detail?.flowStatus) }}</div>
|
|
|
- <div class="status-sub" v-if="triggerDateText && detail?.flowStatus === 0">
|
|
|
+ <div class="status-sub" v-if="triggerDateText && detail?.flowStatus == -1">
|
|
|
执行时间已经过去 {{ daysDiff }} 天了
|
|
|
</div>
|
|
|
- <div class="status-sub" v-if="detail?.flowStatus === 1">
|
|
|
+ <div class="status-sub" v-if="detail?.flowStatus === 3">
|
|
|
距离执行时间还差 {{ daysDiff }} 天
|
|
|
</div>
|
|
|
- <div class="status-sub" v-if="!detail?.flowStatus || detail?.flowStatus === 2">
|
|
|
+ <div class="status-sub" v-if="!detail?.flowStatus || detail?.flowStatus === 0">
|
|
|
预计触发时间 {{ detail?.activateTime ? formatDate(detail.activateTime) : "--" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -21,9 +21,9 @@
|
|
|
|
|
|
<div class="work-wrap">
|
|
|
<!-- 农事组信息 -->
|
|
|
- <div class="box-wrap group-info group-box">
|
|
|
+ <div class="box-wrap group-info group-box" v-if="detail?.executionLimitDays">
|
|
|
<div class="group-name">
|
|
|
- 该农事为 <span class="light-text">限时溯源农事</span> ,请在 <span class="light-text">3天内</span>
|
|
|
+ 该农事为 <span class="light-text">限时溯源农事</span> ,请在 <span class="light-text">{{detail?.executionLimitDays}}天内</span>
|
|
|
完成溯源认证上传,如果逾期未认证,该农事将不可溯源认证,且不计入飞鸟有味平台
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -39,21 +39,21 @@
|
|
|
<div class="form-item">
|
|
|
<div class="item-name">农事目的</div>
|
|
|
<div class="item-text">
|
|
|
- {{ detail.purpose || prescription.name || "--" }}
|
|
|
+ {{ prescription.purpose || prescription.purposeName || "--" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="item-name">农事时间</div>
|
|
|
<div class="item-text">
|
|
|
- {{ detail.intervelTime ? `间隔 ${detail.intervelTime} 天后 执行` : "--" }}
|
|
|
+ {{ detail.executeDate || "--" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="item-name">执行区域</div>
|
|
|
<div class="item-text light-text area-text">
|
|
|
- 桂味种植区域
|
|
|
- <!-- <div class="area-btn" @click="handleViewArea">查看区域</div> -->
|
|
|
- <div class="area-btn area-btn-right" @click="toDraw">建议勾选<el-icon><ArrowRight /></el-icon></div>
|
|
|
+ {{ detail?.executionRegion?.regionName }}种植区域
|
|
|
+ <div class="area-btn" v-if="detail?.executionRegion?.regionRange" @click="handleViewArea">查看区域</div>
|
|
|
+ <div class="area-btn area-btn-right" v-else @click="toDraw">建议勾选<el-icon><ArrowRight /></el-icon></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
@@ -135,7 +135,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="fixed-btn-wrap execute-action" v-if="info?.appType === 1 && detail?.flowStatus === 1">
|
|
|
+ <div class="fixed-btn-wrap execute-action" v-if="info?.appType === 1 && detail?.flowStatus === null">
|
|
|
<div class="action-item second" @click="handleConvert">转发农事</div>
|
|
|
<div class="action-item primary" @click="handleExecute">溯源认证</div>
|
|
|
</div>
|
|
|
@@ -149,7 +149,7 @@
|
|
|
</div>
|
|
|
<!-- 执行区域地图弹窗 -->
|
|
|
<popup v-model:show="showMapPopup" closeable class="map-popup">
|
|
|
- <map-info :farmId="detail.farmId" />
|
|
|
+ <map-info :rangeWkt="detail?.executionRegion?.regionRange" />
|
|
|
</popup>
|
|
|
</template>
|
|
|
|
|
|
@@ -173,7 +173,7 @@ const router = useRouter();
|
|
|
// const info = JSON.parse(localStorage.getItem("localUserInfo") || "{}");
|
|
|
const info = { appType: 1 };
|
|
|
|
|
|
-/** 接口根级与 detail 合并后的详情(兼容旧 groupList / 新 pesticideList、prescriptionList) */
|
|
|
+/** 接口根级与 detail 合并后的详情(pesticideList、prescriptionList) */
|
|
|
const detail = ref({
|
|
|
farmId: null,
|
|
|
farmWorkLibId: null,
|
|
|
@@ -187,7 +187,6 @@ const detail = ref({
|
|
|
remark: "",
|
|
|
pesticideList: [],
|
|
|
prescriptionList: [],
|
|
|
- groupList: [],
|
|
|
confirmPicture: [],
|
|
|
executeEvidence: [],
|
|
|
expertName: "",
|
|
|
@@ -214,7 +213,7 @@ const normalizeCropAlbum = (album) => {
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * prescriptionList.pesticideFertilizerList → 与旧 groupList.pesticideList 一致(含 params 三行执行方式)
|
|
|
+ * prescriptionList.pesticideFertilizerList → 含 params 三行执行方式
|
|
|
*/
|
|
|
const mapFertilizerToPesticideItem = (f) => {
|
|
|
if (!f || typeof f !== "object") return null;
|
|
|
@@ -282,6 +281,7 @@ const getDetail = () => {
|
|
|
detail.value = {
|
|
|
...inner,
|
|
|
post: data?.post ?? null,
|
|
|
+ executionRegion: data?.executionRegion ?? null,
|
|
|
expertNameFromFarmBasicInfo:
|
|
|
data?.expertNameFromFarmBasicInfo ?? "",
|
|
|
rangeWkt: data?.rangeWkt ?? null,
|
|
|
@@ -329,20 +329,17 @@ const triggerDateText = computed(() => {
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
- * 展示用「分段」列表:旧数据用 groupList;新接口用 detail.pesticideList 或 prescriptionList 推导
|
|
|
+ * 展示用「分段」列表:detail.pesticideList 或 prescriptionList 推导
|
|
|
*/
|
|
|
const stageList = computed(() => {
|
|
|
const d = detail.value;
|
|
|
+ console.log("d", d);
|
|
|
if (!d) return [];
|
|
|
|
|
|
- if (Array.isArray(d.groupList) && d.groupList.length) {
|
|
|
- return d.groupList;
|
|
|
- }
|
|
|
-
|
|
|
if (Array.isArray(d.pesticideList) && d.pesticideList.length) {
|
|
|
return [
|
|
|
{
|
|
|
- name: d.farmWorkName || "",
|
|
|
+ ...d,
|
|
|
pesticideList: d.pesticideList,
|
|
|
cropAlbum: normalizeCropAlbum(
|
|
|
d.confirmPicture?.length
|
|
|
@@ -353,16 +350,6 @@ const stageList = computed(() => {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- if (Array.isArray(d.prescriptionList) && d.prescriptionList.length) {
|
|
|
- return d.prescriptionList.map((p) => ({
|
|
|
- name: p.name || "",
|
|
|
- pesticideList: (p.pesticideFertilizerList || [])
|
|
|
- .map(mapFertilizerToPesticideItem)
|
|
|
- .filter(Boolean),
|
|
|
- cropAlbum: normalizeCropAlbum(p.cropAlbum),
|
|
|
- }));
|
|
|
- }
|
|
|
-
|
|
|
return [];
|
|
|
});
|
|
|
|
|
|
@@ -378,10 +365,10 @@ const hasRemark = (prescription, stageIndex) => {
|
|
|
};
|
|
|
|
|
|
const handleTagType = (tagType) => {
|
|
|
- if (tagType === 0) return "已过期";
|
|
|
- if (tagType === 1) return "待认证";
|
|
|
- if (tagType === 2) return "待触发";
|
|
|
- if (tagType === 3) return "已完成";
|
|
|
+ if (tagType == 0) return "待触发";
|
|
|
+ if (tagType == -1) return "已过期";
|
|
|
+ if (tagType == 3) return "待认证";
|
|
|
+ if (tagType == 5) return "已完成";
|
|
|
return "待触发"
|
|
|
}
|
|
|
|
|
|
@@ -390,7 +377,7 @@ const handleExecute = () => {
|
|
|
// wx.miniProgram.navigateTo({
|
|
|
// url: `/pages/subPages/location_check/index?lng=113.264435&lat=23.129163`,
|
|
|
// });
|
|
|
- executePopupRef.value.openPopup();
|
|
|
+ executePopupRef.value.openPopup(route.query.recordId);
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -401,7 +388,13 @@ const handleViewArea = () => {
|
|
|
}
|
|
|
|
|
|
const toDraw = () => {
|
|
|
- router.push("/draw_region");
|
|
|
+ router.push({
|
|
|
+ path: "/draw_area",
|
|
|
+ query: {
|
|
|
+ subjectId: localStorage.getItem('selectedFarmId'),
|
|
|
+ varietyId: route.query.typeId,
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const handleBack = () => {
|