Browse Source

技术标准接口联调

ljb 10 months ago
parent
commit
fc1f75cff6
2 changed files with 192 additions and 127 deletions
  1. 91 111
      src/option/achievement/technicalStandard.js
  2. 101 16
      src/views/achievement/technical-standard.vue

+ 91 - 111
src/option/achievement/technicalStandard.js

@@ -7,196 +7,176 @@ export default {
   searchMenuSpan: 6,
   searchMenuSpan: 6,
   border: true,
   border: true,
   index: true,
   index: true,
-  viewBtn: true,
   selection: true,
   selection: true,
   addBtn: true,
   addBtn: true,
   delBtn: true,
   delBtn: true,
   searchLabelWidth: 140,
   searchLabelWidth: 140,
-  labelWidth: 140,
+  labelWidth: 100,
   menuWidth: 160,
   menuWidth: 160,
   dialogClickModal: false,
   dialogClickModal: false,
-  dialogWidth: 760,
+  dialogWidth: 500,
   dialogType: "drawer",
   dialogType: "drawer",
   column: [
   column: [
     {
     {
       label: "标准号",
       label: "标准号",
-      prop: "number",
-      span: 12,
-      width: 130,
+      prop: "zbh",
+      span: 24,
+      width: 100,
       align: "center",
       align: "center",
       search: true,
       search: true,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
-          message: "请输入专利号",
+          message: "请输入标准号",
           trigger: "blur",
           trigger: "blur",
         },
         },
       ],
       ],
     },
     },
     {
     {
       label: "标准名称",
       label: "标准名称",
-      prop: "name",
-      span: 12,
+      prop: "zbmc",
+      span: 24,
       search: true,
       search: true,
-      width: 100,
-      align: "center",
+      width: 140,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
-          message: "请输入专利名称",
+          message: "请输入标准名称",
           trigger: "blur",
           trigger: "blur",
         },
         },
       ],
       ],
     },
     },
     {
     {
-      label: "版本号",
-      prop: "identityCard",
-      span: 12,
+      label: "标准类别",
+      prop: "bzlb",
+      span: 24,
       search: true,
       search: true,
-      width: 155,
-      align: "center",
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=technical_standard_type',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      width: 100,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
-          message: "请输入专利类型",
+          message: "请选择标准类别",
           trigger: "blur",
           trigger: "blur",
         },
         },
       ],
       ],
     },
     },
     {
     {
-      label: "登记号",
-      prop: "secondaryUnit",
-      span: 12,
-      width: 140,
-      search: true,
+      label: "颁布部门",
+      prop: "bbbm",
+      span: 24,
+      width: 120,
       align: "center",
       align: "center",
       showOverflowTooltip: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择是否国防专利",
-          trigger: "blur",
-        },
-      ],
     },
     },
     {
     {
-      label: "开发完成日期",
-      prop: "department",
-      type: "select",
-      span: 12,
-      width: 140,
+      label: "起草单位",
+      prop: "qlr",
+      span: 24,
+      width: 100,
       search: true,
       search: true,
       align: "center",
       align: "center",
       showOverflowTooltip: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择国别",
-          trigger: "blur",
-        },
-      ],
     },
     },
     {
     {
-      label: "首次发布日期",
-      prop: "post",
-      type: "input",
-      span: 12,
-      width: 100,
+      label: "参与人",
+      prop: "cyr",
+      span: 24,
+      width: 70,
       align: "center",
       align: "center",
-      search: false,
+      search: true,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请输入申请号/专利号",
-          trigger: "blur",
-        },
-      ],
     },
     },
     {
     {
-      label: "登记批准日期",
-      prop: "postLocation",
-      type: "select",
-      span: 12,
+      label: "实施日期",
+      prop: "ssrq",
+      type: "date",
+      valueFormat: 'yyyy-MM-dd',
+      span: 24,
       width: 100,
       width: 100,
-      search: false,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       align: "center",
       align: "center",
-      rules: [
-        {
-          required: true,
-          message: "请选择申请日",
-          trigger: "blur",
-        },
-      ],
     },
     },
     {
     {
-      label: "取得方式",
-      prop: "nature",
-      type: "select",
-      span: 12,
-      width: 80,
+      label: "状态",
+      prop: "state",
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=technical_standard_state',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      width: 100,
       align: "center",
       align: "center",
       search: true,
       search: true,
+      span: 24,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: "请选择授权日",
-          trigger: "change",
-        },
-      ],
     },
     },
     {
     {
-      label: "关联研发项目情况",
-      prop: "personnelType",
-      type: "select",
-      span: 12,
-      width: 80,
+      label: "参与/主持",
+      prop: "canyunZhuchi",
+      span: 24,
+      width: 90,
       align: "center",
       align: "center",
-      search: false,
-      dicUrl: "/api/kd-system/dict-biz/dictionary?code=renyuanleixing",
-      props: {
-        label: "dictValue",
-        value: "dictKey",
-      },
       showOverflowTooltip: true,
       showOverflowTooltip: true,
+    },
+    {
+      label: "关联研发项目情况",
+      prop: "canyunZhuchi",
+      align: 'center',
       children: [
       children: [
         {
         {
           label: "研发项目名称",
           label: "研发项目名称",
+          prop: 'xmId',
+          width: 120,
+          span: 24,
+          hide: true
+        },
+        {
+          label: "研发项目名称",
+          prop: 'xmmc',
+          width: 120,
           search: true,
           search: true,
-          rules: [
-            {
-              required: true,
-              message: "请输入发明人",
-              trigger: "blur",
-            },
-          ],
+          showOverflowTooltip: true,
+          display: false
         },
         },
         {
         {
           label: "研发项目编号",
           label: "研发项目编号",
+          prop: 'xmbh',
+          width: 100,
+          align: 'center',
           search: true,
           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,
       showOverflowTooltip: true,
     },
     },
   ],
   ],

+ 101 - 16
src/views/achievement/technical-standard.vue

@@ -42,43 +42,128 @@
         >
         >
           打印
           打印
         </el-button>
         </el-button>
+        <div class="tip">提示:企业可自行上传全部历史专利信息和资料,如专利与系统中已建档的研究项目无关,则研发项目编号和研发项目名称非必填。</div>
       </template>
       </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>
     </avue-crud>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
   </basic-container>
   </basic-container>
 </template>
 </template>
 
 
 <script>
 <script>
-import {exportBloByPost} from "@/api/common";
+import projectSelect from "@/components/project-select";
+import {exportBlob} from "@/api/common";
 import NProgress from 'nprogress';
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 import 'nprogress/nprogress.css';
 import {getToken} from "@/util/auth";
 import {getToken} from "@/util/auth";
 import {downloadXls} from "@/util/util";
 import {downloadXls} from "@/util/util";
-
+import { isAlphanumericCombination } from "@/util/regex";
 
 
 export default window.$crudCommon({
 export default window.$crudCommon({
-  
+  components: {
+    projectSelect
+  },
   data() {
   data() {
     return {
     return {
-      params: {},
+      wideTableColumns: [],
+      printTitle: "",
     };
     };
   },
   },
   methods: {
   methods: {
+    validCustom() {
+      if (!isAlphanumericCombination(this.form.zbh)) {
+        this.$message.warning("标准号必须是英文字母加数字组合!");
+        return false;
+      }
+      return true;
+    },
+    addBefore(loading, callback) {
+      if (!this.validCustom()) {
+        loading();
+        return;
+      }
+      callback && callback();
+    },
+    updateBefore(loading, callback) {
+      if (!this.validCustom()) {
+        loading();
+        return false;
+      }
+      callback && callback();
+    },
+    handleImport() {
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/kycg/jsbz/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() {
     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/jsbz/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/technicalStandard'
+  name: 'achievement/technicalStandard',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      if (!!item.attachment) {
+        item.attachment = JSON.parse(item.attachment);
+      }
+      return item;
+    })
+
+    return data;
+  }
 });
 });
 </script>
 </script>