|
|
|
|
@ -2,20 +2,18 @@ |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--厂商信息--> |
|
|
|
|
<pane size="84"> |
|
|
|
|
<el-col> |
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
|
<el-form-item label="厂商名称" prop="userName"> |
|
|
|
|
<el-input v-model="queryParams.userName" placeholder="请输入厂商名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
|
<el-form-item label="厂商名称" prop="name"> |
|
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入厂商名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="联系人" prop="phonenumber"> |
|
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入联系人" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
|
<el-form-item label="联系人" prop="contactBy"> |
|
|
|
|
<el-input v-model="queryParams.contactBy" placeholder="请输入联系人" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="联系电话" prop="phonenumber"> |
|
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入联系电话" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
|
<el-form-item label="联系电话" prop="contactWay"> |
|
|
|
|
<el-input v-model="queryParams.contactWay" placeholder="请输入联系电话" clearable 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> |
|
|
|
|
@ -36,23 +34,23 @@ |
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['device:deviceManufacturer:export']">导出</el-button> |
|
|
|
|
</el-col> |
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="50" align="center" /> |
|
|
|
|
<el-table-column label="厂商名称" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> |
|
|
|
|
<el-table-column label="联系人" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible" width="120" /> |
|
|
|
|
<el-table-column label="联系方式" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
|
<el-table-column label="创建人" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
|
<el-table-column label="创建日期" align="center" prop="createTime" v-if="columns[6].visible" width="160"> |
|
|
|
|
<el-table-column label="ID" align="center" key="Id" prop="Id" /> |
|
|
|
|
<el-table-column label="厂商名称" align="center" key="name" prop="name" width="120" /> |
|
|
|
|
<el-table-column label="联系人" align="center" key="contactBy" prop="contactBy" width="120" /> |
|
|
|
|
<el-table-column label="联系方式" align="center" key="contactWay" prop="contactWay" width="120" /> |
|
|
|
|
<el-table-column label="创建人" align="center" key="CreateBy" prop="CreateBy" width="120" /> |
|
|
|
|
<el-table-column label="创建日期" align="center" prop="CreateDate" width="160"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
|
<span>{{ parseTime(scope.row.CreateDate) }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="状态" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
|
<el-table-column label="状态" align="center" key="Status" prop="Status" width="120" /> |
|
|
|
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.userId !== 1"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['device:deviceManufacturer:edit']">修改</el-button> |
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['device:deviceManufacturer:remove']">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
@ -68,66 +66,23 @@ |
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="760px" append-to-body> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<!-- 用户昵称 + 手机号码 --> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="用户昵称" prop="nickName"> |
|
|
|
|
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="手机号码" prop="phonenumber"> |
|
|
|
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" /> |
|
|
|
|
<el-form-item label="厂商名称" prop="name"> |
|
|
|
|
<el-input v-model="form.name" placeholder="请输入用户昵称" maxlength="30" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
<!-- 邮箱 + 用户名称 --> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="邮箱" prop="email"> |
|
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> |
|
|
|
|
<el-form-item label="联系人" prop="contactBy"> |
|
|
|
|
<el-input v-model="form.contactBy" placeholder="请输入手机号码" maxlength="30" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName"> |
|
|
|
|
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> |
|
|
|
|
<el-form-item label="联系方式" prop="contactWay"> |
|
|
|
|
<el-input v-model="form.contactWay" placeholder="请输入手机号码" maxlength="11" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
<!-- 用户密码(仅新增)+ 用户性别 --> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password"> |
|
|
|
|
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="用户性别"> |
|
|
|
|
<el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%"> |
|
|
|
|
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</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 dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="角色"> |
|
|
|
|
<el-select v-model="form.roleIds" multiple placeholder="请选择角色" style="width: 100%"> |
|
|
|
|
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
<!-- 备注(单独一行) --> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="备注"> |
|
|
|
|
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入内容" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -231,23 +186,14 @@ export default { |
|
|
|
|
queryParams: { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
userName: undefined, |
|
|
|
|
phonenumber: undefined, |
|
|
|
|
name: undefined, |
|
|
|
|
contactBy: undefined, |
|
|
|
|
status: undefined, |
|
|
|
|
deptId: undefined |
|
|
|
|
}, |
|
|
|
|
// 列信息 |
|
|
|
|
columns: [ |
|
|
|
|
{ key: 0, label: '厂商名称', visible: true, showInSelector: true }, |
|
|
|
|
{ key: 1, label: '设备类型', visible: true, showInSelector: true }, |
|
|
|
|
{ key: 2, label: '供货商名称', visible: true, showInSelector: true }, |
|
|
|
|
{ key: 3, label: '联系人', visible: true, showInSelector: true }, // 👈 不在显隐选择器中出现 |
|
|
|
|
{ key: 4, label: '联系电话', visible: true, showInSelector: true }, |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
// 表单校验 |
|
|
|
|
rules: { |
|
|
|
|
userName: [ |
|
|
|
|
name: [ |
|
|
|
|
{ required: true, message: "用户名称不能为空", trigger: "blur" }, |
|
|
|
|
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
@ -266,7 +212,7 @@ export default { |
|
|
|
|
trigger: ["blur", "change"] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
phonenumber: [ |
|
|
|
|
contactBy: [ |
|
|
|
|
{ |
|
|
|
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
|
|
|
|
message: "请输入正确的手机号码", |
|
|
|
|
@ -332,8 +278,8 @@ export default { |
|
|
|
|
// 用户状态修改 |
|
|
|
|
handleStatusChange(row) { |
|
|
|
|
let text = row.status === "0" ? "启用" : "停用" |
|
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() { |
|
|
|
|
return changeUserStatus(row.userId, row.status) |
|
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.name + '"用户吗?').then(function() { |
|
|
|
|
return changeUserStatus(row.Id, row.status) |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$modal.msgSuccess(text + "成功") |
|
|
|
|
}).catch(function() { |
|
|
|
|
@ -348,12 +294,12 @@ export default { |
|
|
|
|
// 表单重置 |
|
|
|
|
reset() { |
|
|
|
|
this.form = { |
|
|
|
|
userId: undefined, |
|
|
|
|
Id: undefined, |
|
|
|
|
deptId: undefined, |
|
|
|
|
userName: undefined, |
|
|
|
|
name: undefined, |
|
|
|
|
nickName: undefined, |
|
|
|
|
password: undefined, |
|
|
|
|
phonenumber: undefined, |
|
|
|
|
contactBy: undefined, |
|
|
|
|
email: undefined, |
|
|
|
|
sex: undefined, |
|
|
|
|
status: "0", |
|
|
|
|
@ -378,7 +324,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 多选框选中数据 |
|
|
|
|
handleSelectionChange(selection) { |
|
|
|
|
this.ids = selection.map(item => item.userId) |
|
|
|
|
this.ids = selection.map(item => item.Id) |
|
|
|
|
this.single = selection.length != 1 |
|
|
|
|
this.multiple = !selection.length |
|
|
|
|
}, |
|
|
|
|
@ -409,8 +355,8 @@ export default { |
|
|
|
|
/** 修改按钮操作 */ |
|
|
|
|
handleUpdate(row) { |
|
|
|
|
this.reset() |
|
|
|
|
const userId = row.userId || this.ids |
|
|
|
|
getUser(userId).then(response => { |
|
|
|
|
const Id = row.Id || this.ids |
|
|
|
|
getUser(Id).then(response => { |
|
|
|
|
this.form = response.data |
|
|
|
|
this.postOptions = response.posts |
|
|
|
|
this.roleOptions = response.roles |
|
|
|
|
@ -423,7 +369,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
/** 重置密码按钮操作 */ |
|
|
|
|
handleResetPwd(row) { |
|
|
|
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", { |
|
|
|
|
this.$prompt('请输入"' + row.name + '"的新密码', "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
@ -435,21 +381,21 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}).then(({ value }) => { |
|
|
|
|
resetUserPwd(row.userId, value).then(response => { |
|
|
|
|
resetUserPwd(row.Id, value).then(response => { |
|
|
|
|
this.$modal.msgSuccess("修改成功,新密码是:" + value) |
|
|
|
|
}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
/** 分配角色操作 */ |
|
|
|
|
handleAuthRole: function(row) { |
|
|
|
|
const userId = row.userId |
|
|
|
|
this.$router.push("/system/user-auth/role/" + userId) |
|
|
|
|
const Id = row.Id |
|
|
|
|
this.$router.push("/system/user-auth/role/" + Id) |
|
|
|
|
}, |
|
|
|
|
/** 提交按钮 */ |
|
|
|
|
submitForm: function() { |
|
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.form.userId != undefined) { |
|
|
|
|
if (this.form.Id != undefined) { |
|
|
|
|
updateUser(this.form).then(response => { |
|
|
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
|
this.open = false |
|
|
|
|
@ -467,9 +413,9 @@ export default { |
|
|
|
|
}, |
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
|
handleDelete(row) { |
|
|
|
|
const userIds = row.userId || this.ids |
|
|
|
|
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() { |
|
|
|
|
return delUser(userIds) |
|
|
|
|
const Ids = row.Id || this.ids |
|
|
|
|
this.$modal.confirm('是否确认删除用户编号为"' + Ids + '"的数据项?').then(function() { |
|
|
|
|
return delUser(Ids) |
|
|
|
|
}).then(() => { |
|
|
|
|
this.getList() |
|
|
|
|
this.$modal.msgSuccess("删除成功") |
|
|
|
|
|