ZaiZai 10 ماه پیش
والد
کامیت
1f92eacc4d
3فایلهای تغییر یافته به همراه62 افزوده شده و 17 حذف شده
  1. 16 0
      src/api/certificate/list.js
  2. 2 2
      src/config/index.json
  3. 44 15
      src/views/certificate/lists/addList.vue

+ 16 - 0
src/api/certificate/list.js

@@ -115,3 +115,19 @@ export const getPriwbsPdf = (pkeyId) => {
     params: {pkeyId}
   })
 }
+
+export const picPresave = (form) => {
+  return request({
+    url: '/api/blade-manager/signPfxFile/picPresave',
+    method: 'post',
+    data: form
+  })
+}
+
+export const prePicture = (id) => {
+  return request({
+    url: '/api/blade-manager/signPfxFile/prePicture',
+    method: 'post',
+    data: {id}
+  })
+}

+ 2 - 2
src/config/index.json

@@ -1,7 +1,7 @@
 {
-  "target": "http://39.108.216.210:8090",
+  "target1": "http://39.108.216.210:8090",
   "target2": "http://127.0.0.1:8090",
-  "target3": "http://192.168.0.125:8090",
+  "target": "http://192.168.0.196:8090",
   "dev": {
     "port": 1888
   },

+ 44 - 15
src/views/certificate/lists/addList.vue

@@ -164,11 +164,11 @@
             <div style="position: relative; display: flex;align-items: center; color: #1A1A1A; cursor: default;" @click.stop="stopClick">
               <el-input v-model="form.wide" style="width:60px; margin-left: 24px;" placeholder="宽度" size="small" :disabled="form.signatureFileUrl.length<=0"></el-input>
               <div style="display: inline-block; margin-left: 8px;">x</div>
-              <el-input v-model="form.higt" style="width:60px; margin-left: 8px;" placeholder="高度" size="small" :disabled="form.signatureFileUrl.length<=0"></el-input>
+              <el-input v-model="form.high" style="width:60px; margin-left: 8px;" placeholder="高度" size="small" :disabled="form.signatureFileUrl.length<=0"></el-input>
               <span style="margin-left: 8px; font-size: 22px;cursor: pointer" @click.stop="signatureSave">
                 <i class="el-icon-success" :style="form.signatureFileUrl.length<=0?'color: #1A1A1A;':'color: #1e9fff;'"></i>
               </span>
-              <el-button size="small" type="warning" style="margin-left: 12px" :disabled="form.signatureFileUrl.length<=0">预览</el-button>
+              <el-button size="small" type="warning" style="margin-left: 12px" :disabled="form.signatureFileUrl.length<=0 || !signatureId" @click.stop="signaturePreview">预览</el-button>
             </div>
           </div>
           <div
@@ -263,7 +263,7 @@
 </template>
 
 <script>
-import { save, getById, findUserByName, queryRole, queryProjectAndContract, addFileInfo, update, findPfxType } from "@/api/certificate/list";
+import { save, getById, findUserByName, queryRole, queryProjectAndContract, addFileInfo, update, findPfxType, picPresave, prePicture } from "@/api/certificate/list";
 import {getDictionary as getDictbiz} from "@/api/system/dictbiz";
 export default {
   data () {
@@ -305,6 +305,7 @@ export default {
       userData: [],//关联用户
       pfxType: [],//
       options:[],
+      signatureId: '',
     }
   },
   methods: {
@@ -393,12 +394,9 @@ export default {
             fromData.signatureFileUrl = fileData.link;
             fromData.signatureFileName = fileData.originalName;
           } else {
-
             if(this.form.signatureFileUrl&&this.form.signatureFileUrl[0]&&this.form.signatureFileUrl[0].raw){
                fromData.signatureFileUrl = this.form.signatureFileUrl[0].raw
             }
-
-
           }
           let tag = true
           let enterpriseUnifiedCode = ''
@@ -459,7 +457,7 @@ export default {
     changecertificateFileUrl2 (file) {//签名体图片变化回调
       this.form.signatureFileUrl = [file]
       this.form.wide = 600
-      this.form.higt = 165
+      this.form.high = 165
     },
     pushSignPfxDeputieList () {//添加关联项目
       // this.form.signPfxDeputieList.unshift({
@@ -517,10 +515,10 @@ export default {
             this.form.wide = 600
           }
           //高度
-        if (res.data.higt) {
-          this.form.higt = res.data.higt
+        if (res.data.high) {
+          this.form.high = res.data.high
         } else {
-          this.form.higt = 165
+          this.form.high = 165
         }
       }
     },
@@ -637,10 +635,44 @@ export default {
 
       }
     },
-    signatureSave() {
+    async signatureSave() {
       const form = this.form
       const isImg = form.signatureFileUrl.length <= 0
-      console.log('保存', isImg)
+      if (isImg) {
+        this.$message({
+          message: '请先上传签名图片',
+          type: 'error'
+        })
+        return
+      }
+      console.log(form.wide, form.high)
+      if (!form.wide || !form.high) {
+        this.$message({
+          message: '请先填写宽度和高度的尺寸',
+          type: 'error'
+        })
+        return
+      }
+      const file = form.signatureFileUrl[0].raw
+      let fromData = new FormData();
+      fromData.append('file', file);
+      fromData.append('wide', form.wide);
+      fromData.append('high', form.high);
+      const { data: res } = await picPresave(fromData)
+      console.log(res)
+    },
+    async signaturePreview() {
+     const cid = this.signatureId
+      if (!cid) {
+        this.$message({
+          message: '请先上传和保存尺寸',
+          type: 'error'
+        })
+        return
+      }
+      console.log(cid)
+      const { data: res } = await prePicture(cid)
+      console.log(res)
     },
     stopClick() {},
   },
@@ -652,10 +684,7 @@ export default {
     this.findPfxType();//查询企业签章类型
   },
   mounted () {
-
     this.updateDependentFieldValidation();
-
-
   }
 }
 </script>