index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <!-- 车辆信息 -->
  2. <template>
  3. <div class="main">
  4. <div class="search">
  5. <el-input
  6. placeholder="输入车牌号"
  7. class="search-input"
  8. clearable
  9. v-model="mixins_query.plateNo"
  10. ></el-input>
  11. <el-select
  12. placeholder="停车场名称"
  13. clearable
  14. v-model="mixins_query.parkId"
  15. >
  16. <el-option
  17. v-for="(item,index) in nameParkingLot"
  18. :key="index"
  19. :value="item.label"
  20. :label="item.name"
  21. @click.native="parkingLot(item.name)"
  22. ></el-option>
  23. </el-select>
  24. <el-select
  25. placeholder="状态"
  26. clearable
  27. >
  28. <el-option
  29. label="正常"
  30. :value="1"
  31. ></el-option>
  32. <el-option
  33. label="已过期"
  34. :value="2"
  35. ></el-option>
  36. </el-select>
  37. <el-button
  38. type="primary"
  39. class="search-btn"
  40. @click="mixins_search"
  41. icon="el-icon-search"
  42. >查询</el-button>
  43. <div class="search-icon">
  44. <el-dropdown
  45. type="primary"
  46. @command="addCommand"
  47. >
  48. <span class="zoniot_font zoniot-icon-tianjia2"></span>
  49. <el-dropdown-menu
  50. slot="dropdown"
  51. hide-on-click="false"
  52. class="device-search-dropdown"
  53. >
  54. <el-dropdown-item command="add">单个添加</el-dropdown-item>
  55. <el-dropdown-item command="batchAdd">
  56. <div class="upload_div">
  57. <xk-upload
  58. class="upload_class"
  59. @callback="mixins_search"
  60. :params="{ importType: 'FACILITY' }"
  61. >
  62. <span
  63. class="upload_text"
  64. slot="content"
  65. >批量添加</span>
  66. </xk-upload>
  67. </div>
  68. </el-dropdown-item>
  69. <el-dropdown-item command="template">下载模板</el-dropdown-item>
  70. </el-dropdown-menu>
  71. </el-dropdown>
  72. <el-tooltip
  73. class="item"
  74. effect="light"
  75. placement="bottom"
  76. content="导出"
  77. >
  78. <i
  79. class="zoniot_font zoniot-icon-daochu2"
  80. @click="exportExcel()"
  81. ></i>
  82. </el-tooltip>
  83. </div>
  84. </div>
  85. <zz-table
  86. :cols="cols"
  87. :settings="{ showCheckbox: false, showIndex: true, stripe: true }"
  88. :data="mixins_list"
  89. :pageset="mixins_pageset"
  90. @page-change="pageChange"
  91. @selection-change="selectionChange"
  92. >
  93. <template
  94. slot-scope="scope"
  95. slot="opt"
  96. >
  97. <div class="opt">
  98. <el-tooltip
  99. class="item"
  100. effect="light"
  101. placement="bottom"
  102. content="充值"
  103. >
  104. <i
  105. class="zoniot_font zoniot-icon-shoukuan"
  106. @click="collections(scope.row)"
  107. ></i>
  108. </el-tooltip>
  109. <el-tooltip
  110. class="item"
  111. effect="light"
  112. placement="bottom"
  113. content="编辑"
  114. >
  115. <i
  116. class="zoniot_font zoniot-icon-bianji"
  117. @click="add( scope.row)"
  118. ></i>
  119. </el-tooltip>
  120. <el-tooltip
  121. effect="light"
  122. placement="bottom"
  123. content="删除"
  124. >
  125. <i
  126. class="zoniot_font zoniot-icon-shanchu redText"
  127. @click="deleteOne(scope.row)"
  128. ></i>
  129. </el-tooltip>
  130. </div>
  131. </template>
  132. </zz-table>
  133. </div>
  134. </template>
  135. <script>
  136. import index from './index';
  137. import list from '@utils/list';
  138. export default {
  139. mixins: [index, list],
  140. data () {
  141. return {
  142. mixins_post: 'post',
  143. nameParkingLot: [],
  144. parkName: '',
  145. }
  146. },
  147. methods: {
  148. // 删除
  149. deleteOne (row) {
  150. debugger
  151. // cardId
  152. // parkId
  153. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  154. confirmButtonText: '确定',
  155. cancelButtonText: '取消',
  156. type: 'warning'
  157. }).then(() => {
  158. this.$message({
  159. type: 'success',
  160. message: '删除成功!'
  161. });
  162. this.$http.get('/sc-community-web/parkingCar/deleteVehicleInfor', { id: row.cardId, parkId: row.parkId }).then(({ data, msg, status }) => {
  163. this.mixins_search();
  164. }).catch(() => { });
  165. }).catch(() => {
  166. this.$message({
  167. type: 'info',
  168. message: '已取消删除'
  169. });
  170. });
  171. },
  172. add (row) {
  173. console.log(row.cardId);
  174. this.details(row.cardId);
  175. },
  176. parkingLot (name) {
  177. this.parkName = name;
  178. },
  179. addCommand (command) {
  180. if (command === 'add') {
  181. // this.addOrEdit('add');
  182. this.details();
  183. }
  184. if (command === 'template') {
  185. // this.__exportExcel('/sc-community/excel/download/template', { importType: 'FACILITY' });
  186. this.__exportExcel('/sc-community-web/parkingCar/getCarInfoExcel');
  187. return;
  188. }
  189. },
  190. exportExcel () {
  191. this.__exportExcel('/sc-community-web/parkingCar/getCarInfoExcel');
  192. },
  193. details (row) {
  194. // 添加
  195. new Promise((resolve) => {
  196. this.$store.dispatch('addPopup', {
  197. url: '/vehicleInformation/setpPage/details.vue',
  198. width: '900px',
  199. height: '861px',
  200. props: {
  201. cardId: row,
  202. callback: resolve
  203. },
  204. // showConfirmButton: true,
  205. // showCancelButton: true,
  206. hideStar: true,
  207. title: '新增内部车'
  208. });
  209. }).then(() => {
  210. this.mixins_search();
  211. });
  212. // 充值
  213. // new Promise((resolve) => {
  214. // this.$store.dispatch('addPopup', {
  215. // url: '/vehicleInformation/setpPage/recharge.vue',
  216. // width: '511px',
  217. // height: '683px',
  218. // props: {
  219. // // id: row.id,
  220. // // callback: resolve
  221. // callback: resolve,
  222. // },
  223. // // showConfirmButton: true,
  224. // // showCancelButton: true,
  225. // hideStar: true,
  226. // title: '充值操作'
  227. // });
  228. // }).then(() => {
  229. // this.mixins_search();
  230. // });
  231. },
  232. // 充值
  233. collections (row) {
  234. // 充值
  235. debugger
  236. new Promise((resolve) => {
  237. this.$store.dispatch('addPopup', {
  238. url: '/vehicleInformation/setpPage/recharge.vue',
  239. width: '511px',
  240. height: '683px',
  241. props: {
  242. // id: row.id,
  243. // callback: resolve
  244. userName: row.userName,
  245. cardType: row.cardType,
  246. parkId: row.parkId,
  247. cardId: row.cardId,
  248. callback: resolve,
  249. },
  250. // showConfirmButton: true,
  251. // showCancelButton: true,
  252. hideStar: true,
  253. title: '充值操作'
  254. });
  255. }).then(() => {
  256. this.mixins_search();
  257. });
  258. },
  259. // 获取停车场名称
  260. nameParking () {
  261. this.$http.post('/sc-community-web/parkingCar/findParkInfo', { pageNum: this.mixins_pageset.pageIndex, pageSize: this.mixins_pageset.pageSize }).then(({ data, status, msg }) => {
  262. console.log(data.list);
  263. for (let i = 0; i < data.list.length; i++) {
  264. this.nameParkingLot.push({
  265. name: data.list[i].garageName,
  266. label: data.list[i].parkId
  267. })
  268. }
  269. })
  270. },
  271. },
  272. created () {
  273. this.mixins_dataUrl = '/sc-community-web/parkingCar/queryCars';
  274. this.mixins_query = {};
  275. this.mixins_search();
  276. this.nameParking();
  277. }
  278. }
  279. </script>