index.vue 5.0 KB

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