Commit 65c6e5a4 authored by huangjie's avatar huangjie

企业方案

parent a2130fca
import request from '@/utils/request'
//新增租户套餐
export function addTenantPackage(param) {
return request({
url: '/system/tenant/package',
method: 'POST',
data: param
})
}
//获取租户套餐
export function detailTenantPackage(packageId) {
return request({
url: '/system/tenant/package/'+packageId,
method: 'get',
})
}
//租户套餐列表
export function getTenantPackage(param) {
return request({
url: '/system/tenant/package/list',
method: 'get',
params: param
})
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="方案名称" prop="roleName"> <el-form-item label="方案名称" prop="roleName">
<el-input <el-input
v-model="queryParams.roleName" v-model="queryParams.packageName"
placeholder="请输入方案名称" placeholder="请输入方案名称"
clearable clearable
style="width: 240px" style="width: 240px"
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<span>{{(queryParams.pageNum - 1) *queryParams.pageSize + scope.$index + 1}}</span> <span>{{(queryParams.pageNum - 1) *queryParams.pageSize + scope.$index + 1}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="方案名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> <el-table-column label="方案名称" prop="packageName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="备注" prop="roleKey" width="400"> <el-table-column label="备注" prop="remark" width="400">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
title="" title=""
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
width="400" width="400"
trigger="hover" trigger="hover"
popper-class="popovers" popper-class="popovers"
content="备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数"> :content="scope.row.remark">
<div class="over" slot="reference">备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数备注测试字数</div> <div class="over" slot="reference">{{scope.row.remark}}</div>
</el-popover> </el-popover>
</template> </template>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</template> </template>
</el-table-column> </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" v-if="scope.row.roleId !== 1"> <template slot-scope="scope" v-if="scope.row.packageId !== 1">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -108,11 +108,16 @@ ...@@ -108,11 +108,16 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改角色配置对话框 --> <!-- 添加或修改租户套餐配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="方案名称" prop="roleName"> <el-form-item label="方案名称" prop="packageName">
<el-input v-model="form.roleName" placeholder="请输入方案名称" /> <el-input v-model="form.packageName" placeholder="请输入方案名称" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio v-model="form.status" label="0">正常</el-radio>
<el-radio v-model="form.status" label="1">停用</el-radio>
</el-form-item> </el-form-item>
<el-form-item label="角色授权"> <el-form-item label="角色授权">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox> <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
...@@ -124,7 +129,7 @@ ...@@ -124,7 +129,7 @@
show-checkbox show-checkbox
ref="menu" ref="menu"
node-key="id" node-key="id"
:check-strictly="!form.menuCheckStrictly" :check-strictly="!form.menuIds"
empty-text="加载中,请稍候" empty-text="加载中,请稍候"
:props="defaultProps" :props="defaultProps"
></el-tree> ></el-tree>
...@@ -145,6 +150,9 @@ ...@@ -145,6 +150,9 @@
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { addTenantPackage ,getTenantPackage,detailTenantPackage} from "@/api/enterpriseManagement/enterpriseManagement";
export default { export default {
name: "programme", name: "programme",
dicts: ['ent_pro_status'], dicts: ['ent_pro_status'],
...@@ -207,9 +215,7 @@ ...@@ -207,9 +215,7 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
roleName: undefined, packageName:'',
roleKey: undefined,
status: undefined
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -219,15 +225,12 @@ ...@@ -219,15 +225,12 @@
}, },
// 表单校验 // 表单校验
rules: { rules: {
roleName: [ packageName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" } { required: true, message: "套餐名称不能为空", trigger: "blur" }
], ],
roleKey: [ status: [
{ required: true, message: "权限字符不能为空", trigger: "blur" } { required: true, message: "状态不能为空", trigger: "blur" }
], ],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
} }
}; };
}, },
...@@ -235,10 +238,10 @@ ...@@ -235,10 +238,10 @@
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询角色列表 */ /** 查询方案列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => { getTenantPackage(this.queryParams).then(response => {
this.roleList = response.rows; this.roleList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -272,7 +275,7 @@ ...@@ -272,7 +275,7 @@
/** 根据角色ID查询菜单树结构 */ /** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) { getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => { return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.data.menus; this.menuOptions = response.data;
return response; return response;
}); });
}, },
...@@ -303,16 +306,12 @@ ...@@ -303,16 +306,12 @@
this.deptExpand = true, this.deptExpand = true,
this.deptNodeAll = false, this.deptNodeAll = false,
this.form = { this.form = {
roleId: undefined, packageId: undefined,
roleName: undefined, packageName: undefined,
roleKey: undefined, remark: undefined,
roleSort: 0, menuCheckStrictly:true,
status: "0", status: "0",
menuIds: [], menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -381,14 +380,14 @@ ...@@ -381,14 +380,14 @@
this.reset(); this.reset();
this.getMenuTreeselect(); this.getMenuTreeselect();
this.open = true; this.open = true;
this.title = "添加角色"; this.title = "添加方案";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const roleId = row.roleId || this.ids const packageId = row.packageId
const roleMenu = this.getRoleMenuTreeselect(roleId); const roleMenu = this.getRoleMenuTreeselect(packageId);
getRole(roleId).then(response => { detailTenantPackage(packageId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
...@@ -401,7 +400,7 @@ ...@@ -401,7 +400,7 @@
}) })
}); });
}); });
this.title = "修改角色"; this.title = "修改方案";
}); });
}, },
/** 选择角色权限范围触发 */ /** 选择角色权限范围触发 */
...@@ -434,7 +433,7 @@ ...@@ -434,7 +433,7 @@
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.roleId != undefined) { if (this.form.packageId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys(); this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => { updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
...@@ -443,7 +442,7 @@ ...@@ -443,7 +442,7 @@
}); });
} else { } else {
this.form.menuIds = this.getMenuAllCheckedKeys(); this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => { addTenantPackage(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
......
...@@ -35,8 +35,8 @@ module.exports = { ...@@ -35,8 +35,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://47.104.91.229:9099/prod-api`, // target: `http://47.104.91.229:9099/prod-api`,
// target: `http://192.168.0.165:9098`,//施 target: `http://192.168.0.165:9098`,//施
target: `http://192.168.60.6:9098`,//谭 // target: `http://192.168.60.6:9098`,//谭
// target: `http://139.9.157.49:9099`,//测试 // target: `http://139.9.157.49:9099`,//测试
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment