diff --git a/src/page/main/authority/organization/index.vue b/src/page/main/authority/organization/index.vue index 307b852eb61d790fbc0735d5cf7d76716e4197e5..bf24bbfb2a9abd35e31b5bcf59ced5eb9299dc8f 100644 --- a/src/page/main/authority/organization/index.vue +++ b/src/page/main/authority/organization/index.vue @@ -173,7 +173,7 @@ const headers = reactive([ }, { label: "手机号", - prop: "contact_phone", + prop: "phone", minWidth: 150, }, { diff --git a/src/page/main/authority/organization/user-detail/index.vue b/src/page/main/authority/organization/user-detail/index.vue index aeebd1fad522713976bd746e58e7adeaf4145bd6..618c4fe00a68a8e697ea09f02c5f6bc62aecb30a 100644 --- a/src/page/main/authority/organization/user-detail/index.vue +++ b/src/page/main/authority/organization/user-detail/index.vue @@ -4,7 +4,7 @@
-
账号信息
+
基础信息
@@ -17,20 +17,14 @@ alt="" />
- -
-
-
-
-
-
个人信息
-
-
-
-
-
- - + + +
@@ -39,7 +33,7 @@ - diff --git a/src/page/main/authority/user/add/index.vue b/src/page/main/authority/user/add/index.vue index d6a6bfb3bb174fa1bcb0487715701000d408fae2..391e4c0b49f9c07909ac31214d33a0137442f92b 100644 --- a/src/page/main/authority/user/add/index.vue +++ b/src/page/main/authority/user/add/index.vue @@ -26,6 +26,7 @@ import { useRoute, useRouter } from "vue-router"; import systemForm from "./system-form.vue"; import { reactive, ref, onBeforeUnmount, onMounted } from "vue"; import axios from "@/request/http.js"; +import CryptoJS from "crypto-js"; import { ElMessage } from "element-plus"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; const route = useRoute(); @@ -57,42 +58,51 @@ const getSystemFormData = (data) => { }; //提交表单 const submit = () => { - if (route.query.id) { - let params = { - ...formData, - logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : "", - }; - axios.put(`/v1/api/user/${route.query.id}`, params).then((res) => { - if (res.data.code == 200) { - ElMessage.success(res.data.msg); - cancel(); - } else { - ElMessage.error(res.data.data); - } - }); - } else { - let params = { - ...formData, - logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : "", - password: CryptoJS.AES.encrypt(formData.password, "swuE9cmCZQwrkYRV").toString(), - }; - axios.put(`/v1/api/user/add`, params).then((res) => { - if (res.data.code == 200) { - ElMessage.success(res.data.msg); - cancel(); - } else { - ElMessage.error(res.data.data); - } - }); - } + systemFormRef.value.validateForm().then((res) => { + if (!res) return; + if (route.query.id) { + let params = { + ...systemFormRef.value.systemForm, + logo: + systemFormRef.value.systemForm.logo && systemFormRef.value.systemForm.logo.length > 0 + ? systemFormRef.value.systemForm.logo[0].url + : "", + }; + axios.put(`/v1/api/user/${route.query.id}`, params).then((res) => { + if (res.data.code == 200) { + ElMessage.success(res.data.msg); + cancel(); + } else { + ElMessage.error(res.data.data); + } + }); + } else { + let params = { + ...systemFormRef.value.systemForm, + logo: + systemFormRef.value.systemForm.logo && systemFormRef.value.systemForm.logo.length > 0 + ? systemFormRef.value.systemForm.logo[0].url + : "", + password: CryptoJS.AES.encrypt(systemFormRef.value.systemForm.password, "swuE9cmCZQwrkYRV").toString(), + }; + delete params.confirm_password; + axios.post(`/v1/api/user/add`, params).then((res) => { + if (res.data.code == 200) { + ElMessage.success(res.data.msg); + cancel(); + } else { + ElMessage.error(res.data.data); + } + }); + } + }); }; //取消 const cancel = () => { - // router.go(-1); router.push({ path: "/authority/user", query: { - id: formData.organization_id, + organization_id: systemFormRef.value.systemForm.organization_id, }, }); }; @@ -103,18 +113,12 @@ const getDetail = () => { const form = res.data.data; systemFormRef.value.setForm({ organization_id: form.organization_id, - system_role_id: form.system_role_id, + select_role: form.system_role, logo: form.logo ? [{ url: form.logo }] : [], - business_code: form.business_code, - business_name: form.business_name, - business_desc: form.business_desc, + name: form.name, system_account: form.system_account, - system_phone: form.system_phone, - access_address: form.access_address, - develop_id: form.develop_id, + phone: form.phone, state: form.state, - appid: form.app_id, - appsecret: form.app_secret, }); } else { ElMessage.error(res.data.data); diff --git a/src/page/main/authority/user/add/system-form.vue b/src/page/main/authority/user/add/system-form.vue index aad807967746aa87521f62d6077c895f1ff844a3..28fd0aa6af528b6e79dadc29544a8fe5b8e872f1 100644 --- a/src/page/main/authority/user/add/system-form.vue +++ b/src/page/main/authority/user/add/system-form.vue @@ -15,37 +15,10 @@ :disabled="formType" style="width: 100%" /> - - + + - - - - - - - - - - -
- - - - 重置 -
-
- + - - - - - - + + + - - + + - + - + - - - - - - - - @@ -119,7 +61,7 @@ diff --git a/src/page/main/authority/user/index.vue b/src/page/main/authority/user/index.vue index 53fd3104c76918f744c0de19ed4143128ee17f06..c05bcaed892c32cb2f1c18a23587628e1481a0da 100644 --- a/src/page/main/authority/user/index.vue +++ b/src/page/main/authority/user/index.vue @@ -55,11 +55,6 @@ :stripe="true" :select="true" @selectAc="selectRows"> -