yjryu / KERIS star
Stormen123 2023-11-09
231109 김성훈 기업홍보관 기업상세보기 PICK,PICK취소 추가
@62ce95c40645c7aa0cd5c0e6392e42744066f91b
client/views/pages/user/networking/MatchingOne.vue
--- client/views/pages/user/networking/MatchingOne.vue
+++ client/views/pages/user/networking/MatchingOne.vue
@@ -47,7 +47,8 @@
                 <div class="mat-sec2-end">
                     <p>
 
-                        <i class="fa-regular fa-heart fa-lg" style="color: #3f87f7;"></i>
+                        <i v-if="!company.pick_yn" class="fa-regular fa-heart fa-lg" style="color: #3f87f7;" @click="pickConfirm()"></i>
+                        <i v-else class="fa fa-heart fa-lg" style="color: #d41515;" @click="pickCancelModal()"></i>
                         <span id="pickBtn" @click="openPickListMadal">{{ company.company_pick_cnt }}개</span>의 기업이 pick했습니다!
                     </p>
                     <p><span>조회수</span>{{ company.view_cnt }}</p>
@@ -75,7 +76,7 @@
             </td>
             <td>
                 <button v-if="item.pick_yn" disabled :style="{ backgroundColor: '#ccc' }">완료</button>
-                <button v-else :style="{ backgroundColor: '#3f87f7' }" @click="pick(item)"> 수락</button>
+                <button v-else :style="{ backgroundColor: '#3f87f7' }" @click="modalPick(item)"> 수락</button>
             </td>
         </table>
     </div>
@@ -108,6 +109,8 @@
                 file_path: null,
                 file_nm: null,
                 file_extn_nm: null,
+                pick_yn: null,
+                userCompanyId:null
             },
 
             pickSelectList:[],
@@ -223,7 +226,63 @@
             }
         },
 
-        pick: function(item) {
+        pickConfirm: function() {
+        
+        if(this.company.userCompanyId != this.company.company_id) {
+            if(confirm(this.company.company_nm + "에 PICK 신청을 하시겠습니까?")) {
+            this.pick()
+            }
+        } else {
+            alert("자신의 기업에는 PICK을 할 수 없습니다.")
+        }
+        
+        },
+
+        pickCancelModal: function() {
+            if(confirm(this.company.company_nm + "에게 신청한 PICK을 취소 하시겠습니까?")) {
+                this.pickCancel()
+            }
+        },
+
+        pick: function() {
+            const vm = this;
+            
+            axios({
+                url: '/matching/pick.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.company
+            }).then(function(response) {
+                alert(response.data);
+                vm.companySelectOne();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('기업 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickCancel: function() {
+            const vm = this;
+
+            axios({
+                url: '/matching/pickCancel.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.company
+            }).then(function(response) {
+            alert(response.data);
+            vm.companySelectOne();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('기업 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        modalPick: function(item) {
             const vm = this;
 
             axios({
Add a comment
List