yjryu / KERIS star
Stormen123 2023-11-09
231109 김성훈 PICK 취소 수정
@4a4393a4556164930ae91a1c75b3cf2c12ee00c6
client/views/pages/user/networking/Matching.vue
--- client/views/pages/user/networking/Matching.vue
+++ client/views/pages/user/networking/Matching.vue
@@ -94,6 +94,7 @@
                 searchType: null,
                 searchText: null,
             },
+            userCompanyId: null,
             bestList:[],
             companyList:[],
             keyword:[],
@@ -121,6 +122,7 @@
                 vm.companyListCount = response.data.companySelectListCount;
                 vm.companyIdx = vm.companyListCount - (vm.companyListSearch.currentPage - 1) * vm.companyListSearch.perPage;
                 vm.companyTop6List = response.data.companyTop6;
+                vm.userCompanyId = response.data.userCompanyId;
 
                  for( let i = 0; i < vm.companyList.length; i++) {
                     vm.keyword = vm.companyList[i].keyword.split('#',4);
@@ -136,9 +138,15 @@
         },
 
         pickModal: function(item) {
-            if(confirm(item.company_nm + "에 PICK 신청을 하시겠습니까?")) {
+        
+            if(this.userCompanyId != item.company_id) {
+                if(confirm(item.company_nm + "에 PICK 신청을 하시겠습니까?")) {
                 this.pick(item)
+                }
+            } else {
+                alert("자신의 기업에는 PICK을 할 수 없습니다.")
             }
+            
         },
 
         pickCancelModal: function(item) {
@@ -149,7 +157,7 @@
 
         pick: function(item) {
             const vm = this;
-
+            
             axios({
                 url: '/matching/pick.json',
                 method: 'post',
@@ -177,13 +185,8 @@
                 },
                 data: item
             }).then(function(response) {
-                if(response.data > 0) {
-                    alert("PICK 취소 완료 되었습니다.")
-                    vm.companySelectList();
-                } else {
-                    alert("이미 취소된 PICK입니다.")
-                }
-                
+               alert(response.data);
+               vm.companySelectList();
             }).catch(function(error) {
                 console.log('error - ', error)
                 alert('기업 목록 조회 오류, 관리자에게 문의하세요.');
Add a comment
List