Merterial.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <style lang="scss">
  2. </style>
  3. <template>
  4. <section>
  5. <p>公司管理 > 资料列表</p>
  6. <div class="filter">
  7. <el-form label-width="70px" :inline="true" size="small" label-position="left">
  8. <el-form-item label="名称">
  9. <el-input clearable placeholder="请输入名称" v-model="form.name"></el-input>
  10. </el-form-item>
  11. <el-form-item>
  12. <el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
  13. <el-button icon="el-icon-plus" @click="$router.push({path:'/company/add'})" type="primary">新增资料</el-button>
  14. </el-form-item>
  15. </el-form>
  16. </div>
  17. <el-table
  18. class="table"
  19. :data="list" height="64vh"
  20. border v-loading="loading"
  21. style="width: 100%">
  22. <el-table-column
  23. type="selection" fixed="left"
  24. width="40">
  25. </el-table-column>
  26. <el-table-column
  27. prop="name"
  28. label="宣传资料名称">
  29. </el-table-column>
  30. <el-table-column
  31. prop="ctime" width="200"
  32. label="时间">
  33. </el-table-column>
  34. <el-table-column fixed="right"
  35. prop="zip" width="170"
  36. label="操作">
  37. <template slot-scope="scope">
  38. <el-button icon="el-icon-edit" @click="$router.push({path:'/company/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
  39. <el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <Page ref="pageButton" :total='total' @pageChange='gopage'/>
  44. </section>
  45. </template>
  46. <script>
  47. import Page from '../../components/Page';
  48. export default {
  49. components:{
  50. Page
  51. },
  52. data(){
  53. return{
  54. form:{name:'',page:1,page_size:20},
  55. activeName:"1",
  56. total:1,
  57. list:[{name:'2333'}],
  58. loading:false
  59. }
  60. },
  61. methods:{
  62. gopage(size){
  63. if(size){
  64. this.form.page_size=size
  65. }
  66. this.form.page=this.$refs.pageButton.page
  67. this.getData()
  68. },
  69. getData(){
  70. var parm=this.form;
  71. this.loading=true
  72. // this.$api.getClass(parm).then(res=>{
  73. // this.list=res.data.data.list
  74. // this.total=res.data.data.total
  75. // this.loading=false
  76. // })
  77. },
  78. del(id){
  79. this.$confirm('确定删除吗', '提示', {
  80. type: 'warning'
  81. }).then(() => {
  82. this.$api.deleteClass({id:id}).then((res)=>{
  83. this.$message({
  84. message: '删除成功',
  85. type: 'success'
  86. })
  87. this.getData()
  88. })
  89. })
  90. },
  91. },
  92. created(){
  93. // this.getData()
  94. }
  95. }
  96. </script>