|
|
@@ -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>
|