projects/mes-zjl #416

Merged
juzi merged 4 commits from projects/mes-zjl into projects/mes-test 2025-01-07 14:28:21 +08:00
13 changed files with 128 additions and 60 deletions

View File

@ -44,11 +44,7 @@ export function updateRole(data) {
} }
// 角色状态修改 // 角色状态修改
export function changeRoleStatus(id, status) { export function changeRoleStatus(data) {
const data = {
id,
status
}
return request({ return request({
url: '/system/role/update-status', url: '/system/role/update-status',
method: 'put', method: 'put',

View File

@ -23,7 +23,7 @@ const permission = {
state.topbarRouters = routes state.topbarRouters = routes
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
console.log('==SET_SIDEBAR_ROUTERS==:',routes) // console.log('==SET_SIDEBAR_ROUTERS==:',routes)
state.sidebarRouters = routes state.sidebarRouters = routes
}, },
}, },

View File

@ -28,7 +28,6 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items'
import showDetail from './showDetail.vue' import showDetail from './showDetail.vue'
import { publicFormatter } from '@/utils/dict';
export default { export default {
name: 'PlanConfig', name: 'PlanConfig',

View File

@ -176,7 +176,6 @@ import {
} from "@/utils/constants"; } from "@/utils/constants";
import { getSpuSimpleList } from "@/api/mall/product/spu"; import { getSpuSimpleList } from "@/api/mall/product/spu";
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
import {changeRoleStatus} from "@/api/system/role";
export default { export default {
name: "PromotionCouponTemplate", name: "PromotionCouponTemplate",

View File

@ -5,6 +5,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
export default { export default {
name: "StatusBtn2", name: "StatusBtn2",
props: { props: {
@ -15,7 +16,14 @@ export default {
}, },
computed: { computed: {
state() { 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 ? "" : "";
}, },
}, },
}; };

View File

@ -21,12 +21,12 @@
<el-table-column <el-table-column
prop="name" prop="name"
label="部门名称" label="部门名称"
width="260"></el-table-column> min-width="260"></el-table-column>
<el-table-column <el-table-column
prop="leader" prop="leader"
label="负责人" label="负责人"
:formatter="userNicknameFormat" :formatter="userNicknameFormat"
width="120" /> min-width="120" />
<el-table-column prop="sort" label="排序" width="200"></el-table-column> <el-table-column prop="sort" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态" width="100">
<template v-slot="scope"> <template v-slot="scope">
@ -37,7 +37,7 @@
label="创建时间" label="创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
width="200"> min-width="200">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
@ -45,32 +45,38 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="160"
class-name="small-padding fixed-width"> class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini"
type="text" 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)" @click="handleAdd(scope.row)"
v-hasPermi="['system:dept:create']"> v-hasPermi="['system:dept:create']">
新增 新增
</el-button> </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 <el-button
v-if="scope.row.parentId !== 0" v-if="scope.row.parentId !== 0"
size="mini"
type="text" type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:dept:delete']"> v-hasPermi="['system:dept:delete']">
删除 <svg-icon icon-class="table_delete"></svg-icon>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -117,9 +123,9 @@
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="item in users" v-for="item in users"
:key="parseInt(item.id)" :key="item.id"
:label="item.nickname" :label="item.nickname"
:value="parseInt(item.id)" /> :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -316,7 +322,7 @@ export default {
return '未设置'; return '未设置';
} }
for (const user of this.users) { for (const user of this.users) {
if (row.leaderUserId === user.id) { if (row.leaderUserId == user.id) {
return user.nickname; return user.nickname;
} }
} }

View File

@ -32,10 +32,23 @@
</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 v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:dict:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:delete']">删除</el-button> 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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -33,12 +33,25 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</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" width='100'>
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:dict:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:delete']">删除</el-button> 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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -52,31 +52,36 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="160"
class-name="small-padding fixed-width"> class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini"
type="text" 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)" @click="handleAdd(scope.row)"
v-hasPermi="['system:menu:create']"> v-hasPermi="['system:menu:create']">
新增 新增
</el-button> </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 <el-button
size="mini"
type="text" type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:menu:delete']"> v-hasPermi="['system:menu:delete']">
删除 <svg-icon icon-class="table_delete"></svg-icon>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -27,12 +27,25 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</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" width='100'>
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:post:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:post:delete']">删除</el-button> 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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -26,7 +26,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="状态" prop="status" v-if="isEdit"> <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-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -38,7 +38,7 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { addRole, getRole, updateRole } from "@/api/system/role"; import { addRole, getRole, updateRole,changeRoleStatus } from "@/api/system/role";
export default { export default {
name: "RoleAdd", name: "RoleAdd",
data() { data() {
@ -124,6 +124,18 @@ export default {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.isEdit = false; this.isEdit = false;
}, },
//
changeStatus(val) {
//
changeRoleStatus({
id: this.form.id,
status: val ? 0 : 1,
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
}
}, },
}; };
</script> </script>

View File

@ -39,7 +39,7 @@
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="50%">
<role-add ref="roleAdd" @successSubmit="successSubmit" /> <role-add ref="roleAdd" @successSubmit="successSubmit"/>
</base-dialog> </base-dialog>
<!-- 菜单权限 --> <!-- 菜单权限 -->
<base-dialog <base-dialog
@ -246,6 +246,7 @@ export default {
this.$refs.roleAdd.formClear(); this.$refs.roleAdd.formClear();
this.centervisible = false; this.centervisible = false;
this.addOrEditTitle = ''; this.addOrEditTitle = '';
this.getList();
}, },
handleConfirm() { handleConfirm() {
this.$refs.roleAdd.submitForm(); this.$refs.roleAdd.submitForm();

View File

@ -242,8 +242,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitRole"> </el-button>
<el-button @click="cancelRole"> </el-button> <el-button @click="cancelRole"> </el-button>
<el-button type="primary" @click="submitRole"> </el-button>
</div> </div>
</base-dialog> </base-dialog>
</div> </div>
@ -297,7 +297,7 @@ const tableProps = [
prop: 'dept', prop: 'dept',
label: '部门', label: '部门',
minWidth: 120, minWidth: 120,
filter: (item) => item.name || '', filter: (item) => item?.name || '',
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@ -496,6 +496,9 @@ export default {
username: [ username: [
{ required: true, message: '用户名称不能为空', trigger: 'blur' }, { required: true, message: '用户名称不能为空', trigger: 'blur' },
], ],
deptId: [
{ required: true, message: '归属部门不能为空', trigger: 'change' },
],
nickname: [ nickname: [
{ required: true, message: '用户昵称不能为空', trigger: 'blur' }, { required: true, message: '用户昵称不能为空', trigger: 'blur' },
], ],