el-table 复杂表头行内增删改代码示例

news2024/12/28 5:07:55

效果如图
在这里插入图片描述

<template>
    <div class="app-container">
        <el-card class="box-card item">
            <div slot="header" class="clearfix" @click="showCondition = !showCondition">
                <span>
                    <i class="el-icon-search"></i>
                    {{ $t("commom.selectCondition") }}
                </span>
                <el-button style="float: right; padding: 3px 0" type="text">
                    <i class="el-icon-arrow-up" v-bind:class="showCondition ? 'active' : ''"></i>
                </el-button>
            </div>
            <el-collapse-transition>
                <div class="text item" v-show="showCondition">
                    <el-form :inline="true" :model="searchParam" class="demo-form-inline" label-width="120px"
                        label-position="right" label-suffix="">
                        <el-form-item label="部门类型">
                            <el-select v-model="searchParam.type" placeholder="请选择" size="mini" clearable
                                style="width:120px" @change="getDpList">
                                <el-option :key="1" label="维护部门" :value="1"></el-option>
                                <el-option :key="2" label="运营部门" :value="2"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="部门">
                            <el-cascader change-on-select size="mini" v-model="searchParam.topList"
                                :options="departmentList" filterable :props="defaultProps" clearable @change="getMenList">
                            </el-cascader>
                        </el-form-item>
                        <el-form-item label="员工">
                            <el-select v-model="searchParam.menId" placeholder="请选择" filterable size="mini">
                                <el-option v-for="item in MenList" :key="item.id" :label="item.name" :value="item.id">
                                    <span style="float: left">{{ item.name }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.no }}</span>
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="选择时间">
                            <el-date-picker v-if="searchParam.menId != null && searchParam.menId != 0"
                                v-model="searchParam.time" type="daterange" align="left" unlink-panels size="mini"
                                range-separator="" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"
                                start-placeholder="开始日期" end-placeholder="结束日期">
                            </el-date-picker>
                            <el-date-picker v-else size="mini" v-model="searchParam.time" type="month"
                                value-format="yyyy-MM" placeholder="选择月">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item style="float:right">
                            <el-button icon="el-icon-search" size="mini" @click="searchData()">查询</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </el-collapse-transition>
        </el-card>
        <el-row :gutter="5">
            <el-col :span="24">
                <el-card>
                    <div slot="header" class="clearfix">
                        <span style="font-size:16px">
                            <i class="el-icon-tickets"></i> 详细信息
                        </span>
                        <el-button type="primary" style="float:right;" icon="el-icon-circle-plus-outline" size="mini"
                            @click="addEvaluation()">添加人员考评</el-button>
                    </div>
                    <div>
                        <el-table height="750px" id="tb" :header-cell-style="{ 'text-align': 'center' }"
                            :cell-style="{ 'text-align': 'center' }" :data="tableData" style="width: 100%;">
                            <el-table-column width="140" label="姓名">
                                <template slot-scope="scope">
                                    <el-select class="input_div" v-if="scope.row.isAdd" v-model="scope.row.menId"
                                        placeholder="请选择" filterable size="mini">
                                        <el-option v-for="item in MenList" :key="item.id" :label="item.name"
                                            :value="item.id">
                                            <span style="float: left">{{ item.name }}</span>
                                            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.no }}</span>
                                        </el-option>
                                    </el-select>
                                    <span v-else v-text="scope.row.name"></span>
                                </template>
                            </el-table-column>
                            <el-table-column label="人工评分">
                                <el-table-column width="70" label="">
                                    <template slot="header">
                                        <div>
                                            <el-tooltip :disabled="isShowTooltip" content="着装:工作服、鞋" placement="top">
                                                <span>*着装</span>
                                            </el-tooltip>
                                        </div>
                                    </template>
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.xie" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.xie"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column label="出勤">
                                    <el-table-column width="60" label="病假">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="2" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.bj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.bj"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="60" label="事假">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.sj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.sj"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="80" label="未按规定办理请假">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.wqj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.wqj"></span>
                                        </template>
                                    </el-table-column>
                                </el-table-column>
                                <el-table-column label="专业技能水平">
                                    <el-table-column width="60" label="一级">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="4" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.yj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.yj"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="60" label="二级">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="3" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.ej"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.ej"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="60" label="三级">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="2" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.saj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.saj"></span>
                                        </template>
                                    </el-table-column>
                                </el-table-column>
                                <el-table-column label="工作态度">
                                    <el-table-column width="60" label="主管反馈">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.zg"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.zg"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="60" label="投诉情况">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.ts"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.ts"></span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column width="84">
                                        <template slot="header">
                                            <div>
                                                <el-tooltip :disabled="isShowTooltip" content="违纪情况:上班打游戏、睡觉、带无关人员进入办公区域"
                                                    placement="top">
                                                    <span>*违纪情况</span>
                                                </el-tooltip>
                                            </div>
                                        </template>
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="14" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.wj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.wj"></span>
                                        </template>
                                    </el-table-column>
                                </el-table-column>
                                <el-table-column width="77" label="">
                                    <template slot="header">
                                        <div>
                                            <el-tooltip :disabled="isShowTooltip" content="违反安全规定:吸烟等" placement="top">
                                                <span>*违反安全规定</span>
                                            </el-tooltip>
                                        </div>
                                    </template>
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="20" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.wf" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.wf"></span>
                                    </template>
                                </el-table-column>
                            </el-table-column>
                            <el-table-column label="系统评分">
                                <el-table-column label="设备清洁保养">
                                    <el-table-column width="70" label="根据系统工单">
                                        <template slot-scope="scope">
                                            <el-input-number class="num_div_one" :controls="false" :max="20" :min="0"
                                                v-if="scope.row.isEdit" v-model="scope.row.gj"
                                                size="mini"></el-input-number>
                                            <span v-else v-text="scope.row.gj"></span>
                                        </template>
                                    </el-table-column>
                                </el-table-column>
                                <el-table-column width="70" label="记录本填写">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.jlb" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.jlb"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="80" label="设备及配电间巡检情况">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.xj" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.xj"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="60" label="迟到">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.cd" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.cd"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="60" label="早退">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="5" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.zt" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.zt"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="60" label="旷工">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="15" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.kg" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.kg"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="60" label="响应时间">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.xy" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.xy"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="70" label="维修量">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.wxl" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.wxl"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="60" label="维修时间">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.wxsj" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.wxsj"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="84" label="">
                                    <template slot="header">
                                        <div>
                                            <el-tooltip :disabled="isShowTooltip" content="维修质量:维修完后重复故障率" placement="top">
                                                <span>*维修质量</span>
                                            </el-tooltip>
                                        </div>
                                    </template>
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.wxzl" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.wxzl"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="84" label="">
                                    <template slot="header">
                                        <div>
                                            <el-tooltip :disabled="isShowTooltip" content="工单填写情况:误填、漏填、填错" placement="top">
                                                <span>*工单填写情况</span>
                                            </el-tooltip>
                                        </div>
                                    </template>
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.gdtx" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.gdtx"></span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="70" label="接转单加权分">
                                    <template slot-scope="scope">
                                        <el-input-number class="num_div_one" :controls="false" :max="10" :min="0"
                                            v-if="scope.row.isEdit" v-model="scope.row.jzd" size="mini"></el-input-number>
                                        <span v-else v-text="scope.row.jzd"></span>
                                    </template>
                                </el-table-column>
                            </el-table-column>
                            <el-table-column width="90" label="得分">
                                <template slot-scope="scope">
                                    <!-- <el-input-number class="num_div_one" :controls="false" :max="5" :min="0" v-if="scope.row.isEdit" v-model="scope.row.total" size="mini"></el-input> -->
                                    <span>
                                        {{
                                            Number(scope.row.xie) +
                                            Number(scope.row.bj) +
                                            Number(scope.row.sj) +
                                            Number(scope.row.wqj) +
                                            Number(scope.row.yj) +
                                            Number(scope.row.ej) +
                                            Number(scope.row.saj) +
                                            Number(scope.row.zg) +
                                            Number(scope.row.ts) +
                                            Number(scope.row.wj) +
                                            Number(scope.row.wf) +
                                            Number(scope.row.gj) +
                                            Number(scope.row.jlb) +
                                            Number(scope.row.xj) +
                                            Number(scope.row.cd) +
                                            Number(scope.row.zt) +
                                            Number(scope.row.kg) +
                                            Number(scope.row.xy) +
                                            Number(scope.row.wxl) +
                                            Number(scope.row.wxsj) +
                                            Number(scope.row.wxzl) +
                                            Number(scope.row.gdtx) +
                                            Number(scope.row.jzd) +
                                            Number(scope.row.wxsj)
                                        }}
                                        <!-- {{ scope.row.total }} -->
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column width="160" label="月份">
                                <template slot-scope="scope">
                                    <el-date-picker class="month_div" size="mini" v-if="scope.row.isEdit"
                                        v-model="scope.row.month" type="month" value-format="yyyy-MM" placeholder="选择月">
                                    </el-date-picker>
                                    <span v-else v-text="scope.row.month"></span>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button v-if="!scope.row.isEdit" size="mini"
                                        @click="handleEdit(scope.$index, scope.row)">
                                        编辑
                                    </el-button>
                                    <el-button v-if="scope.row.isEdit" @click="doEdit(scope.$index, scope.row)" size="mini"
                                        type="success" icon="el-icon-check" circle></el-button>
                                    <el-button v-if="scope.row.isEdit" @click="cancelEdit(scope.$index, scope.row)"
                                        size="mini" type="info" icon="el-icon-close" circle></el-button>
                                    <el-button v-if="!scope.row.isEdit" type="danger" size="mini"
                                        @click="handleDelete(scope.$index, scope.row)">
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                        <el-pagination :current-page.sync="searchParam.page" @size-change="handleSizeChange"
                            @current-change="handleCurrentChange" :page-count="pageCount" :total="total"
                            :page-sizes="[50, 80, 100]" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
                    </div>
                </el-card>
            </el-col>
        </el-row>

