list.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="user-list">
  3. <div class="mb-20 flex-justify-space baC-fff sys-radius-10 box-sizing-border pd-15-10">
  4. <div class="align-items-center">
  5. <el-input
  6. class="input-w-200 mr-10"
  7. placeholder="请输入查询关键词"
  8. prefix-icon="el-icon-search"
  9. v-model="fromData.search">
  10. </el-input>
  11. <el-button type="primary" icon="el-icon-search" @click="searchFun()">查询</el-button>
  12. </div>
  13. <div class="">
  14. <el-button type="success" icon="el-icon-circle-plus-outline" @click="add()">发起签署</el-button>
  15. </div>
  16. </div>
  17. <div class="mb-30">
  18. <el-table :data="list" stripe >
  19. <el-table-column fixed prop="id" label="ID"></el-table-column>
  20. <el-table-column fixed prop="contract_name" label="合同名称"></el-table-column>
  21. <el-table-column fixed prop="contract_no" label="合同编号"></el-table-column>
  22. <el-table-column prop="created_at" label="发起签署时间"></el-table-column>
  23. <el-table-column prop="status_str" label="是否签署">
  24. <template slot-scope="scope">
  25. <el-tag v-if="scope.row.status == 2" type="success">{{scope.row.status_str}}</el-tag>
  26. <el-tag v-else type="danger">{{scope.row.status_str}}</el-tag>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="sign_url" label="签署链接"></el-table-column>
  30. <el-table-column fixed='right' prop="" label="下载" width="300">
  31. <template slot-scope="scope">
  32. <el-button v-if="scope.row.status == 2" type="success" icon="el-icon-circle-plus-outline" @click="download(scope.row)">下载</el-button>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. </div>
  37. <div class="mb-30 flex-justify-end">
  38. <el-pagination
  39. background
  40. @current-change="handleCurrentChange"
  41. :current-page.sync="fromData.page"
  42. :page-size="10"
  43. layout="prev, pager, next"
  44. :total="total">
  45. </el-pagination>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import {signList,signDownload} from '@/api/signContract.js'
  51. export default {
  52. data(){
  53. return{
  54. list:[],
  55. fromData:{
  56. page:1,
  57. search:'',
  58. },
  59. total:0,
  60. isAJAX:false,
  61. }
  62. },
  63. mounted(){
  64. this.getList();
  65. },
  66. methods:{
  67. getList(){
  68. signList(this.fromData).then((res)=>{
  69. if(res.code == 1){
  70. this.list = res.data.items;
  71. this.total = res.data.total
  72. }
  73. })
  74. },
  75. handleCurrentChange(val){
  76. this.fromData.page = val;
  77. this.getList();
  78. },
  79. searchFun(){
  80. this.fromData.page = 1;
  81. this.getList();
  82. },
  83. add(item){
  84. this.$router.push({path:'/sign/add'})
  85. },
  86. download(item){
  87. if(this.isAJAX){
  88. return
  89. }
  90. this.isAJAX = true;
  91. signDownload({contract_id:item.id}).then((res)=>{
  92. this.isAJAX = false;
  93. if(res.code == 1){
  94. this.$message.success(res.msg);
  95. window.open(res.data.files[0].downloadUrl)
  96. }else{
  97. this.$message.error(res.msg);
  98. }
  99. })
  100. },
  101. },
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .user-list{
  106. }
  107. </style>