BusMarketCouponsEventList.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :span="6">
  8. <a-form-item label="事件名称">
  9. <j-input
  10. placeholder="事件名称"
  11. v-model="queryParam.name"
  12. style="width: 200px"
  13. ></j-input>
  14. </a-form-item>
  15. </a-col>
  16. <a-col :md="6" :sm="8">
  17. <span
  18. style="float: left; overflow: hidden"
  19. class="table-page-search-submitButtons"
  20. >
  21. <a-button type="primary" @click="searchQuery" icon="search"
  22. >查询</a-button
  23. >
  24. <a-button
  25. type="primary"
  26. @click="searchReset"
  27. icon="reload"
  28. style="margin-left: 8px"
  29. >重置</a-button
  30. >
  31. </span>
  32. </a-col>
  33. </a-row>
  34. </a-form>
  35. </div>
  36. <!-- 查询区域-END -->
  37. <!-- 操作按钮区域 -->
  38. <div class="table-operator">
  39. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  40. <a-dropdown v-if="selectedRowKeys.length > 0">
  41. <a-button style="margin-left: 8px">
  42. 批量操作 <a-icon type="down"
  43. /></a-button>
  44. </a-dropdown>
  45. </div>
  46. <!-- table区域-begin -->
  47. <div>
  48. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
  49. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
  50. <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
  51. >项
  52. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  53. </div> -->
  54. <a-table
  55. ref="table"
  56. size="middle"
  57. :scroll="{ x: true }"
  58. bordered
  59. rowKey="id"
  60. :columns="columns"
  61. :dataSource="dataSource"
  62. :pagination="ipagination"
  63. :loading="loading"
  64. :rowSelection="{
  65. selectedRowKeys: selectedRowKeys,
  66. onChange: onSelectChange,
  67. }"
  68. class="j-table-force-nowrap"
  69. @change="handleTableChange"
  70. >
  71. <template slot="timeslot" slot-scope="text, record, index">
  72. {{ record.startTime + "~" + record.endTime }}
  73. </template>
  74. <template slot="stateslot" slot-scope="text, record, index">
  75. {{ record.state == 1 ? "启用" : "禁用" }}
  76. </template>
  77. <span slot="action" slot-scope="text, record">
  78. <a @click="handleConfig(record)">配置</a>
  79. <a-divider type="vertical" />
  80. <a @click="handleEdit(record)">编辑</a>
  81. <a-divider type="vertical" />
  82. <a-dropdown>
  83. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  84. <a-menu slot="overlay">
  85. <a-menu-item>
  86. <a @click="handleDetail(record)">详情</a>
  87. </a-menu-item>
  88. <a-menu-item>
  89. <a-popconfirm
  90. title="确定删除吗?"
  91. @confirm="() => handleDelete(record.id)"
  92. >
  93. <a>删除</a>
  94. </a-popconfirm>
  95. </a-menu-item>
  96. </a-menu>
  97. </a-dropdown>
  98. </span>
  99. </a-table>
  100. </div>
  101. <bus-market-coupons-event-modal
  102. ref="modalForm"
  103. @ok="modalFormOk"
  104. ></bus-market-coupons-event-modal>
  105. <bus-market-coupons-event-detail-list-modal
  106. :eventId="eventId"
  107. ref="modalCouponsEventDetailList"
  108. ></bus-market-coupons-event-detail-list-modal>
  109. </a-card>
  110. </template>
  111. <script>
  112. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  113. import BusMarketCouponsEventModal from "./modules/BusMarketCouponsEventModal";
  114. import BusMarketCouponsEventDetailListModal from "./modules/BusMarketCouponsEventDetailListModal";
  115. import { filterObj } from "@/utils/util";
  116. import { getAction } from "@/api/manage";
  117. export default {
  118. name: "marketRechargeList",
  119. mixins: [JeecgListMixin],
  120. components: {
  121. BusMarketCouponsEventModal,
  122. BusMarketCouponsEventDetailListModal,
  123. },
  124. data() {
  125. return {
  126. queryParam: {},
  127. // 分页参数
  128. ipagination: {
  129. current: 1,
  130. pageSize: 10,
  131. pageSizeOptions: ["10", "20", "30"],
  132. showTotal: (total, range) => {
  133. return range[0] + "-" + range[1] + " 共" + total + "条";
  134. },
  135. showQuickJumper: true,
  136. showSizeChanger: true,
  137. total: 0,
  138. },
  139. // 表头
  140. columns: [
  141. {
  142. title: "商家",
  143. align: "center",
  144. dataIndex: "hotelName",
  145. },
  146. {
  147. title: "事件名称",
  148. align: "center",
  149. dataIndex: "name",
  150. },
  151. {
  152. title: "事件类型",
  153. align: "center",
  154. dataIndex: "typeName",
  155. },
  156. {
  157. title: "有效期",
  158. align: "center",
  159. dataIndex: "startTime",
  160. scopedSlots: { customRender: "timeslot" },
  161. },
  162. {
  163. title: "状态",
  164. align: "center",
  165. dataIndex: "remarks",
  166. scopedSlots: { customRender: "stateslot" },
  167. },
  168. {
  169. title: "操作",
  170. dataIndex: "action",
  171. align: "center",
  172. fixed: "right",
  173. width: 147,
  174. scopedSlots: { customRender: "action" },
  175. },
  176. ],
  177. url: {
  178. list: "/business/busMarketCouponsEvent/list",
  179. delete: "/business/busMarketCouponsEvent/delete",
  180. deleteBatch: "/business/busMarketCouponsEvent/deleteBatch",
  181. exportXlsUrl: "/business/busMarketCouponsEvent/exportXls",
  182. importExcelUrl: "/business/busMarketCouponsEvent/importExcel",
  183. },
  184. dictOptions: {},
  185. superFieldList: [],
  186. selectedRowKeys: [],
  187. isorter: {
  188. column: "createTime",
  189. order: "desc",
  190. },
  191. eventId: "",
  192. };
  193. },
  194. created() {},
  195. methods: {
  196. handleConfig(item) {
  197. this.eventId = item.id;
  198. this.$refs.modalCouponsEventDetailList.eventId = item.id;
  199. this.$refs.modalCouponsEventDetailList.visible = true;
  200. this.$refs.modalCouponsEventDetailList.title = "赠送明细";
  201. this.$refs.modalCouponsEventDetailList.add(item.id);
  202. },
  203. },
  204. };
  205. </script>
  206. <style scoped>
  207. @import "~@assets/less/common.less";
  208. </style>