</div>
</template>

<script>
import { parseTime, removeNull } from '@/utils'
import common from '@/api/common.js'
import workTimeStatistics from '@/api/statisticsAndAnalysis/workTimeStatistics.js'
import * as echarts from 'echarts'
import MyTable from '../../dashBoard/operationBoard/components/myTable.vue'

export default {
    name: 'personnelEvaluation',
    data () {
        return {
            col: [
                {
                    prop: 'name',
                    label: '姓名'
                },
                {
                    label: '人工评分',
                    children: [
                        {
                            prop: 'xie',
                            label: '着装工作服/鞋'
                        },
                        {
                            label: '出勤',
                            children: [
                                {
                                    prop: 'bj',
                                    label: '病假'
                                },
                                {
                                    prop: 'sj',
                                    label: '事假'
                                },
                                {
                                    prop: 'wqj',
                                    label: '未按规定办理请假'
                                },
                            ]
                        },
                        {
                            label: '专业技能水平',
                            children: [
                                {
                                    prop: 'yj',
                                    label: '一级'
                                },
                                {
                                    prop: 'ej',
                                    label: '二级'
                                },
                                {
                                    prop: 'saj',
                                    label: '三级'
                                },
                            ]
                        },
                        {
                            label: '工作态度',
                            children: [
                                {
                                    prop: 'zg',
                                    label: '主管反馈'
                                },
                                {
                                    prop: 'ts',
                                    label: '投诉情况'
                                },
                                {
                                    prop: 'wj',
                                    label: '违纪情况(上班打游戏、睡觉、带无关人员进入办公区域)'
                                },
                            ]
                        },
                        {
                            prop: 'wf',
                            label: '违反安全规定(吸烟等)'
                        },
                    ]
                },
                {
                    label: '系统评分',
                    children: [
                        {
                            label: '设备清洁保养',
                            children: [
                                {
                                    prop: 'gj',
                                    label: '根据系统工单'
                                }
                            ]
                        },
                        {
                            prop: 'jlb',
                            label: '记录本填写'
                        },
                        {
                            prop: 'xj',
                            label: '设备及配电间巡检情况'
                        },
                        {
                            prop: 'cd',
                            label: '迟到'
                        },
                        {
                            prop: 'zt',
                            label: '早退'
                        },
                        {
                            prop: 'kg',
                            label: '旷工'
                        },
                        {
                            prop: 'xy',
                            label: '响应时间'
                        },
                        {
                            prop: 'wxl',
                            label: '维修量'
                        },
                        {
                            prop: 'wxsj',
                            label: '维修时间'
                        },
                        {
                            prop: 'wxzl',
                            label: '维修质量(维修完后重复故障率)'
                        },
                        {
                            prop: 'gdtx',
                            label: '工单填写情况(误填、漏填、填错)'
                        },
                        {
                            prop: 'jzd',
                            label: '接转单加权分'
                        },
                    ]
                },
                {
                    prop: 'total',
                    label: '得分'
                },
                {
                    prop: 'month',
                    label: '月份'
                },
            ],
            tableData: [
                {
                    name: '兰珏',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '张屏',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '陈筹',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '王砚',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '辜清章',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '二皮匠',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '安欣',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '老默',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                },
                {
                    name: '高启强',
                    xie: 5,
                    bj: 2,
                    sj: 5,
                    wqj: 10,
                    yj: 4,
                    ej: 3,
                    saj: 2,
                    zg: 10,
                    ts: 10,
                    wj: 14,
                    wf: 20,
                    gj: 20,
                    jlb: 5,
                    xj: 5,
                    cd: 5,
                    zt: 5,
                    kg: 15,
                    xy: 10,
                    wxl: 10,
                    wxsj: 10,
                    wxzl: 10,
                    gdtx: 10,
                    jzd: 10,
                    total: 210,
                    month: '2023-01',
                    isEdit: false
                }
            ],
            showCondition: true, // 手风琴
            searchParam: {
                // lineCode: '华虹计通',
                // stationCode: '8号线维保组',
                // macSysNo: '所有',
                topList: [],
                type: '',
                menId: 0,
                departmentId: 0,
                startTime: '',
                endTime: '',
                time: [],
                page: 1,
                row: 50,
            },
            MenList: [{ id: 0, name: '全部' }],
            defaultProps: {
                children: 'children',
                label: 'name',
                id: 'id',
                value: 'id'
            },
            departmentList: [],
            departmentList1: [],
            departmentList2: [],
            companyList: [],
            groupList: [],
            menList: [],
            dataList: [],
            xData: [],
            yData: [],
            pageCount: 0, // 页数
            total: 0, // 条目数
        }
    },
    created () {
        var dayjs = this.dayjs
        this.searchParam.time = dayjs(new Date()).format('YYYY-MM')
        this.getDepartmentList1()
        this.getDepartmentList2()
    },
    components: {
        MyTable
    },
    mounted () {

    },
    methods: {
        handleEdit (index, row) {
            row.isEdit = true
        },
        // 编辑
        doEdit (index, row) {
            // 调用编辑接口
            row.isAdd = false
        },
        // 取消编辑
        cancelEdit (index, row) {
            row.isEdit = false
            if (row.isAdd) {
                this.tableData.splice(index, 1)
            }
        },
        // 删除
        handleDelete (index, row) {
            this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                center: true
            })
                .then(() => {
                    // 执行删除操作
                })
                .catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    })
                })

        },
        handleCurrentChange (val) {
            this.searchParam.page = val
            // 查询数据
        },
        // 调整每页显示条数
        handleSizeChange (val) {
            this.searchParam.row = val
            // 查询数据
        },
        addEvaluation () {
            if (this.searchParam.topList.length == 0) {
                this.$message({
                    type: 'warning',
                    message: '请选择部门!',
                })
                return
            }
            let row = {
                name: '兰珏',
                xie: 5,
                bj: 2,
                sj: 5,
                wqj: 10,
                yj: 4,
                ej: 3,
                saj: 2,
                zg: 10,
                ts: 10,
                wj: 14,
                wf: 20,
                gj: 20,
                jlb: 5,
                xj: 5,
                cd: 5,
                zt: 5,
                kg: 15,
                xy: 10,
                wxl: 10,
                wxsj: 10,
                wxzl: 10,
                gdtx: 10,
                jzd: 10,
                total: 210,
                month: '2023-01',
                isEdit: true,
                isAdd: true
            }
            this.tableData.unshift(row);
        },
        // 获取维护部门
        getDepartmentList1 () {
            common.GetDepartmentListEnable({ type: 1 }).then((val) => {
                if (val.data != null) {
                    this.departmentList1 = removeNull(val.data)
                }
            })
        },
        // 获取运营部门
        getDepartmentList2 () {
            common.GetOperateDepartmentListEnable({ type: 1 }).then((val) => {
                if (val.data != null) {
                    this.departmentList2 = removeNull(val.data)
                }
            })
        },
        // 根据部门类型获取部门列表
        getDpList (type) {
            this.searchParam.menId = 0
            this.MenList = [{ id: 0, name: '全部' }]
            if (type == 1) {
                this.departmentList = this.departmentList1
            }
            if (type == 2) {
                this.departmentList = this.departmentList2
            }
            if (!type) {
                this.departmentList = []
            }
        },
        // 获取部门员工
        getMenList (list) {
            this.searchParam.menId = 0
            this.searchParam.departmentId = 0
            if (!this.searchParam.type || this.searchParam.topList.length == 0) {
                this.MenList = [{ id: 0, name: '全部' }]
            } else {
                var model = {}
                if (this.searchParam.type == 1) {
                    model = {
                        iPage: 1,
                        count: 9999,
                        noName: '',
                        departmentId: -1,
                        departmentIdList: [],
                        specialty: ''
                    }
                    model.departmentId =
                        this.searchParam.topList[this.searchParam.topList.length - 1]
                    common.GetMenInfor(model).then((val) => {
                        if (val.data != null) {
                            this.MenList = val.data.listData
                        } else {
                            this.MenList = []
                        }
                        this.MenList.push({ id: 0, name: '全部' })
                    })
                }
                if (this.searchParam.type == 2) {
                    model = {
                        iPage: 1,
                        count: 9999,
                        noName: '',
                        departmentId: -1,
                        departmentIdList: [],
                        specialty: ''
                    }
                    model.departmentId =
                        this.searchParam.topList[this.searchParam.topList.length - 1]
                    common.GetOperateMenInfor(model).then((val) => {
                        if (val.data != null) {
                            this.MenList = val.data.listData
                        } else {
                            this.MenList = []
                        }
                        this.MenList.push({ id: 0, name: '全部' })
                    })
                }
            }
        },
    }
}
</script>
  
