123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- //车辆管理
- <template>
- <div class="container">
-
- <div class="center">
- <el-row style="padding-left:15px;">
- <el-col :span="12">
- <el-button class="bg-bottom" type="primary" size="small" @click="handleadd()">添加
- </el-button>
- </el-col>
- <el-col :span="12" class="bg-right"></el-col>
- </el-row>
- <div class="fromdata">
- <el-table :data="carData">
- <el-table-column type="index" label="序号">
- <template scope="scope">
- <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
- <span v-else>{{ scope.$index + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="carNo" label="车牌号">
- </el-table-column>
- <el-table-column prop="address" label="操作">
- <template slot-scope="scope">
- <el-button @click="handledel(scope.row)" type="primary">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
- style="text-align:center" :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
- </el-pagination>
- </div>
- <el-dialog
- title="添加车牌号"
- :visible.sync="show"
- width="30%"
- :before-close="handleClose">
- <el-input v-model="carNo" maxlength="7" placeholder="请输入车牌号"></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="show = false">取消</el-button>
- <el-button type="primary" @click="addcarNo">添加</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import WsUpload from '@/components/WsUpload'
- import {
- addcarInfo,
- getcarInfo,
- delcarInfo
- } from '@/model/personnelManagement/index'
- import {
- woekflowhandle
- } from '@/model/tasksport/index'
- export default {
- components: {
- WsUpload,
- },
- data() {
- return {
- value: '',
- carData: [],
- carNo:'',
- deptBudgetTotal: 0,
- currentPage: 1,
- pageSize: 10,
- show:false,
- recordList:[],
- compId:localStorage.getItem('ws-pf_compId'),
- }
- },
- activated() {
- this.getList()
- },
- methods: {
- handleadd(){
- this.show=true
- },
- handleClose(){
- this.show=false
- },
- handledel(row){
- delcarInfo({id:row.id,compId:localStorage.getItem('ws-pf_compId'),}).toPromise()
- .then((response) => {
- this.$message({
- message: '删除成功!',
- type: 'success',
- })
- this.getList()
- })
- },
- addcarNo(){
- addcarInfo({carNo:this.carNo,compId:localStorage.getItem('ws-pf_compId'),}).toPromise()
- .then((response) => {
- this.$message({
- message: '添加成功!',
- type: 'success',
- })
- this.show=false
- this.getList()
- })
- },
- typeChange(num) {
- if (num == 1) {
- this.searchType = 1
- }
- else if (num == 2) {
- this.searchType = 2
- }else if(num == 3){
- this.searchType = 3
- }else{
- this.searchType = 4
- }
- this.currentPage = 1
- this.getList()
- },
- getList() {
- getcarInfo({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- compId: localStorage.getItem('ws-pf_compId'),
- })
- .toPromise()
- .then(response => {
- this.carData = response.records
- this.deptBudgetTotal = response.total
- })
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`)
- this.pageSize = val
- this.getList()
- },
- handleCurrentChange(val) {
- this.currentPage = val
- console.log(`当前页: ${val}`)
- this.getList()
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .container {
- background: #E8ECF6;
- }
- .center {
- margin: 0 auto;
- background: #ffffff;
- // height: calc(100vh - 13vh);
- border-radius: 4px;
- padding: 20px 0;
- /deep/.el-table td,
- /deep/.el-table th {
- text-align: center;
- }
- }
- .row_top {
- background: #F6F7FC;
- border-radius: 4px;
- margin-bottom: 10px;
- .bg-left {
- padding-left: 30px;
- }
- .bg-right {
- padding-right: 10px;
- text-align: right;
- }
- .title {
- position: relative;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- }
- .datascreen {
- display: flex;
- .data_css {
- width: 40%;
- }
- .input_css {
- width: 50%;
- margin: 0 10px;
- }
- .find {
- margin-right: 10px;
- }
- }
- .fromdata {
- margin: 20px 15px;
- overflow-y: scroll;
- height: 546px;
- }
- .top_info{
- margin: 10px 0 0 10px;
- min-width: 712px;
- .info_css{
- margin-right: 20px;
- }
- }
- .bg-right{
- padding-top:15px;
- }
- </style>
|