|
|
@@ -2,9 +2,9 @@
|
|
|
<div class="completed-work">
|
|
|
<custom-header name="农事详情" :isClose="query?.hideBack ? true : false" :showClose="false"></custom-header>
|
|
|
<div class="work-content">
|
|
|
- <div class="step-wrap" v-show="query.status !== 'warning'">
|
|
|
+ <!-- <div class="step-wrap" v-show="query.status !== 'warning'">
|
|
|
<farm-steps :currentStep="currentStep" />
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div
|
|
|
class="content-status"
|
|
|
:class="{ warning: query.status === 'warning' }"
|
|
|
@@ -31,11 +31,11 @@
|
|
|
该农事已完成
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <template v-if="query.status !== 'warning'">
|
|
|
+ <template v-if="query.status !== 'warning'">
|
|
|
<div class="status-r" v-if="curRole == 0">{{ status === 0 ? "设置提醒" : "去评价" }}</div>
|
|
|
<div class="status-r" v-if="curRole == 1">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
|
|
|
<div class="status-r" v-if="curRole == 2">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
|
|
|
- </template> -->
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<div class="work-wrap" v-if="query?.farmWorkOrderId || detailData?.flowStatus === 4">
|
|
|
<div class="box-wrap executor-info" v-if="query.status === 'warning' || curRole == 0 || curRole == 2">
|
|
|
@@ -143,70 +143,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="work-wrap info-wrap">
|
|
|
- <div
|
|
|
- class="box-wrap farm-photo farm-info"
|
|
|
- v-if="
|
|
|
- (curRole == 2 && currentStep == 2 && detailData?.executeEvidence?.length) ||
|
|
|
- (detailData?.flowStatus === 4 && detailData?.executeEvidence?.length)
|
|
|
- "
|
|
|
- >
|
|
|
- <div class="info-title">
|
|
|
- <div class="card-title">执行照片</div>
|
|
|
- <!-- <div class="info-more">
|
|
|
- 点击查看更多
|
|
|
- <el-icon><ArrowRight /></el-icon>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- <div class="photo-list pt-10">
|
|
|
- <!-- <div class="img-item" v-for="(item, index) in detailData.executeEvidence" :key="index">
|
|
|
- <img
|
|
|
- class="photo-item"
|
|
|
- :src="base_img_url2 + item"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- </div> -->
|
|
|
-
|
|
|
- <photo-provider :photo-closable="true">
|
|
|
- <photo-consumer
|
|
|
- v-for="src in detailData.executeEvidence"
|
|
|
- intro="执行照片"
|
|
|
- :key="src"
|
|
|
- :src="base_img_url2 + src"
|
|
|
- >
|
|
|
- <div class="img-item">
|
|
|
- <img :src="base_img_url2 + src" class="view-box" />
|
|
|
- </div>
|
|
|
- </photo-consumer>
|
|
|
- </photo-provider>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="box-wrap farm-info">
|
|
|
- <div class="info-title">
|
|
|
- <div class="card-title">农场现状</div>
|
|
|
- <!-- <div class="info-more">
|
|
|
- 点击查看更多
|
|
|
- <el-icon><ArrowRight /></el-icon>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- <div class="info-content">{{ farmStatusText }}</div>
|
|
|
- </div>
|
|
|
- <div class="box-wrap farm-photo" v-if="triggerImg.length">
|
|
|
- <div class="photo-list">
|
|
|
- <photo-provider :photo-closable="true">
|
|
|
- <photo-consumer
|
|
|
- v-for="src in triggerImg"
|
|
|
- intro="触发照片"
|
|
|
- :key="src"
|
|
|
- :src="base_img_url2 + src.cloudFilename"
|
|
|
- >
|
|
|
- <div class="img-item">
|
|
|
- <img :src="base_img_url2 + src.cloudFilename" class="view-box" />
|
|
|
- </div>
|
|
|
- </photo-consumer>
|
|
|
- </photo-provider>
|
|
|
- </div>
|
|
|
- <!-- <div class="list-text">点击查看更多</div> -->
|
|
|
- </div>
|
|
|
|
|
|
<div class="box-wrap farm-data">
|
|
|
<div class="card-title">
|
|
|
@@ -215,6 +151,7 @@
|
|
|
<div class="point"></div>
|
|
|
<span>2区</span>
|
|
|
</div> -->
|
|
|
+ <div class="tag-text">托管农事</div>
|
|
|
</div>
|
|
|
<div class="data-content">
|
|
|
<div class="form-item">
|
|
|
@@ -376,9 +313,15 @@
|
|
|
<div class="fixed-btn" @click="showPriceSheetPopup">确认并报价</div>
|
|
|
</div>
|
|
|
<!-- 农资,步骤:农资已执行,请求确认 -->
|
|
|
- <div class="fixed-btn-wrap center" v-if="curRole == 2 && currentStep == 2">
|
|
|
- <!-- <div class="fixed-btn second" @click="handleShare">转发给客户</div> -->
|
|
|
- <div class="fixed-btn" @click="showUploadExecutePopup">请求确认</div>
|
|
|
+ <!-- <div class="fixed-btn-wrap center" v-if="curRole == 2 && currentStep == 2">
|
|
|
+ <div class="fixed-btn orange" @click="selectExecuteTime">确认执行时间</div>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 农资,步骤:农事已确认 -->
|
|
|
+ <div class="fixed-btn-wrap" v-if="curRole == 2 && currentStep == 2">
|
|
|
+ <div class="fixed-btn second" @click="showPriceSheetPopup">生成报价单</div>
|
|
|
+ <div class="fixed-btn" @click="handleTimelineAction(detailData)">转入农事任务</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -412,6 +355,9 @@
|
|
|
</div>
|
|
|
</popup>
|
|
|
|
|
|
+ <!-- 确认执行时间 -->
|
|
|
+ <calendar v-model:show="showCalendar" @confirm="onConfirmExecuteTime" :min-date="minDate" :max-date="maxDate" />
|
|
|
+
|
|
|
<!-- 上传执行照片 -->
|
|
|
<upload-execute ref="uploadExecuteRef" @uploadSuccess="handleUploadSuccess" :onlyShare="onlyShare" />
|
|
|
<!-- 发起需求成功弹窗 -->
|
|
|
@@ -419,6 +365,9 @@
|
|
|
|
|
|
<!-- 上传照片弹窗 -->
|
|
|
<review-upload-popup :key="10" v-model="showUpload" :record-id="sectionId" @success="handleSelfDone" />
|
|
|
+
|
|
|
+ <!-- 新增:激活上传弹窗 -->
|
|
|
+ <active-upload-popup ref="activeUploadPopupRef" @handleUploadSuccess="handleUploadSuccess"></active-upload-popup>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -426,7 +375,7 @@ import customHeader from "@/components/customHeader.vue";
|
|
|
import { ref, computed, onActivated, onDeactivated } from "vue";
|
|
|
// import NewFarmMap from "./newFarmMap";
|
|
|
import { useStore } from "vuex";
|
|
|
-import { Popup } from "vant";
|
|
|
+import { Popup, Calendar } from "vant";
|
|
|
import offerPopup from "@/components/popup/offerPopup.vue";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import farmSteps from "@/components/farmSteps.vue";
|
|
|
@@ -439,6 +388,8 @@ import { formatArea } from "@/common/commonFun";
|
|
|
import wx from "weixin-js-sdk";
|
|
|
import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
|
|
|
import FnShareSheet from "@/components/pageComponents/FnShareSheet.vue";
|
|
|
+import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
|
|
|
+import eventBus from "@/api/eventBus";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const store = useStore();
|
|
|
@@ -494,27 +445,14 @@ const demandOptions = ref([
|
|
|
{ name: "微信", icon: "wechat", type: "wechat" },
|
|
|
]);
|
|
|
const onDemandSelect = (option) => {
|
|
|
- if (option.type === "wechat") {
|
|
|
- const query = {
|
|
|
- askInfo: { title: "农事需求", content: "是否分享该农事需求给好友" },
|
|
|
- shareText: `发起了 ${detailData.value.farmWorkName} 的接单需求 请查看!`,
|
|
|
- id: detailData.value.id,
|
|
|
- farmWorkOrderId: detailData.value.orderId,
|
|
|
- postImg: triggerImg.value.length ? base_img_url2 + triggerImg.value[triggerImg.value.length - 1].cloudFilename : ''
|
|
|
- };
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=priceSheet`,
|
|
|
- });
|
|
|
- }else{
|
|
|
- VE_API.z_farm_work_record.updatePublicStatus({ recordId: query.value.id, isPublic: 1 }).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- taskPopupType.value = "success";
|
|
|
- successText.value = "需求已发送成功";
|
|
|
- taskPopupActionType.value = 0;
|
|
|
- showTaskPopup.value = true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ VE_API.z_farm_work_record.updatePublicStatus({ recordId: query.value.id, isPublic: 1 }).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ taskPopupType.value = "success";
|
|
|
+ successText.value = "需求已发送成功";
|
|
|
+ taskPopupActionType.value = 0;
|
|
|
+ showTaskPopup.value = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
const handleDemand = () => {
|
|
|
// router.push("/share_page");
|
|
|
@@ -570,6 +508,28 @@ const showPriceSheetPopup = () => {
|
|
|
priceSheetPopupRef.value.handleShowPopup(detailData.value);
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+const executorList = ref([{
|
|
|
+ id: 1,
|
|
|
+ name: "张三",
|
|
|
+ phone: "13800138000",
|
|
|
+}, {
|
|
|
+ id: 2,
|
|
|
+ name: "李四",
|
|
|
+ phone: "13800138001",
|
|
|
+}])
|
|
|
+function handleTimelineAction(item) {
|
|
|
+ eventBus.emit("activeUpload:show", {
|
|
|
+ gardenIdVal: item.farmId,
|
|
|
+ needExecutorVal: true,
|
|
|
+ problemTitleVal: '请选择 ' + item.farmWorkName + ' 执行截止时间',
|
|
|
+ imgDescVal: '请上传凭证(转入农事任务凭证)',
|
|
|
+ arrangeIdVal: item.farmWorkArrangeId,
|
|
|
+ executorListVal: executorList.value,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const showIgnore = () => {
|
|
|
taskPopupType.value = "warningIgnore";
|
|
|
showTaskPopup.value = true;
|
|
|
@@ -607,6 +567,20 @@ const handleRemindExecute = () => {
|
|
|
}, 10);
|
|
|
};
|
|
|
|
|
|
+const showCalendar = ref(false);
|
|
|
+const maxDate = ref(new Date(2025, 12, 25));
|
|
|
+const minDate = new Date(2010, 0, 1);
|
|
|
+const selectExecuteTime = () => {
|
|
|
+ showCalendar.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const formatDate = (date) => `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
|
|
+
|
|
|
+const onConfirmExecuteTime = (date) => {
|
|
|
+ console.log("date", formatDate(date));
|
|
|
+ showCalendar.value = false;
|
|
|
+};
|
|
|
+
|
|
|
const handleForward = () => {
|
|
|
if (quotationData.value.itemsList && quotationData.value.itemsList.length > 0) {
|
|
|
onlyShare.value = true;
|
|
|
@@ -658,7 +632,6 @@ onActivated(async () => {
|
|
|
const id = query.value?.id;
|
|
|
if (id) {
|
|
|
await getDetail(id);
|
|
|
- getTriggerImg(id);
|
|
|
|
|
|
//查询农场现状信息
|
|
|
getFarmWorkArrangeDetail(detailData.value.farmWorkArrangeId);
|
|
|
@@ -812,11 +785,6 @@ function getServiceCost(cost, area) {
|
|
|
return (parseFloat(cost) * parseFloat(area)).toFixed(2);
|
|
|
}
|
|
|
|
|
|
-const triggerImg = ref([]);
|
|
|
-const getTriggerImg = async (id) => {
|
|
|
- const { data } = await VE_API.z_farm_work_record.getTriggerImg({ farmWorkRecordId: id });
|
|
|
- triggerImg.value = data || [];
|
|
|
-};
|
|
|
const detailData = ref({});
|
|
|
|
|
|
// 计算距离执行时间的天数差
|
|
|
@@ -843,6 +811,7 @@ const getDetail = async (id) => {
|
|
|
const { data } = await VE_API.z_farm_work_record.getDetail({ id });
|
|
|
if (data && data.length > 0) {
|
|
|
detailData.value = data[0];
|
|
|
+ maxDate.value = new Date(detailData.value.executeDate);
|
|
|
currentStep.value = getCurrentStep(detailData.value.flowStatus);
|
|
|
parmasPage.value = {
|
|
|
...detailData.value,
|
|
|
@@ -1046,7 +1015,7 @@ const changeRegion = (e) => {
|
|
|
&.orange {
|
|
|
color: #ff953d;
|
|
|
border: 1px solid #ff953d;
|
|
|
- background: #fff;
|
|
|
+ background: rgba(255, 149, 61, 0.1);
|
|
|
}
|
|
|
&.excute {
|
|
|
background: linear-gradient(180deg, #ffd887, #ed9e1e);
|
|
|
@@ -1065,6 +1034,11 @@ const changeRegion = (e) => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
+ .tag-text {
|
|
|
+ color: #2199F8;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
.point-wrap {
|
|
|
display: flex;
|
|
|
align-items: center;
|