| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <div>
- <avue-crud
- ref="crud"
- v-bind="bindVal"
- v-on="onEvent"
- v-model="form"
- :page.sync="page"
- :before-open="handleBeforeOpen"
- :permission="permissionList"
- >
- <template slot="menuLeft">
- <el-button
- v-if="!isSelAnnual"
- type="danger"
- size="small"
- icon="el-icon-delete"
- plain
- @click="handleDelete"
- >
- 删 除
- </el-button>
- <el-button
- v-if="!isSelAnnual"
- type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- @click="handleImport"
- >
- 导入
- </el-button>
- <el-button
- type="warning"
- size="small"
- plain
- icon="el-icon-download"
- @click="handleExport"
- >
- 导出
- </el-button>
- <print-table-btn @click="printTable" />
- </template>
-
- </avue-crud>
- <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
- <WideTablePrinter
- ref="printWideTable"
- :columns="wideTableColumns"
- :data="data"
- :print-title="printTitle"
- :rows-per-page="30"
- :default-landscape="true"
- />
- </div>
- </template>
- <script>
- import {exportBloByPost} from "@/api/common";
- import UploadExcelDialog from "@/components/upload-excel-dialog";
- import {getToken} from "@/util/auth";
- import {downloadXls} from "@/util/util";
- export default window.$crudCommon({
- components: {
- UploadExcelDialog,
- },
- data() {
- return {
- wideTableColumns: [],
- printTitle: "",
- };
- },
- created() {
- this.option.height = window.innerHeight - 270;
- let newOption = { ...this.option };
- // 姓名下拉框,设置监听事件
- newOption.column.forEach(item => {
- if (item.prop == "zcmc") {
- item.change = ({ item }) => {
- if (!!item) {
- this.form = {
- ...this.form,
- ytxe: item.zcyz,
- };
- }
- }
- }
- });
- this.option = { ...newOption };
- },
- methods: {
- handleBeforeOpen(done) {
- this.option.column.forEach(item => {
- if (item.prop == "zcmc") {
- item.dicUrl = '/api/kd-scientific/zc/page';
- item.dicQuery.yearAndMonth = '202507';
- }
- });
- done();
- },
- handleImport() {
- this.$refs.uploadExcelDialog.open('/api/kd-scientific/ys-wxzctxfy/import');
- },
- uploadAfter() {
- this.page.currentPage = 1;
- this.getList(this.page);
- },
- handleExport() {
- exportBloByPost(`/api/kd-scientific/ys-wxzctxfy/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
- downloadXls(res.data, `无形资产摊销费用.xlsx`);
- });
- },
- /**
- * 打印表格
- * @param isLandscape 是否横向打印
- */
- printTable(isLandscape) {
- this.wideTableColumns = this.$refs.crud.columnOption;
- this.printTitle = `无形资产摊销费用`;
- this.$nextTick(() => {
- this.$refs.printWideTable.printTable(isLandscape);
- })
- },
- },
- }, {
- // 模块路径
- name: 'projectManage/wxzctxCost',
- res: ({ data }) => {
- return data;
- },
- });
- </script>
|