zhangyanpeng
2020-04-22 d7e4b63134fbb434ef382453ed8d3ef4cf378808
src/views/calendarTask.vue
@@ -21,7 +21,7 @@
         </div>
      </div>
      
      <el-dialog @close="Cancel" width="40%" top="10%" :visible.sync="dialog_1" v-if="dialog_1">
      <el-dialog width="40%" top="10%" :visible.sync="dialog_1" v-if="dialog_1">
         <div slot="title" class="dialog-title" style="text-align: left;">
           <span> 任务处理 </span>
         </div>
@@ -37,7 +37,6 @@
               ref="upload"
               :on-success="upSuccess"
               :on-error="upError"
               >
               <el-button size="medium" type="text">选择文件</el-button>
               <div slot="tip" class="el-upload__tip">文件不超过50M</div>
@@ -49,13 +48,14 @@
               type="textarea"
               :rows="2"
               placeholder="请输入内容"
               @change="setDesc"
               v-model="desc_task">
            </el-input>
         </div>
         
         <!-- 处理完成 -->
         <div slot="footer" class="dialog-footer">
            <el-button v-if="handleTaskType.mustAttach" @click="submitUpload">点击上传</el-button>
         <!--    <el-button v-if="handleTaskType.mustAttach" @click="submitUpload">点击上传</el-button> -->
            <el-button @click="Cancel">取 消</el-button>
            <el-button type="primary" @click="doHandleTask">处理完成</el-button>
         </div>
@@ -73,6 +73,8 @@
        },
        data(){
           return{
                  isZ: true,
                  me_date: null,
              datedef:[
                     {'date': "2020-01-01", 'task': 3},
                     {'date': "2020-01-11", 'task': 2},
@@ -95,6 +97,7 @@
               
               //获取当月数据
               let nowDate = new Date();
               this.me_date = nowDate;
               var imoment = this.$moment(nowDate);
               let iformat = imoment.format('YYYY-MM');
               let systemDate = iformat + '-01 00:00:00';
@@ -132,6 +135,12 @@
                  this.dialog_1 = true;
               },
               
               setDesc(val) {
                  this.upData = {//设置要传的参数
                     desp: val
                  };
               },
               doHandleTask() {
                  //此id的明细任务完成
                  let id = this.handleTaskType.id;
@@ -139,9 +148,6 @@
                     this.$message('请填写描述');
                     return
                  }
                  this.upData = {//设置要传的参数
                     desp: this.desc_task
                  };
                  
                  if(this.handleTaskType.mustAttach) {
                     this.$refs.upload.submit();//开始上传
@@ -154,7 +160,7 @@
                        params   
                        })
                        .then(data_ => {
                           console.log(data_);
                        //   console.log(data_);
                           if(data_.data.success) {
                              this.$message('处理成功');
                              me.Cancel();
@@ -162,15 +168,15 @@
                              this.$message({message:'处理任务失败', type: 'warning'});
                           }
                        }).catch(error => {
                           console.log(error);
                        //   console.log(error);
                        });
                  }
                  
                  
                  
                  if (this.dialog_1) {
                  /* if (this.dialog_1) {
                     this.Cancel();
                  }
                  } */
               },
               
            submitUpload() {
@@ -185,6 +191,7 @@
             
             upSuccess(response, file, fileList) {
                this.$message('上传成功');
                this.Cancel();
             },
             
             upError(err, file, fileList) {
@@ -192,10 +199,21 @@
             },
               
               Cancel() {
                  this.isZ = false;
                  this.isZ = true;
                  this.dialog_1 = false;
               //   let header_height = this.$refs.calendar_div.getElementsByClassName('z_calendar_table')[0].offsetHeight;
               //   this.$refs.calendar_div.getElementsByClassName('z_right')[0].style['height'] = header_height + "px";
                  this.DayDataTree = [];
                  var imoment = this.$moment(this.me_date);
                  let iformat = imoment.format('YYYY-MM');
                  let systemDate = iformat + '-01 00:00:00';
                  this.getDatedef(systemDate);
               },
               
               dateChange(date_) {
                  this.me_date = date_;
                  var imoment = this.$moment(date_);
                  let iformat = imoment.format('YYYY-MM');
                  let systemDate = iformat + '-01 00:00:00';
@@ -227,7 +245,8 @@
                        params
                     })
                     .then(data_ => {
                        console.log(data_);
                     //   console.log(data_);
                        window.console.log(data_);
                        let datas= data_.data.data;
                        datas = datas.map(el => {
                           var imoment = this.$moment(el.date);
@@ -238,7 +257,7 @@
                        })
                        this.datedef = datas;
                     }).catch(error => {
                        console.log(error);
                  //      console.log(error);
                     });
               },
               
@@ -252,7 +271,8 @@
                        params
                     })
                     .then(data_ => {
                        console.log(data_);
                     //   console.log(data_);
                        window.console.log(data_);
                        // let DayDatas = [
                        //    {'id': "111", 'name': "测试1项目", 'desc': "此项目主要针对提高效率和销售量"}, //返回的数组字段
                        //    {'id': "111_1", 'name': "立题服务", 'mustAttach': true, 'parentId': "111"}, //
@@ -287,10 +307,10 @@
                        }
                        this.DayDataTree = result;
                     }).catch(error => {
                        console.log(error);
                     //   console.log(error);
                     })
               }
               },
               
            }
      }