projects/mes-zjl #416
@ -44,11 +44,7 @@ export function updateRole(data) {
|
||||
}
|
||||
|
||||
// 角色状态修改
|
||||
export function changeRoleStatus(id, status) {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
export function changeRoleStatus(data) {
|
||||
return request({
|
||||
url: '/system/role/update-status',
|
||||
method: 'put',
|
||||
|
@ -23,7 +23,7 @@ const permission = {
|
||||
state.topbarRouters = routes
|
||||
},
|
||||
SET_SIDEBAR_ROUTERS: (state, routes) => {
|
||||
console.log('==SET_SIDEBAR_ROUTERS==:',routes)
|
||||
// console.log('==SET_SIDEBAR_ROUTERS==:',routes)
|
||||
state.sidebarRouters = routes
|
||||
},
|
||||
},
|
||||
|
@ -28,7 +28,6 @@ import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items'
|
||||
import showDetail from './showDetail.vue'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'PlanConfig',
|
||||
|
@ -176,7 +176,6 @@ import {
|
||||
} from "@/utils/constants";
|
||||
import { getSpuSimpleList } from "@/api/mall/product/spu";
|
||||
import { parseTime } from "@/utils/ruoyi";
|
||||
import {changeRoleStatus} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
name: "PromotionCouponTemplate",
|
||||
|
@ -5,6 +5,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
|
||||
export default {
|
||||
name: "StatusBtn2",
|
||||
props: {
|
||||
@ -15,7 +16,14 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
state() {
|
||||
return this.injectData.status === 1 ? "关闭" : "开启";
|
||||
let label = ''
|
||||
getDictDatas(DICT_TYPE.COMMON_STATUS).forEach((item) => {
|
||||
if (parseInt(item.value) === this.injectData.status) {
|
||||
label = item.label;
|
||||
}
|
||||
})
|
||||
return label
|
||||
// return this.injectData.status === 1 ? "关闭" : "开启";
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -21,12 +21,12 @@
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="部门名称"
|
||||
width="260"></el-table-column>
|
||||
min-width="260"></el-table-column>
|
||||
<el-table-column
|
||||
prop="leader"
|
||||
label="负责人"
|
||||
:formatter="userNicknameFormat"
|
||||
width="120" />
|
||||
min-width="120" />
|
||||
<el-table-column prop="sort" label="排序" width="200"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template v-slot="scope">
|
||||
@ -37,7 +37,7 @@
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="200">
|
||||
min-width="200">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
@ -45,32 +45,38 @@
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="160"
|
||||
class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dept:update']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:dept:create']">
|
||||
新增
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:dept:update']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dept:update']">
|
||||
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
|
||||
</el-button>
|
||||
<span
|
||||
v-if="scope.row.parentId !== 0"
|
||||
v-hasPermi="['system:dept:delete']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.parentId !== 0"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dept:delete']">
|
||||
删除
|
||||
<svg-icon icon-class="table_delete"></svg-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -117,9 +123,9 @@
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in users"
|
||||
:key="parseInt(item.id)"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="parseInt(item.id)" />
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -316,7 +322,7 @@ export default {
|
||||
return '未设置';
|
||||
}
|
||||
for (const user of this.users) {
|
||||
if (row.leaderUserId === user.id) {
|
||||
if (row.leaderUserId == user.id) {
|
||||
return user.nickname;
|
||||
}
|
||||
}
|
||||
|
@ -32,10 +32,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:delete']">删除</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:update']">
|
||||
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:dict:delete']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:delete']">
|
||||
<svg-icon icon-class="table_delete"></svg-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -33,12 +33,25 @@
|
||||
<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" width='100'>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:delete']">删除</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:update']">
|
||||
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:dict:delete']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:delete']">
|
||||
<svg-icon icon-class="table_delete"></svg-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -52,31 +52,36 @@
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="160"
|
||||
class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:menu:update']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:menu:create']">
|
||||
新增
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:menu:update']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:menu:update']">
|
||||
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:menu:delete']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:menu:delete']">
|
||||
删除
|
||||
<svg-icon icon-class="table_delete"></svg-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -27,12 +27,25 @@
|
||||
<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" width='100'>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:post:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:post:delete']">删除</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:post:update']">
|
||||
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
|
||||
</el-button>
|
||||
<span
|
||||
v-hasPermi="['system:post:delete']"
|
||||
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
|
||||
>|</span
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:post:delete']">
|
||||
<svg-icon icon-class="table_delete"></svg-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -26,7 +26,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="status" v-if="isEdit">
|
||||
<el-switch v-model="form.status"> </el-switch>
|
||||
<el-switch v-model="form.status" @change='changeStatus'> </el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -38,7 +38,7 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { addRole, getRole, updateRole } from "@/api/system/role";
|
||||
import { addRole, getRole, updateRole,changeRoleStatus } from "@/api/system/role";
|
||||
export default {
|
||||
name: "RoleAdd",
|
||||
data() {
|
||||
@ -124,6 +124,18 @@ export default {
|
||||
this.$refs.form.resetFields();
|
||||
this.isEdit = false;
|
||||
},
|
||||
// 修改状态
|
||||
changeStatus(val) {
|
||||
// 调用状态修改接口
|
||||
changeRoleStatus({
|
||||
id: this.form.id,
|
||||
status: val ? 0 : 1,
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -39,7 +39,7 @@
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<role-add ref="roleAdd" @successSubmit="successSubmit" />
|
||||
<role-add ref="roleAdd" @successSubmit="successSubmit"/>
|
||||
</base-dialog>
|
||||
<!-- 菜单权限 -->
|
||||
<base-dialog
|
||||
@ -246,6 +246,7 @@ export default {
|
||||
this.$refs.roleAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
this.getList();
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.roleAdd.submitForm();
|
||||
|
@ -242,8 +242,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitRole">确 定</el-button>
|
||||
<el-button @click="cancelRole">取 消</el-button>
|
||||
<el-button type="primary" @click="submitRole">确 定</el-button>
|
||||
</div>
|
||||
</base-dialog>
|
||||
</div>
|
||||
@ -297,7 +297,7 @@ const tableProps = [
|
||||
prop: 'dept',
|
||||
label: '部门',
|
||||
minWidth: 120,
|
||||
filter: (item) => item.name || '',
|
||||
filter: (item) => item?.name || '',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
@ -496,6 +496,9 @@ export default {
|
||||
username: [
|
||||
{ required: true, message: '用户名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: '归属部门不能为空', trigger: 'change' },
|
||||
],
|
||||
nickname: [
|
||||
{ required: true, message: '用户昵称不能为空', trigger: 'blur' },
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user