zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<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>