Commit a9c3f3f8 authored by 吴春's avatar 吴春
parents c10afdb9 07ba8c15
import { weekdays } from "moment";
var calendarUtils = {
//选中状态
checkState: {
......@@ -18,7 +20,7 @@ var calendarUtils = {
CurrentDateStr: calendarUtils.formatDate2(d)
};
},
//初始化日历
//初始化日历 一 二 三 四 五 六 日
createCalendar: function (dateStr) {
var days = [];
var date;
......@@ -75,6 +77,61 @@ var calendarUtils = {
CurrentWeek: currentWeek
};
},
//初始化日历 日 一 二 三 四 五 六
createCalendar_V2: function (dateStr) {
var days = [];
var date;
if (dateStr) {
date = new Date(dateStr);
} else {
var now = new Date();
date = new Date(calendarUtils.formatDate(now.getFullYear(), now.getMonth() + 1, 1));
}
var currentDay = date.getDate();
var currentYear = date.getFullYear();
var currentMonth = date.getMonth() + 1;
var currentWeek = date.getDay(); // 1...6,0
var str = calendarUtils.formatDate(
currentYear,
currentMonth,
currentDay
);
days.length = 0;
// 当月第一天是周日,放在第一行第1个位置,前面0个
//初始化第一周
for (var i =currentWeek ;i>=0; i--) {
var d = new Date(str);
d.setDate(d.getDate() - i);
var dayobject = {};
dayobject.day = d;
days.push(dayobject); //将日期放入data 中的days数组 供页面渲染使用
}
//其他周
var temp = 35;
if (
currentWeek +
new Date(currentYear, currentMonth, 0).getDate() >35
) {
temp = 41;
}
for (var i = 1; i < temp - currentWeek; i++) {
var d = new Date(str);
d.setDate(d.getDate() + i);
var dayobject = {};
dayobject.day = d;
days.push(dayobject);
}
return {
DayArray: days,
CurrentDay: currentDay,
CurrentMonth: currentMonth,
CurrentYear: currentYear,
CurrentWeek: currentWeek
};
},
// 返回 类似 2016-01-02 格式的字符串
formatDate: function (year, month, day) {
var y = year;
......
......@@ -37,19 +37,19 @@
<span style="color:#000000;background-color: #02F78E;padding:2px 4px;border-radius:5px">特别价</span>
</div>
<div class="hotelProductManage2_calendar">
<div class="hotelProductManage2_calendarItem" v-for="(item, index) in days" :key="index">
<div class="hotelProductManage2_calendarItem" v-for="(item, index) in dayList" :key="index">
<div class="calendarItem_month" title="点击查看详情" @click="calendarShow(item, index)">{{item.date}}</div>
<div class="hotelproductCkbox">
<el-checkbox v-model="item.isCked" @change="changeHotelStatus(item,index)">全选</el-checkbox>
</div>
<div class="calendarItem_week">
<div>周日</div>
<div>周一</div>
<div>周二</div>
<div>周三</div>
<div>周四</div>
<div>周五</div>
<div>周六</div>
<div>周日</div>
</div>
<div class="calendarItem_day">
<div v-for="(subItem, index2) in item.days" :key="index2"
......@@ -621,7 +621,7 @@
TotalInventory: '',
Validity: ''
},
days: [],
dayList: [],
calendar: {
num: 0,
show: false,
......@@ -937,15 +937,15 @@
this.hotelInfo.HotelName = json.HotelName;
this.hotelInfo.TotalInventory = json.TotalInventory;
this.hotelInfo.Validity = json.Validity;
for (let i = 0; i < this.days[key].days.length; i++) {
for (let i = 0; i < this.dayList[key].days.length; i++) {
for (let j = 0; j < json.list.length; j++) {
if (this.days[key].days[i].day === json.list[j].DayStr) {
this.days[key].days[i]['data'] = json.list[j]
if (this.dayList[key].days[i].day === json.list[j].DayStr) {
this.dayList[key].days[i]['data'] = json.list[j]
}
}
}
if (key === this.calendar.num) {
this.$set(this.calendar, 'data', this.days[this.calendar.num])
this.$set(this.calendar, 'data', this.dayList[this.calendar.num])
}
this.$forceUpdate();
}
......@@ -953,18 +953,19 @@
},
getCalendarDays: function (date, key) {
let month = new Date(date).Format('yyyy-MM')
let dayList = this.$calendarUtils.createCalendar(date).DayArray;
let tempMonth = this.$calendarUtils.createCalendar_V2(date).DayArray;
//console.log("dayList",tempMonth);
let days = [];
for (let i = 0; i < dayList.length; i++) {
let month = dayList[i].day.Format('yyyy-MM');
let day = dayList[i].day.Format('yyyy-MM-dd');
for (let i = 0; i < tempMonth.length; i++) {
let month = tempMonth[i].day.Format('yyyy-MM');
let day = tempMonth[i].day.Format('yyyy-MM-dd');
days.push({
date: dayList[i].day,
date: tempMonth[i].day,
month: month,
day: day
});
};
this.days[key] = {
this.dayList[key] = {
date: month,
days: days,
isCked: false
......
......@@ -362,7 +362,7 @@
<div>
<div class="el-col" style="width:280px">
<div>
<div class="TCL-TCNUM">{{item.TCNUM}}</div>
<div class="TCL-TCNUM">{{item.TCNUM}}({{item.TCID}})</div>
<div class="d12" style="float:none;margin:3px auto;">
<p><i class="iconfont icon-biaoti1"></i>{{item.LineName}}</p>
<p class="d12p">{{item.Title}}</p>
......@@ -528,7 +528,7 @@
<div class="TC_remarkContent">
<div class="clearfix TCL-redType">
<div class="TCL_remarkTitle">地接备注团号:</div>
<div class="TCL_Content"> {{item.CombinationNum}}</div>
<div class="TCL_Content"> {{item.DMCNum}}</div>
</div>
<div class="clearfix TCL-redType">
<div class="TCL_remarkTitle">OP对外备注:</div>
......
......@@ -383,8 +383,12 @@
</div>
<div>
<div class="el-col" style="position:relative;width:200px">
<template v-if="item.TeamType==3">
<div title="地接团" class="travel_warningDi"></div>
</template>
<template v-else>
<div v-if="item.IsWarning===1" title="紧急团" class="travel_warning"></div>
<!-- <div v-else title="地接团" class="travel_warningDi"></div> -->
</template>
<div>
<div class="TC_teamType">
<span v-if="item.IsB2B==0" title="内部团">{{$t('Operation.Op_nei')}}</span>
......@@ -589,10 +593,10 @@
<span slot="reference" class="price">{{$t('Operation.Op_priceDetail')}}</span>
</el-popover>
</p>
<p class="travelprice">
<p style="color:red;margin:20px 0 10px 0;font-size:12px;">
今日点击量:{{item.TodayClickCount}}
</p>
<p class="travelprice">
<p style="color:red;font-size:12px;">
总点击量:{{item.TotalClickCount}}
</p>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment