|
@@ -30,7 +30,7 @@
|
|
|
ref="printWideTable"
|
|
ref="printWideTable"
|
|
|
:columns="wideTableColumns"
|
|
:columns="wideTableColumns"
|
|
|
:data="data"
|
|
:data="data"
|
|
|
- :print-title="printTitle"
|
|
|
|
|
|
|
+ :print-title="pageTitle"
|
|
|
:rows-per-page="30"
|
|
:rows-per-page="30"
|
|
|
:default-landscape="true"
|
|
:default-landscape="true"
|
|
|
/>
|
|
/>
|
|
@@ -64,10 +64,25 @@ export default window.$crudCommon({
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
'params.yearAndMonth'(newVal) {
|
|
'params.yearAndMonth'(newVal) {
|
|
|
|
|
+ if (newVal.length > 4) {
|
|
|
|
|
+ // 是否勾选未全年
|
|
|
|
|
+ this.isSelAnnual = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isSelAnnual = true;
|
|
|
|
|
+ }
|
|
|
this.page.currentPage = 1;
|
|
this.page.currentPage = 1;
|
|
|
this.getList(this.page);
|
|
this.getList(this.page);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ pageTitle() {
|
|
|
|
|
+ let yearAndMonthCN = moment(this.params.yearAndMonth).format("yyyy年MM月");
|
|
|
|
|
+ if (this.isSelAnnual) {
|
|
|
|
|
+ yearAndMonthCN = moment(this.params.yearAndMonth).format("yyyy年");
|
|
|
|
|
+ }
|
|
|
|
|
+ return `${yearAndMonthCN}项目参研人员汇总表`
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
spanMethod({ row, column, rowIndex, columnIndex }) {
|
|
spanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
let fields = ["xmmc"];
|
|
let fields = ["xmmc"];
|
|
@@ -90,22 +105,13 @@ export default window.$crudCommon({
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
- this.$confirm("是否导出吗?", "提示", {
|
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- NProgress.start();
|
|
|
|
|
- exportBloByPost(`/api/kd-scientific/technician/xmcyryhzb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
|
|
- downloadXls(res.data, `${this.params.yearAndMonth}项目参研人员汇总表.xlsx`);
|
|
|
|
|
- NProgress.done();
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ exportBloByPost(`/api/kd-scientific/technician/xmcyryhzb-export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
|
|
+ downloadXls(res.data, `${this.pageTitle}.xlsx`);
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
printTable(isLandscape) {
|
|
printTable(isLandscape) {
|
|
|
this.wideTableColumns = this.$refs.crud.columnOption;
|
|
this.wideTableColumns = this.$refs.crud.columnOption;
|
|
|
- this.printTitle = `${this.params.yearAndMonth}项目参研人员汇总表`;
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
|
})
|
|
})
|