剧本编制代码调整

This commit is contained in:
joylink_cuiweidong 2020-07-10 17:14:30 +08:00
parent 2b5b21c1cf
commit 5deef9fe6b
2 changed files with 4 additions and 8 deletions

View File

@ -228,21 +228,17 @@ const training = {
setSimulationUserList: (state, simulationUserList) => {
state.simulationUserList = simulationUserList;
},
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, isDriver}) => {
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId}) => {
if (oldMemberId) {
// 重置旧数据
if (state.memberData[oldMemberId].trust) {
state.memberData[newMemberId].trust = false;
}
state.memberData[oldMemberId].trust = false;
delete state.memberData[oldMemberId].userId;
state.memberData[oldMemberId].disabled = false;
}
// 更新新数据
state.memberData[newMemberId].userId = userId;
state.memberData[newMemberId].disabled = true;
if (isDriver) {
state.memberData[newMemberId].trust = true;
}
state.memberData[newMemberId].trust = true;
},
updateMemberAndUser: (state, {simulationUserList, userId}) => {
simulationUserList.forEach(item => {

View File

@ -176,7 +176,7 @@ export default {
prdType = '';
}
}
this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.$store.state.user.id, isDriver:memberInfo.type == '司机'});
this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.$store.state.user.id});
this.oldMemberId = role;
this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{