From 8b8d15fe9b761d47dbc33eeb2d324680d7609b10 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Oct 2020 13:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=BC=96=E8=BE=91=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage_system/index/index.vue | 16 ++++++---------- src/views/manage_system/index/services.js | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/views/manage_system/index/index.vue b/src/views/manage_system/index/index.vue index c3b2dcaa..82410b54 100644 --- a/src/views/manage_system/index/index.vue +++ b/src/views/manage_system/index/index.vue @@ -1124,20 +1124,14 @@ export default { */ async updateCompany() { if (!this.checkCompanyData()) { - return; + return false; } var thisApp = this; this.currentCompany.modifyUserID = sessionStorage.userId; const res = await services.updateCompany(this.currentCompany); const flag = res.Code === 0; if (!flag) { - thisApp.$notify.error({ - title: "温馨提示", - message: res.Msg, - offset: 100, - duration: 5000, - }); - return; + return false; } thisApp.$notify({ title: "恭喜您", @@ -1147,6 +1141,7 @@ export default { duration: 2500, }); thisApp.listCompany(); + return true; // this.$axios({ // method: "put", // url: encodeURI(process.env.API_HOST + "sysinfo/company"), @@ -1406,12 +1401,13 @@ export default { /** * 更新企业信息,保存数据 */ - updateSave: function () { + async updateSave () { + const flag = await this.updateCompany(); + if(!flag) return; this.el_formLabelcolor = "textlabelgray"; this.editButtonGroup = 1; this.boolEdit = false; this.rightTitle = this.currentCompany.companyName; - this.updateCompany(); }, /** * 取消更新企业信息 diff --git a/src/views/manage_system/index/services.js b/src/views/manage_system/index/services.js index 6932617f..c9379d5a 100644 --- a/src/views/manage_system/index/services.js +++ b/src/views/manage_system/index/services.js @@ -1,4 +1,4 @@ -import { fetchApi } from '@/utils/request'; +import { fetchApi, wrapErrorHint } from '@/utils/request'; import dayjs from 'dayjs'; /** @@ -143,7 +143,7 @@ export async function updateCompany(data) { } const resData = await fetchApi('company/updateCompanyById', { company: fixedData, user: userData }); - return resData; + return wrapErrorHint(resData); } async function recursionFetchNode(parentNodeId, topNodeId) {