parking_temp_list.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', '模板库管理')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}" />
  5. <div id="app">
  6. <div class="all">
  7. <div class="vue-head">
  8. <div class="vue-main-title">
  9. <div class="vue-main-title-left"></div>
  10. <div class="vue-main-title-content">模板库管理</div>
  11. <div class="vue-main-title-right"> <el-button style="margin-top:10px;color: #FFFFFF;background-color: #29ba9c;" @click="addTemp"> <i class="el-icon-plus"></i> 添加新模板</el-button></div>
  12. </div>
  13. <div class="vue-search">
  14. <el-form :inline="true" :model="search" class="demo-form-inline">
  15. <el-form-item label="">
  16. <el-input v-model="search.kwd" placeholder="关键字"></el-input>
  17. </el-form-item>
  18. <el-form-item label="">
  19. <el-button type="primary" @click="handleSearch">搜索</el-button>
  20. </el-form-item>
  21. </el-form>
  22. </div>
  23. <el-table :data="tableData" style="width: 100%">
  24. <el-table-column prop="name" label="模板名称" align="center">
  25. </el-table-column>
  26. <el-table-column label="操作" align="center">
  27. <template slot-scope="scope">
  28. <i class="el-icon-edit-outline" style="font-size:18px;cursor:pointer" @click="edit(scope.row.id)"></i>
  29. <i class="el-icon-delete-solid" style="font-size:18px;cursor:pointer" @click="deleteTemp(scope.row.id)"></i>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. </div>
  34. <div class="vue-page" >
  35. <el-row>
  36. <el-col align="right">
  37. <el-pagination layout="prev, pager, next,jumper" @current-change="search1" :total="total" :page-size="per_page" :current-page="current_page" background></el-pagination>
  38. </el-col>
  39. </el-row>
  40. </div>
  41. </div>
  42. </div>
  43. <script language='javascript'>
  44. //vue
  45. var app = new Vue({
  46. el: "#app",
  47. delimiters: ['[[', ']]'],
  48. data() {
  49. return {
  50. page: 1,
  51. tableData: [],
  52. current_page:1,
  53. total:1,
  54. per_page:15,
  55. search:{
  56. kwd:''
  57. }
  58. }
  59. },
  60. computed: {
  61. },
  62. mounted() {
  63. this.getTempList()
  64. },
  65. methods: {
  66. //获取模板列表数据
  67. getTempList() {
  68. this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.parking-temp.get-list') !!}", {
  69. page: this.current_page,
  70. kwd:this.search.kwd
  71. }).then(res => {
  72. if (res.data.result) {
  73. this.tableData = res.data.data.data
  74. this.current_page = res.data.data.current_page
  75. this.total=res.data.data.total
  76. this.per_page =res.data.data.per_page
  77. } else {
  78. this.$message.error(res.data.msg);
  79. }
  80. })
  81. },
  82. //编辑模板
  83. edit(id) {
  84. let url = "{!! yzWebUrl('plugin.printer.admin.parking-temp.add') !!}&id=" + id
  85. window.location.href = url
  86. },
  87. addTemp() {
  88. let url = "{!! yzWebUrl('plugin.printer.admin.parking-temp.add') !!}"
  89. window.location.href = url
  90. },
  91. deleteTemp(id) {
  92. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  93. confirmButtonText: '确定',
  94. cancelButtonText: '取消',
  95. type: 'warning'
  96. }).then(() => {
  97. this.$http.post("{!! yzWebFullUrl('plugin.printer.admin.parking-temp.del') !!}&id=" + id, {
  98. temp:{id}
  99. }).then(res => {
  100. if (res.data.result) {
  101. this.$message.success(res.data.msg);
  102. this.getTempList()
  103. } else {
  104. this.$message.error(res.data.msg);
  105. }
  106. })
  107. }).catch(() => {
  108. this.$message({
  109. type: 'info',
  110. message: '已取消删除'
  111. });
  112. });
  113. },
  114. // 搜索
  115. search1(page){
  116. this.getTempList(page)
  117. },
  118. handleSearch(){
  119. this.getTempList()
  120. }
  121. },
  122. })
  123. </script>
  124. @endsection