ggooalice 2 gadi atpakaļ
vecāks
revīzija
b735a45086

+ 16 - 6
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/edit.vue

@@ -67,6 +67,7 @@
                 ></van-picker>
             </van-popup>
         <!-- 参与人 -->
+        <van-button @click="test">test</van-button>
         <van-field label="全部参与人" @click="userNamesShow = true" readonly clickable v-show="projectDetail.isPublic == 0">
             <template #input>
                 <span v-if="!projectDetail.userNames"></span>
@@ -208,6 +209,9 @@ export default {
             let mon = date.getMonth() + 1
             return `${date.getFullYear()}-${mon<10?'0'+mon:mon}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
         },
+        test(){
+            console.log(this.projectDetail);
+        },
 
         mainProjectConfirm(value,key){
             this.projectDetail.projectMainId = value.id
@@ -361,14 +365,20 @@ export default {
                     let userNames = ''
                     let userId = []
                     for(let i in res.data.participationList){
-                        userNames += res.data.participationList[i].name + ','
-                        userId.push(res.data.participationList[i].id)
-                        this.inchargerList.push(res.data.participationList[i])
+                        if(res.data.participationList[i].id && res.data.participationList[i].id != 'null'){
+                            userNames += res.data.participationList[i].name + ','
+                            userId.push(res.data.participationList[i].id)
+                            this.inchargerList.push(res.data.participationList[i])
+                        }
                     }
-                    this.$set(this.projectDetail,'userNames',userNames.substring(0,userNames.length - 1))
+                    this.$set(this.projectDetail,'userNames',userNames ? userNames.substring(0,userNames.length - 1) : '')
                     this.$set(this.projectDetail,'userId',userId)
-                    this.currentStartDate = new Date(res.data.planStartDate)
-                    this.currentEndDate = new Date(res.data.planEndDate)
+                    if(res.data.planStartDate){
+                        this.currentStartDate = new Date(res.data.planStartDate)
+                    }
+                    if(res.data.planEndDate){
+                        this.currentEndDate = new Date(res.data.planEndDate)
+                    }
                     this.getUserList()
                     if(this.user.timeType.projectLevelState == 1){
                         this.getLevelList()