123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>管理员列表</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!-- 所有的 css & js 资源 -->
- <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/httpVueLoader.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <script src="../../static/kj/upload-util.js"></script>
- <style type="text/css">
- .el-radio {
- margin-right: 10px;
- }
- </style>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <div class="c-panel">
- <!-- ------------- 检索参数 ------------- -->
- <h4 class="c-title">检索参数</h4>
- <el-form>
- <div class="c-item" v-if="sa.isAdmin()">
- <label class="c-label">备案组织:</label>
- <el-select v-model="p.deptId">
- <el-option label="请选择" v-for="(item,index) in deptList" :key="item.id" :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </div>
- <sa-item type="text" name="名称" v-model="p.name"></sa-item>
- <sa-item type="text" name="手机号" v-model="p.phone"></sa-item>
- <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1;f5()">查询
- </el-button>
- <el-button type="info" icon="el-icon-refresh" @click="p.name='';p.phone='';f5()">重置</el-button>
- </el-form>
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList">
- <sa-td type="index" name="序号"></sa-td>
- <sa-td type="text" name="姓名" prop="name"></sa-td>
- <sa-td type="text" name="手机" prop="phone" min-width="120px">
- <template slot-scope="s">
- <span v-if="s.row.phone">{{s.row.phone}}</span>
- <span v-else>{{s.row.name}}</span>
- </template>
- </sa-td>
- <sa-td type="text" name="所属组织" prop="deptName" not='-'></sa-td>
- <sa-td type="text" name="审核单位" prop="departmentName" not='-' width="130"></sa-td>
- <sa-td type="datetime" name="创建日期" prop="createTime" width="150px"></sa-td>
- <sa-td type="datetime" name="最后登录" prop="lastLoginTime" width="150px" not='-'></sa-td>
- <el-table-column label="操作" fixed="right" width="200px">
- <template slot-scope="s">
- <el-dropdown trigger="click" style="font-size: 0.85em;" v-if="sa.isAuth('mini-user-edit')">
- <el-button type="primary" class="c-btn">
- 修改资料 <i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown" >
- <span @click="updateDept(s.row)">
- <el-dropdown-item>修改组织</el-dropdown-item>
- </span>
- <span @click="updatePassword(s.row)">
- <el-dropdown-item>改密码</el-dropdown-item>
- </span>
- </el-dropdown-menu>
- </el-dropdown>
- <span @click="del(s.row)">
- <el-button v-if="sa.isAuth('mini-user-del')" type="danger" class="c-btn"
- icon="el-icon-delete">删除</el-button>
- </span>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
- </sa-item>
- </div>
- <el-dialog title="修改组织" :modal="false" :visible.sync="dept.visible" width="400px">
- <div class="c-item">
- <label class="c-label"><span style="color: red;">*</span>组织:</label>
- <el-select v-model="dept.deptId">
- <el-option label="请选择" v-for="(item,index) in deptList" :key="item.id" :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dept.visible=false">取 消</el-button>
- <el-button type="primary" @click="sureFn">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- <script>
- var app = new Vue({
- components: {
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
- "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue')
- },
- el: '.vue-box',
- data: {
- sa: sa, // 超级对象
- p: { // 查询参数
- id: '',
- name: '',
- pageNo: 1,
- pageSize: 10,
- },
- dept:{
- visible:false,
- deptId:''
- },
- deptList: [],
- modal: {
- visible: false,
- form: {
- id: '',
- departmentId: ''
- }
- },
- dataCount: 0,
- dataList: [], // 数据集合
- roleList: [], // 角色集合
- },
- methods: {
- updateDept(data) {
- Object.assign(this.dept, {
- visible: true,
- deptId:data.deptId,
- id:data.id
- })
- },
- sureFn() {
- let data = this.dept;
- let deptId = data.deptId;
- if (!deptId) {
- sa.error('请选择组织');
- return;
- }
- sa.ajax('/TbMiniUser/updateDept', data, function(res) {
- this.dept.visible = false;
- this.f5();
- }.bind(this));
- },
- getDeptList() {
- sa.ajax('/TbDept/getList', {
- pageNo: 1,
- pageSize: 100
- }, function(resp) {
- let list = resp.data;
-
- this.deptList = list;
- }.bind(this))
- },
- // 刷新
- f5: function(isPage) {
- sa.ajax('/TbMiniUser/getList', this.p, function(res) {
- this.dataList = res.data; // 数据
- this.dataCount = res.dataCount;
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this));
- },
- // 修改密码
- updatePassword: function(data) {
- layer.prompt({
- title: '修改密码'
- }, function(pass, index) {
- layer.close(index);
- if (pass.length < 4) {
- return layer.msg('新密码长度请不要低于4位');
- }
- sa.ajax('/TbMiniUser/updatePassword', {
- id: data.id,
- password: pass
- }, function(res) {
- layer.msg('修改成功');
- })
- });
- },
- // 删除
- del: function(data) {
- sa.confirm('是否删除,此操作不可撤销', function() {
- sa.ajax('/TbMiniUser/delete', {
- id: data.id
- }, function(res) {
- sa.arrayDelete(app.dataList, data);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- })
- });
- },
- },
- created: function() {
- this.f5();
- this.getDeptList();
- sa.onInputEnter(); // 监听回车执行查询
- }
- })
- </script>
- </body>
- </html>
|