index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="padding-20">
  3. <div class="search-box">
  4. <el-form ref="form"
  5. :inline="true"
  6. :model="searchForm"
  7. clearable
  8. class="mt-10">
  9. <el-form-item label="门店名称:">
  10. <el-input
  11. v-model="searchForm.bar_name"
  12. placeholder="请输入门店名称"
  13. clearable></el-input>
  14. </el-form-item>
  15. <el-form-item class="ml-10">
  16. <el-button
  17. icon="el-icon-search"
  18. type="primary"
  19. @click="searchSubmit">查询
  20. </el-button>
  21. </el-form-item>
  22. <el-form-item class="ml-10">
  23. <el-button icon="el-icon-plus"
  24. type="primary"
  25. v-permission="'business_outlet_list_add'"
  26. @click="add">新增
  27. </el-button>
  28. </el-form-item>
  29. </el-form>
  30. </div>
  31. <el-table :data="tableData"
  32. v-loading="tableLoading"
  33. fit
  34. class="marginT-10 order-table"
  35. :max-height="vheight">
  36. <el-table-column type="expand">
  37. <template slot-scope="props">
  38. <el-form label-position="left"
  39. inline
  40. class="demo-table-expand"
  41. label-width="160px">
  42. <el-form-item label="编号">
  43. <span>{{ props.row.id }}</span>
  44. </el-form-item>
  45. <el-form-item label="酒吧名称">
  46. <span>{{ props.row.bar_name }}</span>
  47. </el-form-item>
  48. <el-form-item label="门店地址">
  49. <span>{{ props.row.bar_address }}</span>
  50. </el-form-item>
  51. <el-form-item label="酒吧状态">
  52. <span>{{ ['无效', '有效'][props.row.bar_status] }}</span>
  53. </el-form-item>
  54. <el-form-item label="点歌开始时间">
  55. <span>{{ props.row.bar_song_start_time }}</span>
  56. </el-form-item>
  57. <el-form-item label="点歌结束时间">
  58. <span>{{ props.row.bar_song_end_time }}</span>
  59. </el-form-item>
  60. <el-form-item label="酒吧座位预定开始时间">
  61. <span>{{ props.row.bar_place_reserve_start_time }}</span>
  62. </el-form-item>
  63. <el-form-item label="酒吧座位预定结束时间">
  64. <span>{{ props.row.bar_place_reserve_end_time }}</span>
  65. </el-form-item>
  66. <el-form-item label="门店图片">
  67. <el-image style="width: 100px; height: 100px"
  68. :src="props.row.bar_img_url[0]"
  69. :preview-src-list="props.row.bar_img_url">
  70. </el-image>
  71. </el-form-item>
  72. <el-form-item label="创建时间">
  73. <span>{{ props.row.created_at }}</span>
  74. </el-form-item>
  75. <el-form-item label="更新时间">
  76. <span>{{ props.row.updated_at }}</span>
  77. </el-form-item>
  78. </el-form>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="编号" prop="id" width="160"></el-table-column>
  82. <el-table-column label="酒吧名称" prop="bar_name"></el-table-column>
  83. <el-table-column label="门店地址" prop="bar_address"></el-table-column>
  84. <el-table-column label="酒吧状态" sortable :sort-method="() => {}" width="100">
  85. <template slot-scope="scope">
  86. <p>{{ ['无效', '有效'][scope.row.bar_status] }}</p>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="操作" width="100">
  90. <template slot-scope="scope">
  91. <el-button type="text" v-permission="'business_outlet_list_edit'" @click="edit(scope.row)">编辑</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <el-pagination
  96. class="marginT-20"
  97. @size-change="handleSizeChange"
  98. @current-change="handleCurrentChange"
  99. :hide-on-single-page="true"
  100. :current-page="page"
  101. :page-size="page_size"
  102. :page-sizes="[10, 20, 100, 200, 300, 400]"
  103. background
  104. layout="total, sizes, prev, pager, next, jumper"
  105. :total="totalCount"/>
  106. <detail v-if="detailsDialog.show"
  107. v-model="detailsDialog.show"
  108. :exData="detailsDialog.exData"
  109. @success="init"></detail>
  110. </div>
  111. </template>
  112. <script>
  113. import page from '@/mixin/page'
  114. import detail from './details'
  115. export default {
  116. mixins: [page],
  117. components: {
  118. detail,
  119. },
  120. data () {
  121. return {
  122. detailsDialog: {
  123. show: false,
  124. exData: {}
  125. },
  126. searchForm: {},
  127. tableData: [],
  128. tableUrl: '/v1/bar/list'
  129. }
  130. },
  131. methods: {
  132. add () {
  133. this.detailsDialog.exData = {}
  134. this.detailsDialog.show = true
  135. },
  136. edit (row) {
  137. this.detailsDialog.exData = row
  138. this.detailsDialog.show = true
  139. }
  140. },
  141. mounted () {
  142. this.init()
  143. },
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .demo-table-expand {
  148. .el-form-item {
  149. width: 50%;
  150. margin-right: 0;
  151. margin-bottom: 0;
  152. ::v-deep &__label {
  153. color: #99a9bf;
  154. }
  155. }
  156. }
  157. </style>