index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div>
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-form-item>
  7. <a-tree-select
  8. v-model="queryParam.deptId"
  9. style="width: 150px"
  10. :show-search="true"
  11. allow-clear
  12. placeholder="选择车间"
  13. :tree-data="treeData"
  14. tree-node-filter-prop="label"
  15. :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
  16. />
  17. </a-form-item>
  18. <a-form-item>
  19. <j-list-select-tag
  20. v-model="queryParam.lineId"
  21. style="width: 150px"
  22. placeholder="选择线别"
  23. dict-code="line"
  24. />
  25. </a-form-item>
  26. <a-form-item>
  27. <j-list-select-tag
  28. v-model="queryParam.stationId"
  29. style="width: 150px"
  30. placeholder="选择区间站场"
  31. dict-code="station"
  32. />
  33. </a-form-item>
  34. <a-form-item>
  35. <j-dict-select-tag
  36. v-model="queryParam.xingbie"
  37. style="width: 150px"
  38. placeholder="选择行别"
  39. dict-code="xingbie"
  40. />
  41. </a-form-item>
  42. <a-form-item>
  43. <a-input
  44. v-model="queryParam.pillarArea"
  45. style="width: 150px"
  46. placeholder="输入支柱号范围"
  47. />
  48. </a-form-item>
  49. <a-form-item>
  50. <a-input
  51. v-model="queryParam.marker"
  52. style="width: 150px"
  53. placeholder="输入公里标"
  54. />
  55. </a-form-item>
  56. <a-form-item>
  57. <a-input
  58. v-model="queryParam.cdh"
  59. style="width: 150px"
  60. placeholder="道岔号"
  61. />
  62. </a-form-item>
  63. <a-form-item>
  64. <a-button type="primary" @click="searchQuery">查询</a-button>
  65. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  66. </a-form-item>
  67. </a-form>
  68. </div>
  69. <!-- 操作按钮区域 -->
  70. <div class="table-operator" style="margin: 15px 0">
  71. <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
  72. <!-- <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
  73. <!-- <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
  74. <!-- <a-button ghost type="danger" icon="import">导入</a-button>-->
  75. <!-- </a-upload>-->
  76. <a-dropdown v-if="selectedRowKeys.length > 0">
  77. <a-menu slot="overlay">
  78. <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
  79. </a-menu>
  80. <a-button style="margin-left: 8px">
  81. 批量操作 <a-icon type="down" />
  82. </a-button>
  83. </a-dropdown>
  84. </div>
  85. <!-- table区域-begin -->
  86. <div>
  87. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  88. <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  89. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  90. </div>
  91. <a-table
  92. ref="table"
  93. size="middle"
  94. bordered
  95. row-key="id"
  96. :columns="columns"
  97. :data-source="dataSource"
  98. :pagination="ipagination"
  99. :loading="loading"
  100. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  101. @change="handleTableChange"
  102. >
  103. <span slot="action" slot-scope="text, record">
  104. <a-button size="small" type="primary" @click="handleEdit(record)">
  105. 编辑
  106. </a-button>
  107. <a-divider type="vertical" />
  108. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  109. <a-button size="small" type="danger">
  110. 删除
  111. </a-button>
  112. </a-popconfirm>
  113. </span>
  114. </a-table>
  115. <check-and-edit-model ref="modalForm" @ok="modalFormOk" />
  116. </div>
  117. <!-- table区域-end -->
  118. <!-- 表单区域 -->
  119. </div>
  120. </template>
  121. <script>
  122. import { listMixin } from '@/mixin/listMixin'
  123. import columns from './indexColumns'
  124. import CheckAndEditModel from './CheckAndEditModel'
  125. import {getAction} from "@/api/request";
  126. export default {
  127. components: {
  128. CheckAndEditModel
  129. },
  130. mixins: [listMixin],
  131. data() {
  132. return {
  133. // 查询条件
  134. queryParam: {},
  135. // 表头
  136. columns: columns(this),
  137. treeData: [],
  138. url: {
  139. list: '/business/catenary/bus/fdfxjyq/list',
  140. delete: '​/business​/catenary​/bus​/fdfxjyq​/',
  141. exportXlsUrl: '/exportXlsUrl',
  142. tree: '/system/dept/treeSelect',
  143. importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
  144. }
  145. }
  146. },
  147. created() {
  148. this.loadTree()
  149. },
  150. methods: {
  151. loadTree() {
  152. this.treeData = []
  153. getAction(this.url.tree).then((res) => {
  154. if (res.code === 200) {
  155. this.treeData = res.data
  156. }
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style scoped>
  163. @import '~@/assets/less/common.less'
  164. </style>