<style lang="scss">
.el-card__body {
    padding: 0px;
}

.input_div input.el-input__inner {
    width: 140px;
}

.month_div input.el-input__inner {
    width: 63% !important;
}

#tb {
    .num_div_one {
        width: 54px;
    }

    .el-input-number.is-without-controls .el-input__inner {
        padding-left: 8px;
        padding-right: 8px;
    }
}
</style>



本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/358720.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

外籍在读博士|赴新西兰奥克兰大学双院士导师麾下联合培养

N同学来自阿拉伯国家&#xff0c;但本硕博都是在我国某省属高校就读&#xff0c;现为材料学专业一年级博士生。联合培养首选澳洲国家&#xff0c;包括澳大利亚和新西兰&#xff0c;其次是美国&#xff0c;希望在2023年初出国&#xff0c;以完成整个学年的学习计划。在我们的帮助…

Android稳定性系列-01-使用 Address Sanitizer检测原生代码中的内存错误

前言想必大家曾经被各种Native Crash折磨过&#xff0c;本地测试没啥问题&#xff0c;一到线上或者自动化测试就出现各种SIGSEGV、SIGABRT、SIGILL、SIGBUS、SIGFPE异常&#xff0c;而且堆栈还是崩溃到libc.so这种&#xff0c;看起来跟我们的代码没啥关系&#xff0c;关键还不好…

