list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 fixed='right' prop="" label="下载" width="300">
  30. <template slot-scope="scope">
  31. <el-button v-if="scope.row.status == 2" type="success" icon="el-icon-circle-plus-outline" @click="download(scope.row)">下载</el-button>
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. </div>
  36. <div class="mb-30 flex-justify-end">
  37. <el-pagination
  38. background
  39. @current-change="handleCurrentChange"
  40. :current-page.sync="fromData.page"
  41. :page-size="10"
  42. layout="prev, pager, next"
  43. :total="total">
  44. </el-pagination>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import {signList,signDownload} from '@/api/signContract.js'
  50. export default {
  51. data(){
  52. return{
  53. list:[],
  54. fromData:{
  55. page:1,
  56. search:'',
  57. },
  58. total:0,
  59. isAJAX:false,
  60. }
  61. },
  62. mounted(){
  63. this.getList();
  64. },
  65. methods:{
  66. getList(){
  67. signList(this.fromData).then((res)=>{
  68. if(res.code == 1){
  69. this.list = res.data.items;
  70. this.total = res.data.total
  71. }
  72. })
  73. },
  74. handleCurrentChange(val){
  75. this.fromData.page = val;
  76. this.getList();
  77. },
  78. searchFun(){
  79. this.fromData.page = 1;
  80. this.getList();
  81. },
  82. add(item){
  83. this.$router.push({path:'/sign/add'})
  84. },
  85. download(item){
  86. if(this.isAJAX){
  87. return
  88. }
  89. this.isAJAX = true;
  90. signDownload({contract_id:item.contract_id}).then((res)=>{
  91. this.isAJAX = false;
  92. if(res.code == 1){
  93. this.$message.success(res.msg);
  94. window.open(res.data.files[0].downloadUrl)
  95. }else{
  96. this.$message.error(res.msg);
  97. }
  98. })
  99. },
  100. },
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .user-list{
  105. }
  106. </style>