Browse Source

科研论文接口联调

ljb 10 months ago
parent
commit
b31aa8421f

+ 4 - 4
src/api/achievement/researchPaper.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/kd-scientific/technician/page',
+    url: '/api/kd-scientific/kycg/kylw/list',
     method: 'get',
     params: {
       ...params,
@@ -14,7 +14,7 @@ export const getList = (current, size, params) => {
 
 export const add = (row) => {
   return request({
-    url: '/api/kd-scientific/technician/save',
+    url: '/api/kd-scientific/kycg/kylw/save',
     method: 'post',
     data: row
   })
@@ -23,7 +23,7 @@ export const add = (row) => {
 
 export const update = (row) => {
   return request({
-    url: '/api/kd-scientific/technician/update',
+    url: '/api/kd-scientific/kycg/kylw/update',
     method: 'post',
     data: row
   })
@@ -32,7 +32,7 @@ export const update = (row) => {
 
 export const remove = (ids) => {
   return request({
-    url: '/api/kd-scientific/technician/remove',
+    url: '/api/kd-scientific/kycg/kylw/remove',
     method: 'post',
     params: {
       ids,

+ 1 - 1
src/option/achievement/otherAchivement.js

@@ -136,7 +136,7 @@ export default {
       align: 'center',
       children: [
         {
-          label: "项目项目名称",
+          label: "研发项目名称",
           prop: 'xmId',
           width: 120,
           span: 24,

+ 90 - 124
src/option/achievement/researchPaper.js

@@ -7,7 +7,6 @@ export default {
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
   selection: true,
   addBtn: true,
   delBtn: true,
@@ -15,188 +14,155 @@ export default {
   labelWidth: 140,
   menuWidth: 160,
   dialogClickModal: false,
-  dialogWidth: 760,
+  dialogWidth: 560,
   dialogType: "drawer",
   column: [
     {
-      label: "标准号",
-      prop: "number",
-      span: 12,
-      width: 130,
-      align: "center",
+      label: "论文名称",
+      prop: "lwmc",
+      span: 24,
+      width: 140,
       search: true,
       showOverflowTooltip: true,
       rules: [
         {
           required: true,
-          message: "请输入专利号",
+          message: "请输入论文名称",
           trigger: "blur",
         },
       ],
     },
     {
-      label: "标准名称",
-      prop: "name",
-      span: 12,
+      label: "作者姓名",
+      prop: "zzxm",
+      span: 24,
       search: true,
-      width: 100,
-      align: "center",
+      width: 80,
+      align: 'center',
       showOverflowTooltip: true,
       rules: [
         {
           required: true,
-          message: "请输入专利名称",
+          message: "请输入作者姓名",
           trigger: "blur",
         },
       ],
     },
     {
-      label: "版本号",
-      prop: "identityCard",
-      span: 12,
+      label: "通讯作者",
+      prop: "txzz",
+      span: 24,
       search: true,
-      width: 155,
-      align: "center",
+      width: 80,
+      align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请输入专利类型",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "登记号",
-      prop: "secondaryUnit",
-      span: 12,
-      width: 140,
+      label: "第一作者单位",
+      prop: "dyzzdw",
+      span: 24,
       search: true,
-      align: "center",
+      width: 100,
+      align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择是否国防专利",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "开发完成日期",
-      prop: "department",
-      type: "select",
-      span: 12,
-      width: 140,
-      search: true,
-      align: "center",
+      label: "发表日期",
+      prop: "fbrq",
+      type: 'date',
+      valueFormat: 'yyyy-MM-DD',
+      span: 24,
+      width: 90,
+      align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择国别",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "首次发布日期",
-      prop: "post",
-      type: "input",
-      span: 12,
-      width: 100,
-      align: "center",
-      search: false,
+      label: "期刊名称",
+      prop: "qkmc",
+      span: 24,
+      width: 120,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请输入申请号/专利号",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "登记批准日期",
-      prop: "postLocation",
-      type: "select",
-      span: 12,
-      width: 100,
-      search: false,
+      label: "刊/卷号",
+      prop: "kjh",
+      span: 24,
+      width: 80,
+      align: 'center',
       showOverflowTooltip: true,
-      align: "center",
-      rules: [
-        {
-          required: true,
-          message: "请选择申请日",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "取得方式",
-      prop: "nature",
-      type: "select",
-      span: 12,
-      width: 80,
-      align: "center",
+      label: "期刊类型",
+      prop: "qklx",
+      span: 24,
       search: true,
+      type: 'select',
+      align: 'center',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=paper_type',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      width: 80,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择授权日",
-          trigger: "change",
-        },
-      ],
     },
     {
-      label: "关联研发项目情况",
-      prop: "personnelType",
-      type: "select",
-      span: 12,
+      label: "期刊级别",
+      prop: "qkjb",
+      span: 24,
       width: 80,
       align: "center",
-      search: false,
-      dicUrl: "/api/kd-system/dict-biz/dictionary?code=renyuanleixing",
-      props: {
-        label: "dictValue",
-        value: "dictKey",
-      },
       showOverflowTooltip: true,
+    },
+    {
+      label: "关联研发项目情况",
+      prop: "canyunZhuchi",
+      align: 'center',
       children: [
         {
           label: "研发项目名称",
+          prop: 'xmId',
+          width: 120,
+          span: 24,
+          hide: true
+        },
+        {
+          label: "研发项目名称",
+          prop: 'xmmc',
+          width: 120,
           search: true,
-          rules: [
-            {
-              required: true,
-              message: "请输入发明人",
-              trigger: "blur",
-            },
-          ],
+          showOverflowTooltip: true,
+          display: false
         },
         {
           label: "研发项目编号",
+          prop: 'xmbh',
+          width: 100,
+          align: 'center',
           search: true,
-          rules: [
-            {
-              required: true,
-              message: "请输入发明人",
-              trigger: "blur",
-            },
-          ],
+          showOverflowTooltip: true,
+          display: false
         },
       ],
     },
     {
-      label: "附件上传",
-      prop: "personnelType",
-      type: "select",
-      span: 12,
-      width: 80,
-      align: "center",
-      search: false,
+      label: "附件信息",
+      prop: "attachment",
+      minWidth: 200,
+      type: "upload",
+      multiple: true,
+      span: 24,
+      dataType: "object",
+      action: '/api/kd-resource/oss/endpoint/put-file',
+      uploadPreview: (file, column, done) => {
+        window.open(file.url, "_blank");
+        return;
+      },
+      propsHttp: {
+        url: "link",
+        name: "originalName",
+        res: "data",
+      },
       showOverflowTooltip: true,
     },
   ],

+ 7 - 0
src/styles/common.scss

@@ -26,5 +26,12 @@ a{
 *{
   outline: none;
 }
+
+.tip {
+  color: red;
+  font-size: 12px;
+  line-height: 22px;
+  margin: 6px 0 2px;
+}
 //滚动条样式
 @include scrollBar;

+ 8 - 15
src/views/achievement/other-achievements.vue

@@ -42,6 +42,7 @@
         >
           打印
         </el-button>
+        <div class="tip" style="color: red;">提示:企业可自行上传全部历史专利信息和资料,如专利与系统中已建档的研究项目无关,则研发项目编号和研发项目名称非必填。</div>
       </template>
 
       <template slot="attachment" slot-scope="{ row }">
@@ -69,7 +70,7 @@
 
 <script>
 import projectSelect from "@/components/project-select";
-import {exportBloByPost} from "@/api/common";
+import {exportBlob} from "@/api/common";
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 import {getToken} from "@/util/auth";
@@ -110,8 +111,7 @@ export default window.$crudCommon({
       callback && callback();
     },
     handleImport() {
-      let excelParams = { yearAndMonth: this.params.yearAndMonth };
-      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/qt/import', excelParams);
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/qt/import');
     },
     uploadAfter() {
       this.page.currentPage = 1;
@@ -133,17 +133,10 @@ export default window.$crudCommon({
       return newFormData;
     },
     handleExport() {
-      this.$confirm("是否导出吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        NProgress.start();
-        exportBloByPost(`/api/kd-scientific/kycg/qt/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-          downloadXls(res.data, `其他成果管理.xlsx`);
-          NProgress.done();
-        })
-      });
+      exportBlob(`/api/kd-scientific/kycg/qt/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `其他成果列表.xlsx`);
+        NProgress.done();
+      })
     },
     /**
      * 打印表格
@@ -151,7 +144,7 @@ export default window.$crudCommon({
      */
     printTable(isLandscape) {
       this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `其他成果管理`;
+      this.printTitle = `其他成果列表`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
       })

+ 79 - 15
src/views/achievement/research-paper.vue

@@ -42,13 +42,35 @@
         >
           打印
         </el-button>
+        <div class="tip">提示:企业可自行上传全部历史专利信息和资料,如专利与系统中已建档的研究项目无关,则研发项目编号和研发项目名称非必填。论文发表后再进行登记。</div>
       </template>
+
+      <template slot="attachment" slot-scope="{ row }">
+        <div v-for="(file, index) of row.attachment" :key="index">
+          <el-link @click="handleDownFile(file)">{{ file.label }}</el-link>
+        </div>
+      </template>
+
+      <template slot="xmIdForm">
+        <project-select ref="proSelect" placeholder="请选择项目名称" v-model="form.xmId"></project-select>
+      </template>
+
     </avue-crud>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
   </basic-container>
 </template>
 
 <script>
-import {exportBloByPost} from "@/api/common";
+import projectSelect from "@/components/project-select";
+import {exportBlob} from "@/api/common";
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 import {getToken} from "@/util/auth";
@@ -56,29 +78,71 @@ import {downloadXls} from "@/util/util";
 
 
 export default window.$crudCommon({
-  
+  components: {
+    projectSelect
+  },
   data() {
     return {
-      params: {},
+      wideTableColumns: [],
+      printTitle: "",
     };
   },
   methods: {
+    handleImport() {
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/kylw/import');
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
+    getFormData() {
+      let newFormData = { ...this.form };
+      if (!!newFormData.xmId) {
+        let projectList = this.$refs.proSelect.projectList;
+        let selPro = projectList.find(item => item.id === newFormData.xmId );
+        if (!!selPro) {
+          newFormData.xmmc = selPro.xmmc;
+          newFormData.xmbh = selPro.xmbh;
+        }
+      }
+      if (!!newFormData.attachment) {
+        newFormData.attachment = JSON.stringify(newFormData.attachment);
+      }
+      return newFormData;
+    },
     handleExport() {
-      this.$confirm("是否导出吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        NProgress.start();
-        exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-          downloadXls(res.data, `技术人员上一年度平均工资${this.params.yearAndMonth}.xlsx`);
-          NProgress.done();
-        })
-      });
+      exportBlob(`/api/kd-scientific/kycg/kylw/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `科研论文列表.xlsx`);
+        NProgress.done();
+      })
+    },
+    /**
+     * 打印表格
+     * @param isLandscape 是否横向打印
+     */
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `科研论文列表`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
     },
+    handleDownFile(file) {
+      window.open(file.value, "_blank");
+    }
   },
 }, {
   // 模块路径
-  name: 'achievement/researchPaper'
+  name: 'achievement/researchPaper',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      if (!!item.attachment) {
+        item.attachment = JSON.parse(item.attachment);
+      }
+      return item;
+    })
+
+    return data;
+  }
 });
 </script>