优化角色添加成员
This commit is contained in:
parent
6803810f00
commit
deb73d972c
@ -146,7 +146,7 @@
|
||||
<div class="boxCom">
|
||||
<el-row>
|
||||
<el-col :span="25" :lg="24">
|
||||
<el-form-item label="关联ERP" prop="is_verify_erp_inventory">
|
||||
<el-form-item label="验证ERP库存" prop="is_verify_erp_inventory">
|
||||
<el-radio-group v-model="form.is_verify_erp_inventory">
|
||||
<el-radio :value="true">是</el-radio>
|
||||
<el-radio :value="false">否</el-radio>
|
||||
@ -194,35 +194,35 @@
|
||||
<div v-for="(item,index) in form.component_info" :key="index">
|
||||
<el-row>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="部件SN/Sp" prop="component_serial_no">
|
||||
<el-form-item label="部件SN/Sp" :prop="'form.component_info.'+index+'.component_serial_no'">
|
||||
<el-input class="input" v-model="item.component_serial_no" placeholder="部件SN/Se"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="部件厂商" prop="component_manufacturer">
|
||||
<el-input class="input" v-model="form.component_manufacturer" type="text" placeholder="请输入部件厂商"></el-input>
|
||||
<el-form-item label="部件厂商" :prop="'form.component_info.'+index+'.component_manufacturer'">
|
||||
<el-input class="input" v-model="item.component_manufacturer" type="text" placeholder="请输入部件厂商"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="部件型号" prop="component_model">
|
||||
<el-input class="input" v-model="form.component_model" type="text" placeholder="请输入部件型号"></el-input>
|
||||
<el-form-item label="部件型号" :prop="'form.component_info.'+index+'.component_model'">
|
||||
<el-input class="input" v-model="item.component_model" type="text" placeholder="请输入部件型号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="部件PN/Sp" prop="component_pn">
|
||||
<el-input class="input" v-model="form.component_pn" type="text" placeholder="请输入部件SN/Sp"></el-input>
|
||||
<el-form-item label="部件PN/Sp" :prop="'form.component_info.'+index+'.component_pn'">
|
||||
<el-input class="input" v-model="item.component_pn" type="text" placeholder="请输入部件SN/Sp"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="SLA截止时间" prop="sla_expiration">
|
||||
<el-date-picker class="input" v-model="form.sla_expiration" type="date" value-format="YYYY-MM-DD" placeholder="请选择SLA截止时间"></el-date-picker>
|
||||
<el-form-item label="SLA截止时间" :prop="'form.component_info.'+index+'.sla_expiration'">
|
||||
<el-date-picker class="input" v-model="item.sla_expiration" type="date" value-format="YYYY-MM-DD" placeholder="请选择SLA截止时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :lg="6">
|
||||
<el-form-item label="剩余BD数" prop="bd_backup_count">
|
||||
<el-input class="input" v-model="form.bd_backup_count" type="text" placeholder="请输入剩余BD数"></el-input>
|
||||
<el-form-item label="剩余BD数" :prop="'form.component_info.'+index+'.bd_backup_count'">
|
||||
<el-input class="input" v-model="item.bd_backup_count" type="text" placeholder="请输入剩余BD数"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -235,7 +235,6 @@
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="btnBox">
|
||||
<el-button type="primary" :size="size" @click="save" :loading="isSave">确认保存</el-button>
|
||||
|
||||
@ -88,8 +88,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="memberShow = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="isMember" @click="userSubmit">保 存</el-button>
|
||||
<el-button @click="memberShow = false">关 闭</el-button>
|
||||
<!-- <el-button type="primary" :loading="isMember" @click="userSubmit">保 存</el-button>-->
|
||||
</template>
|
||||
</el-dialog>
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
||||
@ -445,6 +445,8 @@
|
||||
if(arr.indexOf(em.id) ==-1){
|
||||
this.userIds.push(em.id);
|
||||
this.userCheckList.push(em);
|
||||
// 添加用户
|
||||
this.userSingleSubmit(em.id);
|
||||
return
|
||||
}
|
||||
this.userIds.forEach((item,index)=>{
|
||||
@ -457,6 +459,8 @@
|
||||
this.userCheckList.splice(index,1);
|
||||
}
|
||||
})
|
||||
// 单个删除用户
|
||||
this.deleteSingleMember(em.id);
|
||||
},
|
||||
deleteUser(em){
|
||||
this.userIds.forEach((item,index)=>{
|
||||
@ -469,8 +473,21 @@
|
||||
this.userCheckList.splice(index,1);
|
||||
}
|
||||
})
|
||||
this.deleteSingleMember(em.id);
|
||||
},
|
||||
// 移除角色成员
|
||||
async deleteSingleMember(id){
|
||||
let params = {
|
||||
role_id:this.role_id,
|
||||
user_ids:[id],
|
||||
}
|
||||
this.userLoading = true;
|
||||
const res = await this.$API.system.role.roleUserDel.post(params);
|
||||
this.userLoading = false;
|
||||
if(res.code == 200){
|
||||
await this.getRoleList();
|
||||
}
|
||||
},
|
||||
deleteMember(){
|
||||
this.$confirm(`确定删除选中成员吗?`, '提示', {
|
||||
type: 'warning'
|
||||
@ -499,6 +516,19 @@
|
||||
this.memberShow = false;
|
||||
},
|
||||
// 保存成员
|
||||
async userSingleSubmit(id) {
|
||||
let params = {
|
||||
role_ids: [this.role_id],
|
||||
user_ids: [id]
|
||||
};
|
||||
this.userLoading = true;
|
||||
const res = await this.$API.system.role.roleUserAdd.post(params);
|
||||
this.userLoading = false;
|
||||
if(res.code == 200){
|
||||
this.$message.success('保存成功');
|
||||
await this.getRoleList();
|
||||
}
|
||||
},
|
||||
async userSubmit() {
|
||||
let params = {
|
||||
role_ids: [this.role_id],
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<div class="th name">姓名</div>
|
||||
<div class="th mobile">手机号</div>
|
||||
<div class="th email">邮箱</div>
|
||||
<div class="th department">部门</div>
|
||||
<!-- <div class="th department">部门</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div :class="list.length==0?'tableBody tableBodyNull':'tableBody'">
|
||||
@ -19,7 +19,7 @@
|
||||
<div class="td name">{{item.name}}</div>
|
||||
<div class="td mobile">{{item.mobile}}</div>
|
||||
<div class="td email">{{item.email}}</div>
|
||||
<div class="td department">{{item.department}}</div>
|
||||
<!-- <div class="td department">{{item.department}}</div>-->
|
||||
</div>
|
||||
</template>
|
||||
<el-empty v-else :description="emptyText" :image-size="100"></el-empty>
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "members.vue",
|
||||
name: "",
|
||||
data(){
|
||||
return{
|
||||
size: "default",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user