|
|
@@ -361,9 +361,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="submit-btn" :class="{ 'center-btn': onlyPrice }">
|
|
|
+ <div class="submit-btn" :class="{ 'center-btn': onlyPrice || defaultTagName === 0 }">
|
|
|
<!-- <div v-if="!onlyPrice" class="btn second" @click.prevent="cancelEdit">取消编辑</div> -->
|
|
|
- <div v-if="!onlyPrice" class="btn second" @click.prevent="handleCancelAttention">取消关注</div>
|
|
|
+ <div v-if="!onlyPrice && defaultTagName !== 0" class="btn second" @click.prevent="handleCancelAttention">取消关注</div>
|
|
|
<div class="btn" @click.prevent="submitForm(formRef)">保存</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -463,8 +463,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-if="!isDefault">
|
|
|
- <div class="submit-btn" v-has-permission="'农事规划'">
|
|
|
- <div class="btn second" @click.prevent="handleCancelAttention">取消关注</div>
|
|
|
+ <div class="submit-btn" :class="{ 'center-btn': defaultTagName === 0 }" v-has-permission="'农事规划'">
|
|
|
+ <div v-if="defaultTagName !== 0" class="btn second" @click.prevent="handleCancelAttention">取消关注</div>
|
|
|
<div class="btn" @click.prevent="toEditPrescription">编辑处方</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -556,6 +556,7 @@ const tagList = ref([
|
|
|
]);
|
|
|
|
|
|
const tagName = ref("");
|
|
|
+const defaultTagName = ref("");
|
|
|
|
|
|
// 互动表单数据
|
|
|
const interactFormData = ref({
|
|
|
@@ -723,6 +724,9 @@ const handleBtn = () => {
|
|
|
|
|
|
const toEditPrescription = () => {
|
|
|
isEdit.value = true;
|
|
|
+ if (tagName.value === 0) {
|
|
|
+ tagName.value = 1;
|
|
|
+ }
|
|
|
nextTick(() => {
|
|
|
if (pageRef.value) {
|
|
|
pageRef.value.scrollTo({ top: 0, behavior: "auto" });
|
|
|
@@ -800,12 +804,38 @@ const handleCompleteNext = () => {
|
|
|
// 判断是否是最后一个
|
|
|
const isLast = currentIndex === ids.value.length - 1;
|
|
|
|
|
|
- // 如果是最后一个,标记为全部完成
|
|
|
+ // 如果是最后一个
|
|
|
if (isLast) {
|
|
|
// 从数组中删除当前项(已经完成的)
|
|
|
ids.value.splice(currentIndex, 1);
|
|
|
// 更新 sessionStorage
|
|
|
sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
|
|
|
+
|
|
|
+ // 如果删除后数组为空,标记为全部完成
|
|
|
+ if (ids.value.length === 0) {
|
|
|
+ allDone.value = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果删除后数组不为空,从第一个开始获取
|
|
|
+ const firstItem = ids.value[0];
|
|
|
+ if (firstItem && firstItem.farmWorkId && firstItem.arrangeId) {
|
|
|
+ router.replace({
|
|
|
+ path: "/modify",
|
|
|
+ query: {
|
|
|
+ id: firstItem.arrangeId,
|
|
|
+ farmWorkId: firstItem.farmWorkId,
|
|
|
+ farmId: route.query.farmId,
|
|
|
+ containerSpaceTimeId: route.query.containerSpaceTimeId,
|
|
|
+ schemeId: route.query.schemeId,
|
|
|
+ isEdit: route.query.isEdit,
|
|
|
+ onlyPrice: route.query.onlyPrice,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果第一个项无效,标记为全部完成
|
|
|
allDone.value = true;
|
|
|
return;
|
|
|
}
|
|
|
@@ -1303,7 +1333,8 @@ const getFarmWorkArrangeDetail = async (id) => {
|
|
|
if (!id) return;
|
|
|
const { data, code } = await VE_API.farm.getFarmWorkArrangeDetail({ id });
|
|
|
if(code === 0) {
|
|
|
- tagName.value = data.isFollow === 0 ? null : data.isFollow;
|
|
|
+ tagName.value = data.isFollow;
|
|
|
+ defaultTagName.value = data.isFollow;
|
|
|
await handlePhenologyChange(data.phenologyId);
|
|
|
interactFormData.value = {
|
|
|
phenologyId: data.phenologyId || "",
|