离线请款

This commit is contained in:
chenjianan
2019-05-29 19:15:27 +08:00
parent 493aad1939
commit 6c858eb1e2

View File

@@ -118,8 +118,47 @@
</div>
</el-card>
<h3 id="firstAnchor" style="margin-top: 0">采购合同</h3>
<div id="print" class="print" style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="contractDetail1"/>
<div id="print" class="print" style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="contractDetail1"/><hr>
<h3 id="secondAnchor" style="">离线合同</h3>
<div id="offlineContract" style="min-height:500px;margin: 0 auto;width: 800px;border:1px solid black">
<table v-show="contractDetail2.length > 0" class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr>
<th colspan="14"><h1>离线合同</h1></th>
</tr>
<tr>
<td colspan="3" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>
<td width="80px">合同名称</td>
<td id="contractName" colspan="2" style="text-align: left;"/>
<td width="80px">供应商</td>
<td id="supplier" colspan="5" style="text-align: left;"/>
<td id="qrCode" colspan="2" rowspan="2"/>
</tr>
<tr>
<td width="80px">合同编号</td>
<td id="contractNum" colspan="2" style="text-align: left;"/>
<td width="80px">采购员</td>
<td id="buyer" colspan="5" style="text-align: left;"/>
</tr>
<tr id="tablehead">
<td width="50px">序号</td>
<td colspan="2">名称</td>
<td>规格</td>
<td colspan="2">型号</td>
<td>数量</td>
<td colspan="2">单价</td>
<td colspan="2">合计</td>
<td>交货期</td>
<td colspan="2">备注</td>
</tr>
<tr>
<td>总计</td>
<td id="remark" colspan="10"/>
<td id="total" colspan="2" style="text-align: left;"/>
<td/>
</tr>
</table>
</div>
<!--
<el-table v-loading="" :data="contractDetail2" :summary-method="getSummaries" border style="margin-top:10px;max-height: 500px;" height="500px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" min-width="150">
<template slot-scope="scope">
@@ -167,12 +206,14 @@
</template>
</el-table-column>
</el-table>
-->
</div>
</template>
<script>
import { initApproval, execApproval, initApprovalOffline, searchRequsetFundDetail1, searchRequsetFundDetail2, execApprovalOffline, searchContactDetail, searchMateriel } from '@/api/PurchasingCenter/FundApproval'
import { mapGetters } from 'vuex'
import $ from 'jquery'
export default {
name: '', // 管理审批
@@ -204,6 +245,45 @@ export default {
this.fetchData()
},
methods: {
showOffline(row) {
console.log(row, 222)
const children = document.getElementsByClassName('tableData')
const parent = document.getElementsByClassName('offlineContract')[0]
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
let length = 0
this.contractDetail2.length < 15 ? length = 15 : length = this.contractDetail2.length
for (let i = 0; i < length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = `<td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/>`
$('#tablehead').after(tr[i])
}
let total = 0
for (let j = 0; j < this.contractDetail2.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.contractDetail2[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.contractDetail2[j].物料规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.contractDetail2[j].物料型号
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.contractDetail2[j].数量
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.contractDetail2[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = (this.contractDetail2[j].数量 * this.contractDetail2[j].单价).toFixed(2)
document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.contractDetail2[j].交货期要求
document.getElementsByClassName('tableData')[j].children[8].innerHTML = this.contractDetail2[j].备注
total += Number(this.contractDetail2[j].数量 * this.contractDetail2[j].单价)
}
total = total.toFixed(2)
document.getElementById('contractNum').innerHTML = row.离线合同编号
document.getElementById('contractName').innerHTML = row.离线合同名称
document.getElementById('supplier').innerHTML = row.供应商名称
document.getElementById('buyer').innerHTML = row.采购员
document.getElementById('total').innerHTML = total
document.getElementById('remark').innerHTML = row.离线合同备注
},
searchContactDetail(row) {
document.documentElement.scrollTop = this.$el.querySelector('#firstAnchor').offsetTop
searchContactDetail(row.采购合同流水号).then(response => {
@@ -214,6 +294,7 @@ export default {
document.documentElement.scrollTop = this.$el.querySelector('#secondAnchor').offsetTop
searchMateriel(row.离线合同流水号).then(response => {
this.contractDetail2 = response.data
this.showOffline(row)
})
},
getSummaries(param) { // 合计