carNoList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. //车辆管理
  2. <template>
  3. <div class="container">
  4. <div class="center">
  5. <el-row style="padding-left:15px;">
  6. <el-col :span="12">
  7. <el-button class="bg-bottom" type="primary" size="small" @click="handleadd()">添加
  8. </el-button>
  9. </el-col>
  10. <el-col :span="12" class="bg-right"></el-col>
  11. </el-row>
  12. <div class="fromdata">
  13. <el-table :data="carData">
  14. <el-table-column type="index" label="序号">
  15. <template scope="scope">
  16. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  17. <span v-else>{{ scope.$index + 1 }}</span>
  18. </template>
  19. </el-table-column>
  20. <el-table-column prop="carNo" label="车牌号">
  21. </el-table-column>
  22. <el-table-column prop="address" label="操作">
  23. <template slot-scope="scope">
  24. <el-button @click="handledel(scope.row)" type="primary">删除</el-button>
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. </div>
  29. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  30. style="text-align:center" :page-size="pageSize"
  31. layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  32. </el-pagination>
  33. </div>
  34. <el-dialog
  35. title="添加车牌号"
  36. :visible.sync="show"
  37. width="30%"
  38. :before-close="handleClose">
  39. <el-input v-model="carNo" maxlength="7" placeholder="请输入车牌号"></el-input>
  40. <span slot="footer" class="dialog-footer">
  41. <el-button @click="show = false">取消</el-button>
  42. <el-button type="primary" @click="addcarNo">添加</el-button>
  43. </span>
  44. </el-dialog>
  45. </div>
  46. </template>
  47. <script>
  48. import WsUpload from '@/components/WsUpload'
  49. import {
  50. addcarInfo,
  51. getcarInfo,
  52. delcarInfo
  53. } from '@/model/personnelManagement/index'
  54. import {
  55. woekflowhandle
  56. } from '@/model/tasksport/index'
  57. export default {
  58. components: {
  59. WsUpload,
  60. },
  61. data() {
  62. return {
  63. value: '',
  64. carData: [],
  65. carNo:'',
  66. deptBudgetTotal: 0,
  67. currentPage: 1,
  68. pageSize: 10,
  69. show:false,
  70. recordList:[],
  71. compId:localStorage.getItem('ws-pf_compId'),
  72. }
  73. },
  74. activated() {
  75. this.getList()
  76. },
  77. methods: {
  78. handleadd(){
  79. this.show=true
  80. },
  81. handleClose(){
  82. this.show=false
  83. },
  84. handledel(row){
  85. delcarInfo({id:row.id,compId:localStorage.getItem('ws-pf_compId'),}).toPromise()
  86. .then((response) => {
  87. this.$message({
  88. message: '删除成功!',
  89. type: 'success',
  90. })
  91. this.getList()
  92. })
  93. },
  94. addcarNo(){
  95. addcarInfo({carNo:this.carNo,compId:localStorage.getItem('ws-pf_compId'),}).toPromise()
  96. .then((response) => {
  97. this.$message({
  98. message: '添加成功!',
  99. type: 'success',
  100. })
  101. this.show=false
  102. this.getList()
  103. })
  104. },
  105. typeChange(num) {
  106. if (num == 1) {
  107. this.searchType = 1
  108. }
  109. else if (num == 2) {
  110. this.searchType = 2
  111. }else if(num == 3){
  112. this.searchType = 3
  113. }else{
  114. this.searchType = 4
  115. }
  116. this.currentPage = 1
  117. this.getList()
  118. },
  119. getList() {
  120. getcarInfo({
  121. currentPage: this.currentPage,
  122. pageSize: this.pageSize,
  123. compId: localStorage.getItem('ws-pf_compId'),
  124. })
  125. .toPromise()
  126. .then(response => {
  127. this.carData = response.records
  128. this.deptBudgetTotal = response.total
  129. })
  130. },
  131. handleSizeChange(val) {
  132. console.log(`每页 ${val} 条`)
  133. this.pageSize = val
  134. this.getList()
  135. },
  136. handleCurrentChange(val) {
  137. this.currentPage = val
  138. console.log(`当前页: ${val}`)
  139. this.getList()
  140. },
  141. },
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .container {
  146. background: #E8ECF6;
  147. }
  148. .center {
  149. margin: 0 auto;
  150. background: #ffffff;
  151. // height: calc(100vh - 13vh);
  152. border-radius: 4px;
  153. padding: 20px 0;
  154. /deep/.el-table td,
  155. /deep/.el-table th {
  156. text-align: center;
  157. }
  158. }
  159. .row_top {
  160. background: #F6F7FC;
  161. border-radius: 4px;
  162. margin-bottom: 10px;
  163. .bg-left {
  164. padding-left: 30px;
  165. }
  166. .bg-right {
  167. padding-right: 10px;
  168. text-align: right;
  169. }
  170. .title {
  171. position: relative;
  172. }
  173. .title::before {
  174. content: '';
  175. display: inline-block;
  176. width: 5px;
  177. height: 30px;
  178. background: #5473e8;
  179. position: absolute;
  180. left: 0;
  181. }
  182. }
  183. .datascreen {
  184. display: flex;
  185. .data_css {
  186. width: 40%;
  187. }
  188. .input_css {
  189. width: 50%;
  190. margin: 0 10px;
  191. }
  192. .find {
  193. margin-right: 10px;
  194. }
  195. }
  196. .fromdata {
  197. margin: 20px 15px;
  198. overflow-y: scroll;
  199. height: 546px;
  200. }
  201. .top_info{
  202. margin: 10px 0 0 10px;
  203. min-width: 712px;
  204. .info_css{
  205. margin-right: 20px;
  206. }
  207. }
  208. .bg-right{
  209. padding-top:15px;
  210. }
  211. </style>