|
|
@@ -1,7 +1,41 @@
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
<div class="page-left">
|
|
|
- <a-calendar v-model:value="calendarValue">
|
|
|
+ <div class="search-bar">
|
|
|
+ <a-form :model="queryForm" @finish="searchData" layout="inline" autocomplete="off" :colon="false">
|
|
|
+ <a-form-item label="营销团队范围">
|
|
|
+ <a-select style="width: 180px" v-model:value="queryForm.teamScope" placeholder="请选择营销团队范围">
|
|
|
+ <a-select-option :value="1">范围1</a-select-option>
|
|
|
+ <a-select-option :value="2">范围2</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="营销经理">
|
|
|
+ <a-select style="width: 180px" v-model:value="queryForm.manager" placeholder="请选择营销经理">
|
|
|
+ <a-select-option :value="1">经理1</a-select-option>
|
|
|
+ <a-select-option :value="2">经理2</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button type="primary" html-type="submit">查询</a-button>
|
|
|
+ <a-button style="margin-left: 10px" @click="resetForm">重置</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <a-calendar v-model:value="queryForm.date" @change="handleCalendarChange" valueFormat="YYYY-MM-DD">
|
|
|
+ <template #headerRender="{ value }">
|
|
|
+ <div class="calendar-header">
|
|
|
+ <div class="header-date">{{ dayjs(value).format('YYYY-MM') }}</div>
|
|
|
+ <a-space-compact>
|
|
|
+ <a-button type="primary" @click="handleSwitchDate('PREV')" ghost>
|
|
|
+ <LeftOutlined />
|
|
|
+ </a-button>
|
|
|
+ <a-button type="primary" @click="handleSwitchDate('TODAY')">今天</a-button>
|
|
|
+ <a-button type="primary" @click="handleSwitchDate('NEXT')" ghost>
|
|
|
+ <RightOutlined />
|
|
|
+ </a-button>
|
|
|
+ </a-space-compact>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #dateCellRender="{ current }">
|
|
|
<div class="events" v-if="getListData(current).total > 0">
|
|
|
<div class="events-total">共计{{ getListData(current).total }}项任务</div>
|
|
|
@@ -17,46 +51,59 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #monthCellRender="{ current }">
|
|
|
- <div v-if="getMonthData(current)" class="notes-month">
|
|
|
- <!-- <section>{{ getMonthData(current) }}</section>
|
|
|
- <span>Backlog number</span> -->
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</a-calendar>
|
|
|
</div>
|
|
|
<div class="page-right">
|
|
|
<div class="line-1">
|
|
|
<a-input-search v-model:value="searchValue" placeholder="请输入日程内容" enter-button="搜索" @search="onSearch" />
|
|
|
- <a-button type="primary" ghost>添加日程</a-button>
|
|
|
+ <a-button :icon="h(PlusSquareOutlined)" type="primary">创建计划</a-button>
|
|
|
</div>
|
|
|
<div class="line-2">
|
|
|
<StateTabs v-model:value="taskState" :options="taskOptions" />
|
|
|
</div>
|
|
|
<div class="line-content">
|
|
|
- <template v-if="taskState === 0">
|
|
|
- <div>待完成</div>
|
|
|
- </template>
|
|
|
- <template v-if="taskState === 1">
|
|
|
- <div>已完成</div>
|
|
|
- </template>
|
|
|
+ <CalendarDetail :type="taskState" :data="calendarDetail" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script lang="ts" setup>
|
|
|
- import { ref, reactive } from 'vue';
|
|
|
- import { Dayjs } from 'dayjs';
|
|
|
- import StateTabs from './components/stateTabs/index.vue';
|
|
|
+<script setup>
|
|
|
+ import dayjs from 'dayjs';
|
|
|
+ import { ref, reactive, h, onMounted, watch } from 'vue';
|
|
|
import { theme, message } from 'ant-design-vue';
|
|
|
+ import { PlusSquareOutlined } from '@ant-design/icons-vue';
|
|
|
+
|
|
|
+ import { fetchVisitCalendar } from '/@/api/customer-manage/index.js';
|
|
|
+ import StateTabs from './components/stateTabs/index.vue';
|
|
|
+ import CalendarDetail from './components/calendarDetail/index.vue';
|
|
|
|
|
|
const { useToken } = theme;
|
|
|
const { token } = useToken();
|
|
|
|
|
|
+ const queryForm = reactive({
|
|
|
+ teamScope: undefined,
|
|
|
+ manager: undefined,
|
|
|
+ date: dayjs().format('YYYY-MM-DD'),
|
|
|
+ });
|
|
|
+
|
|
|
+ function fetchVisitCalendarData() {
|
|
|
+ console.log('fetchVisitCalendarData', queryForm);
|
|
|
+ // fetchVisitCalendar(queryForm).then((res) => {});
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(fetchVisitCalendarData);
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => ({ date: queryForm.date }),
|
|
|
+ () => {
|
|
|
+ fetchVisitCalendarData();
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+ );
|
|
|
+
|
|
|
// left
|
|
|
- const calendarValue = ref<Dayjs>('');
|
|
|
|
|
|
- const getListData = (value: Dayjs) => {
|
|
|
+ const getListData = (value) => {
|
|
|
let listData;
|
|
|
switch (value.date()) {
|
|
|
case 7:
|
|
|
@@ -96,37 +143,84 @@
|
|
|
return listData ?? { total: 0, details: [] };
|
|
|
};
|
|
|
|
|
|
- const getMonthData = (value: Dayjs) => {
|
|
|
+ const getMonthData = (value) => {
|
|
|
if (value.month() === 8) {
|
|
|
return 1394;
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ function handleSwitchDate(type) {
|
|
|
+ switch (type) {
|
|
|
+ case 'PREV':
|
|
|
+ queryForm.date = dayjs(queryForm.date).subtract(1, 'day').format('YYYY-MM-DD');
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'TODAY':
|
|
|
+ queryForm.date = dayjs().format('YYYY-MM-DD');
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'NEXT':
|
|
|
+ queryForm.date = dayjs(queryForm.date).add(1, 'day').format('YYYY-MM-DD');
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function searchData() {
|
|
|
+ fetchVisitCalendarData();
|
|
|
+ }
|
|
|
+
|
|
|
+ function resetForm() {
|
|
|
+ queryForm.teamScope = undefined;
|
|
|
+ queryForm.manager = undefined;
|
|
|
+ fetchVisitCalendarData();
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleCalendarChange(date) {
|
|
|
+ console.log('handleCalendarChange', date);
|
|
|
+ }
|
|
|
// right
|
|
|
// line-1
|
|
|
- const searchValue = ref<string>('');
|
|
|
+ const searchValue = ref('');
|
|
|
|
|
|
- const onSearch = (searchValue: string) => {
|
|
|
+ const onSearch = (searchValue) => {
|
|
|
console.log('use searchValue', searchValue);
|
|
|
console.log('or use this.searchValue', searchValue.value);
|
|
|
};
|
|
|
// line-2
|
|
|
- const taskState = ref<number>(0);
|
|
|
- const taskOptions = reactive<IKeyValue[]>([
|
|
|
+ const taskState = ref(0);
|
|
|
+ const taskOptions = reactive([
|
|
|
{ key: 0, label: '待完成', count: 0 },
|
|
|
{ key: 1, label: '已完成', count: 0 },
|
|
|
]);
|
|
|
+ // line-3
|
|
|
+ const calendarDetail = reactive([]);
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .search-bar {
|
|
|
+ margin-bottom: 14px;
|
|
|
+ }
|
|
|
+ .calendar-header {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ gap: 20px;
|
|
|
+ .header-date {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
.events {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
gap: 4px;
|
|
|
.events-total {
|
|
|
- // v-bind('token.colorPrimary');
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
- padding: 4px 0 4px 4px;
|
|
|
+ padding: 4px 0 4px 6px;
|
|
|
border-left: 2px solid v-bind('token.colorPrimary');
|
|
|
border-top-right-radius: 6px;
|
|
|
border-bottom-right-radius: 6px;
|
|
|
@@ -186,6 +280,7 @@
|
|
|
gap: 8px;
|
|
|
}
|
|
|
.line-content {
|
|
|
+ flex: 1;
|
|
|
}
|
|
|
}
|
|
|
}
|