Spark3每个job之间任务间隔过长

公司的跑批引擎从impala改成Spark3已经有一个多月了。 不得不说&#xff0c;跑批稳定了好多。资源控制有相对稳定了很多。Spark3比CDH的hive on spark2.4.0要快不少。AQE和CBO真的挺强的。但是使用中发现了一个很奇怪的事情。这个问题在网上搜过&#xff0c;并没有实际解决。 当…

【机器学习】决策树-ID3算法

1.ID3算法 ID3算法利用信息增益进行特征的选择进行树的构建。信息熵的取值范围为0~1&#xff0c;值越大&#xff0c;越不纯&#xff0c;相反值越小&#xff0c;代表集合纯度越高。信息增益反映的是给定条件后不确定性减少的程度。每一次对决策树进行分叉选取属性的时候&#x…

CANopen概念总结、心得体会

NMT网络管理报文&#xff1a; NMT 主机和 NMT 从机之间通讯的报文就称为 NMT 网络管理报文。常见报文说明&#xff1a; 0101---------------网络报文发送Nmt_Start_Node&#xff0c;让电机进入OP模式(此时还不会发送同步信号) setState(d, Operational)------------------开启…

拳打DALL-E 2脚踢Imagen,谷歌最新Muse模型刷新文本图像合成排行榜

