|
@@ -1,24 +1,11 @@
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
- <!-- 日期选择 -->
|
|
|
- <div class="time" v-if="List.length != 0">
|
|
|
- <div class="title">{{List[6].date.split("-")[0] + "年" + List[6].date.split("-")[1] + "月"}}</div>
|
|
|
- <div class="box">
|
|
|
- <div class="item" v-for="(item,index) in List" @click="change_day(item,index)" >
|
|
|
- <div class="text">{{item.week.substring(item.week.length - 1)}}</div>
|
|
|
- <div class="num" :style="index==active?'backgroundColor:#00A1E6;':''">{{item.date.substring(item.date.length - 2)}}</div>
|
|
|
- <div class="item" v-for="(item,index) in List" @click="change_day(item,index)" :key="index">
|
|
|
- <div class="text">周{{item.week.substring(item.week.length - 1)}}</div>
|
|
|
- <div class="num" :style="index==active?'backgroundColor:#00A1E6;':''">{{item.date.split("-")[2]}}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+
|
|
|
<div class="time_box">
|
|
|
<div class="icon" @click="icon_left()">
|
|
|
<van-icon name="arrow-left" />
|
|
|
</div>
|
|
|
- <div class="title">{{year}}年{{ ('0' + month).substr(-2) }}月</div>
|
|
|
+ <div class="title">{{ year }}年{{ ("0" + month).substr(-2) }}月</div>
|
|
|
<div class="icon" @click="icon_right()">
|
|
|
<van-icon name="arrow" />
|
|
|
</div>
|
|
@@ -56,19 +43,31 @@ export default {
|
|
|
List: [],
|
|
|
|
|
|
active: 6,
|
|
|
+
|
|
|
+ title: "",
|
|
|
+ year: 0,
|
|
|
+ month: 0,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.get_list();
|
|
|
|
|
|
document.body.style.backgroundColor = "#00A1E9"; //背景色
|
|
|
+ this.year = new Date().getFullYear();
|
|
|
+ this.month = new Date().getMonth() + 1;
|
|
|
+
|
|
|
+ console.log(this.year + "-" + ("0" + this.month).substr(-2));
|
|
|
+ this.get_list(this.year, this.month);
|
|
|
},
|
|
|
methods: {
|
|
|
- get_list() {
|
|
|
+ get_list(year, month) {
|
|
|
this.$http
|
|
|
.post(
|
|
|
"http://zaoquan.nxjiewei.com:8011/api/workbench/person_register/get_nearly_a_week_list",
|
|
|
- {}
|
|
|
+ {
|
|
|
+ year: year,
|
|
|
+ month: month,
|
|
|
+ }
|
|
|
)
|
|
|
.then((res) => {
|
|
|
console.log(res);
|
|
@@ -85,6 +84,32 @@ export default {
|
|
|
go_detail(id) {
|
|
|
this.$router.push(`/zaoquan/yiqing/yiqing-fanningdetail?id=` + id);
|
|
|
},
|
|
|
+
|
|
|
+ icon_left() {
|
|
|
+ //判断month
|
|
|
+ if (this.month == 1) {
|
|
|
+ this.year = this.year - 1;
|
|
|
+ this.month = 12;
|
|
|
+ } else {
|
|
|
+ this.month = this.month - 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.year, this.month);
|
|
|
+ this.get_list(this.year, this.month);
|
|
|
+ },
|
|
|
+ icon_right() {
|
|
|
+ //判断month
|
|
|
+ if (this.month == 12) {
|
|
|
+ this.year = this.year + 1;
|
|
|
+ this.month = 1;
|
|
|
+ } else {
|
|
|
+ this.month = this.month + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // console.log(this.year+'-'+('0' + this.month).substr(-2))
|
|
|
+ console.log(this.year, this.month);
|
|
|
+ this.get_list(this.year, this.month);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -188,4 +213,28 @@ export default {
|
|
|
text-align: right;
|
|
|
padding-top: 5px;
|
|
|
}
|
|
|
+
|
|
|
+.time_box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 10px;
|
|
|
+
|
|
|
+ width: 350px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 10px;
|
|
|
+
|
|
|
+ height: 50px;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.time_box .icon {
|
|
|
+ padding-top: 5px;
|
|
|
+ width: 50px;
|
|
|
+ text-align: center;
|
|
|
+ color: #00a1e9;
|
|
|
+}
|
|
|
+.time_box .title {
|
|
|
+}
|
|
|
</style>
|