yjryu / KERIS star
Stormen123 2023-11-12
231112 김성훈 매칭시스템 개발 진행중
@31e8671e81b7d07e4ea78f3778b333392945c30c
client/views/pages/user/mypage/MatchingManager.vue
--- client/views/pages/user/mypage/MatchingManager.vue
+++ client/views/pages/user/mypage/MatchingManager.vue
@@ -22,12 +22,12 @@
                 <div class="matching-box-button">
                     <div @click="selectedBox = 'inbox'">
 
-                        <input type="radio" id="inbox" value="inbox" v-model="selectedBox">
+                        <input type="radio" id="inbox" value="inbox" v-model="selectedBox" @click="pickView()">
                         <label for="inbox">Pick</label>
                     </div>
                     <div @click="selectedBox = 'outbox'">
 
-                        <input type="radio" id="outbox" value="outbox" v-model="selectedBox">
+                        <input type="radio" id="outbox" value="outbox" v-model="selectedBox" @click="matchingView()">
                         <label for="outbox">Macthing</label>
                     </div>
 
@@ -37,64 +37,22 @@
             <div>
                 <!-- 상세 1-->
                 <section>
-                    <div v-show="selectedBox === 'inbox'" class="inbox">
+                    <div v-if="selectedBox === 'inbox'" class="inbox">
                         <section class="matching-section-box">
 
                             <div>
                                 <h2>수신함</h2>
                             </div>
                             <div class="inbox-sub">
-                                <div class="inbox-img inbox-img-blur">
-                                    <h4>기업명</h4>
+                                <div class="inbox-img inbox-img-blur" v-for="(item, idx) in pickReceptionList" :key="idx">
+                                    <h4>{{ item.company_nm }}</h4>
 
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
+                                    <img :src="'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm" alt="명함박스">
                                     <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
+                                        <button @click="pickModal(item)">수락</button>
+                                        <button @click="pickRefusalModal(item)">거절</button>
                                     </div>
                                 </div>
-                                <div class="inbox-img inbox-img-blur">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-                                <div class="inbox-img inbox-img-blur">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-                                <div class="inbox-img inbox-img-blur">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-
                             </div>
                         </section>
                         <section class="matching-section-box">
@@ -103,29 +61,14 @@
                                 <h2>발신함</h2>
                             </div>
                             <div class="inbox-sub">
-                                <div class="inbox-img">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
+                                <div class="inbox-img" v-for="(item, idx) in pickDispatchList" :key="idx">
+                                    <h4>{{ item.company_nm }}</h4>
+                                    <img :src="'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm" alt="명함박스">
                                     <div>
-
-
                                         <button class="inbox-btn-gray">응답대기중</button>
-                                        <button class="red-btn">취소</button>
-
+                                        <button class="red-btn" @click="pickCancelModal(item)">취소</button>
                                     </div>
                                 </div>
-                                <div class="inbox-img">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button class="inbox-btn-gray">응답대기중</button>
-                                        <button class="red-btn">취소</button>
-
-                                    </div>
-
-                                </div>
-
                             </div>
                         </section>
 
@@ -134,97 +77,38 @@
                             <h2>완료</h2>
 
                             <div class="inbox-sub">
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
+                                <div class="inbox-img" v-for="(item, idx) in pickCompleteList" :key="idx">
+                                    <h4>{{ item.company_nm }}</h4>
+                                    <img :src="'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm" alt="명함박스">
                                     <div>
-
-                                        <button>매칭 신청</button>
-                                        <button @click="isVisible = true">명함 보기</button>
-
-                                    </div>
-                                </div>
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/inbox-img.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>매칭 신청</button>
-                                        <button @click="isVisible = true">명함 보기</button>
-
-
+                                        <button v-if="item.matching_yn" class="inbox-btn-gray">신청 완료</button>
+                                        <button v-else @click="matchingModal(item)">매칭 신청</button>
+                                        <button @click="cardView(item)">명함 보기</button>
                                     </div>
                                 </div>
                             </div>
                         </section>
                     </div>
-
-
                 </section>
-
-
 
                 <!-- 상세2 -->
                 <section>
 
