liujiayin 2 лет назад
Родитель
Сommit
0a6961dec7

+ 64 - 1
src/api/platform/form/seal.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 import { FORM_URL } from '@/api/baseUrl'
-
+import axios from 'axios'
 /**
  * ca电子签章接口
  * @param {*} params
@@ -60,3 +60,66 @@ export const onlyOfficeToPdf = params => {
         params
     })
 }
+
+/* 自动微签:脚本对文件盖章 */
+export function seal(url, fileType, type) {
+    let Base64 = require('js-base64').Base64
+    let data = {
+        "signKey": "V1FTMjAyMTEyMjFkOTVjNWM=",
+        "signSecret": "YWQwMmY3ZjQ4ZDJmMmYwNDA=",
+        "sealUser": "YWRtaW4=",
+        "password": "MTIzNA==",
+        //"ruleName": "6aqR57yd56ug6KeE5YiZLOmmlumhteeblueroA==",
+        "ruleName": type,
+        "provideSigFile": Base64.encode(url),
+        "fileKey": Base64.encode(generateUUID() + '.' + fileType)
+    }
+    return axios({
+        url: 'https://www.szjyxt.com/doSeal/',
+        method: 'post',
+        data: data
+    })
+}
+
+/* 手动微签:脚本对文件进行手动盖章-预处理 */
+export function sealPre(url, fileKey) {
+    let Base64 = require('js-base64').Base64
+    let data = {
+        "signKey": "V1FTMjAyMTEyMjFkOTVjNWM=",
+        "signSecret": "YWQwMmY3ZjQ4ZDJmMmYwNDA=",
+        "sealUser": "YWRtaW4=",
+        "password": "MTIzNA==",
+        "provideSigFile": Base64.encode(url),
+        // "getSigFile":  Base64.encode(this.$form.$getSigFile),
+        "getSigFile": Base64.encode('https://www.szjyxt.com/#/sealCompleted'),
+        "fileKey": Base64.encode(fileKey),
+    }
+    return axios({
+        url: 'https://www.szjyxt.com/preprocess/' ,
+        method: 'post',
+        data: data
+    })
+}
+
+/* 手动微签:脚本对文件进行手动盖章-手动签章页面的url */
+export function getSigPageUrl(sigFile) {
+    let sigUrl = 'http://120.77.249.241:9999/manualSig/manualSigPage/?signKey=V1FTMjAyMTEyMjFkOTVjNWM=&signSecret=YWQwMmY3ZjQ4ZDJmMmYwNDA=&sigFile=' + sigFile;
+    return sigUrl
+}
+
+export function generateUUID() {
+    var d = new Date().getTime();
+    var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+        var r = (d + Math.random() * 16) % 16 | 0;
+        d = Math.floor(d / 16);
+        return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
+    });
+    return uuid;
+};
+
+
+
+
+
+
+

BIN
src/assets/images/success/completed.png


+ 2 - 0
src/business/platform/form/utils/JForm.js

@@ -6,6 +6,7 @@ import Vue from 'vue'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import common from '@/utils/common'
+import sealApi from '@/utils/seal'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 import store from '@/store'
 import router from '@/router'
@@ -32,6 +33,7 @@ _.extend(JForm, {
         this.$request = request
         this.$dialog = dialog
         this.$common = common
+        this.$sealApi = sealApi
         this.$router = router
         this.$store = store
         this.$import = _import

+ 2 - 0
src/plugins/ibps/index.js

@@ -67,6 +67,8 @@ export default {
                 // 报表路径
                 Vue.prototype.$reportPath = `${BASE_URL}demo/reportJsp/showReport.jsp?access_token=${getToken()}&rpx=${reportPath}/`
                 Vue.prototype.$getReportFile = downloadReport // 通过方法函数,拼接url,并将字符串格式化
+                Vue.prototype.$getSealUri = 'http://120.77.249.241:9999/no/getSealFile/' //微签 回显获取文件地址
+                Vue.prototype.$getFileDow = 'https://www.szjyxt.com/ibps/platform/v3/file/download?attachmentId=' //文件下载地址
                 clearInterval(timer) // 添加成功后即删除定时任务
             }
         }, 500)

+ 8 - 0
src/router/routes.js

@@ -182,6 +182,14 @@ const frameOut = [
             title: 'iframe'
         },
         component: _import('/system/iframe')
+    },
+    {
+      path: '/sealCompleted',
+      name: 'sealCompleted',
+      meta: {
+        title: 'sealCompleted'
+      },
+      component: _import('/remindPage/sealCompleted')
     }
 ]
 

+ 1 - 0
src/setting.js

@@ -151,6 +151,7 @@ export default {
         '/tenantForget',
         '/authredirect',
         '/ziliao',
+        '/sealCompleted',
         '/fileView'
     ],
     // 白名单,匿名请求的URL

+ 3 - 1
src/utils/common.js

@@ -8,7 +8,8 @@ import { getNextIdByAlias } from '@/api/platform/system/identity'
 import { save as sendMsg } from '@/api/platform/message/innerMessage'
 import { save as saveNews } from '@/api/platform/system/news'
 import { bpmTaskSave } from '@/api/platform/bpmn/bpmTask'
-import { onlyOfficeToPdf } from '@/api/platform/form/seal'
+import { onlyOfficeToPdf,generateUUID } from '@/api/platform/form/seal'
+
 import { downloadFile as download } from '@/business/platform/file/utils'
 
 // base64解码
@@ -145,5 +146,6 @@ export default {
     getDateNow,
     getFormatDate,
     onlyOfficeToPdf,
+    generateUUID,
     download
 }

+ 9 - 0
src/utils/seal.js

@@ -0,0 +1,9 @@
+// 微签接口
+
+import { seal,sealPre,getSigPageUrl } from '@/api/platform/form/seal'
+
+export default {
+    seal,
+    sealPre,
+    getSigPageUrl
+}

+ 50 - 0
src/views/remindPage/sealCompleted.vue

@@ -0,0 +1,50 @@
+<template>
+    <div class="contain">
+        <div class="center">
+            <img class="ok-img" src="../../assets/images/success/completed.png" alt="">
+            <div>
+                签章已经完成,请关闭当前页面,回到上个页面继续操作
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    name: "sealCompleted",
+    data() {
+        return {
+            timer: null
+        };
+    },
+    mounted() {
+
+    },
+    beforeDestroy() {
+    },
+};
+</script>
+
+<style scoped lang="less">
+.ok-img {
+    width: 200px;
+    height: 200px;
+    margin: auto;
+    margin-bottom: 20px;
+}
+
+.contain {
+    height: 300px;
+    position: relative;
+    margin-top: 20px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.contain .center {
+    height: 200px;
+    display: flex;
+    flex-direction: column;
+    text-align: center;
+}
+</style>