BusMarketCouponsEventDetailList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 操作按钮区域 -->
  4. <div class="table-operator">
  5. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  6. </div>
  7. <!-- table区域-begin -->
  8. <div>
  9. <a-table
  10. ref="table"
  11. size="middle"
  12. :scroll="{ x: true }"
  13. bordered
  14. rowKey="id"
  15. :columns="columns"
  16. :dataSource="dataSource"
  17. :pagination="ipagination"
  18. :loading="loading"
  19. :rowSelection="{
  20. selectedRowKeys: selectedRowKeys,
  21. onChange: onSelectChange,
  22. }"
  23. class="j-table-force-nowrap"
  24. @change="handleTableChange"
  25. >
  26. <template slot="typeSlot" slot-scope="text, record">
  27. {{ record.type==1?'优惠券':'免房券'}}
  28. </template>
  29. <template slot="imgSlot" slot-scope="text, record">
  30. <span v-if="!text" style="font-size: 12px; font-style: italic"
  31. >无图片</span
  32. >
  33. <img
  34. v-else
  35. :src="getImgView(text)"
  36. :preview="record.id"
  37. height="25px"
  38. alt=""
  39. style="max-width: 80px; font-size: 12px; font-style: italic"
  40. />
  41. </template>
  42. <template slot="fileSlot" slot-scope="text">
  43. <span v-if="!text" style="font-size: 12px; font-style: italic"
  44. >无文件</span
  45. >
  46. <a-button
  47. v-else
  48. :ghost="true"
  49. type="primary"
  50. icon="download"
  51. size="small"
  52. @click="downloadFile(text)"
  53. >
  54. 下载
  55. </a-button>
  56. </template>
  57. <span slot="action" slot-scope="text, record">
  58. <a @click="handleEdit(record)">编辑</a>
  59. <a-divider type="vertical" />
  60. <a-dropdown>
  61. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  62. <a-menu slot="overlay">
  63. <a-menu-item>
  64. <a @click="handleDetail(record)">详情</a>
  65. </a-menu-item>
  66. <a-menu-item>
  67. <a-popconfirm
  68. title="确定删除吗?"
  69. @confirm="() => handleDelete(record.id)"
  70. >
  71. <a>删除</a>
  72. </a-popconfirm>
  73. </a-menu-item>
  74. </a-menu>
  75. </a-dropdown>
  76. </span>
  77. </a-table>
  78. </div>
  79. <bus-market-coupons-event-detail-modal
  80. ref="modalForm"
  81. @ok="modalFormOk"
  82. ></bus-market-coupons-event-detail-modal>
  83. </a-card>
  84. </template>
  85. <script>
  86. import "@/assets/less/TableExpand.less";
  87. import { mixinDevice } from "@/utils/mixin";
  88. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  89. import BusMarketCouponsEventDetailModal from "./BusMarketCouponsEventDetailModal";
  90. export default {
  91. name: "BusMarketCouponsEventDetailList",
  92. mixins: [JeecgListMixin, mixinDevice],
  93. components: {
  94. BusMarketCouponsEventDetailModal,
  95. },
  96. props: {
  97. eventId: {
  98. type: String,
  99. default: "",
  100. },
  101. },
  102. data() {
  103. return {
  104. description: "bus_market_coupons_event_detail_info管理页面",
  105. // 表头
  106. columns: [
  107. {
  108. title: "门店",
  109. align: "center",
  110. dataIndex: "hotelName",
  111. },
  112. {
  113. title: "会员等级",
  114. align: "center",
  115. dataIndex: "levelName",
  116. },
  117. {
  118. title: "券类型",
  119. align: "center",
  120. dataIndex: "type",
  121. scopedSlots: { customRender: "typeSlot" },
  122. },
  123. {
  124. title: "券名称",
  125. align: "center",
  126. dataIndex: "couponsName",
  127. },
  128. {
  129. title: "数量",
  130. align: "center",
  131. dataIndex: "count",
  132. },
  133. {
  134. title: "操作",
  135. dataIndex: "action",
  136. align: "center",
  137. fixed: "right",
  138. width: 147,
  139. scopedSlots: { customRender: "action" },
  140. },
  141. ],
  142. url: {
  143. list: "/business/busMarketCouponsEventDetail/list?eventId=" + this.eventId,
  144. delete: "/business/busMarketCouponsEventDetail/delete",
  145. deleteBatch: "/business/busMarketCouponsEventDetail/deleteBatch",
  146. exportXlsUrl: "/business/busMarketCouponsEventDetail/exportXls",
  147. importExcelUrl: "business/busMarketCouponsEventDetail/importExcel",
  148. },
  149. dictOptions: {},
  150. superFieldList: [],
  151. // eventId: "",
  152. };
  153. },
  154. created(e) {
  155. // this.getSuperFieldList();
  156. },
  157. computed: {
  158. importExcelUrl: function () {
  159. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  160. },
  161. },
  162. methods: {
  163. add(eventId) {
  164. // this.eventId = eventId;
  165. // this.loadData();
  166. },
  167. handleAdd() {
  168. console.log("eventId", this.eventId);
  169. this.$refs.modalForm.add(this.eventId);
  170. this.$refs.modalForm.title = "新增";
  171. this.$refs.modalForm.disableSubmit = false;
  172. },
  173. initDictConfig() {},
  174. getSuperFieldList() {
  175. let fieldList = [];
  176. fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
  177. fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
  178. fieldList.push({ type: "string", value: "eventId", text: "关联事件" });
  179. fieldList.push({ type: "string", value: "levelId", text: "关联会员" });
  180. fieldList.push({
  181. type: "string",
  182. value: "couponsCashId",
  183. text: "关联卷",
  184. });
  185. fieldList.push({
  186. type: "int",
  187. value: "type",
  188. text: "类型(1-优惠卷;3-免房卷)",
  189. });
  190. fieldList.push({ type: "int", value: "count", text: "赠送数量" });
  191. this.superFieldList = fieldList;
  192. },
  193. },
  194. };
  195. </script>
  196. <style scoped>
  197. @import "~@assets/less/common.less";
  198. </style>