ads367 / AJIN-ERP star
류윤주 류윤주 2024-03-14
240314 이세현 공통코드 목록 조회
@e5c1697353e0a057965ae29e1cc9ef103c1a4f6c
client/views/pages/AccountingManagement/BaselineInformation/Bi001.vue
--- client/views/pages/AccountingManagement/BaselineInformation/Bi001.vue
+++ client/views/pages/AccountingManagement/BaselineInformation/Bi001.vue
@@ -53,14 +53,14 @@
                                     </tr>
                                 </thead>
                                 <tbody class="table-border">
-                                      <tr v-for="codeNum in filteredCodeList" :key="codeNum.id">
+                                      <!-- <tr v-for="codeNum in filteredCodeList" :key="codeNum.id">
                                         <td :class="{ 'selected': selectedId === codeNum.id }">{{ codeNum.pathNum }}
                                         </td>
                                         <td @click="clickCodeName(codeNum.id)"
                                             :class="{ 'selected': selectedId === codeNum.id }" class="wrap-text">
                                             {{ codeNum.pathName }}
                                         </td>
-                                    </tr>
+                                    </tr> -->
                                     <tr v-for="(commonCode, idx) in commonCodeList" :key="idx">
                                         <td :class="{ 'selected': selectedId === idx }">{{ commonCode.rcodex }}
                                         </td>
@@ -97,7 +97,7 @@
                                     <!-- <col style="width: 12%;"> -->
 
                                 </colgroup>
-                                <tbody v-for="(codeInput, id) in filteredCodeBox" :key="id" class="filter-table">
+                                <!-- <tbody v-for="(codeInput, id) in filteredCodeBox" :key="id" class="filter-table">
                                     <tr>
                                         <th>분류코드</th>
                                         <td><input type="text"></td>
@@ -153,42 +153,52 @@
                                             </td>
                                         </tr>
                                     </template>
-                                </tbody>
-                                <tbody v-for="(category , id) in codeListByCommonCode" :key="id" class="filter-table">
+                                </tbody> -->
+                                <tbody class="filter-table">
                                     <tr>
                                         <th>분류코드</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" :value="commonCodeOne.gbncod"></td>
                                         <th>분류명</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" :value="bunnam"></td>
                                         <th>코드</th>
-                                        <td><input type="text" class="input-wrap"></td>
+                                        <td><input type="text" class="input-wrap"  style="width: 100%;"></td>
                                         <td colspan="2">
                                             <th >정렬순서</th>
-                                            <td><input type="text" class="input-wrap" style="width: 100%;"></td>
+                                            <td><input type="text" class="input-wrap" style="width: 100%;" :value="commonCodeOne.ordsor"></td>
                                             <th>사용여부</th>
-                                            <td><input type="checkbox" class="ui-checkbox"></td>
+                                            <td><input type="checkbox" class="ui-checkbox" v-model="isChecked"></td>
                                         </td>
