Browse Source

增加导入模板管理功能

ljb 7 months ago
parent
commit
6ef143fdb0

+ 3 - 13
src/api/externalReports/torchDevelopAnnualReport.js

@@ -1,19 +1,9 @@
 import request from '@/router/axios';
 import request from '@/router/axios';
 
 
-export const getList = (params) => {
+export const getData = (params) => {
   return request({
   return request({
-    url: '/api/kd-scientific/setting/torch-dev/list',
+    url: `/api//kd-scientific/hjfznb`,
     method: 'get',
     method: 'get',
-    params: {
-      ...params,
-    }
-  })
-}
-
-export const update = (row) => {
-  return request({
-    url: '/api/kd-scientific/setting/submit',
-    method: 'post',
-    data: row
+    params
   })
   })
 }
 }

+ 9 - 1
src/views/external-reports/external-manage/torch-develop-annual-report.vue

@@ -547,6 +547,7 @@
 <script>
 <script>
 import moment from "moment";
 import moment from "moment";
 import yearMonthSelect from "@/components/year-month-select";
 import yearMonthSelect from "@/components/year-month-select";
+import { getData } from "@/api/externalReports/torchDevelopAnnualReport";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -554,7 +555,7 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      yearAndMonth: moment(new Date()).format('YYYY'),
+      yearAndMonth: "",
 
 
       formData: {}
       formData: {}
     };
     };
@@ -562,11 +563,18 @@ export default {
   watch: {
   watch: {
     "yearAndMonth"(newVal) {
     "yearAndMonth"(newVal) {
       console.log(newVal)
       console.log(newVal)
+      this.getDataFunc(newVal);
     },
     },
   },
   },
   mounted() {
   mounted() {
+    console.log(123)
   },
   },
   methods: {
   methods: {
+    getDataFunc(year) {
+      getData({year}).then(res => {
+        console.log(res)
+      })
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 109 - 61
src/views/resource/attach.vue

@@ -17,7 +17,7 @@
                @refresh-change="refreshChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
                @on-load="onLoad">
       <template slot="menuLeft">
       <template slot="menuLeft">
-        <el-button type="primary"
+        <!-- <el-button type="primary"
                    size="small"
                    size="small"
                    plain
                    plain
                    v-if="permission.attach_upload"
                    v-if="permission.attach_upload"
@@ -30,10 +30,15 @@
                    plain
                    plain
                    v-if="permission.attach_delete"
                    v-if="permission.attach_delete"
                    @click="handleDelete">删 除
                    @click="handleDelete">删 除
-        </el-button>
+        </el-button> -->
       </template>
       </template>
       <template slot-scope="scope" slot="menu">
       <template slot-scope="scope" slot="menu">
         <el-button type="text"
         <el-button type="text"
+                   icon="el-icon-edit"
+                   size="small"
+                   @click="handleUpload(scope.row)">上传附件
+        </el-button>
+        <el-button type="text"
                    icon="el-icon-download"
                    icon="el-icon-download"
                    size="small"
                    size="small"
                    v-if="permission.attach_download"
                    v-if="permission.attach_download"
@@ -74,6 +79,7 @@
         attachBox: false,
         attachBox: false,
         selectionList: [],
         selectionList: [],
         option: {
         option: {
+          dialogWidth: 500,
           height: 'auto',
           height: 'auto',
           calcHeight: 30,
           calcHeight: 30,
           tip: false,
           tip: false,
@@ -84,36 +90,46 @@
           viewBtn: true,
           viewBtn: true,
           selection: true,
           selection: true,
           dialogClickModal: false,
           dialogClickModal: false,
+          delBtn: false,
           column: [
           column: [
             {
             {
-              label: "附件地址",
-              prop: "link",
-              rules: [{
-                required: true,
-                message: "请输入附件地址",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "附件域名",
-              prop: "domainUrl",
+              label: "模板名称",
+              prop: "title",
+              display: false,
               search: true,
               search: true,
-              rules: [{
-                required: true,
-                message: "请输入附件域名",
-                trigger: "blur"
-              }]
             },
             },
             {
             {
-              label: "附件名称",
-              prop: "name",
-              search: true,
+              label: "附件地址",
+              prop: "link",
               rules: [{
               rules: [{
                 required: true,
                 required: true,
-                message: "请输入附件名称",
+                message: "请输入附件地址",
                 trigger: "blur"
                 trigger: "blur"
-              }]
+              }],
+              display: false,
             },
             },
+            // {
+            //   label: "附件域名",
+            //   prop: "domainUrl",
+            //   search: true,
+            //   rules: [{
+            //     required: true,
+            //     message: "请输入附件域名",
+            //     trigger: "blur"
+            //   }],
+            //   display: false,
+            // },
+            // {
+            //   label: "附件名称",
+            //   prop: "name",
+            //   search: true,
+            //   rules: [{
+            //     required: true,
+            //     message: "请输入附件名称",
+            //     trigger: "blur"
+            //   }],
+            //   display: false,
+            // },
             {
             {
               label: "附件原名",
               label: "附件原名",
               prop: "originalName",
               prop: "originalName",
@@ -122,49 +138,57 @@
                 required: true,
                 required: true,
                 message: "请输入附件原名",
                 message: "请输入附件原名",
                 trigger: "blur"
                 trigger: "blur"
-              }]
+              }],
+              display: false,
             },
             },
+            // {
+            //   label: "附件拓展名",
+            //   prop: "extension",
+            //   rules: [{
+            //     required: true,
+            //     message: "请输入附件拓展名",
+            //     trigger: "blur"
+            //   }],
+            //   display: false,
+            // },
+            // {
+            //   label: "附件大小",
+            //   prop: "attachSize",
+            //   slot: true,
+            //   rules: [{
+            //     required: true,
+            //     message: "请输入附件大小",
+            //     trigger: "blur"
+            //   }],
+            //   display: false,
+            // },
             {
             {
-              label: "附件拓展名",
-              prop: "extension",
-              rules: [{
-                required: true,
-                message: "请输入附件拓展名",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "附件大小",
-              prop: "attachSize",
-              slot: true,
-              rules: [{
-                required: true,
-                message: "请输入附件大小",
-                trigger: "blur"
-              }]
+              label: "备注",
+              prop: "remark",
             },
             },
           ]
           ]
         },
         },
         data: [],
         data: [],
         attachForm: {},
         attachForm: {},
-        attachOption: {
-          submitBtn: false,
-          emptyBtn: false,
-          column: [
-            {
-              label: '附件上传',
-              prop: 'attachFile',
-              type: 'upload',
-              drag: true,
-              loadText: '模板上传中,请稍等',
-              span: 24,
-              propsHttp: {
-                res: 'data'
-              },
-              action: "/api/kd-resource/oss/endpoint/put-file-attach"
-            }
-          ]
-        }
+        currRowAttachId: '',
+        // attachOption: {
+        //   submitBtn: false,
+        //   emptyBtn: false,
+        //   column: [
+        //     {
+        //       label: '附件上传',
+        //       prop: 'attachFile',
+        //       type: 'upload',
+        //       drag: true,
+        //       loadText: '模板上传中,请稍等',
+        //       span: 24,
+        //       propsHttp: {
+        //         res: 'data'
+        //       },
+        //       action: "/api/kd-resource/oss/endpoint/put-file-attach"
+        //     }
+        //   ]
+        // }
       };
       };
     },
     },
     computed: {
     computed: {
@@ -186,14 +210,38 @@
           ids.push(ele.id);
           ids.push(ele.id);
         });
         });
         return ids.join(",");
         return ids.join(",");
