yusheng 11 달 전
부모
커밋
8a08ac8778
4개의 변경된 파일52개의 추가작업 그리고 32개의 파일을 삭제
  1. 4 2
      src/api/doc-manage/index.js
  2. 17 7
      src/views/doc/components/file-edit.vue
  3. 11 6
      src/views/doc/components/file-editAll.vue
  4. 20 17
      src/views/doc/components/getCode.vue

+ 4 - 2
src/api/doc-manage/index.js

@@ -427,8 +427,10 @@ export async function updateLcyStatus(data) {
   return Promise.reject(new Error(res.data.message));
 }
 // 编码方案
-export async function listCode(code) {
-  const res = await request.get(`/main/business_code_category/listCode/${code||'WD0001'}`);
+export async function listCode(data={}) {
+  console.log(data?.parentId,'data?.parentId')
+   
+  const res = await request.get(`/main/business_code_category/listCode/${data.id||'0'}`+'?parentId='+(data.parentId||''));
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 17 - 7
src/views/doc/components/file-edit.vue

@@ -123,7 +123,7 @@
         确认
       </el-button>
     </template>
-    <GetCode ref="getCode" @success="success" ></GetCode>
+    <GetCode ref="getCode" @success="success"></GetCode>
 
     <ele-modal
       width="80%"
@@ -176,7 +176,8 @@
         directoryId: '',
         storagePath: [],
         id: '',
-        secretLevel: 1
+        secretLevel: 1,
+        code:''
       };
       return {
         rules: {
@@ -198,7 +199,7 @@
         title: '',
         type: '',
         secretLevelList,
-        nodeDataCode:''
+        nodeData: null
       };
     },
     computed: {
@@ -225,17 +226,26 @@
       },
 
       getCodeOpen() {
-        this.$refs.getCode.open(this.fileType==0?this.nodeDataCode:'');
+        this.$refs.getCode.open(this.fileType == 0 ? this.nodeData : '');
       },
       async getCode() {
         let nodeData = {};
         await this.$nextTick(() => {
           nodeData = this.$refs.cascaderRef.getCheckedNodes();
         });
-        this.nodeDataCode=nodeData[0]?.data?.code
-        const options = await listCode(this.fileType==0?nodeData[0]?.data?.code:'');
+        this.nodeData = {
+          id: nodeData[0]?.data?.id,
+          parentId:
+            nodeData[0]?.data?.parentId != 0 ? nodeData[0]?.data?.parentId : ''
+        };
+        const options = await listCode(this.fileType == 0 ? this.nodeData : '');
         if (options.length > 0) {
-          this.success(await getCode(options[0].id));
+           getCode({
+            categoryId: options[0].id
+          }).then(res=>{
+          this.$set(this.form, 'code', res.codeStr);
+
+          })
         }
       },
       fileChange(file) {

+ 11 - 6
src/views/doc/components/file-editAll.vue

@@ -169,7 +169,7 @@
           directoryId: [{ required: true, message: '请选择', trigger: 'blur' }],
           storagePath: [{ required: true, message: '请选择', trigger: 'blur' }]
         },
-        nodeDataCode: '',
+        nodeData: null,
         templateVisible: false,
         folderList: [],
         list: [],
@@ -210,13 +210,17 @@
         await this.$nextTick(() => {
           nodeData = this.$refs.cascaderRef.getCheckedNodes();
         });
-        this.nodeDataCode = nodeData[0]?.data?.code;
-        this.options = await listCode(
-          this.fileType == 0 ? nodeData[0]?.data?.code : ''
-        );
+        this.nodeData = {
+          id: nodeData[0]?.data?.id,
+          parentId:
+            nodeData[0]?.data?.parentId != 0 ? nodeData[0]?.data?.parentId : ''
+        };
+        this.options = await listCode(this.fileType == 0 ? this.nodeData : '');
 
         if (this.options.length > 0) {
           this.form.businessCodeId = this.options[0].id;
+          this.form.codeType=this.options[0].parentId
+
         }else{
           this.form.businessCodeId=''
         }
@@ -236,7 +240,8 @@
           pageNum: 1,
           size: 100,
           parentId: val,
-          code: this.fileType == 0 ? this.nodeDataCode : ''
+          objId:this.nodeData?.id,
+          objParentId:this.nodeData?.parentId,
         });
         this.options = data.list.filter((item) => item.type == 2);
         this.form.businessCodeId = '';

+ 20 - 17
src/views/doc/components/getCode.vue

@@ -136,12 +136,12 @@
       //   this.setTree(this.list);
       //   this.showEditFlag = true;
       // },
-      async open(nodeDataCode) {
-      this.list = await selectTreeList();
-      this.nodeDataCode=nodeDataCode
-      this.setTree(this.list);
-      this.showEditFlag = true;
-    },
+      async open(nodeData) {
+        this.list = await selectTreeList();
+        this.nodeData = nodeData;
+        this.setTree(this.list);
+        this.showEditFlag = true;
+      },
       setTree(data) {
         data.forEach((item) => {
           item.sonDirectoryList = item.sonDirectoryList.filter(
@@ -164,15 +164,18 @@
       //   this.form.type1 = '';
       // },
       async typeChange(val) {
-      let data = await listParentId({
-        pageNum: 1,
-        size: 100,
-        parentId: val,
-        code:this.nodeDataCode
-      });
-      this.options = data.list.filter((item) => item.type == 2);
-      this.form.type1 = '';
-    },
+        let data = await listParentId({
+          pageNum: 1,
+          size: 100,
+          parentId: val,
+          objId: this.nodeData?.id,
+          objParentId: this.nodeData?.parentId
+        });
+        this.options = data.list.filter((item) => item.type == 2);
+        this.form.type1 = '';
+        this.form.code = '';
+        this.segmentList = [];
+      },
       async type1Change(val) {
         let codeData = await getCode({
           categoryId: val
@@ -201,7 +204,7 @@
               code: item.currentValue
             };
           }),
-          isUpdateNo: 1,
+          isUpdateNo: 1
         });
         this.form.code = codeData.codeStr;
       },
@@ -213,7 +216,7 @@
 
       cancel() {
         this.form.type = '';
-         this.form.code = '';
+        this.form.code = '';
         this.showEditFlag = false;
         this.segmentList = [];
         this.options = [];