From c5730240acf05d0e0503b7ca9d887cfb547627c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com>
Date: Thu, 21 Nov 2024 23:17:52 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A2=E6=88=B7=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/model/customer.js | 42 +++++++++++++++
src/assets/icons/Chat.vue | 13 +++++
src/assets/icons/index.js | 1 +
src/views/maintenance/index.vue | 14 +++++
src/views/serveView/components/commonPage.vue | 52 +++++++++++++-----
src/views/service/infoQuery.vue | 54 +++++++++++++++----
src/views/setting/user/index.vue | 21 +++++++-
7 files changed, 172 insertions(+), 25 deletions(-)
create mode 100644 src/assets/icons/Chat.vue
diff --git a/src/api/model/customer.js b/src/api/model/customer.js
index 06e26a5..397ad1b 100644
--- a/src/api/model/customer.js
+++ b/src/api/model/customer.js
@@ -66,4 +66,46 @@ export default {
}
},
+ orderSubmit: {
+ url: `${config.API_URL}/customer.work.order.submit`,
+ name: "提交问题工单",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ },
+ serviceTypeList:{
+ url: `${config.API_URL}/customer.service.type.list`,
+ name: "问题工单常量类型",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ },
+ replyOrder:{
+ url: `${config.API_URL}/customer.work.order.reply`,
+ name: "回复工单",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ },
+ orderList:{
+ url: `${config.API_URL}/customer.work.order.list`,
+ name: "问题工单列表",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ },
+ orderDelete:{
+ url: `${config.API_URL}/customer.work.order.delete`,
+ name: "删除问题工单",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ },
+ orderMyList:{
+ url: `${config.API_URL}/customer.work.order.my.list`,
+ name: "我的工单",
+ post: async function(data){
+ return await http.post(this.url, data);
+ }
+ }
}
diff --git a/src/assets/icons/Chat.vue b/src/assets/icons/Chat.vue
new file mode 100644
index 0000000..1c356da
--- /dev/null
+++ b/src/assets/icons/Chat.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/assets/icons/index.js b/src/assets/icons/index.js
index 9a2790f..4a5dc97 100644
--- a/src/assets/icons/index.js
+++ b/src/assets/icons/index.js
@@ -48,6 +48,7 @@ export { default as Right } from './Right.vue'
export { default as Customer } from './Customer.vue'
export { default as Region } from './Region.vue'
export { default as SpareParts } from './SpareParts.vue'
+export { default as Chat } from './Chat.vue'
export { default as File7z } from './file/7z.vue'
export { default as FileBmp } from './file/Bmp.vue'
diff --git a/src/views/maintenance/index.vue b/src/views/maintenance/index.vue
index 9365e26..2b63f39 100644
--- a/src/views/maintenance/index.vue
+++ b/src/views/maintenance/index.vue
@@ -95,6 +95,20 @@ export default {
{name:'维保工单'},
{name:'维保工单'},
{name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
+ {name:'维保工单'},
]
}
},
diff --git a/src/views/serveView/components/commonPage.vue b/src/views/serveView/components/commonPage.vue
index 923087e..e912e8c 100644
--- a/src/views/serveView/components/commonPage.vue
+++ b/src/views/serveView/components/commonPage.vue
@@ -29,29 +29,31 @@
-
+
+
+
+
-
-
-
-
-
-
+
+ {{ userNameF }}
+
+
+
-
@@ -81,7 +83,27 @@ export default {
},
data(){
return{
+ userName: "",
+ userNameF: "",
+ userInfo:{},
+ }
+ },
+ created() {
+ const userInfo = this.$TOOL.data.get("USER_INFO");
+ if(userInfo){
+ this.$store.commit("SET_LOGIN_AVATAR", userInfo.avatar);
+ this.$store.commit("SET_LOGIN_NAME", userInfo.name);
+ this.userInfo = userInfo;
+ this.userName = this.$store.state.global.login_name;
+ if(userInfo.company_info){
+ this.companyName = userInfo.company_info.name;
+ }
+ if(this.userName!=''){
+ this.userNameF = this.userName.substring(0, 1);
+ }
+ this.avatar = this.$store.state.global.login_avatar;
+ this.userId = userInfo.id;
}
},
mounted() {
@@ -160,6 +182,12 @@ export default {
border-left: 0;
}
}
+ .userName{
+ display: inline-block;
+ margin-left: 5px;
+ font-size: 12px;
+ cursor: pointer;
+ }
.headerView{
display: flex;
justify-content: space-between;
diff --git a/src/views/service/infoQuery.vue b/src/views/service/infoQuery.vue
index 352bc74..f2f9004 100644
--- a/src/views/service/infoQuery.vue
+++ b/src/views/service/infoQuery.vue
@@ -15,8 +15,8 @@
{{item.from_user && item.from_user.name==""?'匿名':item.from_user && item.from_user.name}}
-
{{item.to_message.to_message}}
-
+
{{item.to_message.to_message}}
+
{{item.to_message_list[0].client_file_name?item.to_message_list[0].client_file_name:'未命名'}}
@@ -166,6 +166,7 @@ export default {
show:false
},
mesList:true,
+ user_chat_params:{},
}
},
created() {
@@ -183,6 +184,12 @@ export default {
this.emojiJson = emoji.data.split(',');
document.addEventListener('click', this.closeDropdown);
+
+ // 获取路由参数
+ let user_chat_info = this.$TOOL.data.get("CHAT_PARAMS");
+ if(user_chat_info){
+ this.user_chat_params = JSON.parse(user_chat_info);
+ }
},
unmounted() {
document.removeEventListener('click', this.closeDropdown);
@@ -242,17 +249,37 @@ export default {
case 38:
if(res.data.contact_list && res.data.contact_list.length>0){
res.data.contact_list.forEach(item=>{
- if(item.to_message.send_message_type === 2){
+ if(item.to_message && item.to_message.send_message_type === 2){
item.to_message_list = JSON.parse(item.to_message.to_message);
}
})
}
this.contactsList = res.data.contact_list;
- if(res.data.contact_list.length>0){
+ // 判断当前联系人列表是否存在了这个人不存在就插入进去
+ if(this.user_chat_params && this.user_chat_params.id){
+ let ids = this.contactsList.map(em=>em.from_user_id);
+ if(ids.indexOf(this.user_chat_params.id)===-1){
+ this.contactsList.unshift({
+ created_at:this.$TOOL.dateFormat(new Date()),
+ from_user:{
+ avatar:this.user_chat_params.avatar,
+ email:this.user_chat_params.email,
+ id:this.user_chat_params.id,
+ mobile:this.user_chat_params.mobile,
+ name:this.user_chat_params.name
+ },
+ from_user_id:this.user_chat_params.id,
+ id:0,
+ to_message:{},
+ to_user_id:""
+ })
+ }
+ }
+ if(this.contactsList.length>0){
if(this.mesList){
- this.to_user_id = res.data.contact_list[0].from_user.id;
- this.params.to_user_id = res.data.contact_list[0].from_user.id;
- this.contactsInfo = res.data.contact_list[0];
+ this.to_user_id = this.contactsList[0].from_user.id;
+ this.params.to_user_id = this.contactsList[0].from_user.id;
+ this.contactsInfo = this.contactsList[0];
this.getCustomerMsgList();
this.mesList = false;
@@ -330,13 +357,18 @@ export default {
this.params.to_message = text + item;
},
closeDropdown(event){
- const dropdownElement = this.$refs.dropdownDown.$el;
- if (!dropdownElement.contains(event.target)) {
- this.$refs.dropdownDown.handleClose();
+ if(this.$refs.dropdownDown && this.$refs.dropdownDown.$el){
+ const dropdownElement = this.$refs.dropdownDown.$el;
+ if (!dropdownElement.contains(event.target)) {
+ this.$refs.dropdownDown.handleClose();
+ }
}
+
setTimeout(()=>{
this.$nextTick(()=>{
- this.$refs.messageInput.focus();
+ if(this.$refs.messageInput){
+ this.$refs.messageInput.focus();
+ }
})
},10)
},
diff --git a/src/views/setting/user/index.vue b/src/views/setting/user/index.vue
index ec5d402..3e836e5 100644
--- a/src/views/setting/user/index.vue
+++ b/src/views/setting/user/index.vue
@@ -75,8 +75,11 @@
- 在线
- 离线
+
+ 在线
+ 离线
+
+
@@ -444,16 +447,30 @@
this.getGroup();
}
this.$refs.table.refresh();
+ },
+ chatLink(item){
+ this.$router.replace({
+ name:"infoQuery",
+ })
+ this.$TOOL.data.set('CHAT_PARAMS',JSON.stringify(item));
}
}
}