|
@@ -99,31 +99,94 @@
|
|
|
<div class="img-list over-img-box" v-if="workItem.reviewImage && workItem.reviewImage.length">
|
|
<div class="img-list over-img-box" v-if="workItem.reviewImage && workItem.reviewImage.length">
|
|
|
<album-carousel :key="2" labelText="农事后" :images="workItem.reviewImage"></album-carousel>
|
|
<album-carousel :key="2" labelText="农事后" :images="workItem.reviewImage"></album-carousel>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="img-list" v-if="false">
|
|
|
|
|
|
|
+ <div class="img-list" v-else>
|
|
|
<div
|
|
<div
|
|
|
class="recheck-text-wrap no-events"
|
|
class="recheck-text-wrap no-events"
|
|
|
:class="{
|
|
:class="{
|
|
|
- active: !diffInDays(workItem.reviewDate2) > 0 && curRole === '0',
|
|
|
|
|
- 'yse-events': curRole === '0' && !diffInDays(workItem.reviewDate2) > 0,
|
|
|
|
|
|
|
+ active: !diffInDays(workItem.reviewDate) > 0 && curRole === '0',
|
|
|
|
|
+ 'yse-events': curRole === '0' && !diffInDays(workItem.reviewDate) > 0,
|
|
|
|
|
+ 'center-wrap': !imageArr.length,
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="date" v-show="workItem.reviewDate">{{ workItem.reviewDate }}</div>
|
|
|
|
|
+ <upload
|
|
|
|
|
+ exampleImg
|
|
|
|
|
+ @handleUpload="handleUpload"
|
|
|
|
|
+ class="upload-wrap"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ height:
|
|
|
|
|
+ imageArr.length && !diffInDays(workItem.reviewDate) > 0
|
|
|
|
|
+ ? 'auto'
|
|
|
|
|
+ : '254px',
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ diffInDays(workItem.reviewDate) == 0 ||
|
|
|
|
|
+ diffInDays(workItem.reviewDate) == null
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ class="img-icon"
|
|
|
|
|
+ :src="
|
|
|
|
|
+ require(`@/assets/img/gallery/img-icon${
|
|
|
|
|
+ curRole === '0' ? '-act' : ''
|
|
|
|
|
+ }.png`)
|
|
|
|
|
+ "
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ />
|
|
|
|
|
+ <div class="recheck-text">
|
|
|
|
|
+ {{ curRole === "2" ? "等待农户上传" : "点击上传照片" }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="recheck-desc"
|
|
|
|
|
+ v-show="curRole === '2' && diffInDays(workItem.reviewDate) != 0"
|
|
|
|
|
+ >
|
|
|
|
|
+ (已逾期{{ diffInDays(workItem.reviewDate, "add") }}天)
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <img class="img-icon" src="@/assets/img/gallery/img-icon.png" alt="" />
|
|
|
|
|
+ <div class="recheck-text">等待复核</div>
|
|
|
|
|
+ <div class="recheck-desc" v-show="diffInDays(workItem.reviewDate) >= 0">
|
|
|
|
|
+ (剩余{{ diffInDays(workItem.reviewDate) }}天)
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </upload>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="submit"
|
|
|
|
|
+ v-show="imageArr.length && !diffInDays(workItem.reviewDate) > 0"
|
|
|
|
|
+ @click="handleSubmit('reviewImage2')"
|
|
|
|
|
+ >
|
|
|
|
|
+ 确认上传
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <div class="img-list" v-else>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="recheck-text-wrap no-events"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ active: !diffInDays(workItem.reviewDate) > 0 && curRole === '0',
|
|
|
|
|
+ 'yse-events': curRole === '0' && !diffInDays(workItem.reviewDate) > 0,
|
|
|
'center-wrap': !imageArr2.length,
|
|
'center-wrap': !imageArr2.length,
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
- <div class="date" v-show="workItem.reviewDate2">{{ workItem.reviewDate2 }}</div>
|
|
|
|
|
|
|
+ <div class="date" v-show="workItem.reviewDate">{{ workItem.reviewDate }}</div>
|
|
|
<upload
|
|
<upload
|
|
|
exampleImg
|
|
exampleImg
|
|
|
@handleUpload="handleUpload2"
|
|
@handleUpload="handleUpload2"
|
|
|
class="upload-wrap"
|
|
class="upload-wrap"
|
|
|
:style="{
|
|
:style="{
|
|
|
height:
|
|
height:
|
|
|
- imageArr2.length && !diffInDays(workItem.reviewDate2) > 0
|
|
|
|
|
|
|
+ imageArr2.length && !diffInDays(workItem.reviewDate) > 0
|
|
|
? 'auto'
|
|
? 'auto'
|
|
|
: '254px',
|
|
: '254px',
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
<template
|
|
<template
|
|
|
v-if="
|
|
v-if="
|
|
|
- diffInDays(workItem.reviewDate2) == 0 ||
|
|
|
|
|
- diffInDays(workItem.reviewDate2) == null
|
|
|
|
|
|
|
+ diffInDays(workItem.reviewDate) == 0 ||
|
|
|
|
|
+ diffInDays(workItem.reviewDate) == null
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
<img
|
|
<img
|
|
@@ -140,28 +203,27 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div
|
|
<div
|
|
|
class="recheck-desc"
|
|
class="recheck-desc"
|
|
|
- v-show="curRole === '2' && diffInDays(workItem.reviewDate2) != 0"
|
|
|
|
|
|
|
+ v-show="curRole === '2' && diffInDays(workItem.reviewDate) != 0"
|
|
|
>
|
|
>
|
|
|
- <!-- (已逾期{{ diffInDays(workItem.reviewDate2, "add") }}天) -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<img class="img-icon" src="@/assets/img/gallery/img-icon.png" alt="" />
|
|
<img class="img-icon" src="@/assets/img/gallery/img-icon.png" alt="" />
|
|
|
<div class="recheck-text">等待复核</div>
|
|
<div class="recheck-text">等待复核</div>
|
|
|
- <div class="recheck-desc" v-show="diffInDays(workItem.reviewDate2) >= 0">
|
|
|
|
|
- (剩余{{ diffInDays(workItem.reviewDate2) }}天)
|
|
|
|
|
|
|
+ <div class="recheck-desc" v-show="diffInDays(workItem.reviewDate) >= 0">
|
|
|
|
|
+ (剩余{{ diffInDays(workItem.reviewDate) }}天)
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</upload>
|
|
</upload>
|
|
|
<div
|
|
<div
|
|
|
class="submit"
|
|
class="submit"
|
|
|
- v-show="imageArr2.length && !diffInDays(workItem.reviewDate2) > 0"
|
|
|
|
|
|
|
+ v-show="imageArr2.length && !diffInDays(workItem.reviewDate) > 0"
|
|
|
@click="handleSubmit('reviewImage2')"
|
|
@click="handleSubmit('reviewImage2')"
|
|
|
>
|
|
>
|
|
|
确认上传
|
|
确认上传
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -182,7 +244,7 @@
|
|
|
<div
|
|
<div
|
|
|
class="up-btn btn"
|
|
class="up-btn btn"
|
|
|
@click="handleContact"
|
|
@click="handleContact"
|
|
|
- v-show="workItem.reviewImage && workItem.reviewImage.length && !imageArr2.length"
|
|
|
|
|
|
|
+ v-show="workItem.reviewImage && workItem.reviewImage.length && !imageArr.length"
|
|
|
>
|
|
>
|
|
|
联系专家
|
|
联系专家
|
|
|
</div>
|
|
</div>
|
|
@@ -201,18 +263,14 @@ import { onMounted, ref, onDeactivated, onActivated } from "vue";
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
import upload from "@/components/upload";
|
|
import upload from "@/components/upload";
|
|
|
import AlbumCarousel from "@/components/album_compoents/albumCarousel";
|
|
import AlbumCarousel from "@/components/album_compoents/albumCarousel";
|
|
|
-import eventBus from "@/api/eventBus";
|
|
|
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
|
import uploadPopup from "@/components/popup/uploadPopup.vue";
|
|
import uploadPopup from "@/components/popup/uploadPopup.vue";
|
|
|
-import { deepClone } from "@/common/commonFun";
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
const workItem = ref({});
|
|
const workItem = ref({});
|
|
|
const curRole = ref("");
|
|
const curRole = ref("");
|
|
|
-const farmId = ref(null);
|
|
|
|
|
// 农事规划页面-显示上传农事凭证按钮
|
|
// 农事规划页面-显示上传农事凭证按钮
|
|
|
const isPlan = ref(false);
|
|
const isPlan = ref(false);
|
|
|
-const id = route.query.json ? JSON.parse(route.query.json).id : null;
|
|
|
|
|
|
|
|
|
|
const diffInDays = (date, type = "minus") => {
|
|
const diffInDays = (date, type = "minus") => {
|
|
|
const targetDate = new Date(date);
|
|
const targetDate = new Date(date);
|
|
@@ -232,30 +290,13 @@ onMounted(() => {
|
|
|
window.scrollTo(0, 0);
|
|
window.scrollTo(0, 0);
|
|
|
curRole.value = localStorage.getItem("SET_USER_CUR_ROLE");
|
|
curRole.value = localStorage.getItem("SET_USER_CUR_ROLE");
|
|
|
paramsPage.value = route.query.json ? JSON.parse(route.query.json) : {};
|
|
paramsPage.value = route.query.json ? JSON.parse(route.query.json) : {};
|
|
|
- farmId.value = paramsPage.value.farmId;
|
|
|
|
|
getDetail();
|
|
getDetail();
|
|
|
-
|
|
|
|
|
- eventBus.on("confirm:callback", confirmCallback);
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const handleConversion = (data) => {
|
|
|
|
|
- const arr = data.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- ...item,
|
|
|
|
|
- filename: item.imgUrl,
|
|
|
|
|
- uploadDate: item.date,
|
|
|
|
|
- district: "",
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- return arr;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const defaultWorkData = ref({});
|
|
|
|
|
const getDetail = () => {
|
|
const getDetail = () => {
|
|
|
- if (!id) return;
|
|
|
|
|
- VE_API.z_farm_work_record.getDetail({ id }).then(({ data }) => {
|
|
|
|
|
|
|
+ if (!paramsPage.value.id) return;
|
|
|
|
|
+ VE_API.z_farm_work_record.getDetail({ id: paramsPage.value.id }).then(({ data }) => {
|
|
|
workItem.value = data[0];
|
|
workItem.value = data[0];
|
|
|
- defaultWorkData.value = deepClone(data[0]);
|
|
|
|
|
getTriggerImg(workItem.value.id);
|
|
getTriggerImg(workItem.value.id);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -268,59 +309,33 @@ const getTriggerImg = (farmWorkRecordId) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
//确认上传
|
|
//确认上传
|
|
|
-const handleSubmit = (image) => {
|
|
|
|
|
|
|
+const handleSubmit = () => {
|
|
|
const params = {
|
|
const params = {
|
|
|
- ...defaultWorkData.value,
|
|
|
|
|
- orderStatus: 6,
|
|
|
|
|
|
|
+ executeEvidence: imageArr.value,
|
|
|
|
|
+ recordId: workItem.value.id,
|
|
|
};
|
|
};
|
|
|
- if (image === "reviewImage") {
|
|
|
|
|
- params.reviewImage = imageArr.value;
|
|
|
|
|
- } else {
|
|
|
|
|
- params.reviewImage2 = imageArr2.value;
|
|
|
|
|
- }
|
|
|
|
|
- VE_API.order.confirm(params).then(({ code }) => {
|
|
|
|
|
|
|
+ VE_API.monitor.addReviewImg(params).then(({ code }) => {
|
|
|
if (code === 0) {
|
|
if (code === 0) {
|
|
|
getDetail();
|
|
getDetail();
|
|
|
ElMessage.success("您已上传成功");
|
|
ElMessage.success("您已上传成功");
|
|
|
imageArr.value = [];
|
|
imageArr.value = [];
|
|
|
- imageArr2.value = [];
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onDeactivated(() => {
|
|
onDeactivated(() => {
|
|
|
workItem.value = {};
|
|
workItem.value = {};
|
|
|
- eventBus.off("confirm:callback", confirmCallback);
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-function confirmCallback() {
|
|
|
|
|
- getDetail();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-//联系专家
|
|
|
|
|
-const handleContact = () => {
|
|
|
|
|
- router.push(`/dialogue?userId=${workItem.value.expert}&name=${workItem.value.expertUserName}`);
|
|
|
|
|
-};
|
|
|
|
|
|
|
+// //联系专家
|
|
|
|
|
+// const handleContact = () => {
|
|
|
|
|
+// router.push(`/dialogue?userId=${workItem.value.expert}&name=${workItem.value.expertUserName}`);
|
|
|
|
|
+// };
|
|
|
|
|
|
|
|
const imageArr = ref([]);
|
|
const imageArr = ref([]);
|
|
|
const handleUpload = ({ imgArr }) => {
|
|
const handleUpload = ({ imgArr }) => {
|
|
|
- imageArr.value = imgArr.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- imgUrl: item,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ imageArr.value = imgArr;
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
-const imageArr2 = ref([]);
|
|
|
|
|
-const handleUpload2 = ({ imgArr }) => {
|
|
|
|
|
- imageArr2.value = imgArr.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- imgUrl: item,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const router = useRouter();
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|