|
@@ -12,10 +12,13 @@
|
|
|
待确认({{ taskCounts[0] || 0 }})
|
|
待确认({{ taskCounts[0] || 0 }})
|
|
|
</div>
|
|
</div>
|
|
|
<div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
|
|
<div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
|
|
|
- 待完成({{ taskCounts[1] || 0 }})
|
|
|
|
|
|
|
+ 已确认({{ taskCounts[1] || 0 }})
|
|
|
</div>
|
|
</div>
|
|
|
<div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
|
|
<div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
|
|
|
- 已完成({{ taskCounts[2] || 0 }})
|
|
|
|
|
|
|
+ 待完成({{ taskCounts[2] || 0 }})
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="filter-item" :class="{ active: activeIndex === 3 }" @click="handleActiveFilter(3)">
|
|
|
|
|
+ 已完成({{ taskCounts[3] || 0 }})
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="select-group">
|
|
<div class="select-group">
|
|
@@ -33,9 +36,9 @@
|
|
|
</div> -->
|
|
</div> -->
|
|
|
<div class="task-content" v-loading="loading">
|
|
<div class="task-content" v-loading="loading">
|
|
|
<div class="task-item" v-for="item in taskList" :key="item.id || item.workRecordId">
|
|
<div class="task-item" v-for="item in taskList" :key="item.id || item.workRecordId">
|
|
|
- <task-item :status="activeIndex === 2 ? 1 : 0" :item-data="item">
|
|
|
|
|
|
|
+ <task-item :status="activeIndex === 3 ? 1 : 0" :item-data="item">
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
- <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 1">
|
|
|
|
|
|
|
+ <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 2">
|
|
|
<div class="footer-l" @click="toDetail(item)">
|
|
<div class="footer-l" @click="toDetail(item)">
|
|
|
查看详情
|
|
查看详情
|
|
|
</div>
|
|
</div>
|
|
@@ -48,6 +51,19 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-else-if="activeIndex === 1" class="item-footer">
|
|
|
|
|
+ <div class="footer-l" @click="toDetail(item)">
|
|
|
|
|
+ 查看详情
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="footer-r">
|
|
|
|
|
+ <div class="btn second">
|
|
|
|
|
+ 转发给客户
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btn primary" @click="showPriceSheetPopup(item)">
|
|
|
|
|
+ 生成报价单
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="item-footer" v-else>
|
|
<div class="item-footer" v-else>
|
|
|
<div class="footer-l farm-name-text">
|
|
<div class="footer-l farm-name-text">
|
|
|
来自<span class="name-text">{{ item.farmName || '未知农场' }}</span>
|
|
来自<span class="name-text">{{ item.farmName || '未知农场' }}</span>
|
|
@@ -83,6 +99,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
<div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
|
|
<div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
|
|
|
</popup>
|
|
</popup>
|
|
|
|
|
+ <!-- 服务报价单 -->
|
|
|
|
|
+ <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -94,6 +112,7 @@ import taskItem from "@/components/taskItem.vue";
|
|
|
import calendar from "./calendar.vue"
|
|
import calendar from "./calendar.vue"
|
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
|
import uploadExecute from "./uploadExecute.vue";
|
|
import uploadExecute from "./uploadExecute.vue";
|
|
|
|
|
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
|
|
|
const store = useStore();
|
|
const store = useStore();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const indexMap = new IndexMap();
|
|
const indexMap = new IndexMap();
|
|
@@ -136,8 +155,9 @@ const taskPopupType = ref('warning');
|
|
|
const getStartFlowStatus = (index) => {
|
|
const getStartFlowStatus = (index) => {
|
|
|
const statusMap = {
|
|
const statusMap = {
|
|
|
0: 0, // 待确认
|
|
0: 0, // 待确认
|
|
|
- 1: 4, // 待完成
|
|
|
|
|
- 2: 5 // 已完成
|
|
|
|
|
|
|
+ 1: '1,2,3', // 待完成
|
|
|
|
|
+ 2: 4, // 待完成
|
|
|
|
|
+ 3: 5 // 已完成
|
|
|
};
|
|
};
|
|
|
return statusMap[index] ?? 0;
|
|
return statusMap[index] ?? 0;
|
|
|
};
|
|
};
|
|
@@ -165,8 +185,9 @@ function initTaskCounts() {
|
|
|
// 并行请求三个状态的数量
|
|
// 并行请求三个状态的数量
|
|
|
Promise.all([
|
|
Promise.all([
|
|
|
getTaskCount(0, 0), // 待确认
|
|
getTaskCount(0, 0), // 待确认
|
|
|
- getTaskCount(4, 1), // 待完成
|
|
|
|
|
- getTaskCount(5, 2) // 已完成
|
|
|
|
|
|
|
+ getTaskCount('1,2,3', 1), // 待确认
|
|
|
|
|
+ getTaskCount(4, 2), // 待完成
|
|
|
|
|
+ getTaskCount(5, 3) // 已完成
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -256,6 +277,14 @@ function toDetail(item) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const priceSheetPopupRef = ref(null);
|
|
|
|
|
+const showPriceSheetPopup = (item) => {
|
|
|
|
|
+ VE_API.z_farm_work_record.getDetail({ id: item.id }).then(({ data }) => {
|
|
|
|
|
+ const res = data[0];
|
|
|
|
|
+ priceSheetPopupRef.value.handleShowPopup(res);
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const currentTask = ref(null);
|
|
const currentTask = ref(null);
|
|
|
function handleAction(item) {
|
|
function handleAction(item) {
|
|
|
if (activeIndex.value === 0) {
|
|
if (activeIndex.value === 0) {
|