-                    <div v-show="selectedBox === 'outbox'">
+                    <div v-if="selectedBox === 'outbox'">
                         <section class="matching-section-box">
 
                             <div>
                                 <h2>수신함</h2>
                             </div>
                             <div class="inbox-sub">
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
+                                <div class="inbox-img" v-for="(item, idx) in matchingReceptionList" :key="idx">
+                                    <h4>{{ item.company_nm }}</h4>
+                                    <img :src="'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm" alt="명함박스">
                                     <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
+                                        <button @click="matchingModal(item)">수락</button>
+                                        <button @click="matchingRefusalModal(item)">거절</button>
                                     </div>
                                 </div>
-                                <div class="inbox-img  ">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button>수락</button>
-                                        <button>거절</button>
-
-
-                                    </div>
-
-                                </div>
-
                             </div>
                         </section>
                         <section class="matching-section-box">
@@ -233,29 +117,14 @@
                                 <h2>발신함</h2>
                             </div>
                             <div class="inbox-sub">
-                                <div class="inbox-img ">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
+                                <div class="inbox-img" v-for="(item, idx) in matchingDispatchList" :key="idx">
+                                    <h4>{{ item.company_nm }}</h4>
+                                    <img :src="'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm" alt="명함박스">
                                     <div>
-
-
                                         <button class="inbox-btn-gray">응답대기중</button>
-                                        <button class="red-btn">취소</button>
-
+                                        <button class="red-btn" @click="matchingCancelModal(item)">취소</button>
                                     </div>
                                 </div>
-                                <div class="inbox-img">
-                                    <h4>기업명</h4>
-                                    <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
-                                    <div>
-
-                                        <button class="inbox-btn-gray">응답대기중</button>
-                                        <button class="red-btn">취소</button>
-
-                                    </div>
-
-                                </div>
-
                             </div>
                         </section>
 
@@ -279,30 +148,16 @@
                                     <h4>기업명</h4>
                                     <img src="../../../../resources/jpg/zigaksa.jpg" alt="명함박스">
                                     <div>
-
                                         <button>매칭 신청</button>
                                         <button>기업 정보</button>
-
                                     </div>
                                 </div>
                             </div>
                         </section>
                     </div>
-
-
                 </section>
-
-
-
-
             </div>
-
-
-
-
         </div>
-
-
     </div>
     <!-- ------------------------------------------------------------------------------------------------------------------- -->
 
@@ -310,10 +165,10 @@
     <div class="matchingmodal" v-if="isVisible">
         <div class="matching-modal-box">
             <div>
-                <h1>기업명</h1>
+                <h1>{{ company_nm }}</h1>
             </div>
-            <div>
-                <img src="../../../../resources/jpg/inbox-img.jpg" alt="">
+            <div call= "inbox-img">
+                <img :src="cardFullPath" alt="명함박스">
             </div>
             <div>
                 <button @click="hideDiv">확인</button>
@@ -322,17 +177,369 @@
     </div>
 </template>
 <script>
