|
|
@@ -122,15 +122,15 @@ export default {
|
|
|
if (val) this.getSelectUserListByCustomerType();
|
|
|
},
|
|
|
},
|
|
|
- assignUserPostValue: {
|
|
|
+ 'assignUserPostItem.postName': {
|
|
|
handler(val) {
|
|
|
if (val) this.getSelectUserListByPostName();
|
|
|
},
|
|
|
+ deep: true,
|
|
|
},
|
|
|
},
|
|
|
activated() {
|
|
|
this.id = this.$route.query.id;
|
|
|
- this.getDictOptionFun();
|
|
|
this.getCustomerClueInfoById();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -154,9 +154,23 @@ export default {
|
|
|
// 如果选择大型装企直接返回用户表列表
|
|
|
if (this.activaAssignTypeItem.dictValue == 1) {
|
|
|
if (res.data && res.data.userList.length) {
|
|
|
- this.assignUserData = res.data.userList;
|
|
|
- this.assignUserItem = this.assignUserData[0];
|
|
|
- this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ let userList = res.data.userList;
|
|
|
+ if (this.assignTypeValue != '大型装企') {
|
|
|
+ let userListFilter = userList.filter(
|
|
|
+ (item) => item.nickName.indexOf(this.infoData.companyName) != -1
|
|
|
+ );
|
|
|
+ this.assignUserData = userListFilter || [];
|
|
|
+ } else {
|
|
|
+ this.assignUserData = userList;
|
|
|
+ }
|
|
|
+ if (this.assignUserData.length) {
|
|
|
+ this.assignUserItem = this.assignUserData[0];
|
|
|
+ this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ } else {
|
|
|
+ this.assignUserData = [];
|
|
|
+ this.assignUserItem = null;
|
|
|
+ this.assignUserValue = '';
|
|
|
+ }
|
|
|
} else {
|
|
|
this.assignUserData = [];
|
|
|
this.assignUserItem = null;
|
|
|
@@ -188,9 +202,23 @@ export default {
|
|
|
selectUserListByPostName({ postName: this.assignUserPostValue }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
if (res.data && res.data.userList.length) {
|
|
|
- this.assignUserData = res.data.userList;
|
|
|
- this.assignUserItem = this.assignUserData[0];
|
|
|
- this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ let userList = res.data.userList;
|
|
|
+ if (this.assignTypeValue != '大型装企') {
|
|
|
+ let userListFilter = userList.filter(
|
|
|
+ (item) => item.nickName.indexOf(this.infoData.companyName) != -1
|
|
|
+ );
|
|
|
+ this.assignUserData = userListFilter || [];
|
|
|
+ } else {
|
|
|
+ this.assignUserData = userList;
|
|
|
+ }
|
|
|
+ if (this.assignUserData.length) {
|
|
|
+ this.assignUserItem = this.assignUserData[0];
|
|
|
+ this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ } else {
|
|
|
+ this.assignUserData = [];
|
|
|
+ this.assignUserItem = null;
|
|
|
+ this.assignUserValue = '';
|
|
|
+ }
|
|
|
} else {
|
|
|
this.assignUserData = [];
|
|
|
this.assignUserItem = null;
|
|
|
@@ -226,6 +254,7 @@ export default {
|
|
|
window.location.replace(window.location.origin + '/mobile/assignAwait');
|
|
|
});
|
|
|
}
|
|
|
+ this.getDictOptionFun();
|
|
|
} else {
|
|
|
this.$toast(res.msg);
|
|
|
}
|