|
@@ -163,7 +163,7 @@
|
|
|
</div>
|
|
|
</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">
|
|
|
<!-- <inspectInfoPrint :printData="printData"></inspectInfoPrint> -->
|
|
|
<outInspectPrint :printData="printData" ref="saveImg"></outInspectPrint>
|
|
|
<div style="text-align:center">
|
|
@@ -373,6 +373,29 @@
|
|
|
}
|
|
|
return year + '' + mouth + datetime
|
|
|
},
|
|
|
+ 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.inspect.pictureAddress = response.data.url
|
|
|
+ addOut(this.inspect)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
closeDialog() {
|
|
|
html2canvas(this.$refs.saveImg.$el).then((canvas) => {
|
|
|
let dataURL = canvas.toDataURL('image/png')
|