+      },
+      attachOption() {
+        return {
+          submitBtn: false,
+          emptyBtn: false,
+          column: [
+            {
+              label: '附件上传',
+              prop: 'attachFile',
+              type: 'upload',
+              drag: true,
+              loadText: '模板上传中,请稍等',
+              span: 24,
+              propsHttp: {
+                res: 'data'
+              },
+              data: {
+                attachId: this.currRowAttachId
+              },
+              action: "/api/kd-resource/oss/endpoint/put-file-attach-exist"
+            }
+          ]
+        }
       }
       }
     },
     },
     methods: {
     methods: {
-      handleUpload() {
+      handleUpload(row) {
+        this.currRowAttachId = row.id;
+        console.log(row)
         this.attachBox = true;
         this.attachBox = true;
       },
       },
       uploadAfter(res, done, loading, column) {
       uploadAfter(res, done, loading, column) {
-        window.console.log(column);
         this.attachBox = false;
         this.attachBox = false;
         this.refreshChange();
         this.refreshChange();
         done();
         done();

+ 22 - 2
src/views/tech-person/month-cjcyry.vue

@@ -18,6 +18,15 @@
           删 除
           删 除
         </el-button> -->
         </el-button> -->
         <el-button
         <el-button
+          type="success"
+          size="small"
+          plain
+          icon="el-icon-upload2"
+          @click="handleImport"
+        >
+          导入
+        </el-button>
+        <el-button
           type="warning"
           type="warning"
           size="small"
           size="small"
           plain
           plain
@@ -60,10 +69,13 @@
       :default-landscape="true"
       :default-landscape="true"
       :zoom="95"
       :zoom="95"
     />
     />
+
+    <upload-excel-dialog ref="uploadExcelDialog" :showTempBtn="false" templateKey="每月实际参研人员" templateName="每月实际参研人员" :uploadAfter="uploadAfter"/>
   </basic-container>
   </basic-container>
 </template>
 </template>
 
 
 <script>
 <script>
+import UploadExcelDialog from "@/components/upload-excel-dialog";
 import {exportBloByPost} from "@/api/common";
 import {exportBloByPost} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import YearMonthSelect from "@/components/year-month-select";
 import moment from "moment";
 import moment from "moment";
@@ -81,7 +93,8 @@ export default window.$crudCommon({
   components: {
   components: {
     YearMonthSelect,
     YearMonthSelect,
     projectSelect,
     projectSelect,
-    personSelect
+    personSelect,
+    UploadExcelDialog
   },
   },
   data() {
   data() {
     return {
     return {
@@ -142,7 +155,14 @@ export default window.$crudCommon({
         NProgress.done();
         NProgress.done();
       });
       });
     },
     },
-
+    handleImport() {
+      let excelParams = { yearAndMonth: this.params.yearAndMonth };
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/xm/monthly/import', excelParams);
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
     printTable(isLandscape) {
     printTable(isLandscape) {
       this.wideTableColumns = this.printOption.column;
       this.wideTableColumns = this.printOption.column;
       this.$nextTick(() => {
       this.$nextTick(() => {