|
@@ -2,20 +2,62 @@
|
|
<div class="w-full h-full workbench">
|
|
<div class="w-full h-full workbench">
|
|
<!-- 日历 -->
|
|
<!-- 日历 -->
|
|
<div class="w-full p16 backgroundThemeColor rounded-b-lg setCaleStrle">
|
|
<div class="w-full p16 backgroundThemeColor rounded-b-lg setCaleStrle">
|
|
- <van-calendar switch-mode="year-month" :show-title="false" :show-mark="false" :poppable="false" :show-confirm="false" :row-height="'3rem'" :min-date="minDate" :style="{ borderRadius: '0.3rem' }">
|
|
|
|
|
|
+ <van-calendar :default-date="(new Date(dateConditions))" switch-mode="year-month" :show-title="false" :show-mark="false" :poppable="false"
|
|
|
|
+ :show-confirm="false" :row-height="'3rem'" :min-date="minDate" :style="{ borderRadius: '0.3rem' }" @select="calendarSelect">
|
|
<template #month-title></template>
|
|
<template #month-title></template>
|
|
</van-calendar>
|
|
</van-calendar>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 日程安排 -->
|
|
<!-- 日程安排 -->
|
|
- <div class="h-52 overflow-y-auto mt-5">
|
|
|
|
|
|
+ <div class="min-h-52 overflow-y-auto mt-5">
|
|
<!-- 有数据的情况 -->
|
|
<!-- 有数据的情况 -->
|
|
- <div></div>
|
|
|
|
|
|
+ <div class="w-full h-full flex flex-col items-center" v-if="visitorProgramList.length">
|
|
|
|
+ <div class="w-full overflow-y-auto max-h-72 px-5 mb-5">
|
|
|
|
+ <template v-for="item in visitorProgramList">
|
|
|
|
+ <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 }}
|
|
|
|
+ </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 }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <template #right>
|
|
|
|
+ <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)">
|
|
|
|
+ <img src="/src/assets/image/edit.png" class="w-full h-full">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="buttonCircle text-white" @click.stop="deleteVisitor(item)">
|
|
|
|
+ <img src="/src/assets/image/delete.png" class="w-full h-full">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-swipe-cell>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ <van-button type="primary" icon="add-o" class="m-auto w-3/5" @click="jumpToAddNewVisitors()">新增计划</van-button>
|
|
|
|
+ </div>
|
|
<!-- 没有数据的情况下 -->
|
|
<!-- 没有数据的情况下 -->
|
|
- <div class="w-full h-full flex flex-col items-center justify-center">
|
|
|
|
- <div class="schedulePicture bg-black mb-5"></div>
|
|
|
|
|
|
+ <div class="w-full h-full flex flex-col items-center justify-center" v-if="!visitorProgramList.length">
|
|
|
|
+ <div class="schedulePicture mb-5">
|
|
|
|
+ <img class="w-full h-full" src="/src/assets/image/schedule.png">
|
|
|
|
+ </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">马上安排</van-button>
|
|
|
|
|
|
+ <van-button type="primary" class="m-auto w-3/5" @click="jumpToAddNewVisitors()">马上安排</van-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -24,15 +66,19 @@
|
|
<div class="text-size-large text-[#000] pl16">常用表单</div>
|
|
<div class="text-size-large text-[#000] pl16">常用表单</div>
|
|
<div class="p16 pt-0 pb-0 flex justify-between overflow-x-auto">
|
|
<div class="p16 pt-0 pb-0 flex justify-between overflow-x-auto">
|
|
<div class="flex">
|
|
<div class="flex">
|
|
- <template v-for="(item, index) in 10">
|
|
|
|
|
|
+ <template v-for="item in commonModulesList">
|
|
<div class="w80 bg-[#FFA359] h-28 rounded-md flex flex-col items-center justify-center">
|
|
<div class="w80 bg-[#FFA359] h-28 rounded-md flex flex-col items-center justify-center">
|
|
- <div class="formImage"></div>
|
|
|
|
- <div class="text-white">表单{{ index }}</div>
|
|
|
|
|
|
+ <div class="formImage">
|
|
|
|
+ <img class="w-full h-full" src="/src/assets/image/form.png">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-white">{{ item.moduleName }}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
<div class="w80 bg-[#357AF4] h-28 rounded-md flex flex-col items-center justify-center">
|
|
<div class="w80 bg-[#357AF4] h-28 rounded-md flex flex-col items-center justify-center">
|
|
- <div class="formImage"></div>
|
|
|
|
|
|
+ <div class="formImage">
|
|
|
|
+ <img class="w-full h-full" src="/src/assets/image/more.png">
|
|
|
|
+ </div>
|
|
<div class="text-white">更多</div>
|
|
<div class="text-white">更多</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -43,11 +89,15 @@
|
|
<div class="mt-3">
|
|
<div class="mt-3">
|
|
<div class="text-size-large text-[#000] pl16">常用联系人</div>
|
|
<div class="text-size-large text-[#000] pl16">常用联系人</div>
|
|
<div class="p16 pt-0 pb-0">
|
|
<div class="p16 pt-0 pb-0">
|
|
- <template v-for="item in 10">
|
|
|
|
|
|
+ <template v-for="item in topContactsList">
|
|
<div class="flex flex-row items-center rounded-md p-4 bg-white mb-5">
|
|
<div class="flex flex-row items-center rounded-md p-4 bg-white mb-5">
|
|
- <div class="contactImage"></div>
|
|
|
|
- <div class="flex-1">张三</div>
|
|
|
|
- <div class="rightArrow"></div>
|
|
|
|
|
|
+ <div class="contactImage">
|
|
|
|
+ <img class="w-full h-full" src="/src/assets/image/topContacts.png">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex-1">{{ item.name }}</div>
|
|
|
|
+ <div class="rightArrow">
|
|
|
|
+ <van-icon name="arrow" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -57,14 +107,86 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
|
+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 } from "@hooks/useApi";
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
|
+import requests from "@common/requests";
|
|
|
|
+import useRouterStore from "@store/useRouterStore.js";
|
|
|
|
|
|
|
|
+const router = useRouterStore()
|
|
|
|
+const dateConditions = ref(dayjs().format('YYYY-MM-DD'))
|
|
const minDate = ref(new Date('2024-01-01'))
|
|
const minDate = ref(new Date('2024-01-01'))
|
|
|
|
+const visitorProgramList = ref([])
|
|
|
|
+const topContactsList = ref([])
|
|
|
|
+const commonModulesList = ref([])
|
|
|
|
+
|
|
|
|
+function deleteVisitor(row) {
|
|
|
|
+ const { id } = row
|
|
|
|
+ showConfirmDialog({
|
|
|
|
+ title: `删除访客`,
|
|
|
|
+ message: `确定删除【访客名称】访客吗?`,
|
|
|
|
+ }).then(() => {
|
|
|
|
+ requests.post(DELETE_VISITOR_PLAN, { planId: id }).then((res) => {
|
|
|
|
+ toastSuccess('删除成功')
|
|
|
|
+ getVisitorPlan()
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ toastFail(err.msg ? err.msg : '删除失败')
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function calendarSelect(data) {
|
|
|
|
+ dateConditions.value = dayjs(data).format("YYYY-MM-DD");
|
|
|
|
+ getVisitorPlan()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function jumpToVisitorDetails(row) {
|
|
|
|
+ router.navigateTo({
|
|
|
|
+ pathName: 'visitorDetails',
|
|
|
|
+ success: () => {
|
|
|
|
+ router.emit('visitorDetailsParameter', {
|
|
|
|
+ row: JSON.stringify(row || {})
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function jumpToAddNewVisitors(row) {
|
|
|
|
+ router.navigateTo({
|
|
|
|
+ pathName: 'addEditorVisitor',
|
|
|
|
+ success: () => {
|
|
|
|
+ router.emit('addEditorVisitorParameter', {
|
|
|
|
+ row: JSON.stringify(row || {})
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getVisitorPlan() {
|
|
|
|
+ requests.post(GET_VISITOR_PLAN, { calenderDate: dateConditions.value }).then((res) => {
|
|
|
|
+ visitorProgramList.value = res.data.records || []
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getFrequentlyUsedContacts() {
|
|
|
|
+ requests.post(GET_FREQUENTLY_USED_CONTACTS, {}).then((res) => {
|
|
|
|
+ topContactsList.value = res.data
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getCommonlyUsedModules() {
|
|
|
|
+ requests.post(GET_COMMONLY_USED_MODULES, {}).then((res) => {
|
|
|
|
+ commonModulesList.value = res.data
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
useLifecycle({
|
|
useLifecycle({
|
|
load: () => {
|
|
load: () => {
|
|
// 添加加载逻辑
|
|
// 添加加载逻辑
|
|
|
|
+ getVisitorPlan()
|
|
|
|
+ getCommonlyUsedModules()
|
|
|
|
+ getFrequentlyUsedContacts()
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
@@ -78,40 +200,68 @@ useLifecycle({
|
|
padding-left: 16px;
|
|
padding-left: 16px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.ra-l6 {
|
|
|
|
+ border-top-left-radius: 6px;
|
|
|
|
+ border-top-right-radius: 6px;
|
|
|
|
+}
|
|
|
|
+
|
|
.w80 {
|
|
.w80 {
|
|
width: 80px;
|
|
width: 80px;
|
|
margin-right: 12px;
|
|
margin-right: 12px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.toBeCompleted {
|
|
|
|
+ background: rgba($color: #F38B3C, $alpha: .1);
|
|
|
|
+ border-color: #F38B3C;
|
|
|
|
+ color: #F38B3C;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.completed {
|
|
|
|
+ background: rgba($color: #07C160, $alpha: .1);
|
|
|
|
+ border-color: #07C160;
|
|
|
|
+ color: #07C160;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.labelTag {
|
|
|
|
+ font-size: 10px;
|
|
|
|
+ padding: 3px 8px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ border: 1px solid;
|
|
|
|
+}
|
|
|
|
+
|
|
.formImage {
|
|
.formImage {
|
|
width: 24px;
|
|
width: 24px;
|
|
height: 24px;
|
|
height: 24px;
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
- background: #000;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.contactImage {
|
|
.contactImage {
|
|
width: 29px;
|
|
width: 29px;
|
|
height: 29px;
|
|
height: 29px;
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
- background: #000;
|
|
|
|
margin-right: 12px;
|
|
margin-right: 12px;
|
|
}
|
|
}
|
|
|
|
|
|
.rightArrow {
|
|
.rightArrow {
|
|
- width: 24px;
|
|
|
|
- height: 27px;
|
|
|
|
- background: #000;
|
|
|
|
|
|
+ font-size: 16px;
|
|
}
|
|
}
|
|
|
|
|
|
.schedulePicture {
|
|
.schedulePicture {
|
|
width: 48px;
|
|
width: 48px;
|
|
height: 51px;
|
|
height: 51px;
|
|
}
|
|
}
|
|
-.setCaleStrle ::v-deep .van-calendar__month-title {
|
|
|
|
|
|
+
|
|
|
|
+.buttonCircle {
|
|
|
|
+ width: 37px;
|
|
|
|
+ height: 37px;
|
|
|
|
+ margin: 0 14px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.setCaleStrle :deep(.van-calendar__month-title) {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|
|
-.setCaleStrle ::v-deep .van-calendar__month {
|
|
|
|
|
|
+
|
|
|
|
+.setCaleStrle :deep(.van-calendar__month) {
|
|
padding: 0.8rem 0 0.5rem 0;
|
|
padding: 0.8rem 0 0.5rem 0;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|