Commit ec63a3bd authored by 罗超's avatar 罗超

no message

parent 96932cf2
......@@ -33,6 +33,7 @@
}
.dataText_text{
margin-right: 10px;
margin-bottom: 10px;
}
.select-radio{
display: flex;
......@@ -68,10 +69,10 @@
</el-radio-group>
</div>
<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 v-if="addCustomerShow">
<div v-if="addDistributionRulesShow">
<addDistributionRules :obj="newObj" @addCustomerOk="addCustomerOk"/>
</div>
</div>
......@@ -84,22 +85,18 @@ export default {
},
data() {
return {
disabledOff: false,
newObj:{},
radioList:[
{name:'顺序分配',id:1},
{name:'随机分配',id:2},
],
newObj:{},
list:[],
visible: false,
CustomerId: 0,
CustomerIdStr: '',
addCustomerShow: false,
addDistributionRulesShow: false,
loading:false,
tableData:[],
sceneList:[],
msg:{
SNO:'',
SNO:0,
Content:''
}
};
......@@ -107,8 +104,8 @@ export default {
mounted() {
this.GetCustomerAllotRule()
let $this = this
this.MsgBus.$on('closeaaddCustomer', function (){
$this.addCustomerShow = false
this.MsgBus.$on('closeaaddDistributionRules', function (){
$this.addDistributionRulesShow = false
})
},
beforeDestroy() {
......@@ -116,79 +113,44 @@ export default {
this.MsgBus.$off('editScene');
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1;
},
saveNow(){
let ids = []
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(){
this.addCustomerShow = false
this.getList()
this.addDistributionRulesShow = false
},
clickSelectPeople(){
this.addCustomerShow = true
this.addDistributionRulesShow = true
},
//删除
handleClose(row){
let tips = '确定将这条账号删除?'
tips = '是否把账号“'+ row.Name + '”删除?'
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apipost('/api/Customer/DelGuestSourceAccount', {
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)
}
// 获取规则详情
GetCustomerAllotRule(){
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
}
}
}
})
},
})
},
}
};
</script>
......@@ -92,10 +92,13 @@
</div>
<div class="addCenter-left">
<div class="addCenter-hidden">
<el-tree class='ApprovalProcessBg'
<el-tree
v-loading="loading"
class='ApprovalProcessBg'
:data="memberList"
show-checkbox
:filter-node-method="filterNode"
:default-checked-keys="memberSetCheckedUserKeys"
ref="tree"
:props="defaultProps"
:render-after-expand="false"
......@@ -113,9 +116,9 @@
<div class="addCenter-right">
<div class="addCenter-hidden">
<div class="addCenter-right-box"
v-for="(item,index) in myAuditUserList"
v-for="(item,index) in showMember"
:key="index">
<el-tag closable @close="deleteUser(item.EmployeeId)">
<el-tag closable @close="mySetCheckedKeys(item.EmployeeId)">
{{item.EmName}}
</el-tag>
</div>
......@@ -126,7 +129,7 @@
</div>
</div>
<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>
</div>
</el-dialog>
......@@ -138,22 +141,17 @@ export default {
},
data() {
return {
loading:false,
filterText:"",
memberSetCheckedUserKeys:[],
myAuditUserList:[],
showMember:[],
defaultProps: {
children: 'ChildList',
label: 'DepartmentName',
},
memberList:[],
title:"",
dialogTableVisible: false,
TransferOther: [],
form: {
Name: '',
SNO: '',
ID: 0,
}
};
},
watch:{
......@@ -162,11 +160,12 @@ export default {
}
},
mounted() {
this.GetCustomerAllotRule()
this.getMember()
if(this.obj.EmpList){
this.myAuditUserList = this.obj.EmpList
console.log(this.myAuditUserList, '')
this.showMember = this.obj.EmpList
this.showMember.forEach(item=>{
this.memberSetCheckedUserKeys.push(item.EmployeeId)
})
}
let $this = this
setTimeout(()=>{
......@@ -174,68 +173,49 @@ export default {
},50)
},
methods: {
getMember() { // 获取指定成员列表
this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => {
this.memberList = res.data.data
}, err => {})
},
mySetCheckedKeys(id) {
if(this.memberSetCheckedKeys.length == 0)
return
if(id == -1) {
this.$refs.treeUser.setCheckedKeys(this.memberSetCheckedKeys)
return
}
this.showMember.splice(this.showMember.findIndex(item => item.DepartmentId === id), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === id), 1)
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, '')
}
})
// 获取部门成员列表
getMember() {
this.loading = true
this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => {
this.memberList = res.data.data
this.loading = false
}, err => {})
},
// 删除指定人员
mySetCheckedKeys(id) {
if(this.memberSetCheckedUserKeys.length == 0) return
this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === id), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === id), 1)
this.$refs.tree.setCheckedKeys(this.memberSetCheckedUserKeys);
},
filterNode(value, data) {
if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1;
},
deleteUser(id){ // 删除人员
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) { //抄送人操作选中
handleNodeChange(data, checked) { //操作选中
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
this.myAuditUserList.forEach(x => {
this.showMember.forEach(x => {
if(x.EmployeeId == data.DepartmentId) {
isExsit = true
return false
}
})
if(!isExsit) {
this.myAuditUserList.push({
this.showMember.push({
EmName: data.DepartmentName,
EmployeeId: data.DepartmentId,
Sort: this.myAuditUserList.length + 1
Sort: this.showMember.length + 1
})
this.memberSetCheckedUserKeys.push(data.DepartmentId)
}
}
else if(data.Type == 2 && !data.IsCheck) {
if(this.myAuditUserList.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) {
this.myAuditUserList.splice(this.myAuditUserList.findIndex(item => item.EmployeeId === data.DepartmentId), 1)
if(this.showMember.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)
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)
}
}
......@@ -247,20 +227,17 @@ export default {
} else if(data.Type == 2 && !data.IsCheck) {
if(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)
}
}
}
},
closedDialog(){
this.MsgBus.$emit('closeaaddCustomer')
},
addData(){
},
submitForm() {
this.MsgBus.$emit('closeaaddDistributionRules')
},
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