Browse Source

专利成果接口联调

ljb 10 months ago
parent
commit
6edfeba3a5
2 changed files with 85 additions and 161 deletions
  1. 51 134
      src/option/achievement/patentAchievement.js
  2. 34 27
      src/views/achievement/patent-achievement.vue

+ 51 - 134
src/option/achievement/patentAchievement.js

@@ -7,13 +7,11 @@ export default {
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
   selection: true,
   addBtn: true,
   delBtn: true,
-  searchLabelWidth: 140,
-  labelWidth: 140,
-  menuWidth: 200,
+  labelWidth: 120,
+  menuWidth: 140,
   dialogClickModal: false,
   dialogWidth: 760,
   dialogType: "drawer",
@@ -22,13 +20,12 @@ export default {
       label: "专利号",
       prop: "zlh",
       span: 12,
-      width: 100,
+      width: 120,
       align: "center",
-      search: false,
       showOverflowTooltip: true,
       rules: [
         {
-          required: false,
+          required: true,
           message: "请输入专利号",
           trigger: "blur",
         },
@@ -39,8 +36,7 @@ export default {
       prop: "zlmc",
       span: 12,
       search: true,
-      width: 130,
-      align: "center",
+      minWidth: 160,
       showOverflowTooltip: true,
       rules: [
         {
@@ -99,7 +95,7 @@ export default {
       prop: "gb",
       type: "select",
       span: 12,
-      width: 130,
+      width: 70,
       search: true,
       dicUrl: "/api/kd-system/dict-biz/dictionary?code=countries",
       props:{
@@ -125,51 +121,29 @@ export default {
       align: "center",
       search: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请输入申请号/专利号",
-          trigger: "blur",
-        },
-      ],
     },
     {
       label: "申请日",
       prop: "shenqingRq",
       type: "date",
       span: 12,
-      width: 100,
+      width: 85,
       search: false,
       format: "yyyy-MM-dd",
       valueFormat: "yyyy-MM-dd",
       showOverflowTooltip: true,
       align: "center",
-      rules: [
-        {
-          required: false,
-          message: "请选择申请日",
-          trigger: "blur",
-        },
-      ],
     },
     {
       label: "授权日",
       prop: "shouquanRq",
       type: "date",
       span: 12,
-      width: 100,
+      width: 85,
       align: "center",
       search: false,
-      format: "yyyy-MM-dd",
-      valueFormat: "yyyy-MM-dd",
+      valueFormat: "yyyy-MM-DD",
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请选择授权日",
-          trigger: "change",
-        },
-      ],
     },
     {
       label: "申请单位",
@@ -180,13 +154,6 @@ export default {
       align: "center",
       search: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请选择参研情况",
-          trigger: "change",
-        },
-      ],
     },
     {
       label: "专利权人",
@@ -197,13 +164,6 @@ export default {
       align: "center",
       search: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请输入专利权人",
-          trigger: "blur",
-        },
-      ],
     },
     {
       label: "共有权人",
@@ -214,13 +174,6 @@ export default {
       align: "center",
       search: false,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请输入共有权人",
-          trigger: "blur",
-        },
-      ],
     },
     {
       label: "发明人",
@@ -231,13 +184,6 @@ export default {
       align: "center",
       search: false,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请输入发明人",
-          trigger: "blur",
-        },
-      ],
     },
     {
       label: "法律状态",
@@ -253,118 +199,89 @@ export default {
         value: "dictKey",
       },
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: false,
-          message: "请选择法律状态",
-          trigger: "blur",
-        },
-      ],
-    },
-     {
-      label: "关联研发项目",
-      prop: "glyfxm",
-      type: "select",
-      span: 12,
-      width: 80,
-      align: "center",
-      search: false,
-      showOverflowTooltip: true,
-      hide: true,
-      viewDisplay: false
     },
     {
       label: "关联研发项目情况",
-      prop: "xmId",
-      slot: true,
-      span: 12,
-      width: 80,
-      align: "center",
-      display: false,
-      search: false,
-      showOverflowTooltip: true,
+      prop: "canyunZhuchi",
+      align: 'center',
       children: [
         {
           label: "研发项目名称",
-          prop: "xmmc",
-          search: true,
-          addDisplay: false,
-          editDisplay: false,
-          viewDisplay: true,
-          align: "center",
+          prop: 'xmId',
           width: 120,
-          rules: [
-            {
-              required: false,
-              message: "请输入发明人",
-              trigger: "blur",
-            },
-          ],
+          span: 12,
+          hide: true
+        },
+        {
+          label: "研发项目名称",
+          prop: 'xmmc',
+          width: 120,
+          search: true,
+          showOverflowTooltip: true,
+          display: false
         },
         {
           label: "研发项目编号",
-          prop: "xmbh",
+          prop: 'xmbh',
+          width: 100,
+          align: 'center',
           search: true,
-          addDisplay: false,
-          editDisplay: false,
-          viewDisplay: true,
-          align: "center",
-          width: 150,
-          rules: [
-            {
-              required: false,
-              message: "请输入发明人",
-              trigger: "blur",
-            },
-          ],
+          showOverflowTooltip: true,
+          display: false
         },
       ],
     },
     {
-      label: "附件上传",
+      label: "附件信息",
       prop: "attachment",
+      minWidth: 200,
       type: "upload",
-      span: 12,
-      width: 120,
-      align: "center",
-      dataType: 'string',
-      search: false,
-      loadText: '附件上传中,请稍等',
-      showOverflowTooltip: true,
+      multiple: true,
+      span: 24,
+      dataType: "object",
+      action: '/api/kd-resource/oss/endpoint/put-file',
+      uploadPreview: (file, column, done) => {
+        console.log(file)
+        window.open(file.url, "_blank");
+        return;
+      },
       propsHttp: {
-        url: 'link',
-        name: 'originalName',
-        res: 'data',
+        url: "link",
+        name: "originalName",
+        res: "data",
       },
-      action: "/api/kd-resource/oss/endpoint/put-file-attach"
+      showOverflowTooltip: true,
     },
     {
       label: "收件人邮箱",
       prop: "sjryx",
       type: "input",
-      span: 12,
+      span: 24,
       width: 150,
       align: "center",
       search: false,
       showOverflowTooltip: true,
+      rules: [{
+        type: 'email',
+        message: '请输入正确的邮箱地址',
+        trigger: 'blur',
+      }]
     },
     {
       label: "专利提醒功能",
       prop: "zltxgn",
       type: "select",
       span: 12,
-      width: 100,
+      width: 90,
       align: "center",
-      search: false,
-      addDisplay: false,
-      editDisplay: false,
+      display: false,
       dicUrl: "/api/kd-system/dict-biz/dictionary?code=zltx",
-      disabled: true,
       props: {
         label: "dictValue",
         value: "dictKey",
       },
       showOverflowTooltip: true,
+      fixed: 'right'
     },
   ],
 };

