|
@@ -9,7 +9,10 @@
|
|
:formatter="formatter" @select="calendarSelect" @panel-change="calendarPanelChangeSet">
|
|
:formatter="formatter" @select="calendarSelect" @panel-change="calendarPanelChangeSet">
|
|
<template #month-title></template>
|
|
<template #month-title></template>
|
|
<template #bottom-info="day">
|
|
<template #bottom-info="day">
|
|
- <div class="doT" v-if="day?.bottomInfo"></div>
|
|
|
|
|
|
+ <div class="flex justify-items-center">
|
|
|
|
+ <div class="doT" v-if="day?.bottomInfo"></div>
|
|
|
|
+ <div class="taskDot" v-if="day?.taskInfo"></div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</van-calendar>
|
|
</van-calendar>
|
|
<div class="flex justify-center" @click="expandAndCollapseClick">
|
|
<div class="flex justify-center" @click="expandAndCollapseClick">
|
|
@@ -25,32 +28,56 @@
|
|
<div class="w-full overflow-y-auto max-h-72 px-5 mb-5">
|
|
<div class="w-full overflow-y-auto max-h-72 px-5 mb-5">
|
|
<template v-for="item in visitorProgramList">
|
|
<template v-for="item in visitorProgramList">
|
|
<van-swipe-cell>
|
|
<van-swipe-cell>
|
|
- <div class="bg-[#FFA35919] ra6 p-4 mb-4" @click="jumpToVisitorDetails(item)">
|
|
|
|
- <div class="w-full flex items-center justify-between">
|
|
|
|
- <div class="text-size-in font-bold text-[#474A56]">{{ item.planName }}</div>
|
|
|
|
- <div :class="`labelTag ${item.finishState == 0 ? 'toBeCompleted' : 'completed'}`">{{ ['未完成',
|
|
|
|
- '已完成'][item.finishState] }}</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
- <div class="text-[#505050]" style="width: 62%;">拜访目的: {{ item.visitGoalName }}</div>
|
|
|
|
- <div class="w-1/3 text-[#505050] flex items-center" style="width: 38%;">
|
|
|
|
- <van-icon name="user-circle-o" class="text-size-in mr-2" />
|
|
|
|
- {{ item.customName }}
|
|
|
|
|
|
+ <!-- 拜访计划 -->
|
|
|
|
+ <template v-if="item.calendarType == 1">
|
|
|
|
+ <div class="bg-[#075985] ra6 p-4 mb-4 text-[#fff]" @click="jumpToVisitorDetails(item)">
|
|
|
|
+ <div class="w-full flex items-center justify-between">
|
|
|
|
+ <div class="text-size-in font-bold text-[#fff]">{{ item.planName }}</div>
|
|
|
|
+ <div :class="`labelTag ${item.finishState == 0 ? 'toBeCompleted' : 'completed'}`">{{ ['未完成',
|
|
|
|
+ '已完成'][item.finishState] }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
+ <div class="text-[#fff]" style="width: 62%;">拜访目的: {{ item.visitGoalName }}</div>
|
|
|
|
+ <div class="w-1/3 text-[#fff] flex items-center" style="width: 38%;">
|
|
|
|
+ <van-icon name="user-circle-o" class="text-size-in mr-2" />
|
|
|
|
+ {{ item.customName }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
+ <div class="w-2/3 text-[#fff]" style="width: 62%;">拜访时间: {{ item.visitTime }}</div>
|
|
|
|
+ <div class="w-1/3 text-[#fff] flex items-center" style="width: 38%;">
|
|
|
|
+ <van-icon name="phone-o" class="text-size-in mr-2" />
|
|
|
|
+ {{ item?.companyPhone }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
- <div class="w-2/3 text-[#505050]" style="width: 62%;">拜访时间: {{ item.visitTime }}</div>
|
|
|
|
- <div class="w-1/3 text-[#505050] flex items-center" style="width: 38%;">
|
|
|
|
- <van-icon name="phone-o" class="text-size-in mr-2" />
|
|
|
|
- <!-- {{ item.telPhone }} -->
|
|
|
|
- {{ item?.companyPhone }}
|
|
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <!-- 任务 -->
|
|
|
|
+ <template v-if="item.calendarType == 2">
|
|
|
|
+ <div class="bg-[#FFA35919] ra6 p-4 mb-4" @click="toEditTask(item)">
|
|
|
|
+ <div class="w-full flex items-center justify-between">
|
|
|
|
+ <div class="text-size-in font-bold text-[#474A56]">{{ item.taskName }}</div>
|
|
|
|
+ <div :class="`labelTag ${taskStatus[item.status]?.type}`">
|
|
|
|
+ {{ taskStatus[item.status]?.label }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
+ <div class="text-[#505050]" style="width: 100%;">任务开始时间: {{ item.endDate }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="w-full flex items-center justify-between mt-4">
|
|
|
|
+ <div class="text-[#505050]" style="width: 100%;">任务截至时间: {{ item.startDate }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
|
|
<template #right>
|
|
<template #right>
|
|
<div class="flex items-center flex-col justify-around h-full bg-[#F9F0E9] ra-l6 py-4">
|
|
<div class="flex items-center flex-col justify-around h-full bg-[#F9F0E9] ra-l6 py-4">
|
|
- <div class="buttonCircle text-white" @click.stop="jumpToAddNewVisitors(item)">
|
|
|
|
|
|
+ <div class="buttonCircle text-white" @click.stop="jumpToAddNewVisitors(item)" v-if="item.calendarType == 1">
|
|
|
|
+ <img src="/src/assets/image/edit.png" class="w-full h-full">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="buttonCircle text-white" @click.stop="toEditTask(item)" v-if="item.calendarType == 2">
|
|
<img src="/src/assets/image/edit.png" class="w-full h-full">
|
|
<img src="/src/assets/image/edit.png" class="w-full h-full">
|
|
</div>
|
|
</div>
|
|
<div class="buttonCircle text-white" @click.stop="deleteVisitor(item)">
|
|
<div class="buttonCircle text-white" @click.stop="deleteVisitor(item)">
|
|
@@ -61,7 +88,7 @@
|
|
</van-swipe-cell>
|
|
</van-swipe-cell>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
- <van-button type="primary" icon="add-o" class="m-auto w-3/5" @click="jumpToAddNewVisitors()">新增计划</van-button>
|
|
|
|
|
|
+ <van-button type="primary" icon="add-o" class="m-auto w-3/5" @click="addTaskPlanPopup = true">新增</van-button>
|
|
</div>
|
|
</div>
|
|
<!-- 没有数据的情况下 -->
|
|
<!-- 没有数据的情况下 -->
|
|
<div class="w-full h-full flex flex-col items-center justify-center" v-if="!visitorProgramList.length">
|
|
<div class="w-full h-full flex flex-col items-center justify-center" v-if="!visitorProgramList.length">
|
|
@@ -69,10 +96,19 @@
|
|
<img class="w-full h-full" src="/src/assets/image/schedule.png">
|
|
<img class="w-full h-full" src="/src/assets/image/schedule.png">
|
|
</div>
|
|
</div>
|
|
<div class="text-center text-[#C4C4C4] mb-5">您今天还没安排日程哦!</div>
|
|
<div class="text-center text-[#C4C4C4] mb-5">您今天还没安排日程哦!</div>
|
|
- <van-button type="primary" class="m-auto w-3/5" @click="jumpToAddNewVisitors()">马上安排</van-button>
|
|
|
|
|
|
+ <van-button type="primary" class="m-auto w-3/5" @click="addTaskPlanPopup = true">马上安排</van-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <!-- 拜访计划和任务的添加按钮 -->
|
|
|
|
+ <van-popup v-model:show="addTaskPlanPopup" closeable destroy-on-close position="bottom">
|
|
|
|
+ <div class="flex w-full flex-col p-12">
|
|
|
|
+ <van-button type="primary" class="m-auto" @click="addTaskClick()">新增任务</van-button>
|
|
|
|
+ <div class="h-6"></div>
|
|
|
|
+ <van-button type="primary" class="m-auto" @click="jumpToAddNewVisitors()">新增计划</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
<!-- 常用表单 -->
|
|
<!-- 常用表单 -->
|
|
<div class="mt-5">
|
|
<div class="mt-5">
|
|
<div class="text-size-large text-[#000] pl16">常用表单</div>
|
|
<div class="text-size-large text-[#000] pl16">常用表单</div>
|
|
@@ -165,7 +201,7 @@
|
|
import { ref, onActivated, nextTick } from 'vue';
|
|
import { ref, onActivated, nextTick } from 'vue';
|
|
import { showConfirmDialog } from 'vant';
|
|
import { showConfirmDialog } from 'vant';
|
|
import { useLifecycle } from '@hooks/useCommon.js';
|
|
import { useLifecycle } from '@hooks/useCommon.js';
|
|
-import { DELETE_VISITOR_PLAN, GET_VISITOR_PLAN, GET_FREQUENTLY_USED_CONTACTS, GET_COMMONLY_USED_MODULES, SAVE_COMMONLY_USED_FORMS, GET_PLAN_CALENDAR } from "@hooks/useApi";
|
|
|
|
|
|
+import { DELETE_VISITOR_PLAN, GET_VISITOR_PLAN, GET_FREQUENTLY_USED_CONTACTS, GET_COMMONLY_USED_MODULES, SAVE_COMMONLY_USED_FORMS, GET_PLAN_CALENDAR, DELETE_TASK } from "@hooks/useApi";
|
|
import { routingInfos } from "@utility/generalVariables.js";
|
|
import { routingInfos } from "@utility/generalVariables.js";
|
|
import usePxToVwView from "@hooks/usePxTransform.js";
|
|
import usePxToVwView from "@hooks/usePxTransform.js";
|
|
import useToast from "@hooks/useToast"
|
|
import useToast from "@hooks/useToast"
|
|
@@ -174,6 +210,13 @@ import requests from "@common/requests";
|
|
import useRouterStore from "@store/useRouterStore.js";
|
|
import useRouterStore from "@store/useRouterStore.js";
|
|
import useInfoStore from "@store/useInfoStore.js";
|
|
import useInfoStore from "@store/useInfoStore.js";
|
|
|
|
|
|
|
|
+const taskStatus = [
|
|
|
|
+ { label: '未开始', type: 'infos' },
|
|
|
|
+ { label: '进行中', type: 'primarys' },
|
|
|
|
+ { label: '已完成', type: 'completed' },
|
|
|
|
+ { label: '已超时', type: 'dangers' },
|
|
|
|
+]
|
|
|
|
+
|
|
const router = useRouterStore()
|
|
const router = useRouterStore()
|
|
const useInfo = useInfoStore()
|
|
const useInfo = useInfoStore()
|
|
const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
|
|
const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
|
|
@@ -191,6 +234,33 @@ const commonExpressionsHaveBeenAdded = ref([])
|
|
const commonExpressionsHaveBeenNodded = ref([])
|
|
const commonExpressionsHaveBeenNodded = ref([])
|
|
const areYouRequesting = ref(false)
|
|
const areYouRequesting = ref(false)
|
|
const displayFrequentlyUsedContacts = ref(false)
|
|
const displayFrequentlyUsedContacts = ref(false)
|
|
|
|
+const addTaskPlanPopup = ref(false)
|
|
|
|
+
|
|
|
|
+function addTaskClick() {
|
|
|
|
+ addTaskPlanPopup.value = false
|
|
|
|
+ const jumpTo = routingInfos['tasks']
|
|
|
|
+ router.navigateTo({
|
|
|
|
+ pathName: 'addEditor',
|
|
|
|
+ success: () => {
|
|
|
|
+ router.emit('addEditorParameter', {
|
|
|
|
+ routerInfo: JSON.stringify(jumpTo)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function toEditTask(row) {
|
|
|
|
+ const jumpTo = routingInfos['tasks']
|
|
|
|
+ router.navigateTo({
|
|
|
|
+ pathName: 'addEditor',
|
|
|
|
+ success: () => {
|
|
|
|
+ router.emit('addEditorParameter', {
|
|
|
|
+ routerInfo: JSON.stringify(jumpTo),
|
|
|
|
+ filedValue: JSON.stringify(row),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
function calendarPanelChangeSet(data) {
|
|
function calendarPanelChangeSet(data) {
|
|
dateConditions.value = dayjs(data.date).format('YYYY-MM-DD')
|
|
dateConditions.value = dayjs(data.date).format('YYYY-MM-DD')
|
|
@@ -254,12 +324,16 @@ function operationForm(type, row) {
|
|
}
|
|
}
|
|
|
|
|
|
function deleteVisitor(row) {
|
|
function deleteVisitor(row) {
|
|
- const { id, planName } = row
|
|
|
|
|
|
+ const { id, planName, calendarType, taskName } = row
|
|
|
|
+ const text = calendarType == 1 ? '访客' : '任务'
|
|
|
|
+ const textMessage = calendarType == 1 ? '访客计划' : '任务'
|
|
|
|
+ let formVal = {}
|
|
|
|
+ calendarType == 1 ? formVal.planId = id : formVal.taskIds = id
|
|
showConfirmDialog({
|
|
showConfirmDialog({
|
|
- title: `删除访客`,
|
|
|
|
- message: `确定删除【${planName}】访客计划吗?`,
|
|
|
|
|
|
+ title: `删除${text}`,
|
|
|
|
+ message: `确定删除【${calendarType == 1 ? planName : taskName}】${textMessage}计划吗?`,
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- requests.post(DELETE_VISITOR_PLAN, { planId: id }).then((res) => {
|
|
|
|
|
|
+ requests.post(calendarType == 1 ? DELETE_VISITOR_PLAN : DELETE_TASK, { ...formVal }).then((res) => {
|
|
toastSuccess('删除成功')
|
|
toastSuccess('删除成功')
|
|
getVisitorPlan()
|
|
getVisitorPlan()
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
@@ -272,7 +346,8 @@ function formatter(day) {
|
|
const { date, bottomInfo } = day
|
|
const { date, bottomInfo } = day
|
|
const currentDate = dayjs(date).format("YYYY-MM-DD");
|
|
const currentDate = dayjs(date).format("YYYY-MM-DD");
|
|
const rqiList = planCalendarList.value.filter(item => item.ymd === currentDate)
|
|
const rqiList = planCalendarList.value.filter(item => item.ymd === currentDate)
|
|
- day.bottomInfo = rqiList.length > 0 ? true : false
|
|
|
|
|
|
+ day.bottomInfo = (rqiList.length > 0 ? true : false)
|
|
|
|
+ day.taskInfo = (planCalendarList.value.find(item => item.currentDate === currentDate)?.taskDtoList.length > 0 ? true : false)
|
|
return day
|
|
return day
|
|
}
|
|
}
|
|
|
|
|
|
@@ -293,6 +368,7 @@ function jumpToVisitorDetails(row) {
|
|
}
|
|
}
|
|
|
|
|
|
function jumpToAddNewVisitors(row) {
|
|
function jumpToAddNewVisitors(row) {
|
|
|
|
+ addTaskPlanPopup.value = false
|
|
router.navigateTo({
|
|
router.navigateTo({
|
|
pathName: 'addEditorVisitor',
|
|
pathName: 'addEditorVisitor',
|
|
success: () => {
|
|
success: () => {
|
|
@@ -332,7 +408,21 @@ function getVisitorPlan() {
|
|
requests.post(GET_VISITOR_PLAN, {
|
|
requests.post(GET_VISITOR_PLAN, {
|
|
calenderDate: dayjs(dateConditions.value).format('YYYY-MM-DD')
|
|
calenderDate: dayjs(dateConditions.value).format('YYYY-MM-DD')
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- visitorProgramList.value = res.data || []
|
|
|
|
|
|
+ // visitorProgramList.value = res.data || []
|
|
|
|
+ visitorProgramList.value = [
|
|
|
|
+ ...(res.data.planList || []).map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ calendarType: 1,
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ ...(res.data.taskList || []).map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ calendarType: 2,
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ ]
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -352,7 +442,22 @@ function getCommonlyUsedModules() {
|
|
function getPlanCalendarList() {
|
|
function getPlanCalendarList() {
|
|
const months = calendarRef.value.getSelectedDate()
|
|
const months = calendarRef.value.getSelectedDate()
|
|
requests.post(GET_PLAN_CALENDAR, { ym: dayjs(months).format('YYYY-MM') }).then(({ data }) => {
|
|
requests.post(GET_PLAN_CALENDAR, { ym: dayjs(months).format('YYYY-MM') }).then(({ data }) => {
|
|
- planCalendarList.value = data || []
|
|
|
|
|
|
+ // planCalendarList.value = data.planList || []
|
|
|
|
+ const newData = [
|
|
|
|
+ ...(data.planList || []).map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ calendarType: 1,
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ ...(data.taskList || []).map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ calendarType: 2,
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ ]
|
|
|
|
+ planCalendarList.value = newData
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -420,6 +525,16 @@ onActivated(() => {
|
|
top: 6px;
|
|
top: 6px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.taskDot {
|
|
|
|
+ width: 10px;
|
|
|
|
+ height: 10px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #ff7300;
|
|
|
|
+ margin: auto;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 6px;
|
|
|
|
+}
|
|
|
|
+
|
|
.toBeCompleted {
|
|
.toBeCompleted {
|
|
background: rgba($color: #F38B3C, $alpha: .1);
|
|
background: rgba($color: #F38B3C, $alpha: .1);
|
|
border-color: #F38B3C;
|
|
border-color: #F38B3C;
|
|
@@ -432,6 +547,24 @@ onActivated(() => {
|
|
color: #07C160;
|
|
color: #07C160;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.infos {
|
|
|
|
+ background: rgba($color: #909399, $alpha: .1);
|
|
|
|
+ border-color: #909399;
|
|
|
|
+ color: #909399;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.primarys {
|
|
|
|
+ background: rgba($color: #075985, $alpha: .1);
|
|
|
|
+ border-color: #075985;
|
|
|
|
+ color: #075985;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.dangers {
|
|
|
|
+ background: rgba($color: #F56C6C, $alpha: .1);
|
|
|
|
+ border-color: #F56C6C;
|
|
|
|
+ color: #F56C6C;
|
|
|
|
+}
|
|
|
|
+
|
|
.labelTag {
|
|
.labelTag {
|
|
font-size: 10px;
|
|
font-size: 10px;
|
|
padding: 3px 8px;
|
|
padding: 3px 8px;
|