| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <basic-container>
- <avue-crud
- v-bind="bindVal"
- v-on="onEvent"
- v-model="form"
- :page.sync="page"
- >
- <template slot="menuLeft">
- <el-button
- type="warning"
- size="small"
- plain
- icon="el-icon-download"
- @click="handleExport"
- >
- 导出
- </el-button>
- </template>
- <template slot="body">
- <h3 class="page-title">{{ pageTitle }}</h3>
- <year-month-select
- v-model="params.year"
- :showMonth="false"
- ></year-month-select>
- </template>
- </avue-crud>
- </basic-container>
- </template>
- <script>
- import { exportBlob } from "@/api/common";
- import YearMonthSelect from "@/components/year-month-select";
- import moment from "moment";
- import { getToken } from "@/util/auth";
- import { downloadXls } from "@/util/util";
- import { mapGetters } from "vuex"
- import { computed } from "vue";
- export default window.$crudCommon({
- components: {
- YearMonthSelect,
- },
- data() {
- return {
- params: {
- year: "",
- },
- };
- },
- watch: {
- "params.year"() {
- this.page.currentPage = 1;
- this.getList(this.page);
- },
- },
- computed: {
- ...mapGetters(['tag']),
- pageTitle() {
- let yearCN = this.params.year ? moment(this.params.year).format('yyyy年') : '';
- return `${yearCN}${this.tag.label}`
- }
- },
- methods: {
- loadData() {
- this.loading = true;
- this.api.getList(this.getSearchParams()).then(res => {
- this.loading = false;
- if (res.data.code == 200) {
- this.data = res.data.data.map(item => {
- item.xmStageField = item.xmStage;
- item.govBonusField = item.govBonus;
- return item;
- });
- }
- })
- },
- getFormData() {
- return { yearAndMonth: this.params.year, xmId: this.form.xmId, id: this.form.id, xmStage: this.form.xmStageField, govBonus: this.form.govBonusField };
- },
- handleExport() {
- exportBlob(
- `/api/kd-scientific/qyyjkfxmqk/export?${
- this.website.tokenHeader
- }=${getToken()}`,
- this.params
- ).then((res) => {
- downloadXls(
- res.data,
- `${this.params.year}企业研究开发项目情况.xlsx`
- );
- });
- },
- },
- },
- {
- // 模块路径
- name: "externalReports/107-1",
- });
- </script>
|