<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> -->
|
|
<!-- 贷款合同信息 -->
|
<loanContactList
|
:applyInfo="applyInfo"
|
v-if="applyInfo.phaseNo >= '0060'"
|
/>
|
<workerLoanContactList
|
:projectCompany="projectCompany"
|
v-if="projectCompany.phaseno >= '0040'"
|
/>
|
<vLoanLoanContactList :mainCredit="mainCredit" v-if="mainCredit.phaseNo" />
|
<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";
|
//工友贷项目url路径是 /workerContract //其他项目路径是 /contract
|
import { setStorage, getStorage, removeStorage } from "@/utils/storage";
|
import loanContactList from "../../views/CreditFlowPublic/baseContract/loanContactList.vue";
|
import workerLoanContactList from "../../views/CreditFlowPublic/baseContract/workerLoanContactList.vue";
|
import vLoanLoanContactList from "../../views/CreditFlowPublic/baseContract/vLoanLoanContactList.vue";
|
import common from "@/utils/common";
|
export default {
|
data() {
|
return {
|
contractList: [],
|
form: {
|
currentPage: "1",
|
pageSize: "10",
|
},
|
total: 0,
|
currentPage: 1,
|
mainCredit: this.$store.state.product.mainCredit,
|
applyInfo: this.$store.state.product.applyInfo,
|
projectCompany: this.$store.state.product.projectCompany,
|
applyMenu: this.$store.state.product.applyMenu,
|
isFixed: false,
|
};
|
},
|
components: { loanContactList, workerLoanContactList, vLoanLoanContactList },
|
created() {
|
this.qryEContractList(this.form);
|
},
|
methods: {
|
// 查询电子合同
|
qryEContractList(form) {
|
form.objectno = this.getBusinessNo()
|
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);
|
},
|
getBusinessNo() {
|
console.log('getBusinessNo',this.applyInfo,this.mainCredit,this.projectCompany )
|
const businessNo = this.applyInfo.serialNo
|
? this.applyInfo.serialNo
|
: this.mainCredit.serialNo
|
? this.mainCredit.serialNo
|
: this.projectCompany.serialno;
|
return businessNo;
|
},
|
// 生成电子合同
|
addContract() {
|
this.$parent._data.loading = true;
|
createEContract({
|
port: "pc",
|
signType: false,
|
functionID: "02",
|
compound: "06",
|
businessNo: this.getBusinessNo()
|
}).then((res) => {
|
this.$parent._data.loading = false;
|
if (res.code == "00") {
|
this.$message.success("生成电子合同成功");
|
qryEContractList({
|
objectno: this.getBusinessNo()
|
}).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() {
|
console.log(
|
"合同页面",
|
this.applyMenu,
|
"this.mainCredit",
|
this.mainCredit,
|
"电子合同信息上一页"
|
);
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "电子合同信息") {
|
if (this.mainCredit.serialNo) {
|
console.log("合同页面上一页", this.applyMenu[index - 1].tabname);
|
common.vLoanTabInfo(
|
this.applyMenu[index - 1].tabname,
|
"CreditFlowPublic",
|
this
|
);
|
} else if (this.projectCompany.serialno) {
|
common.workerTabInfo(
|
this.applyMenu[index - 1].tabname,
|
"CreditFlowPublic",
|
this
|
);
|
} else {
|
common.tabInfo(
|
this.applyMenu[index - 1].tabname,
|
this.applyInfo.flowno,
|
this
|
);
|
}
|
}
|
});
|
},
|
nextPage() {
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "电子合同信息") {
|
if (this.mainCredit.serialNo) {
|
common.vLoanTabInfo(
|
this.applyMenu[index + 1].tabname,
|
"CreditFlowPublic",
|
this
|
);
|
} else if (this.projectCompany.serialno) {
|
common.workerTabInfo(
|
this.applyMenu[index + 1].tabname,
|
"CreditFlowPublic",
|
this
|
);
|
} else {
|
common.tabInfo(
|
this.applyMenu[index + 1].tabname,
|
this.applyInfo.flowno,
|
this
|
);
|
}
|
}
|
});
|
},
|
},
|
beforeRouteLeave(to, from, next) {
|
next();
|
},
|
};
|
</script>
|