原文链接&#xff1a;https://www.techbeat.net/article-info?id4501 作者&#xff1a;seven_ 论文链接&#xff1a; https://arxiv.org/abs/2301.00704 项目主页&#xff1a; https://muse-model.github.io/ 近期火爆AI社区的文本图像合成模型家族又添新成员了&#xff0c;之…

网络计划--时间参数的计算和优化

根据网络图的基本概念和原则绘制出网络图之后&#xff0c;我们可以计算网络图中有关的时间参数&#xff0c;主要目的是找出关键路线&#xff0c;为网络计划的优化、调整和执行提供明确的时间概念。如下图中从始点①到终点⑧共有4条路线&#xff0c;可以分别计算出每条路线所需的…

基于Hive的河北新冠确诊人数分析系统的设计与实现

项目描述 临近学期结束&#xff0c;还是毕业设计&#xff0c;你还在做java程序网络编程&#xff0c;期末作业&#xff0c;老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下&#xff0c;你想解决的问…

通过官网怎么查找联盟申请链接

欢迎关注勤于奋每天12点准时更新国外LEAD相关技术今天还是来聊聊这个问题吧&#xff0c;很多人问我这个问题&#xff0c;我觉得这个都不是啥多难的技术&#xff0c;用点心就能找到。最简单的办法就是通过浏览器去搜索&#xff0c;比如通过google 搜索,就能找到一些信息&#xf…

