yangys
2025-09-22 b311b3cfee0a4635c236eea6c5870d805a29a160
src/views/flowmgr/programexport.vue
@@ -8,32 +8,25 @@
    <basic-container>
        <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="tabsClick">
            <el-tab-pane label="待办" name="todo">
                <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
                    @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                <avue-crud :option="option" :search="searchData" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
                    @size-change="sizeChange" @refresh-change="refreshChange" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                    <template #menu-left>
                        <!-- <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> -->
                        <!-- <el-button type="primary" plain @click="reassign">挂载车床程序库</el-button> -->
                      <!-- @on-load="onLoad"-->
                        <el-button type="primary" :disabled="this.selection.length==0" plain @click="exportExcel">导出</el-button>
                    </template>
                    <template #menu="scope">
                        <!-- <el-button type="primary" text size="default"
                            @click.stop="handleAction(scope.row, scope.index)">处理意见
                        </el-button> -->
                    </template>
                </avue-crud>
            </el-tab-pane>
            <el-tab-pane label="已办" name="completed">
                <avue-crud :option="optionCompleted" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
                    @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                <avue-crud :option="optionCompleted" :search="searchData" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud1" @current-change="currentChange"
                    @size-change="sizeChange" @refresh-change="refreshChange" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                    <template #menu-left>
                        <!-- <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> -->
                        <!-- <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> @on-load="onLoad" -->
                        <!-- <el-button type="primary" plain @click="reassign">挂载车床程序库</el-button> -->
                        <el-button type="primary" :disabled="this.selection.length==0" plain @click="exportExcel">导出</el-button>
                    </template>
                    <template #menu="scope">
                        <!-- <el-button type="primary" text size="default"
                            @click.stop="handleAction(scope.row, scope.index)">处理意见
                        </el-button> -->
                    </template>
                </avue-crud>
            </el-tab-pane>
@@ -60,6 +53,7 @@
                total: 0,
            },
            form: {},
            searchData:{},
            query: {},
            loading: true,
            data: [],
@@ -71,16 +65,13 @@
                viewBtn: true,
                columnBtn: false,
                tip: false,
                // simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                searchEnter:true,
                dialogWidth: '60%',
                // tree: true,
                border: true,
                index: true,
                selection: true,
                // viewBtn: true,
                menuWidth: 200,
                menu: false,
                dialogClickModal: false,
@@ -120,7 +111,17 @@
                        label: '程序包名',
                        prop: 'name',
                        search: true,
                        searchSpan:6,
                        with: 100
                    },
                     {
                        label: '查询范围',
                        prop: 'queryType',
                        type: 'select',
                        search: true,
                        clearable:false,
                        searchSpan:4,
                        with: 100,
                    },
                    {
                        label: '通过时间',
@@ -223,10 +224,11 @@
                        sortable: true,
                    },
                ],
            }
            },
        };
    },
    methods: {
        tabsClick(tab,event) {
            this.onLoad(this.page, this.query);
        },
@@ -246,16 +248,18 @@
        },
        searchChange(params, done) {
            let data = {}
            this.query = params;
            this.page.currentPage = 1;
            console.log('searchChange', params);
            //console.log('searchChange', params);
            params.passTimeBegin = params?.passTime?.[0] || '';
            params.passTimeEnd = params?.passTime?.[1] || '';
            console.log(params);
            //console.log(params);
            data = {
                createTimeBegin: params.passTimeBegin,
                createTimeEnd: params.passTimeEnd,
                name: params.name || ''
                name: params.name || '',
                queryType:this.query.queryType
            }
            this.query = data
            this.onLoad(this.page, data);
@@ -263,6 +267,7 @@
        },
        searchReset() {
            this.query = {};
            this.query.queryType = this.searchData.queryType;
            this.onLoad(this.page);
        },
        /** * 页面加载时获取数据
@@ -270,17 +275,10 @@
        onLoad(page, params = {}) {
            const query = {
                ...this.query,
                // category: params.category ? flowCategory(params.category) : null,
                mode: this.mode,
            };
            var status = this.activeName == 'todo'?null:2;
            params.status = status;
            try {
                delete query.confirmTime; // 删除不必要的查询条件
            } catch (error) {
                console.error('日期格式化错误', error);
            }
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
                const data = res.data.data;
@@ -353,8 +351,32 @@
            });
        },
    },
    computed: {
       ...mapGetters(['permission']),
    },
    mounted() {
        let queryTypeDicData = [
                            {
                                label: '同组编制',
                                value:'group',
                            },
                            {
                                label: '本人编制',
                                value:'self',
                            }
                        ];
        //console.log('this.permission.program_allexpor',this.permission.program_allexport)
        if(this.permission.program_allexport==true){
            queryTypeDicData.push({label:'全部数据',value:'all'});
            this.searchData.queryType = 'all'
        }else{
            this.searchData.queryType = 'self';
        }
        this.option.column[7].dicData = queryTypeDicData;
        this.onLoad(this.page, this.searchData);
    }
}
</script>