update code

main
haha 2024-08-29 22:23:34 +08:00
parent a1fadd65a4
commit 4bc15af9d3
3 changed files with 49 additions and 82 deletions

View File

@ -82,8 +82,8 @@
@pagination="getList" />
<!-- 添加或修改物资类型对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body custom-class="assets-type-dialog" :close-on-click-modal="false"
:close-on-press-escape="false">
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body custom-class="assets-type-dialog"
:close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="公司名称">
<el-input v-model="form.compName" disabled />
@ -109,8 +109,8 @@
<el-input v-model="form.sunit" placeholder="请输入资产单位" />
</el-form-item>
<div class="div-unit">
<el-tag v-for="(it, idx) in units" :class="{ 'is-selected': it.sel, 'is-del': it.del }" @close="doCloseTag(it, idx)"
:closable="!it.sys" @click="doSelTag(it)" :key="idx">
<el-tag v-for="(it, idx) in units" :class="{ 'is-selected': it.sel, 'is-del': it.del }"
@close="doCloseTag(it, idx)" :closable="!it.sys" @click="doSelTag(it)" :key="idx">
<i class="el-icon-check"></i>
{{ it.text }}
</el-tag>
@ -275,7 +275,7 @@ export default {
deptId: this.queryParams.defaultDeptId,
type: null,
name: null,
sunit: null,
sunit: "",
unit: null,
isDel: null,
createBy: null,
@ -327,22 +327,22 @@ export default {
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
let tmps=row.unit.split(",").filter(d=>d);
let uns=this.units.map(d=>d.text).join(",")
tmps.forEach(it=>{
if((","+uns+",").indexOf(","+it+",")==-1){
let tmps = row.unit.split(",").filter(d => d);
let uns = this.units.map(d => d.text).join(",")
tmps.forEach(it => {
if (("," + uns + ",").indexOf("," + it + ",") == -1) {
this.units.push({
text:it,
del:false,
sys:false
text: it,
del: false,
sys: false
})
}
});
this.units.forEach(it=>{
it.sel=(","+row.unit+",").indexOf(","+it.text+",")>=0;
this.units.forEach(it => {
it.sel = ("," + row.unit + ",").indexOf("," + it.text + ",") >= 0;
});
getAssetsType(id).then(response => {
this.form = {...response.data,sunit:''};
this.form = { ...response.data, sunit: '' };
this.open = true;
this.title = "修改物资类型";
});
@ -439,4 +439,5 @@ export default {
}
}
}
}</style>
}
</style>

View File

@ -1,23 +1,13 @@
<template>
<div class="app-container">
<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="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.userName" 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-input v-model="queryParams.phonenumber" 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>
@ -27,34 +17,15 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="openSelectUser"
v-hasPermi="['system:role:add']"
>添加用户</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openSelectUser"
v-hasPermi="['system:role:add']">添加用户</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-circle-close"
size="mini"
:disabled="multiple"
@click="cancelAuthUserAll"
v-hasPermi="['system:role:remove']"
>批量取消授权</el-button>
<el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
@click="cancelAuthUserAll" v-hasPermi="['system:role:remove']">批量取消授权</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-close"
size="mini"
@click="handleClose"
>关闭</el-button>
<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose"></el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -67,7 +38,7 @@
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@ -77,24 +48,14 @@
</el-table-column>
<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-circle-close"
@click="cancelAuthUser(scope.row)"
v-hasPermi="['system:role:remove']"
>取消授权</el-button>
<el-button size="mini" type="text" icon="el-icon-circle-close" @click="cancelAuthUser(scope.row)"
v-hasPermi="['system:role:remove']">取消授权</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<select-user ref="select" :roleId="queryParams.roleId" @ok="handleQuery" />
</div>
</template>
@ -143,10 +104,10 @@ export default {
getList() {
this.loading = true;
allocatedUserList(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
//
@ -176,23 +137,23 @@ export default {
/** 取消授权按钮操作 */
cancelAuthUser(row) {
const roleId = this.queryParams.roleId;
this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function () {
return authUserCancel({ userId: row.userId, roleId: roleId });
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
}).catch(() => { });
},
/** 批量取消授权按钮操作 */
cancelAuthUserAll(row) {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
this.$modal.confirm('是否取消选中用户授权数据项?').then(function () {
return authUserCancelAll({ roleId: roleId, userIds: userIds });
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
}).catch(() => { });
}
}
};

View File

@ -128,7 +128,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="归属部门" prop="deptId">
<treeselect ref="treeSel"v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" @select="doInputDept"/>
<treeselect ref="treeSel" v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" @select="doInputDept"/>
</el-form-item>
</el-col>
</el-row>
@ -346,6 +346,7 @@ export default {
this.form.deptId=undefined;
},400);
}else{
debugger
if(a.data.level==1){//
this.roleOptions=this.oldRoleOptions.filter(d=>{
return d.roleName=="公司管理员"||d.roleName=="普通角色";
@ -354,13 +355,16 @@ export default {
this.roleOptions=this.oldRoleOptions.filter(d=>{
return d.roleName=="段队管理员"||d.roleName=="普通角色";
});
}else if(a.data.level==300){//
}else if(a.data.level==300){//
this.roleOptions=this.oldRoleOptions.filter(d=>{
return d.roleName=="项目管理员"||d.roleName=="普通角色";
return [2,3,4,5,8].indexOf(d.roleId)>=0;
});
}else{
let node=this.$refs.treeSel.selectedNodes[0];
let plevel=node.parentNode?.raw?.data?.level||0;
let roles=[2,3,4,5];
this.roleOptions=this.oldRoleOptions.filter(d=>{
return d.roleName=="公司管理员"||d.roleName=="普通角色";
return roles.indexOf(d.roleId)>=0;
});
}
@ -465,6 +469,7 @@ export default {
handleAdd() {
this.reset();
getUser().then(response => {
debugger
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.oldRoleOptions=response.roles;