Z 1 год назад
Родитель
Сommit
b3957b64c0

+ 18 - 15
src/BIZComponents/addDoc/browse.vue

@@ -35,21 +35,24 @@ export default {
     },
     setFileUrl(row) {
       let file = row.storagePath[0];
-      let url = sessionStorage.filePath + file.storePath;
-      const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
-      this.fileType = getFileType().includes(fileExt) ? 2 : 1;
-      if (this.fileType == 2) {
-        this.fileUrl =
-          '/fm/' +
-          (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
-          '/view.html?url=' +
-          sessionStorage.filePath +
-          '/' +
-          row.outputNdsFiles;
-      } else {
-        this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
-        // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
-      }
+      let fileNames=file.storePath.split('/')
+      let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
+      this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+      
+      // const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
+      // this.fileType = getFileType().includes(fileExt) ? 2 : 1;
+      // if (this.fileType == 2) {
+      //   this.fileUrl =
+      //     '/fm/' +
+      //     (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
+      //     '/view.html?url=' +
+      //     sessionStorage.filePath +
+      //     '/' +
+      //     row.outputNdsFiles;
+      // } else {
+      //   this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+      //   // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
+      // }
     }
   }
 };

+ 2 - 2
src/views/project-manage/project-initiation/components/project-form.vue

@@ -207,14 +207,14 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="客户名称">
-            <el-input v-model="form.contactName" @click.native="handleGetCus" :disabled="dialogType=='view'"></el-input>
+            <el-input v-model="form.contactName" @click.native="handleGetCus" :disabled="dialogType=='view'||!!form.contractName"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item
             prop="contactRelationPhone"
             label="客户联系电话">
-            <el-input v-model="form.contactRelationPhone" :disabled="dialogType=='view'"></el-input>
+            <el-input v-model="form.contactRelationPhone" :disabled="dialogType=='view' || !!form.contractName"></el-input>
           </el-form-item>
         </el-col>