|
@@ -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')
|