修改系统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) { 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

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

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

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

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