| | |
| | | <div style="padding: 10px 10px 0px 10px;"> |
| | | <el-form :inline="true" :model="searchForm"> |
| | | <el-form-item label="名称"> |
| | | <el-input v-model="searchForm.name"></el-input> |
| | | <el-input v-model="searchForm.name" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="small" @click="onSearch" icon="el-icon-search">查询</el-button> |
| | |
| | | <template slot-scope="scope"> |
| | | <p v-if="scope.row.type==0">停车场管理员</p> |
| | | <p v-if="scope.row.type==1">执法人员</p> |
| | | <p v-if="scope.row.type==2">系统管理员</p> |
| | | <p v-if="scope.row.type==3">手持终端管理员</p> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" fixed="right" width="150" align="center"> |
| | |
| | | <el-form-item label="登录名" prop="loginName" :rules="[{required: true, message: '请输入登录名', trigger: 'blur'}]"> |
| | | <el-input v-model="formData.loginName" auto-complete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="密码" prop="password" :rules="[{required: true, message: '请输入密码', trigger: 'blur'}]"> |
| | | <el-input v-model="formData.password" auto-complete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="姓名" prop="name" :rules="[{required: true, message: '请输入姓名', trigger: 'blur'}]"> |
| | | <el-input v-model="formData.name" auto-complete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号" prop="phone" :rules="[{ required: true, message: '手机号不能为空', trigger: 'blur'}]"> |
| | | <el-form-item label="手机号" prop="phone"> |
| | | <el-input v-model="formData.phone" auto-complete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="人员类型" prop="type" :rules="[{required: true, message: '请选择人员类型', trigger: 'change'}]"> |
| | | <el-select v-model="formData.type"> |
| | | <el-option label="停车场管理员" :value=0></el-option> |
| | | <el-option label="停车场后台管理员" :value=0></el-option> |
| | | <el-option label="执法人员" :value=1></el-option> |
| | | <el-option label="系统管理员" :value=2></el-option> |
| | | <el-option label="手持终端管理员" :value=3></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="管理停车场" prop="parkIds"> |
| | | <el-select multiple filterable v-model="parkIds" clearable> |
| | | <el-option |
| | | v-for="item in parkList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="flag = false">取 消</el-button> |
| | |
| | | searchForm: { |
| | | name: '' |
| | | }, |
| | | parkList:[], |
| | | parkIds:[], |
| | | pageData: this.$byutil.defaultPageData(), |
| | | formData: { |
| | | name: '', |
| | | loginName: '', |
| | | phone: '', |
| | | type: '', |
| | | parkIds:'', |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.loadData(); |
| | | this.getParkList(); |
| | | }, |
| | | methods: { |
| | | onSave(){ |
| | | this.formData.parkIds = this.parkIds.toString() |
| | | this.$refs['formData'].validate((valid) => { |
| | | if (valid) { |
| | | this.$byutil.postData(this, this.$systemconfig.basePath + '/user/save', this.formData, res => { |
| | | this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/user/save', this.formData, res => { |
| | | this.$refs['formData'].resetFields(); |
| | | this.flag=false; |
| | | this.$message({message: res.message, type: 'success'}); |
| | | this.$message({message: '保存成功', type: 'success'}); |
| | | this.loadData(); |
| | | }) |
| | | } else { |
| | |
| | | }); |
| | | }, |
| | | loadData() { |
| | | this.$byutil.loadPageData(this, this.$systemconfig.basePath + '/user/findPage', this.searchForm); |
| | | this.$byutil.loadPageData(this, this.$systemconfig.basePath + '/ffzf/user/findPage', this.searchForm); |
| | | }, |
| | | getParkList(){ |
| | | this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/park/findAll',null,res => { |
| | | this.parkList = res.data |
| | | }); |
| | | }, |
| | | onSearch() { |
| | | this.pageData = this.$byutil.defaultPageData(); |
| | |
| | | onAdd() { |
| | | this.flag=true; |
| | | this.$refs['formData'].resetFields(); |
| | | this.parkIds = []; |
| | | this.formData = { |
| | | name: '', |
| | | loginName: '', |
| | | phone: '', |
| | | type: '', |
| | | parkIds:'', |
| | | } |
| | | }, |
| | | onEdit(index, row) { |
| | | this.flag=true; |
| | | this.formData = row; |
| | | this.parkIds = [] |
| | | this.getParkList() |
| | | this.flag=true; |
| | | this.formData = row; |
| | | let ids = null |
| | | if(this.formData.parkIds){ |
| | | ids=this.formData.parkIds.split(",") |
| | | let resList = []; |
| | | ids.forEach(item => { |
| | | resList.push(Number(item)) |
| | | }) |
| | | this.parkIds = resList; |
| | | } |
| | | console.log(this.parkIds) |
| | | }, |
| | | onDelete(index, row) { |
| | | this.$byutil.deleteData(this,this.$systemconfig.basePath+"/user/delete",{id:row.id}, res => { |
| | | this.$message({message: res.message, type: 'success'}); |
| | | this.$byutil.deleteData(this,this.$systemconfig.basePath+"/ffzf/user/delete",{id:row.id}, res => { |
| | | this.$message({message: '删除成功', type: 'success'}); |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | </style> |