2f20888b763f76d442081727fd2dc58e3d7de2c3.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 操作按钮区域 -->
  4. <div class="table-operator" :md="24" :sm="24" style="margin: -25px 0px 10px 2px">
  5. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  6. <a-dropdown v-if="selectedRowKeys.length > 0">
  7. <a-menu slot="overlay">
  8. <a-menu-item key="1" @click="batchDel">
  9. <a-icon type="delete"/>
  10. 删除
  11. </a-menu-item>
  12. </a-menu>
  13. <a-button style="margin-left: 8px"> 批量操作
  14. <a-icon type="down"/>
  15. </a-button>
  16. </a-dropdown>
  17. </div>
  18. <!-- table区域-begin -->
  19. <div>
  20. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  21. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  22. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  23. </div>
  24. <a-table
  25. ref="table"
  26. size="middle"
  27. bordered
  28. rowKey="id"
  29. :columns="columns"
  30. :dataSource="dataSource"
  31. :pagination="ipagination"
  32. :loading="loading"
  33. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  34. @change="handleTableChange">
  35. <span slot="action" slot-scope="text, record">
  36. <a @click="handleEdit(record)">编辑</a>
  37. <a-divider type="vertical"/>
  38. <a-dropdown>
  39. <a class="ant-dropdown-link">
  40. 更多 <a-icon type="down"/>
  41. </a>
  42. <a-menu slot="overlay">
  43. <a-menu-item>
  44. <a href="javascript:;" @click="handleDetail(record)">详情</a>
  45. </a-menu-item>
  46. <a-menu-item>
  47. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  48. <a>删除</a>
  49. </a-popconfirm>
  50. </a-menu-item>
  51. </a-menu>
  52. </a-dropdown>
  53. </span>
  54. </a-table>
  55. </div>
  56. <!-- table区域-end -->
  57. <!-- 表单区域 -->
  58. <JeecgOrderTicket-modal ref="modalForm" @ok="modalFormOk"></JeecgOrderTicket-modal>
  59. </a-card>
  60. </template>
  61. <script>
  62. import JeecgOrderTicketModal from './form/JeecgOrderTicketModal'
  63. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  64. import {getAction} from '@/api/manage'
  65. export default {
  66. name: "JeecgOrderTicketList",
  67. mixins: [JeecgListMixin],
  68. components: {
  69. JeecgOrderTicketModal,
  70. },
  71. data() {
  72. return {
  73. description: '机票信息',
  74. // 表头
  75. columns: [{
  76. title: '航班号',
  77. align: "center",
  78. dataIndex: 'ticketCode'
  79. }, {
  80. title: '航班时间',
  81. align: "center",
  82. dataIndex: 'tickectDate'
  83. }, {
  84. title: '订单号码',
  85. align: "center",
  86. dataIndex: 'orderId',
  87. }, {
  88. title: '创建人',
  89. align: "center",
  90. dataIndex: 'createBy'
  91. }, {
  92. title: '创建时间',
  93. align: "center",
  94. dataIndex: 'createTime',
  95. sorter: true
  96. }, {
  97. title: '操作',
  98. key: 'operation',
  99. align: "center",
  100. width: 130,
  101. scopedSlots: {customRender: 'action'},
  102. }],
  103. url: {
  104. list: "/test/order/listOrderTicketByMainId",
  105. delete: "/test/order/deleteTicket",
  106. deleteBatch: "/test/order/deleteBatchTicket",
  107. }
  108. }
  109. },
  110. methods: {
  111. loadData(arg) {
  112. if (arg === 1) {
  113. this.ipagination.current = 1;
  114. }
  115. var params = this.getQueryParams();
  116. //update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
  117. getAction(this.url.list, {orderId: params.mainId ,pageNo : this.ipagination.current,
  118. pageSize :this.ipagination.pageSize}).then((res) => {
  119. if (res.success) {
  120. this.dataSource = res.result.records;
  121. this.ipagination.total = Number(res.result.total);
  122. } else {
  123. this.dataSource = null;
  124. }
  125. })
  126. //update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
  127. },
  128. getOrderMain(orderId) {
  129. this.queryParam.mainId = orderId;
  130. this.loadData(1);
  131. },
  132. handleAdd: function () {
  133. this.$refs.modalForm.add(this.queryParam.mainId);
  134. this.$refs.modalForm.title = "添加机票信息";
  135. },
  136. }
  137. }
  138. </script>
  139. <style scoped>
  140. .ant-card {
  141. margin-left: -30px;
  142. margin-right: -30px;
  143. }
  144. </style>