Browse Source

修改保存图片

mxx 3 years ago
parent
commit
afdf2a34f6

+ 1 - 15
src/views/houseSelfCollect/component/inspectInfoPrint.vue

@@ -61,11 +61,6 @@
         <div class="">客户签名:</div>
       </div>
       <div class="bottom-row3">扫一扫</div>
-      <div class="bottom-row4">
-        <el-button type="primary">关闭</el-button>
-        <el-button type="primary" @click="printSmall">打印小票</el-button>
-        <el-button type="primary" @click="printBig">打印单据</el-button>
-      </div>
     </div>
   </div>
 </template>
@@ -86,16 +81,7 @@
 
     },
     methods: {
-    printSmall() {
-      window.location.href =
-        '../../../../static/inspection.html?type=1&dataList=' +
-        JSON.stringify(this.printData)
-    },
-    printBig() {
-      window.location.href =
-        '../../../../static/inspection.html?type=2&dataList=' +
-        JSON.stringify(this.printData)
-    },
+
     },
   }
 </script>

+ 18 - 1
src/views/houseSelfCollect/inspectInfo.vue

@@ -114,6 +114,11 @@
     <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @close="closeDialog">
       <div slot="footer">
         <inspectInfoPrint :printData="inspect" ref="saveImg"></inspectInfoPrint>
+        <div class="bottom-row4">
+          <el-button type="primary">关闭</el-button>
+          <el-button type="primary" @click="printSmall">打印小票</el-button>
+          <el-button type="primary" @click="printBig">打印单据</el-button>
+        </div>
       </div>
     </el-dialog>
   </div>
@@ -135,6 +140,7 @@
   } from '@/model/contarct/index'
   import inspectInfoPrint from './component/inspectInfoPrint.vue'
   import html2canvas from "html2canvas"
+  import axios from "axios"
   export default {
     components: {
       inspectInfoPrint,
@@ -187,6 +193,16 @@
       this.getList(this.id)
     },
     methods: {
+      printSmall() {
+        window.location.href =
+          '../../../static/inspection.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      },
+      printBig() {
+        window.location.href =
+          '../../../static/inspection.html?type=2&dataList=' +
+          JSON.stringify(this.printData)
+      },
       getdate() {
         var date = new Date()
         var year = date.getFullYear() //获取完整的年份(4位)
@@ -222,8 +238,9 @@
             }).then((response) => {
               console.log(response)
               //编辑接口
-              this.inspect.xx=response.data.xx
               
+              this.inspect.pictureAddress=response.data.url
+
             })
 
             this.dialogTableVisible = true;