From f7bdedf1f3f7600c73f6d5beb46c1d1f4d518822 Mon Sep 17 00:00:00 2001 From: luobisheng <727299681@qq.com> Date: 星期三, 09 十一月 2022 18:15:34 +0800 Subject: [PATCH] 消息管理丶店铺对接 --- src/views/systemSetting/platform/cockpitManage/updateUser/index.vue | 39 ++++++++++++++++++++++----------------- 1 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/views/systemSetting/platform/cockpitManage/updateUser/index.vue b/src/views/systemSetting/platform/cockpitManage/updateUser/index.vue index a26873b..9aaa8a0 100644 --- a/src/views/systemSetting/platform/cockpitManage/updateUser/index.vue +++ b/src/views/systemSetting/platform/cockpitManage/updateUser/index.vue @@ -11,7 +11,7 @@ label-position="right" > <!-- 閮ㄩ棬鍚嶇О --> - <span style="heght:18px;display:block;line-height: 14px;"> + <span style="height:18px;display:block;line-height: 14px;"> 鎵ф硶浜哄憳缁撴瀯 </span> <el-form-item class="optionItem" label="閮ㄩ棬鍚嶇О:" prop="name"> @@ -71,12 +71,10 @@ </template> <script> import { deepClone } from "@/utils/helper"; -import { updateTeamInfo } from "@/api/system/portal/teamConstruction"; -import { SUCCESS_CODE } from "@/utils"; +import {addTeam, updateTeamInfo} from "@/api/system/portal/teamConstruction"; export default { data() { - return { updateData: null, rules: { @@ -103,18 +101,25 @@ submitUpdate() { this.$refs.user.validate((valid) => { if (valid) { - updateTeamInfo(this.updateData) - .then(({ code, message }) => { - if (code === SUCCESS_CODE) { - this.$emit('closeUpdateDialog'); - this.$message({ type: 'success', message }); - } else { - this.$message({ type: 'error', message }); - } - }) - .catch(err => { - this.$message({ type: 'error', message: err }); - }); + if (this.isUpdate) { + updateTeamInfo(this.updateData) + .then(() => { + this.$emit('closeUpdateDialog'); + this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' }); + }) + .catch(err => { + this.$message({ type: 'error', message: err }); + }); + } else { + addTeam(this.depart) + .then(() => { + this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' }); + this.$emit('closeUpdateDialog'); + }) + .catch(err => { + this.$message({ type: 'error', message: err }); + }); + } } else { this.$message({ type: 'warning', message: '璇锋鏌ュ繀濉」' }); } @@ -125,7 +130,7 @@ this.$emit('closeUpdateDialog'); } }, - props: ['updateDepartmentData'] + props: ['updateDepartmentData', 'isUpdate'] }; </script> <style lang="scss" scoped> -- Gitblit v1.8.0