BdShiftList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-item label="班次编码">
  9. <a-input placeholder="请输入班次编码" v-model="queryParam.code"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="班次名称">
  14. <a-input placeholder="请输入班次名称" v-model="queryParam.name"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="8">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-form>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <a-button type="primary" icon="download" @click="handleExportXls('班次档案')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button type="primary" icon="import">导入</a-button>
  32. </a-upload>
  33. <a-dropdown v-if="selectedRowKeys.length > 0">
  34. <a-menu slot="overlay">
  35. <a-menu-item key="1" @click="batchDel">
  36. <a-icon type="delete"/>
  37. 删除
  38. </a-menu-item>
  39. </a-menu>
  40. <a-button style="margin-left: 8px"> 批量操作
  41. <a-icon type="down"/>
  42. </a-button>
  43. </a-dropdown>
  44. </div>
  45. <!-- table区域-begin -->
  46. <div>
  47. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  48. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. @change="handleTableChange">
  62. <span slot="action" slot-scope="text, record">
  63. <a @click="handleEdit(record)">编辑</a>
  64. <a-divider type="vertical"/>
  65. <a-dropdown>
  66. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  67. <a-menu slot="overlay">
  68. <a-menu-item>
  69. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  70. <a>删除</a>
  71. </a-popconfirm>
  72. </a-menu-item>
  73. </a-menu>
  74. </a-dropdown>
  75. </span>
  76. </a-table>
  77. </div>
  78. <!-- table区域-end -->
  79. <!-- 表单区域 -->
  80. <bdShift-modal ref="modalForm" @ok="modalFormOk"></bdShift-modal>
  81. </a-card>
  82. </template>
  83. <script>
  84. import BdShiftModal from '../schedulingInformation/BdShiftModal'
  85. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  86. import JDictSelectTag from '@/components/dict/JDictSelectTag'
  87. export default {
  88. name: 'BdShiftList',
  89. mixins: [JeecgListMixin],
  90. components: {
  91. BdShiftModal,
  92. JDictSelectTag
  93. },
  94. data() {
  95. return {
  96. description: '班次档案',
  97. // 表头
  98. columns: [
  99. {
  100. title: '行号',
  101. dataIndex: '',
  102. key: 'rowIndex',
  103. width: 60,
  104. align: 'center',
  105. customRender: function (t, r, index) {
  106. return parseInt(index) + 1
  107. }
  108. },
  109. {
  110. title: '班次编码',
  111. align: 'center',
  112. dataIndex: 'code'
  113. },
  114. {
  115. title: '班次名称',
  116. align: 'center',
  117. dataIndex: 'name'
  118. },
  119. {
  120. title: '开始时间',
  121. align: 'center',
  122. dataIndex: 'beginTime'
  123. },
  124. {
  125. title: '结束时间',
  126. align: 'center',
  127. dataIndex: 'endTime'
  128. },
  129. {
  130. title: '状态',
  131. align: 'center',
  132. dataIndex: 'state_dictText'
  133. /* ,customRender:function(t, r, index){
  134. if(t == '1'){
  135. return "启用";
  136. }else{
  137. return "停用";
  138. }
  139. } */
  140. },
  141. {
  142. title: '操作',
  143. dataIndex: 'action',
  144. align: 'center',
  145. scopedSlots: { customRender: 'action' },
  146. }
  147. ],
  148. url: {
  149. list: '/schedulingInformation/bdShift/list',
  150. delete: '/schedulingInformation/bdShift/delete',
  151. deleteBatch: '/schedulingInformation/bdShift/deleteBatch',
  152. exportXlsUrl: '/schedulingInformation/bdShift/exportXls',
  153. importExcelUrl: 'schedulingInformation/bdShift/importExcel',
  154. },
  155. }
  156. },
  157. computed: {
  158. importExcelUrl: function () {
  159. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  160. }
  161. }
  162. }
  163. </script>
  164. <style scoped>
  165. @import '~@assets/less/common.less'
  166. </style>