第三届无线通信AI大赛分享交流会暨颁奖典礼顺利举办,大赛圆满收官

2月16日&#xff0c;第三届无线通信AI大赛分享交流会暨颁奖典礼在北京顺利举行&#xff0c;宣告大赛圆满收官。 分享交流会暨颁奖典礼以线上线下结合的形式展开&#xff0c;邀请无线通信领域的多位专家、学者与「基于AI的信道估计与信道状态信息反馈联合设计」、「基于AI的高精…

将二进制文件作为目标文件中的一个段

将二进制文件作为目标文件中的一个段 python 生成2进制文件 import sysdef testFile(fileName):# --with open(fileName, modewb) as hexFile:bBuf bytes.fromhex("0123456789abcdef")print("bBuf:",bBuf.hex())len hexFile.write(bBuf)print ("l…

Vue3搭建记录

一、初始化项目&#xff1a;项目名称vue3-element-admin npm init vitelatest vue3-element-admin --template vue-ts 二、整合Element-Plus 1.本地安装Element Plus和图标组件 npm install element-plus npm install element-plus/icons-vue 2.全局注册组件 // main.ts imp…

【C#】async关键字修饰后有无await的影响

文章目录测试总结拓展&#xff1a;js的async await问题参考测试 来自微软官网的说法&#xff1a; 异步方法通常包含 await 运算符的一个或多个匹配项&#xff0c;但缺少 await 表达式不会导致编译器错误。 如果异步方法未使用 await 运算符标记悬挂点&#xff0c;则该方法将作…

