gaoshp
2025-07-07 ac0d23872423d6815c2e996de198677dff619a78
导出DNC
已修改1个文件
已添加2个文件
208 ■■■■■ 文件已修改
src/api/flowmgr/programexport.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flow/components/TodolistLeft.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowmgr/programexport.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/flowmgr/programexport.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/*
 * @Date: 2025-06-12 22:38:05
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-07-07 21:49:01
 * @FilePath: /mdmweb/src/api/flowmgr/programexport.js
 */
import request from '@/axios';
export const getList = (current, size, params) => {
  return request({
    url: '/blade-mdm/program/exchange/export-dnc-page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  })
};
src/views/flow/components/TodolistLeft.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2025-07-01 20:45:15
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-07-07 19:51:14
 * @LastEditTime: 2025-07-07 20:00:11
 * @FilePath: /mdmweb/src/views/flow/components/TodolistLeft.vue
-->
<template>
@@ -163,7 +163,7 @@
}
.app-content {
    background-color: #fffee1;
    padding: 10px;
    padding: 10px 30px;
    min-height: 100px;
    overflow: auto;
    max-height: 400px;
src/views/flowmgr/programexport.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,186 @@
<!--
 * @Date: 2025-06-20 20:48:17
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-07-07 22:02:49
 * @FilePath: /mdmweb/src/views/flowmgr/programexport.vue
-->
<template>
    <basic-container>
        <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">
            <template #menu-left>
                <!-- <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> -->
                <!-- <el-button type="primary" plain @click="reassign">挂载车床程序库</el-button> -->
                <el-button type="primary" plain @click="exportExcel">导出到EXCEL</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>
    </basic-container>
</template>
<script>
    import { getList } from '@/api/flowmgr/programexport.js';
    import NProgress from 'nprogress';
    import { exportBlob } from '@/api/common';
    import { getToken } from '@/utils/auth';
    export default {
    name: 'programexport',
    data() {
        return {
            // Define your data properties here
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            form: {},
            query: {},
            loading: true,
            data: [],
            option: {
                addBtn: false,
                editBtn: false,
                delBtn: false,
                viewBtn: true,
                columnBtn: false,
                tip: false,
                // simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                dialogWidth: '60%',
                // tree: true,
                border: true,
                index: true,
                selection: true,
                // viewBtn: true,
                menuWidth: 200,
                menu: false,
                dialogClickModal: false,
                column: [
                    {
                        label: '图号',
                        prop: '',
                    },
                    {
                        label: '图号版次',
                        prop: '',
                    },
                    {
                        label: '工序名称',
                        prop: '',
                    },
                    {
                        label: '程序名称',
                        prop: 'name',
                        search: true,
                    },
                    {
                        label: '通过时间',
                        prop: 'updateTime',
                    },
                    {
                        label: '完成时间',
                        prop: 'passTime',
                        search: true,
                        hide: true,
                        type: 'datetime',
                        format: 'YYYY-MM-DD HH:mm:ss',
                        valueFormat: 'YYYY-MM-DD HH:mm:ss',
                        searchRange: true,
                        searchSpan: 8,
                    },
                ],
            }
        };
    },
    methods: {
        // Define your methods here
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            // this.onLoad();
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
        },
        searchChange(params, done) {
            let data = {}
            this.query = params;
            this.page.currentPage = 1;
            console.log('searchChange', params);
            params.passTimeBegin = params?.passTime?.[0] || '';
            params.passTimeEnd = params?.passTime?.[1] || '';
            console.log(params);
            data = {
                createTimeBegin: params.passTimeBegin,
                createTimeEnd: params.passTimeEnd,
                name: params.name || ''
            }
            this.query = data
            this.onLoad(this.page, data);
            done();
        },
        searchReset() {
            this.query = {};
            this.onLoad(this.page);
        },
        /** * é¡µé¢åŠ è½½æ—¶èŽ·å–æ•°æ®
         */
        onLoad(page, params = {}) {
            console.log('onLoad', page, params);
            const query = {
                ...this.query,
                // category: params.category ? flowCategory(params.category) : null,
                mode: this.mode,
            };
            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;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
            }, () => {
                this.data = [];
                this.loading = false;
            }).catch(err => {
                this.data = [];
                this.loading = false;
            });
        },
        exportExcel() {
            this.$confirm('是否导出?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            }).then(() => {
                NProgress.start();
                exportBlob(
                    `/blade-mdm/program/exchange/export-dnc?${this.website.tokenHeader}=${getToken()}`
                ).then(res => {
                    downloadXls(res.data, `导出机床回传程序${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
                    NProgress.done();
                });
            });
        },
    },
    mounted() {
    }
}
</script>
<style lang="scss" scoped>
</style>