This commit is contained in:
liushuai
2018-12-22 16:26:10 +08:00
parent 64d549cd89
commit 6f6d4d6b57
11 changed files with 88 additions and 119 deletions

View File

@@ -90,7 +90,7 @@
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="warning" size="mini" @click="exportTable('100')">导出</el-button>
<el-button type="warning" size="mini" @click="exportTable()">打印</el-button>
<el-button type="danger" size="mini" @click="Disable(scope.row)">禁用</el-button>
</template>
</el-table-column>
@@ -111,27 +111,28 @@
<el-card>
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="100">
<div id="export">
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="3" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="2" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="5" align="center" style="font-weight: bold">产品销售合同</td>
<td colspan="1" rowspan="3" style="width: 119px"><img id="img" alt=""></td>
</tr>
<tr style="height: 40px">
<td colspan="2" align="center">需方</td>
<td colspan="2" align="center">江苏高精机电装备有限公司</td>
<td colspan="2" align="center">合同编号</td>
<td colspan="1" align="center">需方</td>
<td colspan="3" align="center">江苏高精机电装备有限公司</td>
<td colspan="1" align="center">合同编号</td>
<td colspan="2" align="center">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" align="center">供方</td>
<td colspan="2" align="center">{{ supplier }}</td>
<td colspan="2" align="center">签订地点</td>
<td colspan="1" align="center">供方</td>
<td colspan="3" align="center">{{ supplier }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="2" align="center">江苏盐城</td>
</tr>
</table>
<div style="margin-top: 20px;line-height: 25px">根据中华人民共和国合同法的有关规定经供需双方友好协商在平等自愿的基础上定立本合同以便供需双方共同遵守</div>
<div style="line-height: 25px"> 产品名称规格型号材质数量单价和交货期</div>
<div style="margin-top: 20px;line-height: 30px">根据中华人民共和国合同法的有关规定经供需双方友好协商在平等自愿的基础上定立本合同以便供需双方共同遵守</div>
<div style="line-height: 30px"> 产品名称规格型号材质数量单价和交货期</div>
<table id="50" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="51">
<tr id="tableHead1" style="height: 40px">
@@ -171,8 +172,8 @@
</tr>
</tfoot>
</table>
<div style="line-height: 25px">以上价格为含税增值税价格供方开具真实有效的16%增值税发票</div>
<div id="23"/>
<div style="line-height: 30px">以上价格为含税增值税价格供方开具真实有效的16%增值税发票</div>
<div id="23" style="line-height: 30px"/>
<table id="66" cellspacing="0px" align="center" border width="100%" style="margin-top: 30px">
<tbody id="67">
<tr style="height: 35px">
@@ -282,7 +283,8 @@
<script>
import { initContract, initBuyer, searchTable1, searchTable2, searchTable3, Disable } from '@/api/WorkshopProcurement/ProcurementContractEnquiry'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import $ from 'jquery'
import QRCode from 'qrcode'
export default {
data() {
@@ -422,10 +424,15 @@ export default {
})
})
},
exportTable(tableid) {
getExplorer()
method5(tableid)
Cleanup()
exportTable() {
const htmlNode = $('#export').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().show()
printNode.remove()
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
@@ -437,7 +444,6 @@ export default {
this.searchTable1()
},
searchTable2(row) {
console.log(row)
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
@@ -448,6 +454,18 @@ export default {
this.RMB1 = row.含税总金额_文本
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
QRCode.toDataURL(row.采购合同流水号, opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')