Prechádzať zdrojové kódy

调整周报填写出现时间问题bug状况

humingbo 1 rok pred
rodič
commit
22e5cbf2a5
1 zmenil súbory, kde vykonal 21 pridanie a 8 odobranie
  1. 21 8
      src/views/meeting/weekly.vue

+ 21 - 8
src/views/meeting/weekly.vue

@@ -104,7 +104,6 @@
     </div>
     <div style="margin-top: 50px;margin-right: 150px;  width: 65%;text-align: center">
       <el-button size="mini" type="primary" @click="saveWorkPlan()" v-if="currentWeek===weeks">保存工作计划</el-button>
-
     </div>
 
     <!-- 任务详情对话框 -->
@@ -194,7 +193,8 @@ export default {
             meetingId: null,
             completionTimes: null,
             completionTime: null,
-            projectId: null
+            projectId: null,
+            beginDate:null
           }]
         }
         this.weeks = response.data.weeks
@@ -275,21 +275,34 @@ export default {
             this.$message.warning("请选择周会会议,再填写工作计划!")
             return
           }
-
           let workPlanss = this.workPlans;
-          for (let i = 0; i < workPlanss.length; i++) {
-            if(workPlanss[i].planContent==='' || workPlanss[i].completionTimes===''){
+          let newWorkPlans = []
+          for(let i = 0; i < workPlanss.length; i++){
+            if(workPlanss[i].taskId===undefined || workPlanss[i].taskId==null){
+              newWorkPlans.push(workPlanss[i])
+            }
+          }
+          if(newWorkPlans.length===0){
+            this.$message.warning("请填写新的工作计划在做保存!")
+            return
+          }
+          for (let i = 0; i < newWorkPlans.length; i++) {
+            if(newWorkPlans[i].planContent==='' || newWorkPlans[i].beginDate===undefined ||
+              newWorkPlans[i].completionTimes===undefined || newWorkPlans[i].projectId===undefined){
               this.$message({
                 message: '请将工作计划填写完整!',
                 type: 'warning'
               });
               return
             }
-            workPlanss[i].completionTime = null;
+
+            newWorkPlans[i].completionTime = null;
+            newWorkPlans[i].beginDate =  new Date(newWorkPlans[i].beginDate).getTime()
+
           }
           let data = {
             weeks: this.meetingWeek,
-            workPlans: workPlanss,
+            workPlans: newWorkPlans,
             id: this.workPlans.id,
             meetingId: this.meetingId
           }
@@ -316,7 +329,7 @@ export default {
         if (res.success !== true) {
           this.$message.warning(res.data)
         }else{
-          let row = {planContent: '', 'op': '', id: null, completionTimes: null}
+          let row = {planContent: '', 'op': '', id: null, completionTimes: null,beginDate:null}
           this.workPlans.push(row)
         }
       })