232bb292bb2ba95abb57e50df91f4c3fd199ecc0.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 操作按钮区域 -->
  4. <div class="table-operator" :md="24" :sm="24" style="margin: -25px 0px 10px 0px">
  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. <jeecgOrderCustomer-modal ref="modalForm" @ok="modalFormOk"></jeecgOrderCustomer-modal>
  59. </a-card>
  60. </template>
  61. <script>
  62. import JeecgOrderCustomerModal from './form/JeecgOrderCustomerModal'
  63. import JeecgOrderDMainList from './JeecgOrderDMainList'
  64. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  65. import {getAction} from '@/api/manage'
  66. export default {
  67. name: "JeecgOrderCustomerList",
  68. mixins: [JeecgListMixin],
  69. components: {
  70. JeecgOrderDMainList,
  71. JeecgOrderCustomerModal
  72. },
  73. data() {
  74. return {
  75. description: '订单客户信息',
  76. // 表头
  77. columns: [
  78. {
  79. title: '客户名',
  80. align: "center",
  81. width: 100,
  82. dataIndex: 'name',
  83. key: 'name',
  84. },
  85. {
  86. title: '性别',
  87. align: "center",
  88. dataIndex: 'sex',
  89. customRender: function (text) {
  90. if (text == 1) {
  91. return "男";
  92. } else if (text == 2) {
  93. return "女";
  94. } else {
  95. return text;
  96. }
  97. }
  98. },
  99. {
  100. title: '身份证号码',
  101. align: "center",
  102. dataIndex: 'idcard',
  103. },
  104. {
  105. title: '电话',
  106. dataIndex: 'telphone',
  107. align: "center",
  108. },
  109. {
  110. title: '操作',
  111. key: 'operation',
  112. align: 'center',
  113. width: 130,
  114. scopedSlots: {customRender: 'action'},
  115. },
  116. ],
  117. url: {
  118. list: "/test/order/listOrderCustomerByMainId",
  119. delete: "/test/order/deleteCustomer",
  120. deleteBatch: "/test/order/deleteBatchCustomer",
  121. }
  122. }
  123. },
  124. methods: {
  125. loadData(arg) {
  126. if (arg === 1) {
  127. this.ipagination.current = 1;
  128. }
  129. //update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
  130. var params = this.getQueryParams();
  131. getAction(this.url.list, {orderId: params.mainId, pageNo : this.ipagination.current,
  132. pageSize :this.ipagination.pageSize}).then((res) => {
  133. if (res.success) {
  134. this.dataSource = res.result.records;
  135. this.ipagination.total = Number(res.result.total);
  136. } else {
  137. this.dataSource = null;
  138. }
  139. })
  140. //update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
  141. },
  142. getOrderMain(orderId) {
  143. this.queryParam.mainId = orderId;
  144. this.loadData(1);
  145. },
  146. handleAdd: function () {
  147. this.$refs.modalForm.add(this.queryParam.mainId);
  148. this.$refs.modalForm.title = "添加客户信息";
  149. },
  150. }
  151. }
  152. </script>
  153. <style scoped>
  154. .ant-card {
  155. margin-left: -30px;
  156. margin-right: -30px;
  157. }
  158. </style>