123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <el-dialog
- title="提报列表"
- :visible.sync="visible"
- top="5vh"
- width="60%"
- :before-close="onClose"
- append-to-body
- class="el-dialogDeep"
- v-dialog-drag
- >
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- ref="crud"
- :page.sync="page"
- @current-change="currentChange"
- @size-change="sizeChange"
- :cell-style="cellStyle"
- >
- <template slot-scope="{ row }" slot="name">
- <el-tag style="cursor:pointer" @click="goReport(row.name)">{{
- row.name | nameFormat
- }}</el-tag>
- </template>
- </avue-crud>
- <span slot="footer" class="dialog-footer">
- <el-button @click="onClose()">关 闭</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import { getList } from "@/api/report/report";
- import { nameReportFormat } from "@/filters/report";
- export default {
- data() {
- return {
- visible: false,
- loading: true,
- query: {},
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- option: {
- addBtn: false,
- border: true,
- index: true,
- refreshBtn: false,
- menu: false,
- columnBtn: false,
- header: false,
- column: [
- {
- label: "文件名",
- prop: "name",
- overHidden: true
- },
- {
- label: "创建时间",
- prop: "createTime",
- overHidden: true
- },
- {
- label: "更新时间",
- prop: "updateTime",
- overHidden: true
- }
- ]
- },
- data: []
- };
- },
- props: {
- switchDialog: {
- type: Boolean,
- default: false
- },
- reportName: {
- type: String
- },
- reportId: {
- type: String
- },
- searchValue:{
- type:Object
- }
- },
- filters: {
- nameFormat(name) {
- return nameReportFormat(name);
- }
- },
- methods: {
- cellStyle() {
- return "padding:0;height:40px;";
- },
- onClose() {
- this.visible = false;
- Object.assign(this.$data, this.$options.data());
- this.$emit("onClose", false);
- },
- getList() {
- this.loading = true;
- getList(
- this.page.currentPage,
- this.page.pageSize,
- Object.assign(this.query)
- ).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- if (this.page.total) {
- this.option.height = window.innerHeight - 350;
- }
- });
- },
- goReport(name) {
- let tenantId = this.$store.getters.userInfo.tenant_id
- if(this.reportName == "同海-统计列表"){
- this.$router.push({
- path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
- &tenantId=${this.searchValue.tenantId}
- &status=${this.searchValue.status}
- &cornId=${this.searchValue.cornId}
- &deptid=${this.searchValue.deptid}
- &pname=${this.searchValue.pname}
- &projectType=${this.searchValue.projectType}
- &payStartTime=${this.searchValue.payStartTime}
- &payEndTime=${this.searchValue.payEndTime}
- &userName=${this.searchValue.userName}`
- });
- }else if(name == "客户资料-客户资料.ureport.xml"){
- this.$router.push({
- path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`
- });
- }else if(name == "国内贸易-库存账.ureport.xml"){
- this.$router.push({
- path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}
- &code=${this.searchValue.code}
- &cname=${this.searchValue.cname}
- &brandItem=${this.searchValue.brandItem}
- &placeProduction=${this.searchValue.placeProduction}
- &typeno=${this.searchValue.typeno}
- &typenoOne=${this.searchValue.typenoOne}
- &typenoTwo=${this.searchValue.typenoTwo}
- &stockName=${this.searchValue.stockName}
- &brand=${this.searchValue.brand}
- &tenantId=${tenantId}`
- });
- }else{
- this.$router.push({
- path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}`
- });
- }
- this.$emit("onClose", false);
- }
- },
- watch: {
- switchDialog: function(i) {
- this.visible = i;
- this.query = {
- name: this.reportName ? this.reportName : this.$router.currentRoute.name
- };
- if (i) {
- this.getList();
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|