index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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.lineId"
  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-if="substationShow"
  17. v-model="queryParam.substationId"
  18. :line-id="queryParam.lineId"
  19. style="width: 150px"
  20. placeholder="选择所别"
  21. dict-code="substation"
  22. />
  23. </a-form-item>
  24. <a-form-item>
  25. <j-dict-select-tag
  26. v-model="queryParam.xingbie"
  27. style="width: 150px"
  28. placeholder="选择行别"
  29. dict-code="xingbie"
  30. />
  31. </a-form-item>
  32. <a-form-item>
  33. <j-dict-select-tag
  34. v-model="queryParam.yylx"
  35. style="width: 150px"
  36. placeholder="选择原因类型"
  37. dict-code="gzyy"
  38. />
  39. </a-form-item>
  40. <a-form-item>
  41. <a-input
  42. v-model="queryParam.marker"
  43. style="width: 150px"
  44. placeholder="输入公里标"
  45. />
  46. </a-form-item>
  47. <!-- <a-form-item>-->
  48. <!-- <a-date-picker v-model="queryParam.date1" format="YYYY/MM/DD" placeholder="时间范围" /> - -->
  49. <!-- <a-date-picker v-model="queryParam.date2" format="YYYY/MM/DD" placeholder="时间范围" />-->
  50. <!-- </a-form-item>-->
  51. <a-form-item>
  52. <a-button type="primary" @click="searchQuery">查询</a-button>
  53. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  54. </a-form-item>
  55. </a-form>
  56. </div>
  57. <!-- 操作按钮区域 -->
  58. <div class="table-operator" style="margin: 15px 0">
  59. <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
  60. <!-- <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
  61. <!-- <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
  62. <!-- <a-button ghost type="danger" icon="import">导入</a-button>-->
  63. <!-- </a-upload>-->
  64. <a-dropdown v-if="selectedRowKeys.length > 0">
  65. <a-menu slot="overlay">
  66. <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
  67. </a-menu>
  68. <a-button style="margin-left: 8px">
  69. 批量操作 <a-icon type="down" />
  70. </a-button>
  71. </a-dropdown>
  72. </div>
  73. <!-- table区域-begin -->
  74. <div>
  75. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  76. <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  77. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  78. </div>
  79. <a-table
  80. ref="table"
  81. size="middle"
  82. bordered
  83. row-key="id"
  84. :columns="columns"
  85. :data-source="dataSource"
  86. :pagination="ipagination"
  87. :loading="loading"
  88. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  89. @change="handleTableChange"
  90. >
  91. <span slot="action" slot-scope="text, record">
  92. <a-button size="small" type="primary" @click="handleEdit(record)">
  93. 编辑
  94. </a-button>
  95. <a-divider type="vertical" />
  96. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  97. <a-button size="small" type="danger">
  98. 删除
  99. </a-button>
  100. </a-popconfirm>
  101. </span>
  102. </a-table>
  103. <check-and-edit-model ref="modalForm" @ok="modalFormOk" />
  104. </div>
  105. <!-- table区域-end -->
  106. <!-- 表单区域 -->
  107. </el-card>
  108. </template>
  109. <script>
  110. import { listMixin } from '@/mixin/listMixin'
  111. import columns from './indexColumns'
  112. import CheckAndEditModel from './CheckAndEditModel'
  113. export default {
  114. components: {
  115. CheckAndEditModel
  116. },
  117. mixins: [listMixin],
  118. data() {
  119. return {
  120. // 查询条件
  121. substationId: undefined,
  122. substationShow: true,
  123. queryParam: {},
  124. // 表头
  125. columns: columns(this),
  126. url: {
  127. list: '/business/catenary/bus/jlgz/list',
  128. delete: '/business/catenary/bus/jlgz/',
  129. exportXlsUrl: '/exportXlsUrl',
  130. importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
  131. }
  132. }
  133. },
  134. watch: {
  135. 'queryParam.lineId': {
  136. handler: function(newV, oldV) {
  137. this.substationShow = false
  138. this.$nextTick(() => {
  139. this.queryParam.substationId = undefined
  140. this.substationId = undefined
  141. this.substationShow = true
  142. })
  143. }
  144. }
  145. },
  146. created() {
  147. },
  148. methods: {
  149. }
  150. }
  151. </script>
  152. <style scoped>
  153. @import '~@/assets/less/common.less'
  154. </style>