Commit 66d0a7c7 authored by zhengke's avatar zhengke

新增分摊

parent a405187c
......@@ -551,6 +551,29 @@ input[type="number"] {
</div>
</td>
</tr>
<tr>
<td class="LM_Back" @click="closeOpTion()">负责OP</td>
<td v-for="item in getCompanyList" @click="closeOpTion()" :key="item.subCode">
<span class="joinDepart" v-if="!item.seletOpShow">{{item.joinEmployee | getJoinEmpName}}</span>
<el-select v-model="item.selectOpIdArr" multiple class='w160 multiple_input' filterable
@change="getOPSelected(item)"
:placeholder="$t('pub.pleaseSel')" v-if="item.seletOpShow">
<el-option
v-for="item in item.employeeList"
:key="item.EmployeeId"
:label="item.EmName"
:value="item.EmployeeId">
</el-option>
</el-select>
<span class="upFentan" v-if="item.selectOpIdArr.length>0"
@click.stop="getOPSelectList(item,item.rB_Branch_id)">{{$t('pub.updateMsg')}}</span>
<div v-if="item.showOpSet">
<span class="joinDepart">{{$t('Operation.Op_notInvoled')}}</span>
<span @click.stop="clickedOpSet(item)" class="setItem">{{$t('leader.leader_Set')}}</span>
</div>
</td>
</tr>
</table>
<input type="button" class="normalBtn saveCompanyBtn" @click="saveCompany()" :value="$t('pub.saveBtn')"/>
<input type="button" class="normalBtn" @click="isShowTwo=false" :value="$t('pub.cancelBtn')"/>
......@@ -759,8 +782,11 @@ export default {
this.getCompanyList.map(x => {
x.inputShow = false;
x.seletShow = false;
x.seletOpShow = false;
x.departMentList = "";
x.employeeList=[];
x.selectDepIdArr = [];
x.selectOpIdArr= [];
if (x.lossAllocation == null && x.inputShow == false) {
x.showSet = true;
} else {
......@@ -771,11 +797,21 @@ export default {
} else {
x.showSelectSet = false;
}
if(x.joinEmployee.length==0 && x.seletOpShow==false){
x.showOpSet = true;
}else{
x.showOpSet = false;
}
if (x.joinDepartment.length > 0) {
x.joinDepartment.forEach(y => {
x.selectDepIdArr.push(y.departmentId);
});
}
if (x.joinEmployee.length > 0) {
x.joinEmployee.forEach(y => {
x.selectOpIdArr.push(y.employeeId);
});
}
});
}
});
......@@ -803,6 +839,31 @@ export default {
});
this.getCompanyList = tempCompanyList;
},
getOPSelectList(item, RB_Branch_Id) {
var tempCompanyList = JSON.parse(JSON.stringify(this.getCompanyList));
tempCompanyList.forEach(x => {
if (x.rB_Branch_id == item.rB_Branch_id) {
x.seletOpShow = true;
let userInfo = this.getLocalStorage();
var RB_Group_id = userInfo.RB_Group_id;
let msg = {
GroupId: userInfo.RB_Group_id,
BranchId: item.rB_Branch_id,
DepartmentId: '-1',
PostId: '-1',
IsLeave: '0'
};
this.apipost("admin_get_EmployeeGetList", msg, res => {
if (res.data.resultCode == 1) {
x.employeeList = res.data.data;
}
});
}
});
this.getCompanyList = tempCompanyList;
},
getSelected(item) {
if (item.selectDepIdArr.length > 0) {
let joinDepartment = [];
......@@ -828,6 +889,29 @@ export default {
item.seletShow = false;
}
},
getOPSelected(item){
if (item.selectOpIdArr.length > 0) {
let ckedJoinEmployee = [];
item.selectOpIdArr.forEach(x => {
ckedJoinEmployee.push({
EmployeeId: x,
employeeName: "",
});
});
ckedJoinEmployee.forEach(x => {
item.employeeList.forEach(y => {
if (x.EmployeeId === y.EmployeeId) {
x.employeeName = y.EmName;
}
});
});
item.joinEmployee = ckedJoinEmployee;
} else {
item.joinEmployee = [];
item.showOpSet = true;
item.seletOpShow = false;
}
},
setInput(item) {
item.inputShow = false;
if (item.lossAllocation == null) {
......@@ -866,6 +950,30 @@ export default {
});
this.getCompanyList = tempCompanyList;
},
//点击设置OP开始设置
clickedOpSet(item){
var tempCompanyList = JSON.parse(JSON.stringify(this.getCompanyList));
tempCompanyList.forEach(x => {
if (x.rB_Branch_id == item.rB_Branch_id) {
let userInfo = this.getLocalStorage();
var RB_Group_id = userInfo.RB_Group_id;
let msg = {
GroupId: userInfo.RB_Group_id,
BranchId: item.rB_Branch_id,
DepartmentId: '-1',
PostId: '-1',
IsLeave: '0'
};
this.apipost("admin_get_EmployeeGetList", msg, res => {
if (res.data.resultCode == 1) {
x.employeeList = res.data.data;
}
});
(x.seletOpShow = true), (x.showOpSet = false);
}
});
this.getCompanyList = tempCompanyList;
},
clearInfo() {
this.addMsg = {
lineId: 0,
......@@ -891,6 +999,7 @@ export default {
},
saveCompany() {
var lineBranchList = [];
var lineBranchOPList = [];
this.getCompanyList.forEach(x => {
if (x.joinDepartment.length > 0) {
x.joinDepartment.forEach(y => {
......@@ -902,10 +1011,20 @@ export default {
lineBranchList.push(lineBranch);
});
}
if(x.joinEmployee.length>0){
x.joinEmployee.forEach(y => {
var opBranch = {
rB_Branch_id: x.rB_Branch_id,
EmployeeId: y.EmployeeId
};
lineBranchOPList.push(opBranch);
});
}
});
let msg = {
lineId: this.upLineId,
lineBranchList: lineBranchList
lineBranchList: lineBranchList,
lineBranchOPList: lineBranchOPList
};
this.apipost(
"line_Set_join_branch",
......@@ -964,6 +1083,14 @@ export default {
x.showSelectSet = true;
}
});
},
closeOpTion(){
this.getCompanyList.forEach(x => {
x.seletOpShow = false;
if (x.selectOpIdArr.length == 0) {
x.showOpSet = true;
}
});
}
},
mounted() {
......@@ -981,6 +1108,17 @@ export default {
returnStr = depName.join(",");
}
return returnStr;
},
getJoinEmpName:function(depList){
let returnStr = "";
if (depList.length > 0) {
let depName = [];
depList.forEach(x => {
depName.push(x.employeeName);
});
returnStr = depName.join(",");
}
return returnStr;
}
}
};
......
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