|
|
@@ -10,25 +10,10 @@
|
|
|
:class="{ warning: query.status === 'warning' }"
|
|
|
v-if="currentStep !== 0 || query.status === 'warning'"
|
|
|
>
|
|
|
- <div class="status-l" v-if="status === 0">
|
|
|
+ <div class="status-l">
|
|
|
<div class="stauts-text">{{ query.status === "warning" ? "已过期" : "待完成" }}</div>
|
|
|
- <div class="stauts-sub-text" v-if="query.status !== 'warning' && detailData?.executeDate">
|
|
|
- <template v-if="daysDiff > 0">
|
|
|
- 距离预计执行时间还差 <span class="time-text">{{ daysDiff }}</span> 天
|
|
|
- </template>
|
|
|
- <template v-else-if="daysDiff < 0">
|
|
|
- 距离预计执行时间已经过去了 <span class="time-text">{{ Math.abs(daysDiff) }}</span> 天
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- 预计执行时间为今天
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="stauts-sub-text" v-else-if="query.status === 'warning'">该农事触发但未执行</div>
|
|
|
- </div>
|
|
|
- <div class="status-l" v-if="status === 1">
|
|
|
- <div class="stauts-text">
|
|
|
- <el-icon color="#2199F8" size="16" class="status-icon"><Select /></el-icon>
|
|
|
- 该农事已完成
|
|
|
+ <div class="stauts-sub-text" v-if="detailData?.executeDeadlineDate">
|
|
|
+ 截止到 <span class="time-text">{{ detailData?.executeDeadlineDate }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <template v-if="query.status !== 'warning'">
|
|
|
@@ -250,13 +235,16 @@
|
|
|
<div class="fixed-btn-wrap center" v-if="curRole == 2 && !detailData?.expectedExecuteDate">
|
|
|
<div class="fixed-btn orange" @click="selectExecuteTime">确认执行时间</div>
|
|
|
</div>
|
|
|
+ <div class="fixed-btn-wrap center" v-if="curRole == 2 && detailData?.expectedExecuteDate">
|
|
|
+ <div class="fixed-btn orange" @click="showOfferPopup(detailData)">上传照片</div>
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
<!-- 农资,步骤:农事已确认 -->
|
|
|
- <div class="fixed-btn-wrap" v-if="curRole == 2 && detailData?.expectedExecuteDate">
|
|
|
+ <!-- <div class="fixed-btn-wrap" v-if="curRole == 2 && detailData?.expectedExecuteDate">
|
|
|
<div class="fixed-btn second" @click="showPriceSheetPopup">生成报价单</div>
|
|
|
<div class="fixed-btn" @click="handleTimelineAction(detailData)">转入农事任务</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 报价弹窗 -->
|
|
|
@@ -302,6 +290,8 @@
|
|
|
|
|
|
<!-- 新增:激活上传弹窗 -->
|
|
|
<active-upload-popup ref="activeUploadPopupRef" @handleUploadSuccess="handleUploadSuccess"></active-upload-popup>
|
|
|
+
|
|
|
+ <offer-popup ref="offerPopupRef" @uploadSuccess="handleUploadSuccess"></offer-popup>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -442,6 +432,13 @@ const showPriceSheetPopup = () => {
|
|
|
priceSheetPopupRef.value.handleShowPopup(detailData.value);
|
|
|
};
|
|
|
|
|
|
+const offerPopupRef = ref(null);
|
|
|
+const isGoBack = ref(false);
|
|
|
+const showOfferPopup = (item) => {
|
|
|
+ isGoBack.value = true;
|
|
|
+ offerPopupRef.value.openPopup(item);
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
const executorList = ref([{
|
|
|
id: 1,
|
|
|
@@ -464,52 +461,15 @@ function handleTimelineAction(item) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const showIgnore = () => {
|
|
|
- taskPopupType.value = "warningIgnore";
|
|
|
- showTaskPopup.value = true;
|
|
|
-};
|
|
|
-
|
|
|
-const handleConfirmExecute = () => {
|
|
|
- VE_API.z_farm_work_record_cost
|
|
|
- .selectQuote({ farmWorkRecordId: query.value.id, agriculturalId: quotationData.value.agriculturalId })
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- taskPopupType.value = "success";
|
|
|
- successText.value = "农事已锁单成功";
|
|
|
- taskPopupActionType.value = 0;
|
|
|
- showTaskPopup.value = true;
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-const handleConfirmComplete = () => {
|
|
|
- VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 5 }).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- taskPopupType.value = "success";
|
|
|
- successText.value = "农事已经执行结束,请按照时间复核";
|
|
|
- taskPopupActionType.value = 1;
|
|
|
- showTaskPopup.value = true;
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-const handleRemindExecute = () => {
|
|
|
- onlyShare.value = true;
|
|
|
- parmasPage.value.farmMiniUserId = orderObj.value.agriculturalUserId;
|
|
|
- setTimeout(() => {
|
|
|
- uploadExecuteRef.value.showPopup({ ...parmasPage.value, type: "remindExecute" });
|
|
|
- }, 10);
|
|
|
-};
|
|
|
-
|
|
|
const showCalendar = ref(false);
|
|
|
const maxDate = ref(new Date());
|
|
|
const minDate = new Date(2010, 0, 1);
|
|
|
const selectExecuteTime = () => {
|
|
|
+ console.log("detailData.value", detailData.value.executeDeadlineDate);
|
|
|
maxDate.value = new Date(detailData.value.executeDeadlineDate);
|
|
|
showCalendar.value = true;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
const onConfirmExecuteTime = (date) => {
|
|
|
showCalendar.value = false;
|
|
|
VE_API.z_farm_work_record.updateExpectedExecuteDate({ recordId: query.value.id, expectedExecuteDate: formatDate(date) }).then((res) => {
|
|
|
@@ -550,7 +510,12 @@ const showUploadExecutePopup = () => {
|
|
|
};
|
|
|
|
|
|
const handleUploadSuccess = () => {
|
|
|
- getDetail(query.value.id);
|
|
|
+ if (isGoBack.value) {
|
|
|
+ isGoBack.value = false;
|
|
|
+ router.back();
|
|
|
+ } else {
|
|
|
+ getDetail(query.value.id);
|
|
|
+ }
|
|
|
};
|
|
|
// 地图
|
|
|
// const areaRef = ref(null);
|
|
|
@@ -626,7 +591,7 @@ onActivated(async () => {
|
|
|
|
|
|
return {
|
|
|
...pesticide,
|
|
|
- brand: priceInfo.brand || "--",
|
|
|
+ brand: pesticide.brand || "--",
|
|
|
totalPrice: priceInfo.totalPrice,
|
|
|
// 格式化字段供 price-table 组件使用
|
|
|
price: price > 0 ? `${price}元/${unit}` : "--", // 格式化单价显示
|
|
|
@@ -699,7 +664,6 @@ onActivated(async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.log("quotationData.value", quotationData.value);
|
|
|
// const point = store.state.home.miniUserLocationPoint;
|
|
|
// if (areaRef.value) {
|
|
|
// newFarmMap.initMap(point, areaRef.value, false);
|
|
|
@@ -749,6 +713,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];
|
|
|
+ console.log("detailData.value", detailData.value.executeDeadlineDate);
|
|
|
// maxDate.value = new Date(detailData.value.executeDate);
|
|
|
currentStep.value = getCurrentStep(detailData.value.flowStatus);
|
|
|
parmasPage.value = {
|
|
|
@@ -1045,7 +1010,7 @@ const changeRegion = (e) => {
|
|
|
}
|
|
|
}
|
|
|
.stauts-sub-text {
|
|
|
- color: rgba(255, 255, 255, 0.51);
|
|
|
+ // color: rgba(255, 255, 255, 0.51);
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
.time-text {
|