<template>
|
<div class="product">
|
<p class="title">
|
<span></span>
|
电子合同信息
|
</p>
|
<el-button type="primary" icon="iconfont icon-zengjia1" size="medium" @click="addContract" v-if="applyInfo.phaseNo=='0100'">生成电子合同</el-button>
|
<el-table
|
stripe
|
:data="contractList"
|
style="margin-top:30px"
|
:cell-class-name="cellClass"
|
:header-cell-class-name="headerCellClass"
|
highlight-current-row
|
>
|
<el-table-column prop="edocno" label="电子合同编号"></el-table-column>
|
<el-table-column prop="filename" label="电子合同名称" min-width="200" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="phasename" label="生成流程阶段"></el-table-column>
|
<el-table-column prop="inputtime" label="生成时间"></el-table-column>
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<el-button type="text" @click.native="handleView(scope.row)" v-no-more-click>查看电子合同</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
background
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page.sync="currentPage"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="10"
|
layout="prev, pager, next, jumper, total, sizes"
|
:total="total"
|
></el-pagination>
|
<div :class="[isFixed ? 'fixedBtn' : 'marginTopBtn']">
|
<el-button size="medium" plain @click="prevStep">上一页</el-button>
|
<el-button size="medium" type="primary" @click="nextPage">下一页</el-button>
|
</div>
|
</div>
|
</template>
|
<script>
|
import {
|
qryEContractList,
|
createEContract,
|
getContractUrl
|
} from "@/api/product";
|
import { setStorage, getStorage, removeStorage } from "@/utils/storage";
|
import common from "@/utils/common";
|
export default {
|
data () {
|
return {
|
contractList:[],
|
form:{
|
currentPage: "1",
|
pageSize: "10"
|
},
|
total: 0,
|
currentPage: 1,
|
applyInfo:this.$store.state.product.applyInfo,
|
applyMenu:this.$store.state.product.applyMenu,
|
isFixed:false
|
}
|
},
|
created () {
|
this.qryEContractList(this.form)
|
},
|
methods: {
|
// 查询电子合同
|
qryEContractList(form){
|
form.objectno = this.applyInfo.serialNo
|
qryEContractList(form).then(res=>{
|
this.contractList = res.result.records
|
this.total = res.result.total
|
const fullHeight = document.documentElement.clientHeight; //可是区域高度
|
const targetHeight = document.querySelector('.product').getBoundingClientRect().height
|
if(targetHeight >= fullHeight-80){
|
// 底部按钮需要绝对定位显示
|
this.isFixed = true
|
}
|
})
|
},
|
headerCellClass() {
|
return "headerCellClass";
|
},
|
cellClass() {
|
return "cellClass";
|
},
|
//设置每页多少条
|
handleSizeChange(val) {
|
this.form.pageSize = val;
|
this.qryEContractList(this.form);
|
},
|
//查询当前页
|
handleCurrentChange(val) {
|
this.form.currentPage = val;
|
this.qryEContractList(this.form);
|
},
|
// 生成电子合同
|
addContract(){
|
this.$parent._data.loading = true
|
createEContract({
|
port:'pc',
|
signType:false,
|
functionID:'02',
|
compound:'06',
|
businessNo:this.applyInfo.serialNo
|
}).then(res=>{
|
this.$parent._data.loading = false
|
if(res.code=='00'){
|
this.$message.success('生成电子合同成功')
|
qryEContractList({objectno:this.applyInfo.serialNo}).then(res=>{
|
this.contractList = res.result.records
|
})
|
}
|
})
|
},
|
// 查看电子合同
|
handleView(row){
|
getContractUrl({edocno:row.edocno, bucketname: row.bucketname}).then(res=>{
|
window.open(
|
res.result.url,
|
'newwindow',
|
'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
|
)
|
})
|
},
|
prevStep(){
|
this.applyMenu.forEach((val,index) => {
|
if(val.tabname=='电子合同信息'){
|
common.tabInfo(this.applyMenu[index-1].tabname,this.applyInfo.flowno,this)
|
}
|
});
|
},
|
nextPage(){
|
this.applyMenu.forEach((val,index) => {
|
if(val.tabname=='电子合同信息'){
|
common.tabInfo(this.applyMenu[index+1].tabname,this.applyInfo.flowno,this)
|
}
|
});
|
},
|
}
|
}
|
</script>
|