12e991e4b75a7e5bad3dd1d072cb2c6e7c435f7c.svn-base 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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-button type="primary" icon="download" @click="handleExportXls('一对多示例')">导出</a-button>
  33. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  34. <a-button type="primary" icon="import">导入</a-button>
  35. </a-upload>
  36. <a-dropdown v-if="selectedRowKeys.length > 0">
  37. <a-menu slot="overlay">
  38. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  39. </a-menu>
  40. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  41. </a-dropdown>
  42. </div>
  43. <!-- table区域-begin -->
  44. <div>
  45. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  46. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  47. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  48. </div>
  49. <a-table
  50. ref="table"
  51. size="middle"
  52. bordered
  53. rowKey="id"
  54. :columns="columns"
  55. :dataSource="dataSource"
  56. :pagination="ipagination"
  57. :loading="loading"
  58. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  59. @change="handleTableChange">
  60. <span slot="action" slot-scope="text, record">
  61. <a @click="handleEdit(record)">编辑</a>
  62. <a-divider type="vertical" />
  63. <a-dropdown>
  64. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  65. <a-menu slot="overlay">
  66. <a-menu-item>
  67. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68. <a>删除</a>
  69. </a-popconfirm>
  70. </a-menu-item>
  71. </a-menu>
  72. </a-dropdown>
  73. </span>
  74. </a-table>
  75. </div>
  76. <!-- table区域-end -->
  77. <!-- 表单区域 -->
  78. <jeecgOrderMain-modal ref="modalForm" @ok="modalFormOk"></jeecgOrderMain-modal>
  79. </a-card>
  80. </template>
  81. <script>
  82. import JeecgOrderMainModal from './modules/JeecgOrderMainModal'
  83. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  84. export default {
  85. name: "JeecgOrderMainList",
  86. mixins: [JeecgListMixin],
  87. components: {
  88. JeecgOrderMainModal
  89. },
  90. data () {
  91. return {
  92. description: '订单管理页面',
  93. importExcelUrl:`${window._CONFIG['domianURL']}/test/jeecgOrderMain/importExcel`,
  94. // 表头
  95. columns: [
  96. {
  97. title: '#',
  98. dataIndex: '',
  99. key:'rowIndex',
  100. width:60,
  101. align:"center",
  102. customRender:function (t,r,index) {
  103. return parseInt(index)+1;
  104. }
  105. },
  106. {
  107. title: '订单号',
  108. align:"center",
  109. dataIndex: 'orderCode'
  110. },
  111. {
  112. title: '订单类型',
  113. align:"center",
  114. dataIndex: 'ctype',
  115. customRender: (text, record, index) => {
  116. let re = "";
  117. if (text === '1') {
  118. re = "国内订单";
  119. } else if (text === '2') {
  120. re = "国际订单";
  121. }
  122. return re;
  123. }
  124. },
  125. {
  126. title: '订单日期',
  127. align:"center",
  128. dataIndex: 'orderDate'
  129. },
  130. {
  131. title: '订单金额',
  132. align:"center",
  133. dataIndex: 'orderMoney'
  134. },
  135. {
  136. title: '订单备注',
  137. align:"center",
  138. dataIndex: 'content'
  139. },
  140. {
  141. title: '操作',
  142. dataIndex: 'action',
  143. align:"center",
  144. scopedSlots: { customRender: 'action' },
  145. }
  146. ],
  147. url: {
  148. list: "/test/jeecgOrderMain/list",
  149. delete: "/test/jeecgOrderMain/delete",
  150. deleteBatch: "/test/jeecgOrderMain/deleteBatch",
  151. exportXlsUrl: "/test/jeecgOrderMain/exportXls",
  152. }
  153. }
  154. },
  155. methods: {
  156. }
  157. }
  158. </script>
  159. <style scoped>
  160. /** Button按钮间距 */
  161. .ant-btn {
  162. margin-left: 3px
  163. }
  164. .ant-card-body .table-operator{
  165. margin-bottom: 18px;
  166. }
  167. .ant-table-tbody .ant-table-row td{
  168. padding-top:15px;
  169. padding-bottom:15px;
  170. }
  171. .anty-row-operator button{margin: 0 5px}
  172. .ant-btn-danger{background-color: #ffffff}
  173. .ant-modal-cust-warp{height: 100%}
  174. .ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
  175. .ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
  176. </style>