|
|
@@ -623,14 +623,18 @@ const noPrice = ref(false);
|
|
|
const isDefault = ref(false);
|
|
|
// 是否在完善信息弹窗中
|
|
|
const isDoingComplete = ref(false);
|
|
|
+const farmWorkIds = ref([]);
|
|
|
|
|
|
const showCompletePopup = ref(false);
|
|
|
onActivated(() => {
|
|
|
isDefault.value = route.query.isDefault == 'true' ? true : false;
|
|
|
- isEdit.value = route.query.isEdit ? true : false;
|
|
|
- onlyPrice.value = route.query.onlyPrice ? true : false;
|
|
|
+ isEdit.value = route.query.isEdit == 'true' ? true : false;
|
|
|
+ onlyPrice.value = route.query.onlyPrice == 'true' ? true : false;
|
|
|
noPrice.value = route.query.noPrice == 'true' ? true : false;
|
|
|
- isDoingComplete.value = route.query.isDoingComplete == 'true' ? true : false;
|
|
|
+ // enabled为0时,方案不可用,需要完善
|
|
|
+ isDoingComplete.value = route.query.enabled == 0 ? true : false;
|
|
|
+ // 方案列表中的ids数组
|
|
|
+ farmWorkIds.value = route.query.farmWorkIds ? JSON.parse(route.query.farmWorkIds) : [];
|
|
|
if (route.query.farmWorkId) {
|
|
|
getDetail();
|
|
|
}
|
|
|
@@ -779,18 +783,61 @@ const handleViewDetail = () => {
|
|
|
|
|
|
const handleCompleteNext = () => {
|
|
|
showCompletePopup.value = false;
|
|
|
- router.replace({
|
|
|
- path: "/modify",
|
|
|
- query: {
|
|
|
- farmWorkId: route.query.farmWorkId,
|
|
|
- farmId: route.query.farmId,
|
|
|
- id: route.query.id,
|
|
|
- isEdit: true,
|
|
|
- onlyPrice: false,
|
|
|
- noPrice: false,
|
|
|
- isDefault: false,
|
|
|
- },
|
|
|
- });
|
|
|
+ const farmWorkIds = sessionStorage.getItem("farmWorkIds");
|
|
|
+ const arrangeIds = sessionStorage.getItem("arrangeIds");
|
|
|
+ if (farmWorkIds && arrangeIds) {
|
|
|
+ const farmWorkIdsArray = JSON.parse(farmWorkIds);
|
|
|
+ const arrangeIdsArray = JSON.parse(arrangeIds);
|
|
|
+ // 找到当前 farmWorkId 在数组中的索引
|
|
|
+ const currentFarmWorkId = route.query.farmWorkId;
|
|
|
+ const currentIndex = farmWorkIdsArray.findIndex(id => id == currentFarmWorkId);
|
|
|
+
|
|
|
+ if (currentIndex !== -1) {
|
|
|
+ // 从数组中删除当前项
|
|
|
+ farmWorkIdsArray.splice(currentIndex, 1);
|
|
|
+ arrangeIdsArray.splice(currentIndex, 1);
|
|
|
+
|
|
|
+ // 更新 sessionStorage
|
|
|
+ sessionStorage.setItem("farmWorkIds", JSON.stringify(farmWorkIdsArray));
|
|
|
+ sessionStorage.setItem("arrangeIds", JSON.stringify(arrangeIdsArray));
|
|
|
+
|
|
|
+ // 获取下一个(如果当前索引还在数组范围内,则取当前索引位置的值,否则取第一个)
|
|
|
+ if (farmWorkIdsArray.length > 0 && arrangeIdsArray.length > 0) {
|
|
|
+ const nextIndex = currentIndex < farmWorkIdsArray.length ? currentIndex : 0;
|
|
|
+ const nextFarmWorkId = farmWorkIdsArray[nextIndex];
|
|
|
+ const nextArrangeId = arrangeIdsArray[nextIndex];
|
|
|
+
|
|
|
+ router.replace({
|
|
|
+ path: "/modify",
|
|
|
+ query: {
|
|
|
+ id: nextArrangeId,
|
|
|
+ farmWorkId: nextFarmWorkId,
|
|
|
+ farmId: route.query.farmId,
|
|
|
+ containerSpaceTimeId: route.query.containerSpaceTimeId,
|
|
|
+ schemeId: route.query.schemeId,
|
|
|
+ enabled: 0,
|
|
|
+ isEdit: true,
|
|
|
+ onlyPrice: false,
|
|
|
+ noPrice: true,
|
|
|
+ isDefault: false,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ router.reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // router.replace({
|
|
|
+ // path: "/modify",
|
|
|
+ // query: {
|
|
|
+ // farmWorkId: route.query.farmWorkId,
|
|
|
+ // farmId: route.query.farmId,
|
|
|
+ // id: route.query.id,
|
|
|
+ // isEdit: true,
|
|
|
+ // onlyPrice: false,
|
|
|
+ // noPrice: false,
|
|
|
+ // isDefault: false,
|
|
|
+ // },
|
|
|
+ // });
|
|
|
};
|
|
|
const resetForm = (formEl) => {
|
|
|
if (!formEl) return;
|