| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <template>
- <section>
- <!--工具条-->
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
- <el-form :inline="true">
- <el-form-item>
- <el-date-picker v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change='changeMonth()' :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
- </el-form-item>
- <el-form-item style="float:right;">
- <el-link type="primary" :underline="false" @click="handleAdd">导出日报</el-link>
- </el-form-item>
- <el-form-item style="float:right;">
- <el-link type="primary" :underline="false" @click="handleAdd">项目管理</el-link>
- </el-form-item>
- </el-form>
- </el-col>
- <!--列表-->
- <div>
- <el-card class="box-card daily" shadow="never" :style="'height:'+tableHeight +'px'">
- <div slot="header" class="clearfix">
- <span>日期:</span>
- <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'" @click="choseDate(index)">{{item}}</span>
- </div>
- <div class="allDaily">
- <div class="one_daily">
- <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item>
- <el-card shadow="never">
- <p>项目:<b>工时管家开发项目</b></p>
- <p>时长:1.5h</p>
- <p>事项:1.重新设计工作日报模块<br>
- 2.绘制原型图<br>
- 3.敲代码<br>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- <div class="one_daily">
- <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item>
- <el-card shadow="never">
- <p>项目:<b>工时管家开发项目</b></p>
- <p>时长:1.5h</p>
- <p>事项:1.重新设计工作日报模块<br>
- 2.绘制原型图<br>
- 3.敲代码<br>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- <div class="one_daily">
- <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item>
- <el-card shadow="never">
- <p>项目:<b>工时管家开发项目</b></p>
- <p>时长:1.5h</p>
- <p>事项:1.重新设计工作日报模块<br>
- 2.绘制原型图<br>
- 3.敲代码<br>
- </p>
- </el-card>
- </el-timeline-item>
- <el-timeline-item>
- <el-card shadow="never">
- <p>项目:<b>工时管家开发项目</b></p>
- <p>时长:1.5h</p>
- <p>事项:1.重新设计工作日报模块<br>
- 2.绘制原型图<br>
- 3.敲代码<br>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- </section>
- </template>
- <script>
- import util from '../../common/js/util'
- export default {
- data() {
- return {
- user: JSON.parse(sessionStorage.getItem('user')),
- allDate: [],
- date: util.formatDate.format(new Date(new Date()), 'yyyy-MM'),
- choseDay: 0,
- tableHeight: 0,
- listLoading: false,
- total: 0,
- page: 1,
- size: 20,
- list: [],
-
- addFormVisible: false,
- addLoading: false,
- }
- },
- methods: {
- changeMonth() {
- this.getAllDate();
- this.getList();
- },
- choseDate(i) {
- this.choseDay = i;
- },
- getAllDate() {
- var dayArry = [];
- var day = this.getCountDays();
- for (var k = 1; k <= day; k++) {
- var str = new Date(this.date.replace(/-/g,'/')).getMonth() + 1 + "月" + k + "日";
- if(new Date(this.date.replace(/-/g,'/')).getFullYear() == new Date(new Date()).getFullYear() &&
- new Date(this.date.replace(/-/g,'/')).getMonth() == new Date(new Date()).getMonth()) {
- if(new Date().getDate() == k) {
- this.choseDay = k-1;
- }
- } else {
- this.choseDay = 0;
- }
- dayArry.push(str);
- }
- this.allDate = dayArry;
- },
- getCountDays() {
- var newstr = this.date.replace(/-/g,'/');
- var curDate = new Date(newstr);
- var curMonth = curDate.getMonth();
- curDate.setMonth(curMonth + 1);
- curDate.setDate(0);
- return curDate.getDate();
- },
- //分页
- handleCurrentChange(val) {
- this.page = val;
- this.getList();
- },
- handleSizeChange(val) {
- this.size = val;
- this.getList();
- },
-
- //获取项目列表
- getList() {
- this.listLoading = true;
- this.http.post(this.port.project.projectList, {
- keyName: '',
- pageNum: this.page,
- pageSize: this.size,
- }, res => {
- this.listLoading = false;
- if (res.code == "ok") {
- var list = res.data.list;
- for(var i in list){
- var customCompaniesStr = "";
- for(var j in list[i].customCompanies){
- if(j == list[i].customCompanies.length -1){
- customCompaniesStr += list[i].customCompanies[j].companyName;
- } else {
- customCompaniesStr += list[i].customCompanies[j].companyName + "、";
- }
- }
- list[i].customCompaniesStr = customCompaniesStr;
- }
- this.list = list;
- this.total = res.data.total;
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- });
- }
- }, error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: 'error'
- });
- })
- },
- //显示新增界面
- handleAdd() {
- this.getUnusual();
- this.addFormVisible = true;
- },
- // 获取异常列表
- getUnusual() {
- this.listLoading = true;
- this.http.post(this.port.project.projectList, {
- keyName: '',
- pageNum: this.page,
- pageSize: this.size,
- }, res => {
- this.listLoading = false;
- if (res.code == "ok") {
- var list = res.data.list;
- for(var i in list){
- var customCompaniesStr = "";
- for(var j in list[i].customCompanies){
- if(j == list[i].customCompanies.length -1){
- customCompaniesStr += list[i].customCompanies[j].companyName;
- } else {
- customCompaniesStr += list[i].customCompanies[j].companyName + "、";
- }
- }
- list[i].customCompaniesStr = customCompaniesStr;
- }
- this.list = list;
- this.total = res.data.total;
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- });
- }
- }, error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: 'error'
- });
- })
- },
- },
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 170;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 170;
- };
- },
- mounted() {
- this.getAllDate();
- this.getList();
- }
- }
- </script>
- <style lang="scss" scoped>
- .clearfix {
- overflow-x: auto;
- white-space: nowrap;
- padding: 15px 0;
- .date_item {
- padding:0 15px;
- cursor: pointer;
- }
- .chooseDate {
- color: #20a0ff;
- }
- }
- .one_daily {
- i {
- color: #9ED0FF;
- margin-right: 5px;
- }
- .one_daily_body {
- padding: 15px 0px;
- p {
- margin: 0;
- line-height: 30px;
- }
- }
- ul {
- padding: 0;
- }
- }
- </style>
- <style lang="scss">
- .daily {
- .el-card__body {
- height: 82%;
- overflow-y: auto;
- }
- }
- </style>
|