From 691140a13d211ac460eb5fbb3172ca12a228de9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Fri, 20 Sep 2024 23:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=BA=90=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/setup.js | 7 +++++++ src/layout/components/userbar.vue | 24 ++++++++++++++--------- src/views/order/dataConfirm/index.vue | 12 +++++++++++- src/views/order/orderList/index.vue | 3 +-- src/views/setting/advanced/setup/mail.vue | 23 ++++++++++++++++++++++ 5 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/api/model/setup.js b/src/api/model/setup.js index e33f4b8..c4a474d 100644 --- a/src/api/model/setup.js +++ b/src/api/model/setup.js @@ -32,6 +32,13 @@ export default { post: async function (data) { return await http.post(this.url, data); }, + }, + configInfo:{ + url: `${config.API_URL}/email.source.config.info`, + name: "源邮件获取数据同步模式", + post: async function (data) { + return await http.post(this.url, data); + }, } }, k3:{ diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 5384a30..65f3722 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -176,14 +176,17 @@ if (command == "clearCache") { this.$confirm('清除缓存会将系统初始化,包括登录状态、主题、语言设置等,是否继续?', '警告', { type: 'warning', - }).then(() => { + }).then(async () => { const loading = this.$loading() - this.$TOOL.data.clear() - this.$router.replace({ path: '/login' }) - setTimeout(() => { - loading.close() - location.reload() - }, 1000) + const res = await this.$API.system.user.logout.post(); + if (res.code == 200) { + this.$TOOL.data.clear() + this.$router.replace({path: '/login'}); + setTimeout(() => { + loading.close() + location.reload() + }, 1000) + } }).catch(() => { //取消 }) @@ -194,8 +197,11 @@ type: 'warning', confirmButtonText: '退出', confirmButtonClass: 'el-button--danger' - }).then(() => { - this.$router.replace({ path: '/login' }); + }).then(async () => { + const res = await this.$API.system.user.logout.post(); + if(res.code == 200){ + this.$router.replace({path: '/login'}); + } }).catch(() => { //取消退出 }) diff --git a/src/views/order/dataConfirm/index.vue b/src/views/order/dataConfirm/index.vue index dc14e56..7c69a5f 100644 --- a/src/views/order/dataConfirm/index.vue +++ b/src/views/order/dataConfirm/index.vue @@ -46,7 +46,7 @@
查看原邮件 - + 确认维保 + 自动同步
@@ -198,6 +199,7 @@ export default { refreshShow:false, syncText:"", + is_auto_repair:"", // 邮件数据同步 emailId:'', searchShow:false, searchData:{}, @@ -269,6 +271,7 @@ export default { }, mounted() { this.getData(); + this.getEmailConfig(); }, methods: { customIndexMethod(index){ @@ -280,6 +283,13 @@ export default { return 'all-disabled' } }, + async getEmailConfig() { + const res = await this.$API.setup.mail.configInfo.post(); + if(res.code == 200){ + this.is_auto_repair = res.data.is_auto_repair; + console.log(res.data) + } + }, async getData() { this.listLoading = true; const res = await this.$API.orders.order.mail.list.get(this.listParams); diff --git a/src/views/order/orderList/index.vue b/src/views/order/orderList/index.vue index 4472d7f..1b86a7a 100644 --- a/src/views/order/orderList/index.vue +++ b/src/views/order/orderList/index.vue @@ -96,8 +96,7 @@ export default { flowList:[ {name:'新建/导入/同步邮件',left:false,right:true}, {name:'提交维保',left:true,right:true}, - {name:'审核',left:true,right:true}, - {name:'下发维保',left:true,right:false}, + {name:'审核',left:true,right:false}, ], dialog: { save: false, diff --git a/src/views/setting/advanced/setup/mail.vue b/src/views/setting/advanced/setup/mail.vue index 2838a58..65bac76 100644 --- a/src/views/setting/advanced/setup/mail.vue +++ b/src/views/setting/advanced/setup/mail.vue @@ -8,6 +8,18 @@ +
+
+
维修数据同步模式
+
+ + 手动同步 + 自动同步 + +
+
+
邮件数据同步到维保库的模式,选择自动时无需在邮件明细操作,反之则需手动同步。
+
获取数据源邮件地址
@@ -48,6 +60,7 @@ export default { loading:false, mail:{ active_status:false, + is_auto_repair:true, alias:'', email:'', client_id:'', @@ -97,6 +110,16 @@ export default { margin-right: 10px; } } + .boxItem{ + display: flex;align-items: center; + .boxView{ + margin-left: 15px; + } + } + .msg{ + color: var(--el-text-color-placeholder); + margin: 10px 0 20px 0; + } } .mailMain{ border-top: 1px solid #e8e8e8;