Bladeren bron

融信审批预览按钮

peixh 4 jaren geleden
bovenliggende
commit
ece917bde1
1 gewijzigde bestanden met toevoegingen van 78 en 0 verwijderingen
  1. 78 0
      front-vue/src/views/service/credit/approvalCreditDetail.vue

+ 78 - 0
front-vue/src/views/service/credit/approvalCreditDetail.vue

@@ -101,6 +101,12 @@
                                 icon="el-icon-view"
                                 @click="handleDownload(scope.row)"
                             >下载</el-button>
+                            <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handlePreview(scope.row)"
+                            >预览</el-button>
                         </template>
                     </el-table-column>
             </el-table>
@@ -116,6 +122,12 @@
                                 icon="el-icon-view"
                                 @click="handleDownload(scope.row)"
                             >下载</el-button>
+                            <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handlePreview(scope.row)"
+                            >预览</el-button>
                         </template>
                     </el-table-column>
             </el-table>
@@ -131,9 +143,20 @@
                                 icon="el-icon-view"
                                 @click="handleDownload(scope.row)"
                             >下载</el-button>
+                            <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handlePreview(scope.row)"
+                            >预览</el-button>
                         </template>
                     </el-table-column>
             </el-table>
+            <!--预览-->
+            <el-dialog  :visible.sync="openFile" width="1000px" append-to-body>
+                <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
+                <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
+            </el-dialog>
         </el-tab-pane>
         <el-tab-pane label="签署合同">
             <el-table :data="creditSealList"  style="width: 100%">
@@ -188,6 +211,10 @@ export default {
             },
             // 是否显示弹出层
             open: false,
+            openFile:false,
+            wordUrl: "",
+            show:false,
+            heid:false,
            //应付账款
            payList:[],
            //签发金额大写
@@ -333,6 +360,57 @@ export default {
     callBack(){
 
     },
+    //预览
+    handlePreview(row) {
+        const pfiUrl = row.pfiUrl;
+        const pfiFileName = row.pfiFileName;
+        if (row.pfiUrl) {
+            console.log(pfiFileName.substr(-3));
+            if (pfiFileName.substr(-3) == "pdf") {
+                this.wordUrl = pfiUrl + "/" + getToken();
+                this.show=false;
+                this.heid=true;
+            } else if (
+                pfiFileName.substr(-3) == "jpg" ||
+                pfiFileName.substr(-3) == "png" ||
+                pfiFileName.substr(-3) == "JPG" ||
+                pfiFileName.substr(-3) == "PNG" ||
+                pfiFileName.substr(-4) == "jpeg" ||
+                pfiFileName.substr(-3) == "JPEG" 
+            ) {
+                this.wordUrl =
+                    pfiUrl +
+                    "/" +
+                    getToken();
+                    this.show=true;
+                    this.heid=false;
+                        console.log("====>",this.wordUrl);
+            } else if (
+                pfiFileName.substr(-3) == "doc" ||
+                pfiFileName.substr(-3) == "DOC"||
+                pfiFileName.substr(-4) == "docx" ||
+                pfiFileName.substr(-3) == "DOCX"
+            ) {
+                this.wordUrl =
+                    "https://view.officeapps.live.com/op/view.aspx?src=" +
+                    pfiUrl +
+                    "/" +
+                    getToken() +
+                    "/" +
+                    pfiFileName;
+                    this.show=false;
+                    this.heid=true;
+                    console.log("====>",this.wordUrl);
+            } else {
+                this.$message({
+                    message: "暂不支持该类型文件预览",
+                    type: "warning",
+                });
+                return;
+            }
+        }
+        this.openFile = true;
+    },
      /* //  将数字金额转换为大写金额 */
     smallToBig(money) {
       //  将数字金额转换为大写金额