From 5d9dba7601c1c0f50c835afd1b805c9da41bd0cb Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 금, 07 1월 2022 13:38:58 +0900
Subject: [PATCH] 연락처 입력시 하이픈 X 조회할때만 하이픈 구분 (지역, 핸드폰 번호)

---
 src/main/webapp/scripts/app/user/userModify.controller.js |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/scripts/app/user/userModify.controller.js b/src/main/webapp/scripts/app/user/userModify.controller.js
index 6647595..1387840 100644
--- a/src/main/webapp/scripts/app/user/userModify.controller.js
+++ b/src/main/webapp/scripts/app/user/userModify.controller.js
@@ -27,8 +27,10 @@
                         name: "",
                         phone: "",
                         reservationNotifyTime : "", //  �씠硫붿씪 �븣由� �떆媛�
+                        realtimeNotify : "", // �씠硫붿씪 �떎�떆媛�
                         profileImage : null, //   �뾽濡쒕뱶�븯�뒗 �봽濡쒗븘
-                        profileImageName : null  //  �봽濡쒗븘 紐�
+                        profileImageName : null,  //  �봽濡쒗븘 紐�
+                        projectManagerYN : false
                     }
                 };
 
@@ -83,7 +85,12 @@
                             $scope.vm.form.name = result.data.data.name;
                             $scope.vm.form.account = result.data.data.account;
                             $scope.vm.form.phone = result.data.data.phone;
-                            $scope.vm.form.reservationNotifyTime = result.data.data.reservationNotifyTime;
+                            $scope.vm.form.projectManagerYN = result.data.data.projectManagerYN;
+                            if(result.data.data.reservationNotifyTime === "realTime"){
+                                $scope.vm.form.realtimeNotify = true;
+                            }else{
+                                $scope.vm.form.reservationNotifyTime = "";
+                            }
                         }
                         else {
                             SweetAlert.swal($filter("translate")("users.failedToSelectUserDetail"), result.data.message.message, "error"); // "�궗�슜�옄 �긽�꽭 �젙蹂� 議고쉶 �떎�뙣"
@@ -120,6 +127,11 @@
                     content.name = $rootScope.preventXss(content.name);
                     content.phone = $rootScope.preventXss(content.phone);
                     content.profile = $scope.vm.form.profileImageName;
+                    if(content.realtimeNotify){
+                        content.reservationNotifyTime = "realTime";
+                    }else {
+                        content.reservationNotifyTime = $scope.vm.form.reservationNotifyTime;
+                    }
 
                     User.modify({
                             method : "POST",
@@ -136,6 +148,11 @@
                                     if (result.message.status === "success") {
                                         if (result.data != null) {
                                             $rootScope.user = result.data;  //  �쟾�뿭�쑝濡� �궗�슜�븯�뒗 濡쒓렇�씤 �궗�슜�옄 �젙蹂�.
+                                            // �쟾�솕踰덊샇 �븯�씠�뵂 異붽��븯�뿬 議고쉶
+                                            $scope.vm.phone = $rootScope.user.phone;
+                                            let hyphen = $scope.vm.phone.trim();
+                                            let phone = hyphen.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/,"$1-$2-$3");
+                                            $rootScope.user.phone = phone;
                                         }
                                         else {
                                             throw {message: $filter("translate")("users.notExistUserSession")}; // "�궗�슜�옄 �꽭�뀡�씠 議댁옱�븯吏� �븡�뒿�땲�떎."

--
Gitblit v1.8.0