+ 34 - 27
src/views/achievement/patent-achievement.vue

@@ -42,13 +42,21 @@
         >
           打印
         </el-button>
+
+        <div class="tip">提示:企业可自行上传全部历史专利信息和资料,如专利与系统中已建档的研究项目无关,则研发项目编号和研发项目名称非必填。</div>
       </template>
-      <template slot="glyfxmForm">
+
+
+      <template slot="xmIdForm">
         <project-select v-model="form.xmId" @change="handleProjectChange"></project-select>
       </template>
-      <template slot="attachmentForm">
-        <kd-upload></kd-upload>
+
+      <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>
+
     </avue-crud>
     <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
     <WideTablePrinter
@@ -81,43 +89,36 @@ export default window.$crudCommon({
   },
   data() {
     return {
-      params: {},
       wideTableColumns: [],
       printTitle: "",
     };
   },
   methods: {
+    getFormData() {
+      let newFormData = { ...this.form };
+      if (!!newFormData.attachment) {
+        newFormData.attachment = JSON.stringify(newFormData.attachment);
+      }
+      return newFormData;
+    },
     handleImport() {
-      // let excelParams = { yearAndMonth: this.params.yearAndMonth };
-      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/zl/import', {});
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/zl/import');
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
     },
     handleProjectChange(data){
-      console.log(data)
       this.form = {
         ...this.form,
         xmmc: data.xmmc,
         xmbh: data.xmbh
       }
     },
-    uploadAfter() {
-      this.$message({
-        type: "success",
-        message: "导入成功!"
-      });
-      this.page.currentPage = 1;
-      this.getList(this.page);
-    },
     handleExport() {
-      this.$confirm("是否导出吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        NProgress.start();
-        exportBlob(`/api/kd-scientific/kycg/zl/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-          downloadXls(res.data, `科研成果.xlsx`);
-          NProgress.done();
-        })
+      exportBlob(`/api/kd-scientific/kycg/zl/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `专利成果.xlsx`);
+        NProgress.done();
       });
     },
      /**
@@ -126,18 +127,24 @@ export default window.$crudCommon({
      */
     printTable() {
       this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `科研成果`;
+      this.printTitle = `专利成果`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(true);
       })
     },
+    handleDownFile(file) {
+      window.open(file.value, "_blank");
+    }
   },
 }, {
   // 模块路径
   name: 'achievement/patentAchievement',
   res: ({ data }) => {
     data.records = data.records.map(item => {
-      item.xmId = item.xmId === -1 ? '' : item.xmId;
+      item.xmId = item.xmId === 0 ? '' : item.xmId;
+      if (!!item.attachment) {
+        item.attachment = JSON.parse(item.attachment);
+      }
       return item;
     });