|
|
@ -5,24 +5,12 @@ |
|
|
|
<el-col :span="24" :xs="24"> |
|
|
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px"> |
|
|
|
<el-form-item label="用户名称" prop="name"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.name" |
|
|
|
placeholder="请输入用户名称" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入用户名称" clearable size="small" style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机号码" prop="phone"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.phone" |
|
|
|
placeholder="请输入手机号码" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.phone" placeholder="请输入手机号码" clearable size="small" style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
@ -31,12 +19,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-table |
|
|
|
v-loading="loading" |
|
|
|
:data="userList" |
|
|
|
border |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
> |
|
|
|
<el-table v-loading="loading" :data="userList" border @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="45" align="center" /> |
|
|
|
<el-table-column label="编号" width="100" align="center" prop="userid" /> |
|
|
|
<el-table-column label="用户名称" align="center" prop="userid" :show-overflow-tooltip="true" /> |
|
|
@ -44,12 +27,8 @@ |
|
|
|
<el-table-column label="手机号码" align="center" prop="phone" width="120" /> |
|
|
|
<el-table-column label="状态" width="60" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch |
|
|
|
v-model="scope.row.status" |
|
|
|
active-value="0" |
|
|
|
inactive-value="1" |
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
/> |
|
|
|
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" |
|
|
|
@change="handleStatusChange(scope.row)" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="创建时间" align="center" prop="createdAt" width="165"> |
|
|
@ -57,41 +36,22 @@ |
|
|
|
<span>{{ parseTime(scope.row.createtime) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
align="center" |
|
|
|
class-name="small-padding fixed-width" |
|
|
|
> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
>修改</el-button> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.role !== 'admin'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> |
|
|
|
<el-button v-if="scope.row.role !== 'admin'" size="mini" type="text" icon="el-icon-delete" |
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageIndex" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex" |
|
|
|
:limit.sync="queryParams.pageSize" @pagination="getList" /> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 添加或修改参数配置对话框 --> |
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px"> |
|
|
|
<el-dialog :title="title" v-if="open":visible.sync="open" width="600px"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
@ -107,13 +67,8 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="角色" prop="role_id"> |
|
|
|
<el-select v-model="form.role_id" placeholder="请选择" @change="$forceUpdate()"> |
|
|
|
<el-option |
|
|
|
v-for="item in roleOptions" |
|
|
|
:key="item.role_id" |
|
|
|
:label="item.rolename" |
|
|
|
:value="item.role_id" |
|
|
|
:disabled="item.status == 1" |
|
|
|
/> |
|
|
|
<el-option v-for="item in roleOptions" :key="item.role_id" :label="item.rolename" :value="item.role_id" |
|
|
|
:disabled="item.status == 1" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -127,17 +82,20 @@ |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="状态"> |
|
|
|
<el-radio-group v-model="form.status"> |
|
|
|
<el-radio |
|
|
|
v-for="dict in statusOptions" |
|
|
|
:key="dict.dictValue" |
|
|
|
:label="dict.dictValue" |
|
|
|
>{{ dict.dictLabel }}</el-radio> |
|
|
|
<el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel |
|
|
|
}}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="选择图片"> |
|
|
|
<input ref="upload" class="input-upload" type="file" accept="image/*" @change="previewUploadImg($event)"> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> |
|
|
@ -153,18 +111,9 @@ |
|
|
|
|
|
|
|
<!-- 用户导入对话框 --> |
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px"> |
|
|
|
<el-upload |
|
|
|
ref="upload" |
|
|
|
:limit="1" |
|
|
|
accept=".xlsx, .xls" |
|
|
|
:headers="upload.headers" |
|
|
|
:action="upload.url + '?updateSupport=' + upload.updateSupport" |
|
|
|
:disabled="upload.isUploading" |
|
|
|
:on-progress="handleFileUploadProgress" |
|
|
|
:on-success="handleFileSuccess" |
|
|
|
:auto-upload="false" |
|
|
|
drag |
|
|
|
> |
|
|
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" |
|
|
|
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" |
|
|
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> |
|
|
|
<i class="el-icon-upload" /> |
|
|
|
<div class="el-upload__text"> |
|
|
|
将文件拖到此处,或 |
|
|
@ -188,6 +137,7 @@ |
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate, getUserInit } from '@/api/system/sysuser' |
|
|
|
import { getToken } from '@/utils/auth' |
|
|
|
import { getCourts } from '@/api/login' |
|
|
|
import { addMedia } from '@/api/questionnaire/subject' |
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
|
|
|
|
|
export default { |
|
|
@ -304,6 +254,17 @@ export default { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
previewUploadImg(el) { |
|
|
|
this.upLoadImg(el.target.files[0]) |
|
|
|
}, |
|
|
|
upLoadImg(files) { |
|
|
|
let uploadData = new FormData(); |
|
|
|
uploadData.append('media', files); |
|
|
|
addMedia(uploadData).then(res => { |
|
|
|
this.msgSuccess('上传成功') |
|
|
|
this.form.callingcard = res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 查询用户列表 */ |
|
|
|
getList() { |
|
|
|
this.loading = true |
|
|
@ -342,11 +303,11 @@ export default { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(function() { |
|
|
|
}).then(function () { |
|
|
|
return changeUserStatus(row.userid, row.status) |
|
|
|
}).then(() => { |
|
|
|
this.msgSuccess(text + '成功') |
|
|
|
}).catch(function() { |
|
|
|
}).catch(function () { |
|
|
|
row.status = row.status === '0' ? '1' : '0' |
|
|
|
}) |
|
|
|
}, |
|
|
@ -370,7 +331,8 @@ export default { |
|
|
|
remark: undefined, |
|
|
|
postIds: undefined, |
|
|
|
roleIds: undefined, |
|
|
|
role: undefined |
|
|
|
role: undefined, |
|
|
|
callingcard: undefined |
|
|
|
} |
|
|
|
this.resetForm('form') |
|
|
|
}, |
|
|
@ -444,10 +406,10 @@ export default { |
|
|
|
this.msgError(response.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
/** 提交按钮 */ |
|
|
|
submitForm: function() { |
|
|
|
submitForm: function () { |
|
|
|
this.$refs['form'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.roleOptions.forEach(item => { |
|
|
@ -489,12 +451,12 @@ export default { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(function() { |
|
|
|
}).then(function () { |
|
|
|
return delUser(userids) |
|
|
|
}).then(() => { |
|
|
|
this.getList() |
|
|
|
this.msgSuccess('删除成功') |
|
|
|
}).catch(function() {}) |
|
|
|
}).catch(function () { }) |
|
|
|
}, |
|
|
|
/** 导出按钮操作 */ |
|
|
|
handleExport() { |
|
|
@ -503,11 +465,11 @@ export default { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(function() { |
|
|
|
}).then(function () { |
|
|
|
return exportUser(queryParams) |
|
|
|
}).then(response => { |
|
|
|
this.download(response.msg) |
|
|
|
}).catch(function() {}) |
|
|
|
}).catch(function () { }) |
|
|
|
}, |
|
|
|
/** 导入按钮操作 */ |
|
|
|
handleImport() { |
|
|
|