Browse Source

Merge branch 'hezhihong_bug修复'

hezhihong 1 year ago
parent
commit
9e5b80b5bf
2 changed files with 22 additions and 16 deletions
  1. 21 15
      src/views/REGISTERTASK/index.vue
  2. 1 1
      src/views/task/index.vue

+ 21 - 15
src/views/REGISTERTASK/index.vue

@@ -17,12 +17,11 @@
           </el-descriptions-item>
           <el-descriptions-item label="审核意见">{{ taskList.comments ? taskList.comments : '无' }}</el-descriptions-item>
         </el-descriptions>
-
         <el-form ref="form" :model="taskList" label-width="auto" style="margin-top: 20px">
           <el-row>
             <el-col :span="12">
               <el-col :span="12">
-                <el-form-item label="姓名:">{{ taskList.formobj.nickName }}</el-form-item>
+                <el-form-item label="姓名:">{{ getFormobjAttribute('nickName') }}</el-form-item>
               </el-col>
             </el-col>
             <el-col :span="12">
@@ -35,7 +34,7 @@
                   border-radius: 5px;
                   margin-bottom: -15px;"
                   :z-index="50000"
-                  :src="baseUrl + taskList.formobj.userAvatar"
+                  :src="baseUrl + getFormobjAttribute('userAvatar')"
                   @click="showImagePreview(taskList.formobj.userAvatar)"
                 ></el-image>
               </el-form-item>
@@ -45,36 +44,36 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="类型:">
-                <span v-if="taskList.formobj.type == 2">专家</span>
+                <span v-if="getFormobjAttribute('type') == 2">专家</span>
                 <span v-else>其它</span>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="民族:">{{ taskList.formobj.nation }}</el-form-item>
+              <el-form-item label="民族:">{{ getFormobjAttribute('nation') }}</el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="用户名:">{{ taskList.formobj.userName }}</el-form-item>
+              <el-form-item label="用户名:">{{ getFormobjAttribute('userName') }}</el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="学历:">{{ taskList.formobj.education }}</el-form-item>
+              <el-form-item label="学历:">{{ getFormobjAttribute('education') }}</el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="服务方向:">{{ taskList.formobj.servicesAvailable }}</el-form-item>
+              <el-form-item label="服务方向:">{{ getFormobjAttribute('servicesAvailable') }}</el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="工作经验:">{{ taskList.formobj.experience }}</el-form-item>
+              <el-form-item label="工作经验:">{{ getFormobjAttribute('experience') }}</el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="专业领域:">{{ taskList.formobj.field }}</el-form-item>
+              <el-form-item label="专业领域:">{{ getFormobjAttribute('field') }}</el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="研究方向:">{{ taskList.formobj.research }}</el-form-item>
+              <el-form-item label="研究方向:">{{ getFormobjAttribute('research') }}</el-form-item>
             </el-col>
           </el-row>
           <el-row>
@@ -88,7 +87,7 @@
                   border-radius: 5px;
                   margin-bottom: -15px;"
                   :z-index="50000"
-                  :src="baseUrl + taskList.formobj.diploma"
+                  :src="baseUrl + getFormobjAttribute('diploma')"
                   @click="showImagePreview(taskList.formobj.diploma)"
                 ></el-image>
               </el-form-item>
@@ -104,7 +103,7 @@
                 margin-bottom: -15px;
               "
                   :z-index="50000"
-                  :src="baseUrl + taskList.formobj.credentials"
+                  :src="baseUrl + getFormobjAttribute('credentials')"
                   @click="showImagePreview(taskList.formobj.credentials)"
                 ></el-image>
                </el-form-item>
@@ -112,7 +111,7 @@
           </el-row>
         </el-form>
         <el-dialog :visible="BigImgVisible" fullscreen append-to-body @close="BigImgVisible = false">
-          <img width="100%" :src="taskList.formobj.fileUrl" alt="" />
+          <img width="100%" :src="getFormobjAttribute('fileUrl')" alt="" />
         </el-dialog>
       </el-tab-pane>
       <el-tab-pane label="审批记录" name="审批记录">
@@ -155,7 +154,7 @@ export default {
   },
   props: ['taskList'],
   created() {
-    if (this.taskList.formobj.fileUrl) {
+    if (this.taskList.formobj && this.taskList.formobj.fileUrl) {
       this.fileList.push({
         url: this.baseURL + this.taskList.formobj.fileUrl,
         name: "xxx",
@@ -180,6 +179,13 @@ export default {
       this.previewImageUrl = this.baseURL + url;
       this.imagePreviewVisible = true;
     },
+    getFormobjAttribute(key) {
+      if(this.taskList.formobj) {
+        return this.taskList.formobj[key];
+      } else {
+        return "";
+      }
+    },
   }
 };
 </script>

+ 1 - 1
src/views/task/index.vue

@@ -406,7 +406,7 @@ export default {
       });
     },
 
-    //点击审核
+    //点击详情
     handleExamine(row) {
       // this.taskList = []
       getINSTACTIONTASK(row.id).then((res) => {