修改系统bug
This commit is contained in:
parent
0a9bd0c6de
commit
30c45e6f74
@ -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',
|
||||
|
@ -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",
|
||||
|
@ -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();
|
||||
|
@ -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