+import axios from 'axios';
+import COMMON_UTIL from '../../../../resources/js/commonUtil.js';
+
 export default {
     data() {
         return {
+            pickReceptionListSearch: {
+                currentPage: 1,
+                perPage: 10,
+                searchType: null,
+                searchText: null,
+            },
+            
+            pickDispatchListSearch: {
+                currentPage: 1,
+                perPage: 10,
+                searchType: null,
+                searchText: null,
+            },
+
+            pickCompleteListSearch: {
+                currentPage: 1,
+                perPage: 10,
+                searchType: null,
+                searchText: null,
+            },
+
+            matchingReceptionListSearch: {
+                currentPage: 1,
+                perPage: 10,
+                searchType: null,
+                searchText: null,
+            },
+
+            matchingDispatchListSearch: {
+                currentPage: 1,
+                perPage: 10,
+                searchType: null,
+                searchText: null,
+            },
+
+            // PICK 수신함
+            pickReceptionList: [],
+            pickReceptionListCount: 0,
+            pickReceptionIdx: 0,
+
+            // PICK 발신함
+            pickDispatchList: [],
+            pickDispatchListCount: 0,
+            pickDispatchIdx: 0,
+
+            // PICK 완료 리스트
+            pickCompleteList: [],
+            pickCompleteListCount: 0,
+            pickCompleteIdx: 0,
+            
+            // MATCHING 수신함
+            matchingReceptionList: [],
+            matchingReceptionListCount: 0,
+            matchingReceptionIdx: 0,
+
+            // MATCHING 발신함
+            matchingDispatchList: [],
+            matchingDispatchListCount: 0,
+            matchingDispatchIdx: 0,
+
+            // MATCHING 완료 리스트
+            matchingCompleteList: [],
+            matchingCompleteListCount: 0,
+            matchingCompleteIdx: 0,
+
             selectedBox: 'inbox',
+
+            //명함보기 모달창
             isVisible: false,
+            company_nm: null,
+            cardFullPath: null,
         }
     },
     methods: {
+        pickView: function() {
+            this.selectedBox = 'inbox';
+            this.pickReceptionSelectList();
+            this.pickDispatchSelectList();
+            this.pickCompleteSelectList();
+        },
+
+        matchingView: function() {
+            this.selectedBox = 'outbox';
+            this.matchingReceptionSelectList();
+            this.matchingDispatchSelectList();
+        },
+
+        pickReceptionSelectList: function() {
+            const vm = this;
+            
+            axios({
+                url: '/myPage/pickReceptionList.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.pickReceptionListSearch
+            }).then(function(response) {
+                vm.pickReceptionList = response.data;
+                // vm.pickReceptionListCount = vm.pickReceptionList;
+                // vm.pickReceptionIdx = vm.pickReceptionList.length - (vm.pickReceptionListSearch.currentPage - 1) * vm.pickReceptionListSearch.perPage;
+                
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('수신함 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickDispatchSelectList: function() {
+            const vm = this;
+            
+            axios({
+                url: '/myPage/pickDispatchList.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.pickDispatchListSearch
+            }).then(function(response) {
+                vm.pickDispatchList = response.data;
+                // vm.pickReceptionListCount = vm.pickReceptionList;
+                // vm.pickReceptionIdx = vm.pickReceptionList.length - (vm.pickReceptionListSearch.currentPage - 1) * vm.pickReceptionListSearch.perPage;
+                
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('발신함 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickCompleteSelectList: function() {
+            const vm = this;
+            
+            axios({
+                url: '/myPage/pickCompleteList.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.pickCompleteListSearch
+            }).then(function(response) {
+                vm.pickCompleteList = response.data;
+                // vm.pickReceptionListCount = vm.pickReceptionList;
+                // vm.pickReceptionIdx = vm.pickReceptionList.length - (vm.pickReceptionListSearch.currentPage - 1) * vm.pickReceptionListSearch.perPage;
+                
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('발신함 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickModal: function(item) {
+        
+            if(confirm(item.company_nm + "의 PICK 신청을 수락하시겠습니까?")) {
+            this.pick(item)
+            }
+        },
+
+        pickCancelModal: function(item) {
+            if(confirm(item.company_nm + "에게 신청한 PICK을 취소 하시겠습니까?")) {
+                this.pickCancel(item)
+            }
+        },
+
+        pickRefusalModal: function(item) {
+            if(confirm(item.company_nm + "의 PICK을 거부 하시겠습니까?")) {
+                this.pickRefusal(item)
+            }
+        },
+
+        pick: function(item) {
+            const vm = this;
+            
+            axios({
+                url: '/matching/pick.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+                alert(response.data);
+                vm.pickView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('PICK 수락 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickCancel: function(item) {
+            const vm = this;
+
+            axios({
+                url: '/matching/pickCancel.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+               alert(response.data);
+               vm.pickView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('PICK 취소 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        pickRefusal: function(item) {
+            const vm = this;
+
+            axios({
+                url: '/matching/pickRefusal.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+                alert(response.data);
+                vm.pickView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('PICK 거부 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        cardView: function(item) {
+            this.company_nm = item.company_nm;
+            this.cardFullPath = 'http://localhost:8080'+item.file_path +'\\' + item.file_nm + '.' + item.file_extn_nm;
+            this.isVisible = true
+        },
+
+        matchingModal: function(item) {
+        
+            if(confirm(item.company_nm + "에게 MATCHING 신청을 하시겠습니까?")) {
+            this.matching(item)
+            }
+        },
+
+        matchingCancelModal: function(item) {
+            if(confirm(item.company_nm + "에게 신청한 MATCHING을 취소 하시겠습니까?")) {
+                this.matchingCancel(item)
+            }
+        },
+
+        matchingRefusalModal: function(item) {
+            if(confirm(item.company_nm + "의 MATCHING을 거부 하시겠습니까?")) {
+                this.matchingRefusal(item)
+            }
+        },
+
+        matching: function(item) {
+            const vm = this;
+            
+            axios({
+                url: '/matching/matching.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+                alert(response.data);
+                vm.matchingView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('PICK 거부 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        matchingReceptionSelectList: function() {
+            const vm = this;
+            
+            axios({
+                url: '/myPage/matchingReceptionList.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.matchingReceptionListSearch
+            }).then(function(response) {
+                vm.matchingReceptionList = response.data;
+                // vm.pickReceptionListCount = vm.pickReceptionList;
+                // vm.pickReceptionIdx = vm.pickReceptionList.length - (vm.pickReceptionListSearch.currentPage - 1) * vm.pickReceptionListSearch.perPage;
+                
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('수신함 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        matchingDispatchSelectList: function() {
+            const vm = this;
+            
+            axios({
+                url: '/myPage/matchingDispatchList.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: vm.matchingDispatchListSearch
+            }).then(function(response) {
+                vm.matchingDispatchList = response.data;
+                // vm.pickReceptionListCount = vm.pickReceptionList;
+                // vm.pickReceptionIdx = vm.pickReceptionList.length - (vm.pickReceptionListSearch.currentPage - 1) * vm.pickReceptionListSearch.perPage;
+                
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('발신함 목록 조회 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        matchingCancel: function(item) {
+            const vm = this;
+
+            axios({
+                url: '/matching/matchingCancel.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+               alert(response.data);
+               vm.matchingView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('MATCHING 취소 오류, 관리자에게 문의하세요.');
+            })
+        },
+
+        matchingRefusal: function(item) {
+            const vm = this;
+
+            axios({
+                url: '/matching/matchingRefusal.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: item
+            }).then(function(response) {
+                alert(response.data);
+                vm.matchingView();
+            }).catch(function(error) {
+                console.log('error - ', error)
+                alert('PICK 거부 오류, 관리자에게 문의하세요.');
+            })
+        },
+
         hideDiv() {
             this.isVisible = false;
         }
+    },
+    mounted() {
+        console.log('MatchingManager mounted');
+        this.pickView();
     }
 }
 </script>
client/views/pages/user/networking/Matching.vue
--- client/views/pages/user/networking/Matching.vue
+++ client/views/pages/user/networking/Matching.vue
@@ -140,7 +140,7 @@
         pickModal: function(item) {
         
             if(this.userCompanyId != item.company_id) {
-                if(confirm(item.company_nm + "에 PICK 신청을 하시겠습니까?")) {
+                if(confirm(item.company_nm + "에게 PICK 신청을 하시겠습니까?")) {
                 this.pick(item)
                 }
             } else {
@@ -170,7 +170,7 @@
                 vm.companySelectList();
             }).catch(function(error) {
                 console.log('error - ', error)
-                alert('기업 목록 조회 오류, 관리자에게 문의하세요.');
+                alert(' PICK 오류, 관리자에게 문의하세요.');
             })
         },
 
@@ -189,7 +189,7 @@
                vm.companySelectList();
             }).catch(function(error) {
                 console.log('error - ', error)
-                alert('기업 목록 조회 오류, 관리자에게 문의하세요.');
+                alert('PICK 취소 오류, 관리자에게 문의하세요.');
             })
         },
 
@@ -206,7 +206,7 @@
             }).then(function (response) {
                 vm.$router.push({ path: '/MatchingOne.page', query: {'company_id': item.company_id}});
             }).catch(function (error) {
-                console.log("서버오류");
+                console.log("기업 상세조회 오류, 관리자에게 문의하세요.");
             })
         }
     },
Add a comment
List