|
@@ -1,5 +1,6 @@
|
|
|
<script setup>
|
|
|
import { reactive, toRefs, ref, watch, onMounted } from 'vue';
|
|
|
+import { DatetimePicker , Popup } from 'vant';
|
|
|
import moment from 'moment';
|
|
|
import 'moment/dist/locale/zh-cn';
|
|
|
moment.locale('zh-cn');
|
|
@@ -151,6 +152,15 @@ const touchEndHandle = (e) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 唤起日历
|
|
|
+let showCalendar=ref(false)
|
|
|
+function onSelectCalendarConfirm(e){
|
|
|
+ const t=moment(e).format('YYYY-MM-DD')
|
|
|
+ getRecentWeek(t)
|
|
|
+ selectDateHandle(t,1)
|
|
|
+ showCalendar.value=false
|
|
|
+}
|
|
|
+
|
|
|
/* 选中日期 更新日历 */
|
|
|
watch(
|
|
|
() => state.selectDate,
|
|
@@ -171,9 +181,12 @@ const { weekDateList, selectDate, moveIndex, touch } = toRefs(state);
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <h3 class="current-date">{{ moment(selectDate).format('YYYY年MM月') }}</h3>
|
|
|
+ <h3 class="current-date">
|
|
|
+ <img class="icon" @click="showCalendar=true" src="@/assets/ssbg/calendar__grey_ico.png" alt="" v-if="$route.path==='/ssbg/businesstrip/calendar'">
|
|
|
+ <span>{{ moment(selectDate).format('YYYY年MM月') }}</span>
|
|
|
+ </h3>
|
|
|
<ul class="weekend-ul">
|
|
|
- <li v-for="item in weekDays">
|
|
|
+ <li v-for="item in weekDays" :key="item.label">
|
|
|
<span>{{ item.label }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -215,12 +228,28 @@ const { weekDateList, selectDate, moveIndex, touch } = toRefs(state);
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ v-model:show="showCalendar"
|
|
|
+ round
|
|
|
+ position="bottom"
|
|
|
+ >
|
|
|
+ <DatetimePicker
|
|
|
+ type="date"
|
|
|
+ title="选择年月日"
|
|
|
+ @confirm="onSelectCalendarConfirm"
|
|
|
+ />
|
|
|
+ </Popup>
|
|
|
</template>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.current-date {
|
|
|
text-align: center;
|
|
|
margin-bottom: 10px;
|
|
|
+ .icon{
|
|
|
+ width: 34px;
|
|
|
+ margin-right: 29px;
|
|
|
+ }
|
|
|
}
|
|
|
.weekend-ul {
|
|
|
display: flex;
|