Quellcode durchsuchen

调整编辑项目的项目经理情况

Lijy vor 2 Jahren
Ursprung
Commit
193fe03ea1

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

@@ -118,7 +118,7 @@
                 </div>
             </van-popup>
         <!-- 项目经理 -->
-        <van-field label="项目经理" @click="(user.id == projectDetail.creatorId || editProjectMan) ? inchargerShow = true : ''" readonly clickable :disabled="!(user.id == projectDetail.creatorId || editProjectMan)">
+        <van-field label="项目经理" @click="editProjectMan ? inchargerShow = true : ''" readonly clickable :disabled="!editProjectMan">
             <template #input>
                 <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='projectDetail.inchargerName'></ww-open-data></span>
                 <span v-else>{{projectDetail.inchargerName}}</span>
@@ -427,6 +427,7 @@ export default {
         
 
         getProjectDetail(){
+            this.editProjectMan = false
             this.$axios.post("/project/detail", {id: this.projectId})
             .then(res => {
                 if(res.code == "ok") {
@@ -461,18 +462,20 @@ export default {
                         this.projectDetail.levelLabel = this.levelList[this.projectDetail.level - 1].label
                     }
 
-                    if(this.user.id == res.data.creatorId){
-                        this.editCodeAndName = true
-                        return
-                    }
+                    
                     for(let i in this.user.functionList){
                         if(this.user.functionList[i].name == '编辑负责项目编码和名称' || this.user.functionList[i].name == '管理全部项目'){
                             this.editCodeAndName = true
                         }
-                        if(this.user.functionList[i].name == '管理全部项目') {
+                        if(this.user.functionList[i].name == '管理全部项目' || this.user.id == res.data.creatorId){
                             this.editProjectMan = true
                         }
                     }
+
+                    if(this.user.id == res.data.creatorId){
+                        this.editCodeAndName = true
+                        return
+                    }
                 } else {
                     this.$toast.fail('获取失败');
                 }