修改系统bug

This commit is contained in:
朱菊兰 2025-01-06 10:44:23 +08:00
parent 0a9bd0c6de
commit 30c45e6f74
5 changed files with 20 additions and 9 deletions

View File

@ -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',

View File

@ -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",

View File

@ -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>

View File

@ -246,6 +246,7 @@ export default {
this.$refs.roleAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
this.getList();
},
handleConfirm() {
this.$refs.roleAdd.submitForm();

View File

@ -496,6 +496,9 @@ export default {
username: [
{ required: true, message: '用户名称不能为空', trigger: 'blur' },
],
deptId: [
{ required: true, message: '归属部门不能为空', trigger: 'change' },
],
nickname: [
{ required: true, message: '用户昵称不能为空', trigger: 'blur' },
],