+                                    </tr>
+                                    <tr>
+                                        <th>코드명</th>
+                                        <td><input type="text" v-model="commonCodeOne.nmcodx"></td>
+                                        <th>코드약명</th>
+                                        <td><input type="text" v-model="commonCodeOne.shncod"></td>
                                         <th>{{ category.rref1x == null ? '관리항목1' : category.rref1x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref1x"></td>
                                         <th>{{ category.rref2x == null ? '관리항목2' : category.rref2x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref2x"></td>
+                                    </tr>
+                                    <tr>
                                         <th>{{ category.rref3x == null ? '관리항목3' : category.rref3x }}</th>
-                                        <td><input type="text" style="width: 100%;"></td>
+                                        <td><input type="text" style="width: 100%;" v-model="commonCodeOne.rref3x"></td>
                                         <th>{{ category.rref4x == null ? '관리항목4' : category.rref4x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref4x"></td>
                                         <th>{{ category.rref5x == null ? '관리항목5' : category.rref5x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref5x"></td>
                                         <th>{{ category.rref6x == null ? '관리항목6' : category.rref6x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref6x"></td>
+                                    </tr>
+                                    <tr>
                                         <th>{{ category.rref7x == null ? '관리항목7' : category.rref7x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref7x"></td>
                                         <th>{{ category.rref8x == null ? '관리항목8' : category.rref8x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref8x"></td>
                                         <th>{{ category.rref9x == null ? '관리항목9' : category.rref9x }}</th>
-                                        <td><input type="text"></td>
+                                        <td><input type="text" v-model="commonCodeOne.rref9x"></td>
                                         <th>{{ category.rref10 == null ? '관리항목10' : category.rref10 }}</th>
-                                        <td><input type="text"></td>
-                                        <td v-if="category.rref10" class="flex " style="flex-wrap: nowrap;">
+                                        <td><input type="text" v-model="commonCodeOne.rref10"></td>
+                                        <td v-if="category.rcodex === '003'" class="flex " style="flex-wrap: nowrap;">
                                             <td class="mr1" style="width:80%;">
                                                 <input type="text" name="" id="">
                                             </td>
@@ -196,36 +206,7 @@
                                                 <button @click="openModal" class="blue-btn search-btn"></button>
                                             </td>
                                         </td>
-                                    </tr> 
-                                     <template v-if="showClass1">
-                                        <tr>
-                                            <th>{{ codeInput.pathName7 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-                                            <th>{{ codeInput.pathName8 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-                                            <th>{{ codeInput.pathName9 }}</th>
-                                            <td><input type="text" name="" id="" ></td>
-                                            <th>{{ codeInput.pathName10 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-
-                                        </tr>
-                                    </template>
-                                    <template v-else>
-                                        <tr>
-                                            <th>{{ codeInput.pathName7 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-                                            <th>{{ codeInput.pathName8 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-                                            <th>{{ codeInput.pathName9 }}</th>
-                                            <td><input type="text" name="" id=""></td>
-                                            <th>{{ codeInput.pathName10 }}</th>
-                                            <td class="flex " style="flex-wrap: nowrap;">
-                                            <td class="mr1" style="width:80%;"><input type="text" name="" id=""></td>
-                                            <td style="width:20%;"> <button @click="openModal" class="blue-btn search-btn"></button>
-                                            </td>
-                                            </td>
-                                        </tr>
-                                    </template>
+                                    </tr>
                                 </tbody>
                             </table>
 
@@ -352,7 +333,7 @@
 
 
                                 </colgroup>
-                                <thead class="list-table">
+                                <!-- <thead class="list-table">
                                     <tr v-for="(codeInput, id) in filteredCodeBox" :key="id"
                                         style="background-color: var(--tableblue);">
                                         <th>코드</th>
@@ -376,8 +357,27 @@
 
 
                                     </tr>
+                                </thead> -->
+                                <thead class="list-table">
+                                    <tr style="background-color: var(--tableblue);">
+                                        <th>코드</th>
+                                        <th>코드명칭</th>
+                                        <th>코드약칭</th>
+                                        <th>정렬순서</th>
+                                        <th>사용</th>
+                                        <th class="wrap-text">{{ category.rref1x == null ? '관리항목1' : category.rref1x }}</th>
+                                        <th>{{ category.rref2x == null ? '관리항목2' : category.rref2x }}</th>
+                                        <th>{{ category.rref3x == null ? '관리항목3' : category.rref3x }}</th>
+                                        <th>{{ category.rref4x == null ? '관리항목4' : category.rref4x }}</th>
+                                        <th>{{ category.rref5x == null ? '관리항목5' : category.rref5x }}</th>
+                                        <th>{{ category.rref6x == null ? '관리항목6' : category.rref6x }}</th>
+                                        <th>{{ category.rref7x == null ? '관리항목7' : category.rref7x }}</th>
+                                        <th>{{ category.rref8x == null ? '관리항목8' : category.rref8x }}</th>
+                                        <th>{{ category.rref9x == null ? '관리항목9' : category.rref9x }}</th>
+                                        <th>{{ category.rref10 == null ? '관리항목10' : category.rref10 }}</th>
+                                    </tr>
                                 </thead>
-                                <tbody style="height: 100%; ">
+                                <!-- <tbody style="height: 100%; ">
                                     <tr v-for="(codePath) in listName">
                                         <td>{{ codePath.code }}</td>
                                         <td>{{ codePath.name }}</td>
@@ -397,6 +397,29 @@
                                         <td>{{ codePath.list11 }}</td>
                                         <td>{{ codePath.list12 }}</td>
 
+                                    </tr>
+
+                                    <tr v-if="postList === 0">
+                                        <td colspan="5" class="no-list">검색조건에 해당하는 데이터가 없습니다.</td>
+                                    </tr>
+                                </tbody> -->
+                                <tbody style="height: 100%; ">
+                                    <tr v-for="(item,idx) in codeListByCommonCode" :key="idx" @click="commonCodeDetail(item)">
+                                        <td>{{ item.rcodex }}</td>
+                                        <td>{{ item.nmcodx }}</td>
+                                        <td>{{ item.shncod }}</td>
+                                        <td>{{ item.ordsor }}</td>
+                                        <td><input type="checkbox" checked name="" id="" class="ui-checkbox"></td>
+                                        <td>{{ item.rref1x }}</td>
+                                        <td>{{ item.rref2x }}</td>
+                                        <td>{{ item.rref3x }}</td>
+                                        <td>{{ item.rref4x }}</td>
+                                        <td>{{ item.rref5x }}</td>
+                                        <td>{{ item.rref6x }}</td>
+                                        <td>{{ item.rref7x }}</td>
+                                        <td>{{ item.rref8x }}</td>
+                                        <td>{{ item.rref9x }}</td>
+                                        <td>{{ item.rref10 }}</td>
                                     </tr>
 
                                     <tr v-if="postList === 0">
@@ -521,10 +544,41 @@
                 // 국책과제 카드
                 { id: 14, pathName1: "프로젝트 코드", pathName2: "사업장구분", pathName3: "관리항목3", pathName4: "관리항목4", pathName5: "관리항목5", pathName6: "관리항목6", pathName7: "관리항목7", pathName8: "관리항목8", pathName9: "관리항목9", pathName10: "관리항목10", pathName11: "관리항목11", pathName12: "관리항목12" },
             ],
-            // commonCodeList: [],
-            // commonCodeListCount: null,
-            // codeListByCommonCode: [],
-            // codeListCountByCommonCode: null,
+            commonCodeList: [],
+            commonCodeListCount: null,
+            codeListByCommonCode: [],
+            codeListCountByCommonCode: null,
+            category : {
+                rref1x: null,
+                rref2x: null,
+                rref3x: null,
+                rref4x: null,
+                rref5x: null,
+                rref6x: null,
+                rref7x: null,
+                rref8x: null,
+                rref9x: null,
+                rref10: null,
+            },
+            commonCodeOne: {    
+                gbncod: null,
+                rcodex: null,
+                nmcodx: null,
+                shncod: null,
+                ordsor: null,
+                saygub: null,
+                rref1x: null,
+                rref2x: null,
+                rref3x: null,
+                rref4x: null,
+                rref5x: null,
+                rref6x: null,
+                rref7x: null,
+                rref8x: null,
+                rref9x: null,
+                rref10: null,
+            },
+            bunnam : null
         }
     },
     created() {
@@ -542,69 +596,85 @@
         clickCodeName(commonCode, id) {
             this.activeItemId = id;
             this.selectedId = id;
+
             this.selectListByCommonCode(commonCode)
+            this.category = commonCode;
+            this.commonCodeOne.gbncod = commonCode.rcodex;
+            this.bunnam = commonCode.nmcodx;
         },
          //분류 목록 조회
-        //  selectList: function () {
-        //     let requestData = {
-        //         prjcod : 'AC',
-        //         gbncod : '000'
-        //     }
-        //     const vm = this;
-        //     axios({
-        //         url: '/commonCodeList.json',
-        //         method: 'post',
-        //         headers: {
-        //             'Content-Type': 'application/json;'
-        //         },
-        //         data: requestData
-        //     }).then(function (response) {
-        //         console.log("responseData",response.data.resultData)
-        //         vm.commonCodeList = response.data.resultData.list;
-        //         // vm.commonCodeListCount = response.data.requestData.commonCodeListCount;
-        //     }).catch(function (error) {
-        //         console.log(error);
-        //     });
-        // },
+         selectList: function () {
+            let requestData = {
+                prjcod : 'AC',
+                gbncod : '000'
+            }
+            const vm = this;
+            axios({
+                url: '/commonCodeList.json',
+                method: 'post',
+                headers: {
+                    'Content-Type': 'application/json;'
+                },
+                data: requestData
+            }).then(function (response) {
+                console.log("responseData",response.data.resultData)
+                vm.commonCodeList = response.data.resultData.list;
+                // vm.commonCodeListCount = response.data.requestData.commonCodeListCount;
+            }).catch(function (error) {
+                console.log(error);
+            });
+        },
 
-        // //분류 코드 별 하위 목록 조회
-        // selectListByCommonCode : function (commonCode) {
-        //     let requestData = {
-        //         prjcod : 'AC',
-        //         rcodex : commonCode.rcodex
-        //     }
-        //     const vm = this;
-        //     axios({
-        //         url: '/commonCodeList.json',
-        //         method: 'post',
-        //         headers: {
-        //             'Content-Type': 'application/json;'
-        //         },
-        //         data: requestData
-        //     }).then(function (response) {
-        //         console.log("responseData",response.data.resultData)
-        //         vm.codeListByCommonCode = response.data.resultData.list;
-        //         // vm.commonCodeListCount = response.data.requestData.commonCodeListCount;
-        //     }).catch(function (error) {
-        //         console.log(error);
-        //     });
-        // },
+        //분류 코드 별 하위 목록 조회
+        selectListByCommonCode : function(commonCode){
+            let requestData = {
+                prjcod : 'AC',
+                rcodex : commonCode.rcodex
+            }
+            const vm = this;
+            axios({
+                url: '/commonCodeList.json',
+                method: 'post',
+                headers: {
+                    'Content-Type': 'application/json;'
+                },
+                data: requestData
+            }).then(function (response) {
+                console.log("responseData",response.data.resultData)
+                vm.codeListByCommonCode = response.data.resultData.list;
+                // vm.commonCodeListCount = response.data.requestData.commonCodeListCount;
+            }).catch(function (error) {
+                console.log(error);
+            });
+        },
+
+        //
+        commonCodeDetail : function(item){
+            this.commonCodeOne = item;
+        },
 
     },
     watch: {
 
     },
     computed: {
-        filteredCodeBox() {
-            return this.codeBox.filter(codeInput => this.activeItemId === codeInput.id);
-        },
-        filteredCodeList() {
-            if (this.selectedOptionId !== null) {
-                return this.codeList.filter(item => item.id === this.selectedOptionId);
+        // filteredCodeBox() {
+        //     return this.codeBox.filter(codeInput => this.activeItemId === codeInput.id);
+        // },
+        // filteredCodeList() {
+        //     if (this.selectedOptionId !== null) {
+        //         return this.codeList.filter(item => item.id === this.selectedOptionId);
+        //     }
+        //     return this.codeList; // 옵션이 선택되지 않았다면 전체 목록 반환
+        // },
+        isChecked: {
+            get() {
+                return this.commonCodeOne.saygub === 'Y';
+            },
+            set(value) {
+                this.commonCodeOne.saygub = value ? 'Y' : 'N';
             }
-            return this.codeList; // 옵션이 선택되지 않았다면 전체 목록 반환
-        },
-
+        }
     },
     mounted() {
         console.log('Main mounted');
Add a comment
List