scorpio 2 rokov pred
rodič
commit
27c16cce61

+ 23 - 0
src/views/contract/component/info.vue

@@ -6,6 +6,9 @@
         <el-button type="primary" plain @click="disabled = !disabled"
           >{{ disabled ? '编 辑' : '保 存' }}
         </el-button>
+        <el-button type="primary" plain @click="libraryDetail">
+          查 看</el-button
+        >
       </div>
     </div>
     <div class="padding">
@@ -90,6 +93,11 @@
         </div>
       </el-form>
     </div>
+    <el-image-viewer
+      v-if="showImage"
+      :url-list="preList"
+      @close="showImage = false"
+    />
   </div>
 </template>
 
@@ -123,6 +131,8 @@ export default {
   },
   data() {
     return {
+      showImage: false,
+      preList: [],
       disabled: true,
       typeDic: [],
       stuasDic: [],
@@ -184,6 +194,19 @@ export default {
           this.$message.error(res.msg)
         }
       })
+    },
+    /**
+     * 以图片形式查看文件
+     */
+    libraryDetail() {
+      this.$api.project
+        .articleDetailByFile(this.form.fileFolder.fileId)
+        .then(res => {
+          if (res.code === 200) {
+            this.preList = res.data.imgs.map(e => e.filePath)
+            this.showImage = true
+          }
+        })
     }
   }
 }

+ 9 - 1
src/views/contract/index.vue

@@ -176,7 +176,15 @@ export default {
       this.$api.contract
         .contractList(Object.assign(this.page, data))
         .then(res => {
-          this.data = res.data.records
+          this.data = res.data.records.map(ele => {
+            if (ele.contractsStatus === -1) {
+              ele.contractsStatus = ''
+            }
+            if (ele.type === -1) {
+              ele.type = ''
+            }
+            return ele
+          })
         })
         .finally(() => {
           this.loading = false