CarList.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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 :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="登记人" >
  9. <a-input v-model="queryParam.registrantPerson" placeholder="请输入登记人"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="车牌号" >
  14. <a-input v-model="queryParam.number" placeholder="请输入车牌号"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="车辆型号" >
  20. <a-select placeholder="请选择车辆型号" v-model="queryParam.carType" >
  21. <a-select-option value="轿车">轿车</a-select-option>
  22. <a-select-option value="SUV">SUV</a-select-option>
  23. <a-select-option value="货车">货车</a-select-option>
  24. </a-select>
  25. </a-form-item>
  26. </a-col>
  27. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  28. <a-form-item label="品牌" >
  29. <a-input v-model="queryParam.carBrand" placeholder="请输入品牌"></a-input>
  30. </a-form-item>
  31. </a-col>
  32. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  33. <a-form-item label="发动机号" >
  34. <a-input v-model="queryParam.engineNum" placeholder="请输入发动机号"></a-input>
  35. </a-form-item>
  36. </a-col>
  37. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  38. <a-form-item label="车架号" >
  39. <a-input v-model="queryParam.vin" placeholder="请输入车架号"></a-input>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  43. <a-form-item label="购车时间" >
  44. <j-date placeholder="请选择购车时间" v-model="queryParam.purchaseDate" :trigger-change="true" style="width: 100%"/>
  45. </a-form-item>
  46. </a-col>
  47. </template>
  48. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  49. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  50. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  51. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  52. <a @click="handleToggleSearch" style="margin-left: 8px">
  53. {{ toggleSearchStatus ? '收起' : '展开' }}
  54. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  55. </a>
  56. </span>
  57. </a-col>
  58. </a-row>
  59. </a-form>
  60. </div>
  61. <!-- 查询区域-END -->
  62. <!-- 操作按钮区域 -->
  63. <div class="table-operator">
  64. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  65. <a-button type="primary" icon="download" @click="handleExportXls('车辆信息')">导出</a-button>
  66. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  67. <a-button type="primary" 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"> 批量操作 <a-icon type="down" /></a-button>
  74. </a-dropdown>
  75. </div>
  76. <!-- table区域-begin -->
  77. <div>
  78. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  79. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  80. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  81. </div>
  82. <a-table
  83. ref="table"
  84. size="middle"
  85. bordered
  86. rowKey="id"
  87. :columns="columns"
  88. :dataSource="dataSource"
  89. :pagination="ipagination"
  90. :loading="loading"
  91. :rowSelection="{fixed:true,selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  92. @change="handleTableChange">
  93. <template slot="htmlSlot" slot-scope="text">
  94. <div v-html="text"></div>
  95. </template>
  96. <template slot="imgSlot" slot-scope="text">
  97. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  98. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  99. </template>
  100. <template slot="fileSlot" slot-scope="text">
  101. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  102. <a-button
  103. v-else
  104. :ghost="true"
  105. type="primary"
  106. icon="download"
  107. size="small"
  108. @click="uploadFile(text)">
  109. 下载
  110. </a-button>
  111. </template>
  112. <span slot="action" slot-scope="text, record">
  113. <a @click="handleEdit(record)">编辑</a>
  114. <a-divider type="vertical" />
  115. <a-dropdown>
  116. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  117. <a-menu slot="overlay">
  118. <a-menu-item>
  119. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  120. <a>删除</a>
  121. </a-popconfirm>
  122. </a-menu-item>
  123. </a-menu>
  124. </a-dropdown>
  125. </span>
  126. </a-table>
  127. </div>
  128. <car-modal ref="modalForm" @ok="modalFormOk"></car-modal>
  129. </a-card>
  130. </template>
  131. <script>
  132. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  133. import CarModal from './modules/CarModal'
  134. import JDate from '@/components/jeecg/JDate'
  135. export default {
  136. name: "CarList",
  137. mixins:[JeecgListMixin],
  138. components: {
  139. CarModal,
  140. JDate
  141. },
  142. data () {
  143. return {
  144. description: '车辆信息管理页面',
  145. queryParam:{},
  146. // 表头
  147. columns: [
  148. {
  149. title: '#',
  150. dataIndex: '',
  151. key:'rowIndex',
  152. width:60,
  153. align:"center",
  154. customRender:function (t,r,index) {
  155. return parseInt(index)+1;
  156. }
  157. },
  158. {
  159. title:'登记人',
  160. align:"center",
  161. dataIndex: 'registrantPerson'
  162. },
  163. {
  164. title:'登记部门',
  165. align:"center",
  166. dataIndex: 'registrantDepart'
  167. },
  168. {
  169. title:'车牌号',
  170. align:"center",
  171. dataIndex: 'number'
  172. },
  173. {
  174. title:'车辆型号',
  175. align:"center",
  176. dataIndex: 'carType'
  177. },
  178. {
  179. title:'品牌',
  180. align:"center",
  181. dataIndex: 'carBrand'
  182. },
  183. {
  184. title:'发动机号',
  185. align:"center",
  186. dataIndex: 'engineNum'
  187. },
  188. {
  189. title:'车架号',
  190. align:"center",
  191. dataIndex: 'vin'
  192. },
  193. {
  194. title:'购买价格',
  195. align:"center",
  196. dataIndex: 'price'
  197. },
  198. {
  199. title:'购置日期',
  200. align:"center",
  201. dataIndex: 'purchaseDate',
  202. customRender:function (text) {
  203. return !text?"":(text.length>10?text.substr(0,10):text)
  204. }
  205. },
  206. {
  207. title: '操作',
  208. dataIndex: 'action',
  209. align:"center",
  210. scopedSlots: { customRender: 'action' }
  211. }
  212. ],
  213. url: {
  214. list: "/oa/car/list",
  215. delete: "/oa/car/delete",
  216. deleteBatch: "/oa/car/deleteBatch",
  217. exportXlsUrl: "/oa/car/exportXls",
  218. importExcelUrl: "oa/car/importExcel",
  219. },
  220. dictOptions:{},
  221. }
  222. },
  223. computed: {
  224. importExcelUrl: function(){
  225. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  226. }
  227. },
  228. methods: {
  229. initDictConfig(){
  230. }
  231. }
  232. }
  233. </script>
  234. <style scoped>
  235. @import '~@assets/less/common.less';
  236. </style>