lucw 9 месяцев назад
Родитель
Сommit
e735ca0578
3 измененных файлов с 162 добавлено и 141 удалено
  1. 16 13
      src/components/addDoc/api/index.js
  2. 127 127
      src/components/addDoc/main.vue
  3. 19 1
      src/views/inspectionWork/details.vue

+ 16 - 13
src/components/addDoc/api/index.js

@@ -13,9 +13,9 @@ export async function getDocTreeListAPI(data) {
 }
 }
 
 
 /**
 /**
-* 查询文件数据
-* @data data
-*/
+ * 查询文件数据
+ * @data data
+ */
 export async function filePageAPI(data) {
 export async function filePageAPI(data) {
   const res = await request.post('/fm/file/pageBusiness', data);
   const res = await request.post('/fm/file/pageBusiness', data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
@@ -51,7 +51,7 @@ export async function fileGetByIdAPI(id) {
  * ids查询文件列表
  * ids查询文件列表
  * @data data
  * @data data
  */
  */
- export async function queryIds(data) {
+export async function queryIds(data) {
   const res = await request.post('/fm/file/queryIds', data);
   const res = await request.post('/fm/file/queryIds', data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
@@ -59,12 +59,12 @@ export async function fileGetByIdAPI(id) {
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
 
 
-
-
-
 // 获取编码树
 // 获取编码树
 export async function selectTreeList(data) {
 export async function selectTreeList(data) {
-  const res = await request.post(`/main/business_code_category/selectTreeList`, data);
+  const res = await request.post(
+    `/main/business_code_category/selectTreeList`,
+    data
+  );
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
@@ -72,7 +72,10 @@ export async function selectTreeList(data) {
 }
 }
 // 获取右侧列表
 // 获取右侧列表
 export async function listParentId(data) {
 export async function listParentId(data) {
-  const res = await request.post(`/main/business_code_category/listPageParentId`, data);
+  const res = await request.post(
+    `/main/business_code_category/listPageParentId`,
+    data
+  );
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
@@ -87,10 +90,11 @@ export async function pageSegment(data) {
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
 
 
-
 // 生成编码
 // 生成编码
 export async function getCode(id) {
 export async function getCode(id) {
-  const res = await request.get(`/main/business_code_category/applyForCode/`+id);
+  const res = await request.get(
+    `/main/business_code_category/applyForCode/` + id
+  );
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
@@ -101,7 +105,7 @@ export async function getCode(id) {
  * 上传文件
  * 上传文件
  * @param file 文件
  * @param file 文件
  */
  */
- export async function uploadFileNew (data) {
+export async function uploadFileNew(data) {
   const formData = new FormData();
   const formData = new FormData();
   formData.append('multiPartFile', data.multiPartFile);
   formData.append('multiPartFile', data.multiPartFile);
   formData.append('module', data.module);
   formData.append('module', data.module);
@@ -119,4 +123,3 @@ export async function listCode() {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
-

+ 127 - 127
src/components/addDoc/main.vue

@@ -75,140 +75,140 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import doc_template from './doc_template.vue';
-import fileEdit from './file-edit.vue';
-import browse from './browse.vue';
-import { queryIds } from './api';
+  import doc_template from './doc_template.vue';
+  import fileEdit from './file-edit.vue';
+  import browse from './browse.vue';
+  import { queryIds } from './api';
 
 
-export default {
-  components: { doc_template, fileEdit, browse },
+  export default {
+    components: { doc_template, fileEdit, browse },
 
 
-  data() {
-    return {
-      fileId: [],
-      fileShow: false,
-      showEditFlag: false,
-      tableList: [],
-      type: 'add',
-      columns: [
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
+    data() {
+      return {
+        fileId: [],
+        fileShow: false,
+        showEditFlag: false,
+        tableList: [],
+        type: 'add',
+        columns: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
 
 
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue && cellValue[0]?.name;
-          }
-        },
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue && cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
 
-        {
-          prop: 'sizeUnit',
-          label: '文档大小',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
 
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {},
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
 
-  methods: {
-    open(fileId, type) {
-      //查看详情:view 新增:add
-      this.showEditFlag = true;
-      this.fileId = fileId || [];
-      if (type) {
-        this.type = type;
-      }
-      this.init();
-    },
-    fileEditOpen() {
-      this.$refs.fileEditRef.open();
-    },
-    remove(row) {
-      this.tableList = this.tableList.filter((item) => item.code != row.code);
-      this.fileId = this.tableList.map((item) => item.id);
-    },
-    async init() {
-      if (this.fileId.length > 0) {
-        this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
-      } else {
-        this.tableList = [];
-      }
-    },
-    done(id) {
-      this.fileId.push(...id);
-      this.init();
-    },
-    browseOpen(row) {
-      this.$refs.browseRef.open(row);
-    },
-    addFile() {
-      this.$emit(
-        'success',
-        this.tableList.map((item) => item.id)
-      );
-      this.showEditFlag = false;
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
     },
-    addTemplate() {
-      let list = this.$refs.doc_templateRef.getTableList();
-      this.fileShow = false;
-      if (list.length == 0) {
-        this.$message.error('请选择一条数据');
-        return;
+    created() {},
+
+    methods: {
+      open(fileId, type) {
+        //查看详情:view 新增:add
+        this.showEditFlag = true;
+        this.fileId = fileId || [];
+        if (type) {
+          this.type = type;
+        }
+        this.init();
+      },
+      fileEditOpen() {
+        this.$refs.fileEditRef.open();
+      },
+      remove(row) {
+        this.tableList = this.tableList.filter((item) => item.code != row.code);
+        this.fileId = this.tableList.map((item) => item.id);
+      },
+      async init() {
+        if (this.fileId.length > 0) {
+          this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+        } else {
+          this.tableList = [];
+        }
+      },
+      done(id) {
+        this.fileId.push(...id);
+        this.init();
+      },
+      browseOpen(row) {
+        this.$refs.browseRef.open(row);
+      },
+      addFile() {
+        this.$emit(
+          'success',
+          this.tableList.map((item) => item.id)
+        );
+        this.showEditFlag = false;
+      },
+      addTemplate() {
+        let list = this.$refs.doc_templateRef.getTableList();
+        this.fileShow = false;
+        if (list.length == 0) {
+          this.$message.error('请选择一条数据');
+          return;
+        }
+        this.tableList.push(...list);
       }
       }
-      this.tableList.push(...list);
     }
     }
-  }
-};
+  };
 </script>
 </script>

+ 19 - 1
src/views/inspectionWork/details.vue

@@ -140,6 +140,15 @@
                   <el-input :value="form.remark" disabled />
                   <el-input :value="form.remark" disabled />
                 </el-form-item>
                 </el-form-item>
               </el-col>
               </el-col>
+              <el-col :span="12">
+                <el-form-item label="附件信息">
+                  <el-link @click="openFileModal" type="primary"
+                    >查看附件信息<i class="el-icon-view el-icon--right"></i>
+                  </el-link>
+
+                  <fileMain ref="fileMainRef" />
+                </el-form-item>
+              </el-col>
             </el-row>
             </el-row>
           </el-form>
           </el-form>
         </el-tab-pane>
         </el-tab-pane>
@@ -271,8 +280,11 @@
   import detailMixins from './mixins/detailMixins';
   import detailMixins from './mixins/detailMixins';
   import { parameterGetByCode } from '@/api/main/index';
   import { parameterGetByCode } from '@/api/main/index';
   import { getUserPage } from '@/api/system/organization';
   import { getUserPage } from '@/api/system/organization';
+  import fileMain from '@/components/addDoc/main.vue';
+
   export default {
   export default {
     mixins: [detailMixins],
     mixins: [detailMixins],
+    components: { fileMain },
     data() {
     data() {
       return {
       return {
         activeName: '1',
         activeName: '1',
@@ -285,7 +297,9 @@
         disposeTypeList: [],
         disposeTypeList: [],
         form: {},
         form: {},
         showArrange: '0',
         showArrange: '0',
-        executorList: []
+        executorList: [],
+        // 文件
+        accessory: []
       };
       };
     },
     },
     computed: {
     computed: {
@@ -361,6 +375,7 @@
           });
           });
           this.form = obj;
           this.form = obj;
           this.form.status = res.status;
           this.form.status = res.status;
+          this.accessory = res.accessory;
           console.log(result, 'result');
           console.log(result, 'result');
           if (name == '计划') {
           if (name == '计划') {
             this.form.total = result.data.productNumber || 0;
             this.form.total = result.data.productNumber || 0;
@@ -450,6 +465,9 @@
         } else {
         } else {
           this.$router.go(-1);
           this.$router.go(-1);
         }
         }
+      },
+      openFileModal() {
+        this.$refs.fileMainRef.open(this.accessory, 'view');
       }
       }
     }
     }
   };
   };