726 lines
31 KiB
Vue
726 lines
31 KiB
Vue
<template>
|
||
<div class="app-container">
|
||
<el-card>
|
||
<el-row>
|
||
<!--<span>合 同 号:</span>-->
|
||
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
|
||
<el-option
|
||
v-for="item in contractNum"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value">
|
||
<div style="float: left">{{ item.label }}</div>
|
||
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||
</el-option>
|
||
</el-select>
|
||
<!--<span>供应商:</span>-->
|
||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
|
||
<el-date-picker
|
||
v-model="startTime"
|
||
size="small"
|
||
type="daterange"
|
||
align="center"
|
||
value-format="yyyy-MM-dd"
|
||
format="yyyy-MM-dd"
|
||
range-separator="~"
|
||
style="width:250px"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期"/>
|
||
<!--<span>审批情况:</span>-->
|
||
<el-select v-model="approvalValue" placeholder="审批情况" size="small" clearable style="margin-left: 10px">
|
||
<el-option
|
||
v-for="item in approval"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value"/>
|
||
</el-select>
|
||
<el-button
|
||
type="primary"
|
||
size="small"
|
||
plain
|
||
icon="el-icon-search"
|
||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||
<el-button
|
||
type="primary"
|
||
size="small"
|
||
plain
|
||
icon="el-icon-download"
|
||
@click="searchTable1()">导出合同报表</el-button>
|
||
</el-row>
|
||
</el-card>
|
||
|
||
<el-card>
|
||
<el-table
|
||
v-loading="loading1"
|
||
:data="tableData1"
|
||
:row-class-name="tableRowClassName"
|
||
size="mini"
|
||
border
|
||
style="width: 100%"
|
||
height="500px"
|
||
highlight-current-row
|
||
@row-click="searchTable2">
|
||
<el-table-column label="采购合同号" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.采购合同编号 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="采购合同名称" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.采购合同名称 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="规定到货时间" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.规定到货时间 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="供应商" align="center" width="200px">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.供应商名称 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="采购员" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.姓名 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="总金额(元)" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.含税总金额 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="预付款(元)" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.预付款 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="已付款(元)" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.付款金额 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="审批情况" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.审批情况内容 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="未通过原因" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.未通过原因 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作" align="center" min-width="100px">
|
||
<template slot-scope="scope">
|
||
<el-button type="text" plain size="mini" icon="el-icon-printer" @click="exportTable()">打印</el-button>
|
||
<el-button type="text" plain size="mini" icon="el-icon-back" @click="Disable(scope.row)">打回</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<div class="block" style="margin-top: 10px;">
|
||
<el-pagination
|
||
:current-page="pageCurrent1"
|
||
:page-sizes="[10, 20, 30, 40]"
|
||
:page-size="pageSize1"
|
||
:total="total1"
|
||
style="display:inline-block;width:50%"
|
||
layout="total, sizes, prev, pager, next, jumper"
|
||
@size-change="handleSizeChange1"
|
||
@current-change="handleCurrentChange1"/>
|
||
</div>
|
||
</el-card>
|
||
|
||
<el-card>
|
||
<div style="width:900px;margin-left: 350px">
|
||
<el-card>
|
||
<div v-show="type==='1' || type==='2'" id="export">
|
||
<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>
|
||
<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="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="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: 30px">根据《中华人民共和国合同法》的有关规定,经供需双方友好协商,在平等自愿的基础上定立本合同,以便供需双方共同遵守。</div>
|
||
<div style="line-height: 30px">一、 产品名称、规格型号、材质、数量、单价和交货期:</div>
|
||
<table id="50" cellspacing="0px" align="center" border width="100%" style="">
|
||
<tbody id="4">
|
||
<tr id="tableHead" style="height: 40px">
|
||
<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>
|
||
</tr>
|
||
<!--</tbody>-->
|
||
<!--<!–<tbody id="4">–>-->
|
||
<!--<!–<tr id="tableHead" style="height: 40px">–>-->
|
||
<!--<!–<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>–>-->
|
||
<!--<!–</tr>–>-->
|
||
</tbody>
|
||
<tfoot>
|
||
<tr style="height: 40px">
|
||
<td colspan="7">总价: (人民币){{ RMB }}(未税) </td>
|
||
<td colspan="1" align="center">{{ TotalAmount }}</td>
|
||
</tr>
|
||
<tr style="height: 40px">
|
||
<td colspan="7">总价: (人民币){{ RMB1 }}(含{{ taxRate }}增值税) </td>
|
||
<td colspan="1" align="center">{{ TotalAmount1 }}</td>
|
||
</tr>
|
||
</tfoot>
|
||
</table>
|
||
<div style="line-height: 30px">以上价格为含税增值税价格,供方开具真实有效的{{ taxRate }}增值税发票</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">
|
||
<td colspan="4" align="center">供 方</td>
|
||
<td colspan="4" align="center">需 方</td>
|
||
</tr>
|
||
<tr style="height: 35px">
|
||
<th style="width: 15%">单位名称(章)</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">单位名称(章)</th>
|
||
<td style="width: 35%" colspan="3" align="center">江苏高精</td>
|
||
</tr>
|
||
<tr style="height: 35px">
|
||
<th style="width: 15%">法定代表人</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">法定代表人</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr style="height: 35px">
|
||
<th style="width: 15%">委托代理人</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">委托代理人</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr style="height: 35px">
|
||
<th style="width: 15%">电话</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">电话</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
|
||
<tr v-if="type==='1'" style="height: 35px">
|
||
<th style="width: 15%">传真</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">传真</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr v-if="type==='1'" style="height: 35px">
|
||
<th style="width: 15%">开户银行</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">开户银行</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr v-if="type==='1'" style="height: 35px">
|
||
<th style="width: 15%">账号</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">账号</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr v-if="type==='1'" style="height: 35px">
|
||
<th style="width: 15%">税号</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">税号</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
<tr v-if="type==='1'" style="height: 35px">
|
||
<th style="width: 15%">邮政编码</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
<th style="width: 15%">邮政编码</th>
|
||
<td style="width: 35%" colspan="3" align="center"/>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<div style="line-height: 25px;margin-top: 10px">签订时间:____年__月__日</div>
|
||
<div style="line-height: 25px">有效期限:____年__月__日至____年__月__日</div>
|
||
</div>
|
||
<div v-show="type === '3'" id="WGBLD" style="width: 880px;margin: 0 auto">
|
||
<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>
|
||
</div>
|
||
<div v-show="type === '4'" id="CZCG" style="width: 880px;margin: 0 auto">
|
||
<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="tablehead100" style="height: 35px">
|
||
<td style="text-align: center;width: 7%">序号</td>
|
||
<td colspan="2" style="text-align: center;width: 10%">组号</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: 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 returns2" :key="index" style="height: 35px">
|
||
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
|
||
<td colspan="2" style="text-align: center;width: 10%">{{ list.组号 }}</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: 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>
|
||
</div>
|
||
</el-card>
|
||
</div>
|
||
</el-card>
|
||
|
||
<el-dialog :visible.sync="dialogVisible2" title="采购员选择" center style="min-height: 300px;" width="40%">
|
||
<el-table
|
||
:data="tableData02"
|
||
size="small"
|
||
border
|
||
style="width: 100%;min-height:300px"
|
||
height="300px"
|
||
highlight-current-row
|
||
@row-click="clickBuyer">
|
||
<el-table-column label="考勤编号" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.考勤编号 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="姓名" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.姓名 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="性别" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.性别 }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="工作岗位" align="center">
|
||
<template slot-scope="scope">
|
||
{{ scope.row.岗位名称 }}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button :disabled="submitDisable" type="primary" size="small" icon="el-icon-check" @click="submitSelectBuyer">确定</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { initContract, initBuyer, searchTable1, searchTable2, Disable, searchTable3 } from '@/api/WorkshopProcurement/ProcurementContractEnquiry'
|
||
import $ from 'jquery'
|
||
import QRCode from 'qrcode'
|
||
|
||
export default {
|
||
data() {
|
||
return {
|
||
approval: [{
|
||
value: 0,
|
||
label: '全部'
|
||
}, {
|
||
value: 1,
|
||
label: '通过'
|
||
}, {
|
||
value: 2,
|
||
label: '未通过'
|
||
}, {
|
||
value: 3,
|
||
label: '未审批'
|
||
}],
|
||
startTime: '',
|
||
采购合同名称: '',
|
||
规定到货时间: '',
|
||
操作日期: '',
|
||
approvalValue: '',
|
||
RMB: '',
|
||
TotalAmount: '',
|
||
check1: 0,
|
||
check2: 0,
|
||
check3: 0,
|
||
check4: 0,
|
||
check5: 0,
|
||
startEndDate: '',
|
||
contract: '',
|
||
taxRate: '',
|
||
TotalAmount1: '',
|
||
RMB1: '',
|
||
type: '',
|
||
contractNumValue: '',
|
||
contractNum: [],
|
||
ProcurementContractNum: '',
|
||
buyerName: '',
|
||
buyerValue: '',
|
||
supplier: '',
|
||
supplierName: '',
|
||
supplierValue: '',
|
||
total1: 0,
|
||
pageCurrent1: 1,
|
||
pageSize1: 10,
|
||
tableData1: [],
|
||
loading1: false,
|
||
dialogVisible1: false,
|
||
form1: {},
|
||
goodTime: '',
|
||
returns: [],
|
||
returns1: [],
|
||
returns2: [],
|
||
tableData02: [],
|
||
submitDisable: true,
|
||
dialogVisible2: false,
|
||
textarea: ``,
|
||
contractValue: '' // 显示表2和变更合同用的变量
|
||
}
|
||
},
|
||
created() {
|
||
this.fetchData()
|
||
this.searchTable1()
|
||
},
|
||
methods: {
|
||
fetchData() {
|
||
this.contractNum = []
|
||
initContract().then(response => {
|
||
for (let i = 0; i < response.data.length; i++) {
|
||
this.contractNum.push({
|
||
label: response.data[i].采购合同编号,
|
||
name: response.data[i].采购合同名称,
|
||
value: response.data[i].采购合同流水号
|
||
})
|
||
}
|
||
})
|
||
},
|
||
initBuyer() { // 初始化采购人员
|
||
initBuyer().then(response => {
|
||
this.tableData02 = response.data
|
||
})
|
||
},
|
||
clickBuyer(row) { // 点击采购员表某一行
|
||
this.submitDisable = false
|
||
this.buyerName = row.姓名
|
||
this.buyerValue = row.人员编号
|
||
},
|
||
submitSelectBuyer() { // 确定
|
||
this.dialogVisible2 = false
|
||
},
|
||
searchTable1() {
|
||
this.textarea = ``
|
||
this.loading1 = true
|
||
this.startTime ? this.check1 = 1 : (this.check1 = 0, this.startTime = '')
|
||
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
|
||
this.supplierName ? this.check4 = 1 : this.check4 = 0
|
||
if (this.approvalValue === '' || this.approvalValue === 0) {
|
||
this.check5 = 0
|
||
} else {
|
||
this.check5 = 1
|
||
}
|
||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startTime[0], this.startTime[1], this.check2, this.contractNumValue, this.check4, this.supplierName, this.check5, this.approvalValue).then(response => {
|
||
this.loading1 = false
|
||
console.log(response.data.rows)
|
||
for (let j = 0; j < response.data.rows.length; j++) {
|
||
if (response.data.rows[j].规定到货时间 !== null) {
|
||
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
|
||
}
|
||
}
|
||
this.tableData1 = response.data.rows
|
||
this.total1 = response.data.total
|
||
})
|
||
},
|
||
tableRowClassName({ row, rowIndex }) {
|
||
if (row.审批情况流水号 === '1') {
|
||
return 'adopt'
|
||
} else if (row.审批情况流水号 === '2') {
|
||
return 'NotThrough'
|
||
}
|
||
},
|
||
Disable(row) {
|
||
this.$confirm('此操作将永久禁用该行, 是否继续?', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
Disable(row.采购合同流水号).then(response => {
|
||
if (response.data[0].result === '1') {
|
||
this.$message.success('禁用成功')
|
||
this.searchTable1()
|
||
} else {
|
||
this.$message.error('禁用失败')
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
this.$message({
|
||
type: 'info',
|
||
message: '已取消禁用'
|
||
})
|
||
})
|
||
},
|
||
exportTable() {
|
||
if (this.type === '1' || this.type === '2') {
|
||
const htmlNode = $('#export').html()
|
||
const body = $('body')
|
||
body.children().hide()
|
||
const printNode = $(htmlNode)
|
||
body.append(printNode)
|
||
window.print()
|
||
body.children().not('script').show()
|
||
body.children().not('#app').hide()
|
||
printNode.remove()
|
||
} else if (this.type === '3') {
|
||
const htmlNode = $('#WGBLD').html()
|
||
const body = $('body')
|
||
body.children().hide()
|
||
const printNode = $(htmlNode)
|
||
body.append(printNode)
|
||
window.print()
|
||
body.children().not('script').show()
|
||
body.children().not('#app').hide()
|
||
printNode.remove()
|
||
} else {
|
||
const htmlNode = $('#CZCG').html()
|
||
const body = $('body')
|
||
body.children().hide()
|
||
const printNode = $(htmlNode)
|
||
body.append(printNode)
|
||
window.print()
|
||
body.children().not('script').show()
|
||
body.children().not('#app').hide()
|
||
printNode.remove()
|
||
}
|
||
},
|
||
handleSizeChange1(val) {
|
||
this.pageCurrent1 = 1
|
||
this.pageSize1 = val
|
||
this.searchTable1()
|
||
},
|
||
handleCurrentChange1(val) {
|
||
this.pageCurrent1 = val
|
||
this.searchTable1()
|
||
},
|
||
searchTable2(row) {
|
||
this.type = 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.总金额_文本
|
||
if (row.总金额 === '0') {
|
||
this.TotalAmount = ''
|
||
this.TotalAmount1 = ''
|
||
} else {
|
||
this.TotalAmount = row.总金额
|
||
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
|
||
}
|
||
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
|
||
}
|
||
}
|
||
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 if (this.type === '3') {
|
||
this.contractValue = parseInt(row.采购合同流水号)
|
||
searchTable2(this.contractValue).then(response => {
|
||
this.returns = response.data
|
||
})
|
||
} else {
|
||
this.contractValue = parseInt(row.采购合同流水号)
|
||
searchTable3(this.contractValue).then(response => {
|
||
this.returns2 = response.data
|
||
})
|
||
}
|
||
// searchTable3(this.contractValue).then(response => {
|
||
// this.returns1 = response.data
|
||
// const children1 = document.getElementsByClassName('tableData1')
|
||
// const parent1 = document.getElementById('51')
|
||
// if (children1.length !== 0) {
|
||
// for (let i = children1.length - 1; i >= 0; i--) {
|
||
// parent1.removeChild(children1[i])
|
||
// }
|
||
// }
|
||
// const tr = []
|
||
// for (let i = 0; i < this.returns1.length; i++) {
|
||
// tr[i] = document.createElement('tr')
|
||
// tr[i].setAttribute('class', 'tableData1')
|
||
// 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>'
|
||
// $('#tableHead1').after(tr[i])
|
||
// }
|
||
// for (let j = 0; j < this.returns1.length; j++) {
|
||
// if (response.data[j].备注 === null) {
|
||
// response.data[j].备注 = ''
|
||
// }
|
||
// if (response.data[j].单价 === 0) {
|
||
// response.data[j].单价 = ''
|
||
// }
|
||
// if (response.data[j].金额 === 0) {
|
||
// response.data[j].金额 = ''
|
||
// }
|
||
// document.getElementsByClassName('tableData1')[j].children[0].innerHTML = response.data[j].物料名称
|
||
// document.getElementsByClassName('tableData1')[j].children[1].innerHTML = response.data[j].图号
|
||
// document.getElementsByClassName('tableData1')[j].children[2].innerHTML = response.data[j].规格
|
||
// document.getElementsByClassName('tableData1')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
|
||
// document.getElementsByClassName('tableData1')[j].children[4].innerHTML = response.data[j].备注
|
||
// document.getElementsByClassName('tableData1')[j].children[5].innerHTML = response.data[j].数量
|
||
// document.getElementsByClassName('tableData1')[j].children[6].innerHTML = response.data[j].单价
|
||
// document.getElementsByClassName('tableData1')[j].children[7].innerHTML = response.data[j].金额
|
||
// }
|
||
// })
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.el-date-editor{
|
||
width:200px
|
||
}
|
||
.el-select{
|
||
width:150px;
|
||
margin-right: 10px;
|
||
}
|
||
.el-input{
|
||
width:150px;
|
||
margin-right: 10px;
|
||
}
|
||
span{
|
||
margin: 10px 0 10px 10px;
|
||
}
|
||
.searchForm .el-form-item{
|
||
margin-bottom: 5px;
|
||
}
|
||
</style>
|
||
<style>
|
||
.tableData{
|
||
height: 30px;
|
||
}
|
||
.tableData1{
|
||
height: 30px;
|
||
}
|
||
.el-table .adopt{
|
||
background: #9BD7FC;
|
||
}
|
||
.el-table .NotThrough{
|
||
background: #FF9759;
|
||
}
|
||
</style>
|