gaoshp
2025-08-13 31380071dc933444909ae160c1ea34600784a13b
src/views/basesetting/produceplan.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2025-06-17 11:44:52
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-08-06 20:34:14
 * @LastEditTime: 2025-08-13 22:22:49
 * @FilePath: /mdmweb/src/views/basesetting/produceplan.vue
-->
<template>
@@ -24,17 +24,67 @@
                </el-button>
            </template> -->
        </avue-crud>
        <el-dialog title="" append-to-body v-model="excelBox" width="555px">
            <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
                <template #excelTemplate>
                    <el-button type="primary" @click="handleTemplate">
                        确定
                    </el-button>
                </template>
            </avue-form>
        </el-dialog>
    </basic-container>
</template>
<script>
import { getList, remove,save,update } from '@/api/basesetting/produceplan';
import { mapGetters } from 'vuex';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
import { downloadXls } from '@/utils/util';
export default {
    name: 'ProducePlan',
    data() {
        return {
            // Define your data properties here
            excelOption: {
                submitBtn: false,
                emptyBtn: false,
                column: [
                    // {
                    //     label: '文件类型',
                    //     prop: 'fileType',
                    //     type: 'select',
                    //     span: 24,
                    //     clearable: false,
                    //     dicData: [
                    //         { label: '程序文件', value: 'program' },
                    //         { label: '其他文件', value: 'other' },
                    //     ],
                    // },
                    {
                        label: '文件导入',
                        prop: 'file',
                        type: 'upload',
                        drag: true,
                        loadText: '导入中,请稍后',
                        span: 24,
                        propsHttp: {
                            res: 'data',
                        },
                        data: {
                        },
                        tip: '',
                        action: '/blade-mdm/producedivision/download-template',
                    },
                ],
            },
            excelForm: {
                fileType: 'program',
                excelFile: [],
            },
            excelBox: false,
            option: {
                // Define your Avue CRUD options here
                addBtn: true,
@@ -198,11 +248,23 @@
        },
        importAction() {
            // Logic for importing data
            this.$message.success('导入功能尚未实现');
            // this.$message.success('导入功能尚未实现');
            this.excelBox = true;
        },
        uploadAfter(res, done, loading, column) {
            window.console.log(column);
            this.onLoad(this.page);
            this.excelBox = false;
            done();
        },
      downTemplateAction() {
            // Logic for importing data
            this.$message.success('模板功能尚未实现');
            NProgress.start();
            exportBlob(
                `/blade-mdm/producedivision/download-template`
            ).then(res => {
                downloadXls(res.data, `主制分工表导入模版.xlsx`);
                NProgress.done();
            });
        },
        rowDel(row) {
            this.$confirm('确定将选择数据删除?', {