1dae41be62bdd34dac69e2021d17d67e5edadeaf.svn-base 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="订单号">
  9. <a-input placeholder="请输入订单号" v-model="queryParam.orderCode"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="订单类型">
  14. <a-select placeholder="请输入订单类型" v-model="queryParam.ctype">
  15. <a-select-option value="1">国内订单</a-select-option>
  16. <a-select-option value="2">国际订单</a-select-option>
  17. </a-select>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="6" :sm="24">
  21. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  22. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  23. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  24. </span>
  25. </a-col>
  26. </a-row>
  27. </a-form>
  28. </div>
  29. <!-- 操作按钮区域 -->
  30. <div class="table-operator">
  31. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  32. <a-dropdown v-if="selectedRowKeys.length > 0">
  33. <a-menu slot="overlay">
  34. <a-menu-item key="1" @click="batchDel">
  35. <a-icon type="delete"/>
  36. 删除
  37. </a-menu-item>
  38. </a-menu>
  39. <a-button style="margin-left: 8px"> 批量操作
  40. <a-icon type="down"/>
  41. </a-button>
  42. </a-dropdown>
  43. </div>
  44. <!-- table区域-begin -->
  45. <div>
  46. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  47. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  48. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  49. </div>
  50. <a-table
  51. ref="table"
  52. size="middle"
  53. bordered
  54. rowKey="id"
  55. filterMultiple="filterMultiple"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
  61. @change="handleTableChange"
  62. :customRow="clickThenCheck"
  63. >
  64. <span slot="action" slot-scope="text, record">
  65. <a @click="handleEdit(record)">编辑</a>
  66. <a-divider type="vertical"/>
  67. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68. <a>删除</a>
  69. </a-popconfirm>
  70. </span>
  71. </a-table>
  72. </div>
  73. <!-- table区域-end -->
  74. <a-tabs defaultActiveKey="1">
  75. <a-tab-pane tab="客户信息" key="1">
  76. <Jeecg-Order-Customer-List ref="JeecgOrderCustomerList"></Jeecg-Order-Customer-List>
  77. </a-tab-pane>
  78. <a-tab-pane tab="机票信息" key="2" forceRender>
  79. <Jeecg-Order-Ticket-List ref="JeecgOrderTicketList"></Jeecg-Order-Ticket-List>
  80. </a-tab-pane>
  81. </a-tabs>
  82. <!-- 表单区域 -->
  83. <jeecgOrderDMain-modal ref="modalForm" @ok="modalFormOk"></jeecgOrderDMain-modal>
  84. </a-card>
  85. </template>
  86. <script>
  87. import JeecgOrderDMainModal from './form/JeecgOrderDMainModal'
  88. import JeecgOrderCustomerList from './JeecgOrderCustomerList'
  89. import JeecgOrderTicketList from './JeecgOrderTicketList'
  90. import {deleteAction} from '@/api/manage'
  91. import JeecgOrderCustomerModal from './form/JeecgOrderCustomerModal'
  92. import JeecgOrderTicketModal from './form/JeecgOrderTicketModal'
  93. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  94. export default {
  95. name: "JeecgOrderDMainList",
  96. mixins: [JeecgListMixin],
  97. components: {
  98. JeecgOrderTicketModal,
  99. JeecgOrderCustomerModal,
  100. JeecgOrderDMainModal,
  101. JeecgOrderCustomerList,
  102. JeecgOrderTicketList,
  103. },
  104. data() {
  105. return {
  106. description: '订单管理页面',
  107. /* 分页参数 */
  108. ipagination:{
  109. current: 1,
  110. pageSize: 5,
  111. pageSizeOptions: ['5', '10', '20'],
  112. showTotal: (total, range) => {
  113. return range[0] + "-" + range[1] + " 共" + total + "条"
  114. },
  115. showQuickJumper: true,
  116. showSizeChanger: true,
  117. total: 0
  118. },
  119. // 表头
  120. columns: [{
  121. title: '#',
  122. dataIndex: '',
  123. key: 'rowIndex',
  124. width: 60,
  125. align: "center",
  126. customRender: function (t, r, index) {
  127. return parseInt(index) + 1;
  128. }
  129. },
  130. {
  131. title: '订单号',
  132. align: "center",
  133. dataIndex: 'orderCode'
  134. },
  135. {
  136. title: '订单类型',
  137. align: "center",
  138. dataIndex: 'ctype',
  139. customRender: (text) => {
  140. let re = "";
  141. if (text === '1') {
  142. re = "国内订单";
  143. } else if (text === '2') {
  144. re = "国际订单";
  145. }
  146. return re;
  147. }
  148. },
  149. {
  150. title: '订单日期',
  151. align: "center",
  152. dataIndex: 'orderDate'
  153. },
  154. {
  155. title: '订单金额',
  156. align: "center",
  157. dataIndex: 'orderMoney'
  158. },
  159. {
  160. title: '订单备注',
  161. align: "center",
  162. dataIndex: 'content'
  163. },
  164. {
  165. title: '操作',
  166. dataIndex: 'action',
  167. align: "center",
  168. scopedSlots: {customRender: 'action'},
  169. }],
  170. // 分页参数
  171. type: "radio",
  172. url: {
  173. list: "/test/order/orderList",
  174. delete: "/test/order/delete",
  175. deleteBatch: "/test/order/deleteBatch",
  176. },
  177. }
  178. },
  179. methods: {
  180. clickThenCheck(record) {
  181. return {
  182. on: {
  183. click: () => {
  184. this.onSelectChange(record.id.split(","), [record]);
  185. }
  186. }
  187. };
  188. },
  189. onSelectChange(selectedRowKeys, selectionRows) {
  190. this.selectedRowKeys = selectedRowKeys;
  191. this.selectionRows = selectionRows;
  192. this.$refs.JeecgOrderCustomerList.getOrderMain(this.selectedRowKeys[0]);
  193. this.$refs.JeecgOrderTicketList.getOrderMain(this.selectedRowKeys[0]);
  194. },
  195. onClearSelected() {
  196. this.selectedRowKeys = [];
  197. this.selectionRows = [];
  198. this.$refs.JeecgOrderCustomerList.queryParam.mainId = null;
  199. this.$refs.JeecgOrderTicketList.queryParam.mainId = null;
  200. this.$refs.JeecgOrderCustomerList.loadData();
  201. this.$refs.JeecgOrderTicketList.loadData();
  202. this.$refs.JeecgOrderCustomerList.selectedRowKeys = [];
  203. this.$refs.JeecgOrderCustomerList.selectionRows = [];
  204. this.$refs.JeecgOrderTicketList.selectedRowKeys = [];
  205. this.$refs.JeecgOrderTicketList.selectionRows = [];
  206. },
  207. handleDelete: function (id) {
  208. var that = this;
  209. deleteAction(that.url.delete, {id: id}).then((res) => {
  210. if (res.success) {
  211. that.$message.success(res.message);
  212. that.loadData();
  213. this.$refs.JeecgOrderCustomerList.loadData();
  214. this.$refs.JeecgOrderTicketList.loadData();
  215. } else {
  216. that.$message.warning(res.message);
  217. }
  218. });
  219. },
  220. searchQuery:function(){
  221. this.selectedRowKeys = [];
  222. this.selectionRows = [];
  223. this.$refs.JeecgOrderCustomerList.queryParam.mainId = null;
  224. this.$refs.JeecgOrderTicketList.queryParam.mainId = null;
  225. this.$refs.JeecgOrderCustomerList.loadData();
  226. this.$refs.JeecgOrderTicketList.loadData();
  227. this.$refs.JeecgOrderCustomerList.selectedRowKeys = [];
  228. this.$refs.JeecgOrderCustomerList.selectionRows = [];
  229. this.$refs.JeecgOrderTicketList.selectedRowKeys = [];
  230. this.$refs.JeecgOrderTicketList.selectionRows = [];
  231. this.loadData();
  232. }
  233. }
  234. }
  235. </script>
  236. <style scoped>
  237. .ant-card-body .table-operator {
  238. margin-bottom: 18px;
  239. }
  240. .ant-table-tbody .ant-table-row td {
  241. padding-top: 15px;
  242. padding-bottom: 15px;
  243. }
  244. .anty-row-operator button {
  245. margin: 0 5px
  246. }
  247. .ant-btn-danger {
  248. background-color: #ffffff
  249. }
  250. .ant-modal-cust-warp {
  251. height: 100%
  252. }
  253. .ant-modal-cust-warp .ant-modal-body {
  254. height: calc(100% - 110px) !important;
  255. overflow-y: auto
  256. }
  257. .ant-modal-cust-warp .ant-modal-content {
  258. height: 90% !important;
  259. overflow-y: hidden
  260. }
  261. </style>