RK3568工业开发板工控板说明

说明HW356X-GKA是采用中高端的通用型 SOC&#xff0c;一款基于Rockchip公司RK3568处理器的工控主板。主板标配处理器为Cortex-A55四核&#xff0c;最高主频2GHz的RK3568处理器&#xff0c;内置4GB DDR4内存(最大8GB)&#xff0c;32GB eMMC存储。集成4核 arm架构 A55 处理器和Ma…

记录使用ROS驱动USB相机

参考https://blog.csdn.net/weixin_48657767/article/details/126054121?spm1001.2014.3001.5502cmake编译时有bug&#xff0c;缺包&#xff0c;安装对应的包sudo apt-get install ros-melodic&#xff08;对应ros版本&#xff09;-****&#xff08;对应包名&#xff0c;下划线…

OpenGL学习日记之光照计算

引言 现实生活中的光照极其复杂&#xff0c;而且会收到很多因素的影响&#xff0c;是我们当前计算机的算力无法模拟的。因此我们会根据一些简化的模型来模拟现实光照&#xff0c;这样在可以模拟出近似的光照感受&#xff0c;但是又没有那么复杂的计算。 常用的光照模型有&…

27 pandas 数据透视

文章目录pivot_table 函数1、index需要聚合的列名&#xff0c;默认情况下聚合所有数据值的列2、values在结果透视的行上进行分组的列名或其它分组键【就是透视表里显示的列】3、columns在结果透视表的列上进行分组的列名或其它分组键4、Aggfunc聚合函数或函数列表&#xff08;默…

【1】linux命令每日分享——mkdir

大家好&#xff0c;这里是sdust-vrlab&#xff0c;Linux是一种免费使用和自由传播的类UNIX操作系统&#xff0c;Linux的基本思想有两点&#xff1a;一切都是文件&#xff1b;每个文件都有确定的用途&#xff1b;linux涉及到IT行业的方方面面&#xff0c;在我们日常的学习中&…

【Spring】难理解的Aop编程 | 入门?

作者&#xff1a;狮子也疯狂 专栏&#xff1a;《spring开发》 坚持做好每一步&#xff0c;幸运之神自然会驾凌在你的身上 目录一. &#x1f981; 前言二. &#x1f981; 常见概念2.1 常见术语2.2 AOP入门Ⅰ. &#x1f407; 功能场景Ⅱ. &#x1f407; 实现过程2.3 通知类型Ⅰ.…

XXL-JOB分布式任务调度框架(三)-集群部署

文章目录 1.引言2.集群服务启动3.反向代理4.总结1.引言 XXL-JOB有中心化的思想,一旦调度中心挂机会导致整体不可使用,所以要引入集群。 需要考虑点: db配置保持一致登录账号配置保持一致集群机器时钟保持一致(单机集群可忽视)2.集群服务启动 在是在同一台机器中,并且在…