Commit ec63a3bd authored by 罗超's avatar 罗超

no message

parent 96932cf2
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
} }
.dataText_text{ .dataText_text{
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px;
} }
.select-radio{ .select-radio{
display: flex; display: flex;
...@@ -68,10 +69,10 @@ ...@@ -68,10 +69,10 @@
</el-radio-group> </el-radio-group>
</div> </div>
<br/><br/> <br/><br/>
<el-button class="add-box-btn add-box-cancel">立即保存</el-button> <el-button class="add-box-btn add-box-cancel" @click="saveNow" :disabled="disabledOff">立即保存</el-button>
</div> </div>
<!-- 添加账号弹窗 --> <!-- 添加账号弹窗 -->
<div v-if="addCustomerShow"> <div v-if="addDistributionRulesShow">
<addDistributionRules :obj="newObj" @addCustomerOk="addCustomerOk"/> <addDistributionRules :obj="newObj" @addCustomerOk="addCustomerOk"/>
</div> </div>
</div> </div>
...@@ -84,22 +85,18 @@ export default { ...@@ -84,22 +85,18 @@ export default {
}, },
data() { data() {
return { return {
disabledOff: false,
newObj:{}, newObj:{},
radioList:[ radioList:[
{name:'顺序分配',id:1}, {name:'顺序分配',id:1},
{name:'随机分配',id:2}, {name:'随机分配',id:2},
], ],
newObj:{},
list:[], list:[],
visible: false, addDistributionRulesShow: false,
CustomerId: 0,
CustomerIdStr: '',
addCustomerShow: false,
loading:false, loading:false,
tableData:[], tableData:[],
sceneList:[],
msg:{ msg:{
SNO:'', SNO:0,
Content:'' Content:''
} }
}; };
...@@ -107,8 +104,8 @@ export default { ...@@ -107,8 +104,8 @@ export default {
mounted() { mounted() {
this.GetCustomerAllotRule() this.GetCustomerAllotRule()
let $this = this let $this = this
this.MsgBus.$on('closeaaddCustomer', function (){ this.MsgBus.$on('closeaaddDistributionRules', function (){
$this.addCustomerShow = false $this.addDistributionRulesShow = false
}) })
}, },
beforeDestroy() { beforeDestroy() {
...@@ -116,79 +113,44 @@ export default { ...@@ -116,79 +113,44 @@ export default {
this.MsgBus.$off('editScene'); this.MsgBus.$off('editScene');
}, },
methods: { methods: {
filterNode(value, data) { saveNow(){
if (!value) return true; let ids = []
return data.DepartmentName.indexOf(value) !== -1; this.list.forEach(item=>{
}, ids.push(item.EmployeeId)
})
this.msg.Content = ids.join(',')
console.log(this.msg)
this.disabledOff = true
this.apipost('/api/Customer/SetCustomerAllotRule', this.msg, res=>{
if (res.data.resultCode == 1) {
this.$message.success(res.data.message)
this.disabledOff = false
} else {
this.$message.error(res.data.message)
this.disabledOff = false
}
})
},
addCustomerOk(){ addCustomerOk(){
this.addCustomerShow = false this.addDistributionRulesShow = false
this.getList()
}, },
clickSelectPeople(){ clickSelectPeople(){
this.addCustomerShow = true this.addDistributionRulesShow = true
}, },
//删除 // 获取规则详情
handleClose(row){ GetCustomerAllotRule(){
let tips = '确定将这条账号删除?' this.apipost('/api/Customer/GetCustomerAllotRule', {}, res=>{
tips = '是否把账号“'+ row.Name + '”删除?' if (res.data.resultCode == 1) {
this.$confirm(tips, '提示', { this.msg = {
confirmButtonText: '确定', SNO: res.data.data.SNO,
cancelButtonText: '取消', Content: res.data.data.Content
type: 'warning' };
}).then(() => { this.list = res.data.data.EmpList
this.apipost('/api/Customer/DelGuestSourceAccount', { this.newObj = res.data.data
SAccountId: row.ID
}, res=>{
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
GetCustomerAllotRule(){
this.tableData = []
this.loading = true
this.apipost('/api/Customer/GetCustomerAllotRule', {}, res=>{
if (res.data.resultCode == 1) {
this.msg = {
SNO: res.data.data.SNO,
Content: res.data.data.Content
};
this.list = res.data.data.EmpList
this.newObj = res.data.data
}
})
},
getGetGuestSourceAccountList(){
this.apipost('/api/Customer/GetGuestSourceAccountList', {}, res=>{
if (res.data.resultCode == 1) {
this.list = res.data.data
for(let i=0;i<this.tableData.length;i++){
for(let j=0;j<this.list.length;j++){
if(this.tableData[i].ID==this.list[j].SNO){
let obj = {
ID: this.list[j].ID,
Name: this.list[j].Name,
SNO: this.list[j].SNO,
UpdateBy: this.list[j].UpdateBy,
UpdateDate: this.list[j].UpdateDate,
}
this.tableData[i].list.push(obj)
}
} }
} })
} },
})
},
} }
}; };
</script> </script>
...@@ -92,10 +92,13 @@ ...@@ -92,10 +92,13 @@
</div> </div>
<div class="addCenter-left"> <div class="addCenter-left">
<div class="addCenter-hidden"> <div class="addCenter-hidden">
<el-tree class='ApprovalProcessBg' <el-tree
v-loading="loading"
class='ApprovalProcessBg'
:data="memberList" :data="memberList"
show-checkbox show-checkbox
:filter-node-method="filterNode" :filter-node-method="filterNode"
:default-checked-keys="memberSetCheckedUserKeys"
ref="tree" ref="tree"
:props="defaultProps" :props="defaultProps"
:render-after-expand="false" :render-after-expand="false"
...@@ -113,9 +116,9 @@ ...@@ -113,9 +116,9 @@
<div class="addCenter-right"> <div class="addCenter-right">
<div class="addCenter-hidden"> <div class="addCenter-hidden">
<div class="addCenter-right-box" <div class="addCenter-right-box"
v-for="(item,index) in myAuditUserList" v-for="(item,index) in showMember"
:key="index"> :key="index">
<el-tag closable @close="deleteUser(item.EmployeeId)"> <el-tag closable @close="mySetCheckedKeys(item.EmployeeId)">
{{item.EmName}} {{item.EmName}}
</el-tag> </el-tag>
</div> </div>
...@@ -126,7 +129,7 @@ ...@@ -126,7 +129,7 @@
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="submitForm">确 定</el-button> <el-button type="primary" class="add-box-btn" @click="clickSure">确 定</el-button>
<el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false">取 消</el-button> <el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -138,22 +141,17 @@ export default { ...@@ -138,22 +141,17 @@ export default {
}, },
data() { data() {
return { return {
loading:false,
filterText:"", filterText:"",
memberSetCheckedUserKeys:[], memberSetCheckedUserKeys:[],
myAuditUserList:[], showMember:[],
defaultProps: { defaultProps: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DepartmentName',
}, },
memberList:[], memberList:[],
title:"",
dialogTableVisible: false, dialogTableVisible: false,
TransferOther: [],
form: {
Name: '',
SNO: '',
ID: 0,
}
}; };
}, },
watch:{ watch:{
...@@ -162,11 +160,12 @@ export default { ...@@ -162,11 +160,12 @@ export default {
} }
}, },
mounted() { mounted() {
this.GetCustomerAllotRule()
this.getMember() this.getMember()
if(this.obj.EmpList){ if(this.obj.EmpList){
this.myAuditUserList = this.obj.EmpList this.showMember = this.obj.EmpList
console.log(this.myAuditUserList, '') this.showMember.forEach(item=>{
this.memberSetCheckedUserKeys.push(item.EmployeeId)
})
} }
let $this = this let $this = this
setTimeout(()=>{ setTimeout(()=>{
...@@ -174,68 +173,49 @@ export default { ...@@ -174,68 +173,49 @@ export default {
},50) },50)
}, },
methods: { methods: {
getMember() { // 获取指定成员列表 // 获取部门成员列表
this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => { getMember() {
this.memberList = res.data.data this.loading = true
}, err => {}) this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => {
}, this.memberList = res.data.data
mySetCheckedKeys(id) { this.loading = false
if(this.memberSetCheckedKeys.length == 0) }, err => {})
return },
if(id == -1) { // 删除指定人员
this.$refs.treeUser.setCheckedKeys(this.memberSetCheckedKeys) mySetCheckedKeys(id) {
return if(this.memberSetCheckedUserKeys.length == 0) return
} this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === id), 1)
this.showMember.splice(this.showMember.findIndex(item => item.DepartmentId === id), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === id), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === id), 1) this.$refs.tree.setCheckedKeys(this.memberSetCheckedUserKeys);
this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys);
},
// 获取
GetCustomerAllotRule(){
this.apipost('/api/Customer/GetCustomerAllotRule',{}, res=>{
if (res.data.resultCode == 1) {
// this.userList = res.data.data.EmpList
// console.log(res.data.data.EmpList, '')
}
})
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1; return data.DepartmentName.indexOf(value) !== -1;
}, },
deleteUser(id){ // 删除人员 handleNodeChange(data, checked) { //操作选中
if(this.memberSetCheckedUserKeys.findIndex(item => item === id)!=-1){
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === id), 1)
}
if(this.myAuditUserList.findIndex(item => item.EmployeeId === id)!=-1)
{
this.myAuditUserList.splice(this.myAuditUserList.findIndex(item => item.EmployeeId === id), 1)
}
},
handleNodeChange(data, checked) { //抄送人操作选中
data.IsCheck = checked; data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中 if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false let isExsit = false
this.myAuditUserList.forEach(x => { this.showMember.forEach(x => {
if(x.EmployeeId == data.DepartmentId) { if(x.EmployeeId == data.DepartmentId) {
isExsit = true isExsit = true
return false return false
} }
}) })
if(!isExsit) { if(!isExsit) {
this.myAuditUserList.push({ this.showMember.push({
EmName: data.DepartmentName, EmName: data.DepartmentName,
EmployeeId: data.DepartmentId, EmployeeId: data.DepartmentId,
Sort: this.myAuditUserList.length + 1 Sort: this.showMember.length + 1
}) })
this.memberSetCheckedUserKeys.push(data.DepartmentId) this.memberSetCheckedUserKeys.push(data.DepartmentId)
} }
} }
else if(data.Type == 2 && !data.IsCheck) { else if(data.Type == 2 && !data.IsCheck) {
if(this.myAuditUserList.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) { if(this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) {
this.myAuditUserList.splice(this.myAuditUserList.findIndex(item => item.EmployeeId === data.DepartmentId), 1) this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1)
if(this.myAuditUserList.findIndex(item => item.EmployeeId === data.ParentId) != -1) { if(this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
} }
} }
...@@ -247,20 +227,17 @@ export default { ...@@ -247,20 +227,17 @@ export default {
} else if(data.Type == 2 && !data.IsCheck) { } else if(data.Type == 2 && !data.IsCheck) {
if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) != -1) { if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1)
if(this.myAuditUserList.findIndex(item => item.EmployeeId === data.ParentId) != -1) { if(this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
} }
} }
} }
}, },
closedDialog(){ closedDialog(){
this.MsgBus.$emit('closeaaddCustomer') this.MsgBus.$emit('closeaaddDistributionRules')
},
addData(){
},
submitForm() {
}, },
resetForm() { // 重置表单 clickSure() {
this.dialogTableVisible = false
}, },
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment