<template>
    <div>
        <SearchBox ref="searchBarRef" :formName="search" :formData="query" @showPopupUser="showPop" showResetButton
            @reset="reset" />
        <ButtonBar @search="handleSearch" @add="handleAdd" @remove="handleRemoveBatch" @edit="handleEditBatch"
            @upload="handleUpload" @download="handleDownload" @import="handleImport" @export="handleExport"></ButtonBar>
        <el-card :body-style="cardBodyStyle">
            <el-table :data="tableData" border highlight-current-row @selection-change="handleSelectionChange">
                <el-table-column type="selection" fixed></el-table-column>
                <el-table-column type="index" label="序号" align="center" width="60">
                    <template #default="scope">
                        <span>{{ scope.$index + (currentPage - 1) * pageSize + 1 }}</span>
                    </template>
                </el-table-column>
                <el-table-column v-if="false" prop="" label="ID" width="120" header-align="center" align="center"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="createEmpId" label="创建人id" width="300" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="createDtm" label="创建时间" width="240" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="modifyEmpId" label="修改人id" width="300" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="modifyDtm" label="修改时间" width="240" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="cancleEmpId" label="删除人ID" width="300" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="cancleDtm" label="删除时间" width="240" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="false" prop="cancleYn" label="删除标记" width="240" header-align="center"
                    align="center" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="prodDt" label="生产日期" width="110" header-align="center" align="center"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="prodShift" label="班次" width="80" header-align="center" align="center"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="prodGrp" label="班组" width="80" header-align="center" align="center"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="oreIronGrd" label="原矿品位_铁" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="oreCoppGrd" label="原矿品位_铜" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="oreCobaGrd" label="原矿品位_钴" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="oreSulfGrd" label="原矿品位_硫" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ironCcttIronGrd" label="铁精矿品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ironCcttCoppGrd" label="铁精矿品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ironCcttCobaGrd" label="铁精矿品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ironCcttSulfGrd" label="铁精矿品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="coppCcttIronGrd" label="铜精矿品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="coppCcttCoppGrd" label="铜精矿品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="coppCcttCobaGrd" label="铜精矿品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="coppCcttSulfGrd" label="铜精矿品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="cobaCcttIronGrd" label="钴精矿品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="cobaCcttCoppGrd" label="钴精矿品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="cobaCcttCobaGrd" label="钴精矿品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="cobaCcttSulfGrd" label="钴精矿品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="sulfCcttIronGrd" label="硫精矿品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="sulfCcttCoppGrd" label="硫精矿品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="sulfCcttCobaGrd" label="硫精矿品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="sulfCcttSulfGrd" label="硫精矿品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="tailIronGrd" label="尾矿品位_铁" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="tailCoppGrd" label="尾矿品位_铜" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="tailCobaGrd" label="尾矿品位_钴" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="tailSulfGrd" label="尾矿品位_硫" width="110" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd1" label="1#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd1" label="1#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd1" label="1#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd1" label="1#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd2" label="2#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd2" label="2#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd2" label="2#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd2" label="2#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd3" label="3#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd3" label="3#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd3" label="3#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd3" label="3#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd4" label="4#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd4" label="4#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd4" label="4#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd4" label="4#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd5" label="5#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd5" label="5#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd5" label="5#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd5" label="5#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmIronGrd6" label="6#入磨品位_铁" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCoppGrd6" label="6#入磨品位_铜" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmCobaGrd6" label="6#入磨品位_钴" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>
                <el-table-column v-if="true" prop="ballmSulfGrd6" label="6#入磨品位_硫" width="120" header-align="center"
                    align="right" show-overflow-tooltip>
                </el-table-column>


                <el-table-column label="操作" header-align="center" align="center" width="200px" fixed="right">
                    <template #default="scope">
                        <el-button plain type="warning" @click="handleEdit(scope.row)">编辑</el-button>
                        <el-button plain type="danger" @click="handleDelete(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
        <el-card :body-style="cardBodyStyle">
            <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="pageSizes" :total="totalRows"
                background="background" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
                @current-change="handleCurrentChange">
            </el-pagination>
        </el-card>

        <el-dialog :close-on-click-modal="false" draggable title="编辑" v-model="dialogVisible" width="1200px" top="5vh"
            @open="openDialog">
            <el-form :model="form" label-width="80px" label-position="right" inline ref="ruleFormRef" :rules="rules">
                <el-card style=" margin-bottom: 10px; height: 70px;">
                    <el-row :gutter="60">
                        <el-col span="6">
                            <el-form-item label="生产日期" prop="prodDt">
                                <el-date-picker v-model="form.prodDt" type="date" style="width: 190px;" placeholder="请选择生产日期"
                                    value-format="YYYY-MM-DD" format="YYYY-MM-DD"></el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col span="6">
                            <el-form-item label="班次" prop="prodShift">
                                <el-select v-model="form.prodShift" placeholder="请选择班次" style="width: 190px;">
                                    <el-option v-for="option in optionShiftList" :key="option.dicCode"
                                        :label="option.dicCode" :value="option.dicCode" />
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col span="6">
                            <el-form-item label="班组" prop="prodGrp">
                                <el-select v-model="form.prodGrp" placeholder="请选择班组" style="width: 190px;">
                                    <el-option v-for="option in optionGrpList" :key="option.dicCode"
                                        :label="option.dicCode" :value="option.dicCode" />
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-card>
                <el-card style="margin-bottom: 10px; height: 380px;">
                    <el-tabs>
                        <el-tab-pane label="矿品位信息设置">
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="原矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.oreIronGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="原矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.oreCoppGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="原矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.oreCobaGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="原矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.oreSulfGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="铁精矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ironCcttIronGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="铁精矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ironCcttCoppGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="铁精矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ironCcttCobaGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="铁精矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ironCcttSulfGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="铜精矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.coppCcttIronGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="铜精矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.coppCcttCoppGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="铜精矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.coppCcttCobaGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="铜精矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.coppCcttSulfGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="钴精矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.cobaCcttIronGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="钴精矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.cobaCcttCoppGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="钴精矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.cobaCcttCobaGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="钴精矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.cobaCcttSulfGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="硫精矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.sulfCcttIronGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="硫精矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.sulfCcttCoppGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="硫精矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.sulfCcttCobaGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="硫精矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.sulfCcttSulfGrd" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="尾矿品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.tailIronGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="尾矿品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.tailCoppGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="尾矿品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.tailCobaGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="尾矿品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.tailSulfGrd" clearable style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-tab-pane>
                    </el-tabs>
                </el-card>
                <el-card style=" height: 380px;">
                    <el-tabs>
                        <el-tab-pane label="入磨品位信息设置">
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="1#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd1" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="1#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd1" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="1#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd1" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="1#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd1" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="2#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd2" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="2#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd2" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="2#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd2" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="2#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd2" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="3#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd3" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="3#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd3" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="3#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd3" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="3#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd3" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="4#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd4" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="4#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd4" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="4#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd4" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="4#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd4" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="5#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd5" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="5#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd5" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="5#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd5" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="5#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd5" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6" :offset="1">
                                    <el-form-item label="6#入磨品位_铁" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmIronGrd6" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="6#入磨品位_铜" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCoppGrd6" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="6#入磨品位_钴" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmCobaGrd6" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="5">
                                    <el-form-item label="6#入磨品位_硫" style="white-space: nowrap;">
                                        <el-input v-model="form.ballmSulfGrd6" clearable
                                            style="width: 100px"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-tab-pane>
                    </el-tabs>
                </el-card>
            </el-form>
            <template #footer>
                <div class="dialog-footer">
                    <el-button type="success" @click="handleSave(ruleFormRef)">保存</el-button>
                    <el-button type="danger" @click="handleCancelSave">取消</el-button>
                </div>
            </template>
        </el-dialog>


    </div>
</template>

<script setup>
import ButtonBar from '@/components/ButtonBar.vue'

import {
    ref,
    reactive,
    onMounted,
    getCurrentInstance
} from 'vue'

const {
    proxy
} = getCurrentInstance()

import SearchBox from '@/components/SearchBox.vue'
const searchBarRef = ref(null)

import tools from '@/tools'
const cardBodyStyle = ref(tools.style.card)
const inputStyle = ref(tools.style.input)

onMounted(() => {
    handleSearch()
    getGrp()
    getDic()
})



/**
 *   查询
 */


// 数据字典
const optionShiftList = ref([])
const getDic = () => {
    var url = 'framework/Common/querySelector'
    var param = {
        type: 'PRD_OPER_SHIFT'
    }
    proxy.$axios.get(url, param).then(response => {
        if (response.data.code == '0') {
            optionShiftList.value = response.data.data
        } else {
            ElMessage.error('操作失败！' + response.data.msg)
        }
    })
}
const optionGrpList = ref([])
const getGrp = () => {
    var url = 'framework/Common/querySelector'
    var param = {
        type: 'PRD_OPER_GRP'
    }
    proxy.$axios.get(url, param).then(response => {
        if (response.data.code == '0') {
            optionGrpList.value = response.data.data
        } else {
            ElMessage.error('操作失败！' + response.data.msg)
        }
    })
}



const query = ref({
    // prodDt: proxy.$dayjs().format('YYYY-MM-DD') , 
    prodDt: [proxy.$dayjs().subtract(30, 'day').format('YYYY-MM-DD'), proxy.$dayjs().format('YYYY-MM-DD')],
    prodShift: '',
    prodGrp: ''
})
const tableData = ref([])
const handleSearch = () => {
    currentPage.value = 1
    getTableData()
}

const getTableData = () => {
    var url = 'prd/ReptQltyDaily/query'
    var param = {
        page: currentPage.value,
        rows: pageSize.value,
        params: JSON.stringify(query.value)
    }
    proxy.$axios.get(url, param).then(response => {
        if (response.data.code == '0') {
            tableData.value = response.data.data.records
            totalRows.value = response.data.data.total
        } else {
            ElMessage.error('操作失败！' + response.data.msg)
        }
    })
}
/**
 *   查询
 */

/**
 * 分页
 */
const currentPage = ref(1)
const totalRows = ref(0)
const pageSizes = ref([5, 10, 20, 30, 40])
const pageSize = ref(5)
const handleSizeChange = (val) => {
    pageSize.value = val
    getTableData()
}
const handleCurrentChange = (val) => {
    currentPage.value = val
    getTableData()
}
/**
 * 分页
 */


/**
 * 新增
 */
const dialogVisible = ref(false)
const form = ref({
    prodDt: '',
    prodShift: '',
    prodGrp: '',
    oreIronGrd: '',
    oreCoppGrd: '',
    oreCobaGrd: '',
    oreSulfGrd: '',
    ironCcttIronGrd: '',
    ironCcttCoppGrd: '',
    ironCcttCobaGrd: '',
    ironCcttSulfGrd: '',
    coppCcttIronGrd: '',
    coppCcttCoppGrd: '',
    coppCcttCobaGrd: '',
    coppCcttSulfGrd: '',
    cobaCcttIronGrd: '',
    cobaCcttCoppGrd: '',
    cobaCcttCobaGrd: '',
    cobaCcttSulfGrd: '',
    sulfCcttIronGrd: '',
    sulfCcttCoppGrd: '',
    sulfCcttCobaGrd: '',
    sulfCcttSulfGrd: '',
    tailIronGrd: '',
    tailCoppGrd: '',
    tailCobaGrd: '',
    tailSulfGrd: '',
    ballmIronGrd1: '',
    ballmCoppGrd1: '',
    ballmCobaGrd1: '',
    ballmSulfGrd1: '',
    ballmIronGrd2: '',
    ballmCoppGrd2: '',
    ballmCobaGrd2: '',
    ballmSulfGrd2: '',
    ballmIronGrd3: '',
    ballmCoppGrd3: '',
    ballmCobaGrd3: '',
    ballmSulfGrd3: '',
    ballmIronGrd4: '',
    ballmCoppGrd4: '',
    ballmCobaGrd4: '',
    ballmSulfGrd4: '',
    ballmIronGrd5: '',
    ballmCoppGrd5: '',
    ballmCobaGrd5: '',
    ballmSulfGrd5: '',
    ballmIronGrd6: '',
    ballmCoppGrd6: '',
    ballmCobaGrd6: '',
    ballmSulfGrd6: ''
})
const ruleFormRef = ref()
const rules = reactive({
    prodDt: [{
        required: true,
        message: '请输入生产日期',
        trigger: 'change' | 'blur'
    }],
    prodShift: [{
        required: true,
        message: '请输入班次',
        trigger: 'change' | 'blur'
    }],
    prodGrp: [{
        required: true,
        message: '请输入班组',
        trigger: 'change' | 'blur'
    }],
})

const handleAdd = () => {
    form.value = {
        prodDt: '',
        prodShift: '',
        prodGrp: '',
        oreIronGrd: '',
        oreCoppGrd: '',
        oreCobaGrd: '',
        oreSulfGrd: '',
        ironCcttIronGrd: '',
        ironCcttCoppGrd: '',
        ironCcttCobaGrd: '',
        ironCcttSulfGrd: '',
        coppCcttIronGrd: '',
        coppCcttCoppGrd: '',
        coppCcttCobaGrd: '',
        coppCcttSulfGrd: '',
        cobaCcttIronGrd: '',
        cobaCcttCoppGrd: '',
        cobaCcttCobaGrd: '',
        cobaCcttSulfGrd: '',
        sulfCcttIronGrd: '',
        sulfCcttCoppGrd: '',
        sulfCcttCobaGrd: '',
        sulfCcttSulfGrd: '',
        tailIronGrd: '',
        tailCoppGrd: '',
        tailCobaGrd: '',
        tailSulfGrd: '',
        ballmIronGrd1: '',
        ballmCoppGrd1: '',
        ballmCobaGrd1: '',
        ballmSulfGrd1: '',
        ballmIronGrd2: '',
        ballmCoppGrd2: '',
        ballmCobaGrd2: '',
        ballmSulfGrd2: '',
        ballmIronGrd3: '',
        ballmCoppGrd3: '',
        ballmCobaGrd3: '',
        ballmSulfGrd3: '',
        ballmIronGrd4: '',
        ballmCoppGrd4: '',
        ballmCobaGrd4: '',
        ballmSulfGrd4: '',
        ballmIronGrd5: '',
        ballmCoppGrd5: '',
        ballmCobaGrd5: '',
        ballmSulfGrd5: '',
        ballmIronGrd6: '',
        ballmCoppGrd6: '',
        ballmCobaGrd6: '',
        ballmSulfGrd6: ''
    }
    if (ruleFormRef.value) {
            ruleFormRef.value.resetFields()
        }
    dialogVisible.value = true
}
/**
 * 新增
 */


/**
 * 保存、修改、删除
 */

const openDialog = () => {
}

const handleSave = (ruleFormRef) => {
    ruleFormRef.validate((valid, fields) => {
        if (valid) {
            var url = 'prd/ReptQltyDaily/save'
            var param = {
                json: JSON.stringify(form.value),
            }
            proxy.$axios.post(url, param).then(response => {
                if (response.data.code == 0) {
                    form.value = response.data.data
                    ElMessage({
                        message: '保存成功',
                        type: 'success',
                    })
                    getTableData()
                    dialogVisible.value = false
                } else {
                    // ElMessage.error('操作失败！' + response.data.msg)
                    ElMessage({
                        message: '操作失败' + response.data.msg,
                        type: 'error'
                    })
                }
            })

        } else {
            console.log('error submit!', fields)
            ElMessage.error('请输入有效数据')
        }
    })
}
const handleCancelSave = () => {
    dialogVisible.value = false
}
const handleEdit = (row) => {
    dialogVisible.value = true
    form.value = row
}
const handleDelete = (row) => {
    ElMessageBox.confirm(
        '确定删除本条记录?',
        '提示', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
        draggable: true,
    }
    )
        .then(() => {
            var url = 'prd/ReptQltyDaily/remove'
            var param = {
                id: row.id
            }
            proxy.$axios.post(url, param).then(response => {
                if (response.data.code == 0) {
                    ElMessage({
                        type: 'success',
                        message: '删除成功',
                    })
                    getTableData()
                } else {
                    ElMessage({
                        type: 'error',
                        message: '删除失败' + response.data.msg
                    });
                }
            });
        })
        .catch(() => {
            ElMessage({
                type: 'info',
                message: '已取消',
            })
        })
}

/**
 * 保存、修改、删除
 */

const multipleSelection = ref([])
const handleSelectionChange = (val) => {
    multipleSelection.value = val
}

const handleRemoveBatch = () => {
    console.log('handleRemoveBatch')

    if (multipleSelection.value.length < 1) {
        ElMessage({
            type: 'warning',
            message: '请选择要删除的数据!'
        })
        return
    }

    ElMessageBox.confirm('此操作将删除该数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(() => {
        var ids = []
        multipleSelection.value.forEach((item, index) => {
            ids.push(item.id)
        })
        var url = 'prd/ReptQltyDaily/removeBatch'
        var param = {
            ids: JSON.stringify(ids)
        }
        proxy.$axios.post(url, param).then(response => {
            if (response.data.code == '0') {
                ElMessage({
                    type: 'success',
                    message: '操作成功!',
                });
                getTableData()
                dialogVisible.value = false
            } else {
                ElMessage({
                    type: 'error',
                    message: '操作失败!' + response.data.msg
                });
            }
        })
    }).catch(() => {
        ElMessage({
            type: 'info',
            message: '已取消删除'
        })
    })
}

const handleEditBatch = () => {
    console.log('handleEditBatch')
    if (multipleSelection.value.length != 1) {
        ElMessage({
            type: 'warning',
            message: '请选择一条数据编辑!'
        })
        return
    }
    handleEdit(multipleSelection.value[0])
}

const handleUpload = () => {
    console.log('handleUpload')
}

const handleDownload = () => {
    console.log('handleDownload')
}

const handleImport = () => {
    console.log('handleImport')
}

const handleExport = () => {
    console.log('handleExport')
}

</script>

<style></style>