更新
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
|
||||
<el-card>
|
||||
<div style="width:60%;margin-left: 18%">
|
||||
<el-card>
|
||||
<el-card v-show="type==='1' || type==='2'">
|
||||
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" align="center" style="font-weight: bold">GAOJING</td>
|
||||
@@ -215,6 +215,49 @@
|
||||
<div style="line-height: 25px;margin-top: 10px">签订时间:____年__月__日</div>
|
||||
<div style="line-height: 25px">有效期限:____年__月__日至____年__月__日</div>
|
||||
</el-card>
|
||||
<el-card v-show="type==='3'">
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
|
||||
<tr style="height: 60px">
|
||||
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<th colspan="14"><h4>{{ 采购合同名称 }}</h4></th>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">下单单位</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ supplier }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">单号</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ contract }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">下单日期</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 操作日期 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">计划完成日期</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 规定到货时间 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
|
||||
<tr id="tablehead10" style="height: 35px">
|
||||
<td style="text-align: center;width: 7%">序号</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">物料编码</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">名称</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">材料</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">单位</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">数量</td>
|
||||
<td colspan="2" style="text-align: center;width: 17%">备注</td>
|
||||
</tr>
|
||||
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
|
||||
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">{{ list.图号 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">{{ list.物料名称 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">{{ list.规格 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.数量 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 17%">{{ list.备注 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px">联系人:___________ 联系电话:___________ </div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -278,6 +321,7 @@
|
||||
|
||||
<script>
|
||||
import { initContract, initBuyer, searchTable1, searchTable2, submitApproval } from '@/api/WorkshopProcurement/ProcurementContractApproval'
|
||||
import $ from 'jquery'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
export default {
|
||||
@@ -290,6 +334,9 @@ export default {
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
startEndDate: '',
|
||||
采购合同名称: '',
|
||||
规定到货时间: '',
|
||||
操作日期: '',
|
||||
contract: '',
|
||||
contractNumValue: '',
|
||||
contractNum: [],
|
||||
@@ -436,57 +483,72 @@ export default {
|
||||
},
|
||||
searchTable2(row) {
|
||||
this.type = row.模板类型
|
||||
console.log(row)
|
||||
console.log(this.type)
|
||||
this.规定到货时间 = row.规定到货时间
|
||||
this.操作日期 = row.操作日期
|
||||
this.采购合同名称 = row.采购合同名称
|
||||
this.textarea = row.合同文本
|
||||
this.supplier = row.供应商名称
|
||||
this.contract = row.采购合同编号
|
||||
this.taxRate = row.税率
|
||||
this.RMB = row.总金额_文本
|
||||
this.TotalAmount = row.总金额
|
||||
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
|
||||
this.RMB1 = row.含税总金额_文本
|
||||
document.getElementById('23').innerText = this.textarea
|
||||
this.contractValue = parseInt(row.采购合同流水号)
|
||||
const opts = {
|
||||
errorCorrectionLevel: 'H',
|
||||
type: 'image/jpeg',
|
||||
rendererOpts: {
|
||||
quality: 0.3
|
||||
}
|
||||
if (row.总金额 === '0') {
|
||||
this.TotalAmount = ''
|
||||
this.TotalAmount1 = ''
|
||||
} else {
|
||||
this.TotalAmount = row.总金额
|
||||
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
|
||||
}
|
||||
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')
|
||||
const parent = document.getElementById('4')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
this.RMB1 = row.含税总金额_文本
|
||||
if (this.type === '1' || this.type === '2') {
|
||||
document.getElementById('23').innerText = this.textarea
|
||||
this.contractValue = parseInt(row.采购合同流水号)
|
||||
const opts = {
|
||||
errorCorrectionLevel: 'H',
|
||||
type: 'image/jpeg',
|
||||
rendererOpts: {
|
||||
quality: 0.3
|
||||
}
|
||||
}
|
||||
const tr = []
|
||||
for (let i = 0; i < this.returns.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData')
|
||||
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
|
||||
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
|
||||
document.getElementById('tableHead').after(tr[i])
|
||||
}
|
||||
for (let j = 0; j < this.returns.length; j++) {
|
||||
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
|
||||
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
|
||||
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
|
||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
|
||||
}
|
||||
})
|
||||
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')
|
||||
const parent = document.getElementById('4')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const tr = []
|
||||
for (let i = 0; i < this.returns.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData')
|
||||
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
|
||||
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
|
||||
$('#tableHead').after(tr[i])
|
||||
}
|
||||
for (let j = 0; j < this.returns.length; j++) {
|
||||
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
|
||||
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
|
||||
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
|
||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.contractValue = parseInt(row.采购合同流水号)
|
||||
searchTable2(this.contractValue).then(response => {
|
||||
this.returns = response.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user