yangys
2025-08-15 e84263839093f87bff2b5e471500f06a0d4983dc
src/views/basesetting/produceplan.vue
@@ -6,6 +6,8 @@
-->
<template>
    <basic-container>
        <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="tabsClick">
            <el-tab-pane label="主制分工表" name="zhuzhi">
        <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud"
            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @row-del="rowDel"
@@ -24,13 +26,23 @@
                </el-button>
            </template> -->
        </avue-crud>
            </el-tab-pane>
            <el-tab-pane label="勤哲分工表" name="qinzhe">
                <avue-crud :option="optionQz" :table-loading="loadingQz" :data="dataQz" v-model:page="pageQz"
                    @search-change="searchChangeQz" @search-reset="searchResetQz" @current-change="currentChangeQz"
                    @size-change="sizeChangeQz" @refresh-change="refreshChangeQz" @on-load="onLoadQz">
                </avue-crud>
            </el-tab-pane>
        </el-tabs>
        <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>
@@ -38,6 +50,7 @@
<script>
import { getList, remove,save,update } from '@/api/basesetting/produceplan';
import { getListQz } from '@/api/basesetting/qinzhefgb';
import { mapGetters } from 'vuex';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
@@ -47,6 +60,7 @@
    name: 'ProducePlan',
    data() {
        return {
            activeName: "zhuzhi",
            // Define your data properties here
            excelOption: {
                submitBtn: false,
@@ -133,6 +147,7 @@
                        type: 'select',
                        span: 24,
                        display: true,
                        filterable:true,
                        dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        props: {
                            label: 'name',
@@ -146,6 +161,7 @@
                        prop: 'programmerId',
                        type: 'select',
                        display: true,
                        filterable:true,
                        span: 24,
                        dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        props: {
@@ -160,6 +176,7 @@
                        prop: 'checkerId',
                        type: 'select',
                        display: true,
                        filterable:true,
                        span: 24,
                        dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        props: {
@@ -173,6 +190,7 @@
                        label: '审核',
                        prop: 'seniorId',
                        type: 'select',
                        filterable:true,
                        display: true,
                        span: 24,
                        dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
@@ -196,10 +214,67 @@
            },
            form: {}, // This will hold the form data
            query: {}, // This will hold the search query
            //勤哲页面数据
            dataQz:[],
            loadingQz:false,
            pageQz: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            queryQz: {},
            optionQz: {
                // Define your Avue CRUD options here
                addBtn: false,
                editBtn: false,
                delBtn: false,
                columnBtn: false,
                tip: false,
                // simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                // tree: true,
                border: true,
                index: true,
                menu: false,
                menuWidth: 320,
                dialogWidth: 500,
                dialogClickModal: false,
                column: [
                    {
                        label: '产品号',
                        prop: 'cph',
                        type: 'input',
                        display: true,
                        span: 24,
                    },
               {
                        label: '零组件号',
                        prop: 'ljh',
                        type: 'input',
                        search: true,
                        display: true,
                        span: 24,
                    },
                    {
                        label: '主管工艺',
                        prop: 'zggy',
                        type: 'input',
                        display: true,
                        span: 24
                    }
                ],
            },
        };
    },
    methods: {
        // Define your methods here
        tabsClick(tab,event) {
            //console.log('tab',tab)
            this.onLoad(this.page, this.query);
        },
        searchChange(params, done) {
            this.query = params;
            this.page.currentPage = 1;
@@ -313,7 +388,40 @@
               window.console.log(error);
                }
            );
        }
        },
        sizeChangeQz() {
            this.pageQz.pageSize = pageSize;
        },
        searchChangeQz(params, done) {
            this.queryQz = params;
            this.pageQz.currentPage = 1;
            this.onLoadQz(this.pageQz, params);
            done();
        },
        searchResetQz() {
            this.queryQz = {};
            this.onLoadQz(this.pageQz);
        },
        currentChangeQz() {
            this.pageQz.currentPage = currentPage;
        },
        onLoadQz(page, params = {}) {
            const query = {
                ...this.queryQz,
                // category: params.category ? flowCategory(params.category) : null,
                mode: this.mode,
            };
            this.loadingQz = true;
            getListQz(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
                const data = res.data.data;
                this.pageQz.total = data.total;
                this.dataQz = data.records;
                this.loadingQz = false;
            });
        },
        refreshChangeQz() {
            this.onLoadQz(this.pageQz, this.queryQz);
        },
    },
    mounted() {
        // Code to run when the component is mounted