Forráskód Böngészése

检斤、质检保存图片

achao 3 éve
szülő
commit
d065258ca0

+ 34 - 2
src/views/houseSelfCollect/inspectInfo.vue

@@ -164,7 +164,7 @@
         </div>
       </ws-form>
     </div>
-    <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @close="closeDialog"
+    <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @opened='opendBtn' @close="closeDialog"
       :close-on-click-modal="false">
       <inspectInfoPrint :printData="inspect" ref="saveImg"></inspectInfoPrint>
       <div style="text-align:center">
@@ -362,7 +362,39 @@
                     // this.isName = false;
                 }
             },
-
+      opendBtn(){
+           html2canvas(this.$refs.saveImg.$el).then(canvas => {
+          let dataURL = canvas.toDataURL('image/png');
+          this.imgUrl = dataURL;
+          if (this.imgUrl !== '') {
+            let b = this.dataURLtoFile(this.imgUrl, 'printImg')
+            let formdata = new FormData();
+            formdata.append('file', b);
+            axios({
+              method: 'post',
+              url: 'https://www.zthymaoyi.com/upload/admin',
+              data: formdata
+            }).then((response) => {
+              //编辑接口
+              this.inspect.pictureAddress = response.data.url
+              console.log(this.types)
+              if (this.types == 3) {
+                this.inspect.flag = 0
+              } else if (this.types == 4) {
+                this.inspect.flag = 1
+              }
+              getinspectEdit(this.inspect)
+                .toPromise()
+                .then((response) => {
+                  this.types = ''
+                  // this.inspect = [] 
+              
+                })
+            })
+          }
+        })
+      },
+      
       closeDialog() {
         html2canvas(this.$refs.saveImg.$el).then(canvas => {
           let dataURL = canvas.toDataURL('image/png');

+ 24 - 0
src/views/houseSelfCollect/settlement.vue

@@ -400,6 +400,7 @@
       :visible.sync="isShowPrint"
       :title="printData.compName+'结算凭证'"
        @close="closeDialog"
+       @opened = 'opendBtn'
        :modal-append-to-body = "false"
     >
       <paymentPrint :printData="printData" ref="saveImg"></paymentPrint>
@@ -455,6 +456,29 @@ export default {
     inputFocus(event){
       event.currentTarget.select()
     },
+    opendBtn(){
+            html2canvas(this.$refs.saveImg.$el).then((canvas) => {
+        let dataURL = canvas.toDataURL('image/png')
+        this.imgUrl = dataURL
+        if (this.imgUrl !== '' ) {
+          let b = this.dataURLtoFile(this.imgUrl, 'printImage')
+          let formdata = new FormData()
+          formdata.append('file', b)
+          axios({
+            method: 'post',
+            url: 'https://www.zthymaoyi.com/upload/admin',
+            data: formdata,
+          }).then((response) => {
+            //编辑接口
+            this.paymentList.pictureAddress = response.data.url
+            settlementEdit(this.paymentList)
+              .toPromise()
+              .then((response) => {})
+
+          })
+        }
+      })
+    },
     closeDialog(){
       html2canvas(this.$refs.saveImg.$el).then((canvas) => {
         let dataURL = canvas.toDataURL('image/png')

+ 23 - 1
src/views/houseSelfCollect/weightCheck.vue

@@ -164,7 +164,7 @@
       </div>
 
     </div>
-    <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单" @close="closeDialog"
+    <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单" @opened = 'opendBtn' @close="closeDialog"
       :close-on-click-modal="false">
       <weightCheckPrint :tableData="inspect" ref="saveImg"></weightCheckPrint>
       <div style="text-align:center">
@@ -774,6 +774,28 @@
       printBig() {
         window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.inspect))
       },
+      opendBtn(){
+            html2canvas(this.$refs.saveImg.$el).then((canvas) => {
+          let dataURL = canvas.toDataURL('image/png')
+          this.imgUrl = dataURL
+          if (this.imgUrl !== '') {
+            let b = this.dataURLtoFile(this.imgUrl, 'printImage')
+            let formdata = new FormData()
+            formdata.append('file', b)
+            axios({
+              method: 'post',
+              url: 'https://www.zthymaoyi.com/upload/admin',
+              data: formdata,
+            }).then((response) => {
+              //编辑接口
+              this.weighingList.pictureAddress = response.data.url
+              tare(this.weighingList)
+                .toPromise()
+                .then((response) => {})
+            })
+          }
+        })
+      },
       closeDialog() {
         html2canvas(this.$refs.saveImg.$el).then((canvas) => {
           let dataURL = canvas.toDataURL('image/png')