lxp
2025-03-10 9645430a4b48159a722ffeebfe58a2cf2f6c6020
绩效管理代码搬迁
已添加6个文件
已修改6个文件
2412 ■■■■■ 文件已修改
src/api/cnas/performance/class.js 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/performance/staffEvaluate.js 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/class/index.vue 1321 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/manHour/workTimeConfig.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffAttendance/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffEvaluate/employee-mutual-evaluation.vue 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffEvaluate/evaluation.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffEvaluate/index.vue 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffEvaluate/leader-rate.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/staffEvaluate/supervisor-rate.vue 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/performance/class.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
import resquest from '@/utils/request'
export function page(params) {
    return resquest({
        url: '/performanceShift/page',
        method: 'get',
        params: params
    })
}
export function pageYear(params) {
    return resquest({
        url: '/performanceShift/pageYear',
        method: 'get',
        params: params
    })
}
export function add(data) {
    return resquest({
        url: '/performanceShift/add',
        method: 'post',
        data: data
    })
}
export function exportExcel(params) {
    return resquest({
        url: '/performanceShift/export' + params,
        method: 'get',
        responseType: 'blob'
    })
}
export function update(data) {
    return resquest({
        url: '/performanceShift/update',
        method: 'put',
        data: data
    })
}
export function getUserList() {
    return resquest({
        url: '/performanceShift/getUserList',
        method: 'get'
    })
}
export function list(params) {
    return resquest({
        url: '/shiftTime/list',
        method: 'get',
        params: params
    })
}
export function shiftAdd(data) {
    return resquest({
        url: '/shiftTime/add',
        method: 'post',
        data: data
    })
}
export function remove(id) {
    return resquest({
        url: '/shiftTime/remove',
        method: 'delete',
        params: id
    })
}
export function obtainItemParameterList(params) {
    return resquest({
        url: '/laboratoryScope/obtainItemParameterList',
        method: 'get',
        params: params
    })
}
src/api/cnas/performance/staffEvaluate.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
import resquest from '@/utils/request'
export function obtainItemParameterList(params) {
    return resquest({
        url: '/laboratoryScope/obtainItemParameterList',
        method: 'get',
        params: params
    })
}
export function exportEvaluate(data) {
    return resquest({
        url: '/evaluate/exportEvaluate',
        method: 'post',
        data: data,
        responseType: "blob",
    })
}
export function exportEvaluateLeader(data) {
    return resquest({
        url: '/evaluateLeader/exportEvaluateLeader',
        method: 'post',
        data: data,
        responseType: "blob",
    })
}
export function exportEvaluateCompetent(data) {
    return resquest({
        url: '/evaluateCompetent/exportEvaluateCompetent',
        method: 'post',
        data: data,
        responseType: "blob",
    })
}
export function page(params) {
    return resquest({
        url: '/evaluate/page',
        method: 'get',
        params: params,
    })
}
export function getEvaluateGroup(params) {
    return resquest({
        url: '/evaluateGroup/getEvaluateGroup',
        method: 'get',
        params: params,
    })
}
export function writeEvaluateLeader(data) {
    return resquest({
        url: '/evaluateLeader/writeEvaluateLeader',
        method: 'post',
        data: data,
    })
}
export function getEvaluateLeader(params) {
    return resquest({
        url: '/evaluateLeader/getEvaluateLeader',
        method: 'get',
        params: params,
    })
}
export function getEvaluateCompetent(params) {
    return resquest({
        url: '/evaluateCompetent/getEvaluateCompetent',
        method: 'get',
        params: params,
    })
}
export function writeEvaluateCompetent(data) {
    return resquest({
        url: '/evaluateCompetent/writeEvaluateCompetent',
        method: 'post',
        data: data,
    })
}
src/views/CNAS/process/demand/index.vue
@@ -237,14 +237,14 @@
                <p>试验项目</p>
                <p class="en">Test item</p>
              </td>
              <td>
              <td colspan="2">
                <p>检验依据</p>
                <p class="en">Test standard</p>
              </td>
              <td>
              <!-- <td>
                <p>试验要求</p>
                <p class="en">Test standard</p>
              </td>
              </td> -->
              <td>
                <p>备注</p>
                <p class="en">Note</p>
@@ -258,8 +258,8 @@
                <p>{{ item.model }}</p>
              </td>
              <td>{{ item.product }}</td>
              <td>{{ item.standardMethodList }}</td>
              <td>{{ item.groupConcatTell }}</td>
              <td colspan="2">{{ item.standardMethodList }}</td>
              <!-- <td>{{ item.groupConcatTell }}</td> -->
              <td>{{ item.remark }}</td>
            </tr>
            <tr>
src/views/performance/class/index.vue
@@ -1,9 +1,1322 @@
<template>
  <div>班次</div>
  <div class="class-page">
    <div class="search">
      <div class="search_thing">
        <div class="search_label">选择时间:</div>
        <div class="search_input">
          <el-date-picker
            v-model="query.year"
            :clearable="false"
            format="yyyy"
            placeholder="选择年"
            size="small"
            style="width: 140px"
            type="year"
            @change="refreshTable()"
          >
          </el-date-picker>
          <el-select
            v-model="query.month"
            clearable
            placeholder="选择月"
            size="small"
            style="width: 140px; margin-left: 16px"
            @change="refreshTable()"
          >
            <el-option
              v-for="item in monthOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-input
            v-model="query.userName"
            clearable
            placeholder="请输入人员名称"
            size="small"
            style="width: 140px; margin: 0 16px"
            @keyup.enter.native="refreshTable()"
          ></el-input>
          <el-select
            v-model="query.laboratory"
            clearable
            placeholder="请选择实验室"
            size="small"
            style="width: 140px"
            @change="refreshTable()"
          >
            <el-option
              v-for="item in laboratory"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="search_thing" style="padding-left: 30px">
        <el-button size="small" @click="refresh()">重 ç½®</el-button>
        <el-button size="small" type="primary" @click="refreshTable()"
          >查 è¯¢</el-button
        >
      </div>
      <div class="search_thing btns" style="padding-left: 30px">
        <el-button
          v-if="listPower"
          :loading="downLoading"
          size="small"
          type="primary"
          @click="configTime"
          >时间配置</el-button
        >
        <el-button
          v-if="downPower"
          :loading="downLoading"
          size="small"
          type="primary"
          @click="handleDown"
          >导 å‡º</el-button
        >
        <el-button
          v-if="addPower"
          size="small"
          type="primary"
          @click="schedulingVisible = true"
          >排 ç­</el-button
        >
      </div>
    </div>
    <div v-loading="pageLoading" class="center">
      <div v-show="query.month" class="clearfix" style="width: 100%">
        <div class="fixed-left">
          <div
            class="content-title"
            style="padding-left: 16px; box-sizing: border-box"
          >
            äººå‘˜åç§°
          </div>
          <div
            v-for="(item, index) in list"
            :key="'e' + index"
            :class="{ hoverType: currentUserIndex == index }"
            class="content-user"
            v-on:mouseenter="onMouseEnter(index)"
            v-on:mouseleave="currentUserIndex = null"
          >
            <div class="user-pic">{{ item.name.charAt(0) }}</div>
            <div class="user-info">
              <p style="font-size: 14px; color: #3a7bfa; line-height: 24px">
                <span>{{ item.name }}</span>
                <span>
                  <span
                    style="
                      color: #999999;
                      font-size: 12px;
                      display: inline-block;
                      transform: scale(0.9) translateX(5px);
                    "
                    >出勤:
                  </span>
                  <span style="font-size: 16px; color: #ff4902">
                    {{
                      query.month
                        ? item.monthlyAttendance.totalAttendance
                        : item.sidebarAnnualAttendance.totalAttendance
                    }}天
                  </span>
                </span>
              </p>
              <p
                style="
                  color: #999999;
                  font-size: 12px;
                  transform: scale(0.8) translateX(-20px);
                  white-space: nowrap;
                  width: 150px;
                  overflow-x: show;
                "
              >
                æ—©:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{
                  item.day3
                }},假:{{ item.day4 }},å·®:{{ item.day6 }}
              </p>
            </div>
          </div>
        </div>
        <!--  -->
        <div class="scroll-right">
          <div class="content">
            <div
              class="content-title content-title-right"
              style="border-bottom: 0"
            >
              <div
                v-for="(item, index) in weeks"
                :key="'b' + index"
                class="content-title-item"
              >
                <span
                  v-if="item.week == '周日'"
                  class="month"
                  style="position: absolute; top: 1px"
                  >{{ item.weekNum }}周</span
                >
                <p style="height: 26px; position: absolute; bottom: 1px">
                  <span class="day">{{ item.day }}</span>
                  <span class="week">{{ item.week.charAt(1) }}</span>
                </p>
              </div>
            </div>
            <div
              v-for="(item, index) in list"
              :key="'c' + index"
              class="content-body"
              v-on:mouseenter="onMouseEnter(index)"
              v-on:mouseleave="currentUserIndex = null"
            >
              <div
                v-for="(m, i) in item.list"
                :key="'d' + i"
                :class="{ hoverType: currentUserIndex == index }"
                class="content-body-item"
              >
                <el-dropdown
                  :disabled="!upPower"
                  placement="bottom"
                  style="width: 100%; height: 100%; cursor: pointer"
                  trigger="click"
                  @command="(e) => handleCommand(e, m)"
                >
                  <div
                    :class="{
                      type0: m.shift === '0',
                      type1: m.shift === '1',
                      type2: m.shift === '2',
                      type3: m.shift === '3',
                      type4: m.shift === '4',
                      type5: m.shift === '5',
                      type6: m.shift === '6',
                    }"
                    class="work-box"
                  >
                    <span
                      :style="`opacity: ${
                        getShiftByDic(m.shift) == '无' ? 0 : 1
                      };`"
                      style="cursor: pointer"
                      >{{ getShiftByDic(m.shift) }}</span
                    >
                  </div>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item
                      v-for="(n, j) in classType"
                      :key="'h' + j"
                      :command="n.value"
                      >{{ n.label }}</el-dropdown-item
                    >
                  </el-dropdown-menu>
                </el-dropdown>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div
        v-show="!query.month"
        class="clearfix year-table"
        style="width: 100%"
      >
        <div class="fixed-left">
          <div
            class="content-title"
            style="padding-left: 16px; box-sizing: border-box"
          >
            äººå‘˜åç§°
          </div>
          <div
            v-for="(item, index) in yearList"
            :key="'e' + index"
            :class="{ hoverType: currentUserIndex == index }"
            class="content-user"
            v-on:mouseenter="onMouseEnter(index)"
            v-on:mouseleave="currentUserIndex = null"
          >
            <div class="user-pic">{{ item.name.charAt(0) }}</div>
            <div class="user-info">
              <p style="font-size: 14px; color: #3a7bfa; line-height: 24px">
                {{ item.name }}
              </p>
              <p
                style="
                  color: #999999;
                  font-size: 12px;
                  transform: scale(0.8) translateX(-20px);
                  white-space: nowrap;
                  width: 150px;
                  overflow-x: show;
                "
              >
                æ—©:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{
                  item.day3
                }},假:{{ item.day4 }},å·®:{{ item.day6 }}
              </p>
              <p style="margin-top: 4px">
                <span
                  style="
                    color: #999999;
                    font-size: 12px;
                    display: inline-block;
                    transform: scale(0.8) translateX(-10px);
                  "
                  >合计出勤: </span
                ><span style="font-size: 16px; color: #ff4902"
                  >{{ item.year.totalYearAttendance }}天</span
                >
              </p>
            </div>
          </div>
        </div>
        <div class="scroll-right">
          <div class="content">
            <div>
              <div
                :style="`display: grid;
                grid-template-columns: repeat(${monthList.length}, 1fr);`"
                class="content-title content-title-right"
                style="border-bottom: 0; height: 52px"
              >
                <div
                  v-for="(item, index) in monthList"
                  :key="'b' + index"
                  class="content-title-item"
                  style="height: 52px"
                >
                  <span class="month">{{ item }}月</span>
                </div>
              </div>
              <div
                v-for="(item, index) in yearList"
                :key="'c' + index"
                :style="`display: grid;
              grid-template-columns: repeat(${monthList.length}, 1fr);`"
                class="content-body"
                v-on:mouseenter="onMouseEnter(index)"
                v-on:mouseleave="currentUserIndex = null"
              >
                <div
                  v-for="(m, i) in item.monthList"
                  :key="'d' + i"
                  :class="{ hoverType: currentUserIndex == index }"
                  class="content-body-item"
                >
                  <p style="color: rgb(153, 153, 153); font-size: 12px">
                    åˆè®¡å‡ºå‹¤ï¼š<span style="font-size: 14px; color: #000">{{
                      m.totalMonthAttendance
                    }}</span>
                  </p>
                  <p style="color: rgb(153, 153, 153); font-size: 12px">
                    æ—©:{{ m.day0 }},中:{{ m.day1 }},夜:{{ m.day2 }},休:{{
                      m.day3
                    }},假:{{ m.day4 }},å·®:{{ m.day6 }}
                  </p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <el-pagination
      :current-page="currentPage"
      :page-size="pageSize"
      :page-sizes="[10, 20, 50, 100]"
      :total="total"
      background
      layout="sizes,total, prev, pager, next, jumper"
      style="margin-top: 10px; text-align: right; margin-right: 30px"
      @size-change="handleSizeChange"
      @current-change="currentChange"
    >
    </el-pagination>
    <el-dialog :visible.sync="configTimeVisible" title="时间配置" width="620px">
      <div v-loading="configTimeVisibleLoading" style="min-height: 200px">
        <div v-for="(item, index) in timeQuery" :key="index">
          <div
            class="form"
            style="display: flex; justify-content: space-between"
          >
            <div style="margin-bottom: 12px; width: 200px">
              <span class="form_label">班次:</span>
              <span v-if="!item.isEdit"> {{ item.type }} </span>
              <span v-if="item.isEdit" class="form_input">
                <el-select
                  v-model="item.shift"
                  clearable
                  placeholder="请选择"
                  size="small"
                  style="width: 70%; margin-right: 8px"
                >
                  <el-option
                    v-for="obj in timeTypeList"
                    :key="obj.value"
                    :label="obj.label"
                    :value="obj.value"
                  >
                  </el-option>
                </el-select>
              </span>
            </div>
            <div style="width: calc(100% - 260px)">
              <span class="form_label">时间:</span>
              <span v-if="!item.isEdit">
                {{
                  item.startTime && item.endTime
                    ? item.startTime + "~" + item.endTime
                    : ""
                }}
              </span>
              <span v-if="item.isEdit" class="form_input">
                <el-time-select
                  v-model="item.startTime"
                  :picker-options="{
                    start: '00:00',
                    step: '00:15',
                    end: '24:00',
                  }"
                  placeholder="起始时间"
                  size="small"
                  style="width: 120px"
                >
                </el-time-select>
                <el-time-select
                  v-model="item.endTime"
                  :picker-options="{
                    start: '00:00',
                    step: '00:15',
                    end: '24:00',
                  }"
                  placeholder="结束时间"
                  size="small"
                  style="width: 120px"
                >
                </el-time-select>
              </span>
            </div>
            <span>
              <i
                v-if="item.isEdit"
                class="el-icon-circle-check"
                style="margin-left: 10px; color: #4b79f2; cursor: pointer"
                @click="saveEdit(item, index)"
              ></i>
              <i
                v-if="!item.isEdit"
                class="el-icon-edit"
                style="margin-left: 10px; color: #4b79f2; cursor: pointer"
                @click="item.isEdit = true"
              ></i>
              <i
                v-if="timeQuery.length > 1"
                class="el-icon-delete"
                style="margin-left: 10px; color: #ff4902; cursor: pointer"
                @click="deleteTime(item, index)"
              ></i>
            </span>
          </div>
          <el-divider></el-divider>
          <div
            v-if="index === timeQuery.length - 1"
            style="color: #4b79f2; cursor: pointer"
            @click="addTimeForm"
          >
            æ·»åŠ æ—¶é—´é…ç½®
          </div>
        </div>
        <div
          v-if="timeQuery.length === 0"
          style="color: #4b79f2"
          @click="addTimeForm"
        >
          æ·»åŠ æ—¶é—´é…ç½®
        </div>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="schedulingVisible" title="排班" width="400px">
      <div class="search_thing">
        <div class="search_label" style="width: 90px">
          <span style="color: red; margin-right: 4px">*</span>周次:
        </div>
        <div class="search_input" style="width: calc(100% - 90px)">
          <el-date-picker
            v-model="schedulingQuery.week"
            format="yyyy ç¬¬ WW å‘¨"
            placeholder="选择周次"
            style="width: 100%"
            type="week"
          >
          </el-date-picker>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label" style="width: 90px">
          <span style="color: red; margin-right: 4px">*</span>人员名称:
        </div>
        <div class="search_input" style="width: calc(100% - 90px)">
          <el-select
            v-model="schedulingQuery.userId"
            clearable
            collapse-tags
            multiple
            placeholder="请选择"
            style="width: 100%"
          >
            <el-option-group
              v-for="(item, index) in Object.keys(personList)"
              :key="index"
              :label="item"
            >
              <el-option
                v-for="op in personList[item]"
                :key="op.id"
                :label="op.name"
                :value="op.id"
              >
              </el-option>
            </el-option-group>
          </el-select>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label" style="width: 90px">
          <span style="color: red; margin-right: 4px">*</span>班次:
        </div>
        <div class="search_input" style="width: calc(100% - 90px)">
          <el-select
            v-model="schedulingQuery.shift"
            placeholder="请选择"
            style="width: 100%"
          >
            <el-option
              v-for="item in classType"
              :key="item.value"
              :label="item.dictLabel"
              :value="item.dictValue"
            >
            </el-option>
          </el-select>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="schedulingVisible = false">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="confirmScheduling"
          >ç¡® å®š</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
  <script>
import { getYearAndMonthAndDays } from "../../../utils/date";
<script>
export default {};
import {
  page,
  pageYear,
  add,
  list,
  shiftAdd,
  remove,
  exportExcel,
  getUserList,
  obtainItemParameterList,
  update,
} from "../../../api/cnas/performance/class";
import { getDicts } from "../../../api/system/dict/data";
export default {
  components: {},
  data() {
    return {
      addPower: true,
      upPower: true,
      downPower: true,
      query: {
        userName: "",
        laboratory: "",
        year: new Date(),
        month: new Date().getMonth() + 1,
        // month:''
      },
      monthOptions: [
        {
          value: 1,
          label: "1月",
        },
        {
          value: 2,
          label: "2月",
        },
        {
          value: 3,
          label: "3月",
        },
        {
          value: 4,
          label: "4月",
        },
        {
          value: 5,
          label: "5月",
        },
        {
          value: 6,
          label: "6月",
        },
        {
          value: 7,
          label: "7月",
        },
        {
          value: 8,
          label: "8月",
        },
        {
          value: 9,
          label: "9月",
        },
        {
          value: 10,
          label: "10月",
        },
        {
          value: 11,
          label: "11月",
        },
        {
          value: 12,
          label: "12月",
        },
      ],
      laboratory: [],
      weeks: [],
      classType: [],
      currentUserIndex: null,
      schedulingVisible: false,
      personList: [],
      loading: false,
      schedulingQuery: {
        week: "",
        userId: null,
        shift: "",
      },
      list: [],
      currentPage: 1, // å½“前页
      pageSize: 10, // ä¸€é¡µ10条
      total: 0,
      pageLoading: false, // ç»„ä»¶loading的展示,默认为true
      finishLoding: false, // åŠ è½½å®Œæˆï¼Œæ˜¾ç¤ºå·²ç»æ²¡æœ‰æ›´å¤šäº†
      monthList: [],
      yearList: [],
      downLoading: false,
      configTimeVisible: false, // æ—¶é—´é…ç½®å¼¹æ¡†
      configTimeVisibleLoading: false, // æ—¶é—´é…ç½®å¼¹æ¡†loading
      timeTypeList: [],
      timeQuery: [],
      listPower: false,
    };
  },
  watch: {},
  mounted() {
    this.selectEnumByCategory();
    this.obtainItemParameterList();
    this.getUsers();
    if (this.query.month) {
      this.init();
    } else {
      this.initYear();
    }
    this.monthList = [];
    for (let i = 12; i > 0; i--) {
      this.monthList.push(i);
    }
    this.monthList.reverse();
  },
  methods: {
    refresh() {
      this.list = [];
      this.yearList = [];
      this.currentPage = 1;
      this.query = {
        userName: "",
        laboratory: "",
        year: new Date(),
        month: new Date().getMonth() + 1,
      };
      if (this.query.month) {
        this.init();
      } else {
        this.initYear();
      }
    },
    refreshTable() {
      this.currentPage = 1;
      if (this.query.month) {
        this.list = [];
        this.init();
      } else {
        this.yearList = [];
        this.initYear();
      }
    },
    currentChange(num) {
      this.currentPage = num;
      if (this.query.month) {
        this.init();
      } else {
        this.initYear();
      }
    },
    handleSizeChange(val) {
      this.pageSize = val;
      if (this.query.month) {
        this.init();
      } else {
        this.initYear();
      }
    },
    transFromNumber(num) {
      let changeNum = [
        "零",
        "一",
        "二",
        "三",
        "四",
        "五",
        "六",
        "七",
        "八",
        "九",
      ]; //changeNum[0] = "零"
      let unit = ["", "十", "百", "千", "万"];
      num = parseInt(num);
      let getWan = (temp) => {
        let strArr = temp.toString().split("").reverse();
        let newNum = "";
        for (var i = 0; i < strArr.length; i++) {
          newNum =
            (i == 0 && strArr[i] == 0
              ? ""
              : i > 0 && strArr[i] == 0 && strArr[i - 1] == 0
              ? ""
              : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i])) +
            newNum;
        }
        return newNum;
      };
      let overWan = Math.floor(num / 10000);
      let noWan = num % 10000;
      if (noWan.toString().length < 4) noWan = "0" + noWan;
      return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
    },
    init() {
      this.pageLoading = true;
      let year = this.query.year.getFullYear();
      let month0 = this.query.month
        ? this.query.month
        : new Date().getMonth() + 1;
      let month = month0 > 9 ? month0 : "0" + month0;
      let params = {
        size: this.pageSize,
        current: this.currentPage,
        time: year + "-" + month + "-01 00:00:00",
        userName: this.query.userName,
        laboratory: this.query.laboratory,
      };
      page(params).then((res) => {
        this.pageLoading = false;
        if (res.code == 201) return;
        this.total = res.data.page.total;
        this.list = res.data.page.records.map((item) => {
          for (let key in item.monthlyAttendance) {
            let type = this.getDayByDic(key);
            if (type != undefined || type != null) {
              item[`day${type}`] = item.monthlyAttendance[key];
            }
          }
          return item;
        });
        let headerList = res.data.headerList;
        this.weeks = [];
        headerList.forEach((item) => {
          let obj = {
            weekNum: item.weekly,
            week: item.headerTime.split(" ")[1],
            day: item.headerTime.split(" ")[0],
          };
          this.weeks.push(obj);
        });
      });
    },
    initYear() {
      this.pageLoading = true;
      let year = this.query.year.getFullYear();
      let params = {
        size: this.pageSize,
        current: this.currentPage,
        time: year + "-01-01 00:00:00",
        userName: this.query.userName,
        laboratory: this.query.laboratory,
      };
      pageYear(params).then((res) => {
        this.pageLoading = false;
        if (res.code == 201) return;
        this.total = res.data.total;
        this.yearList = res.data.records.map((item) => {
          for (let key in item.year) {
            let type = this.getDayByDic(key);
            if (type != undefined || type != null) {
              item[`day${type}`] = item.year[key];
            }
          }
          item.monthList = [];
          for (let m in item.month) {
            let obj = {};
            for (let key in item.month[m]) {
              let type = this.getDayByDic(key);
              if (type != undefined || type != null) {
                obj[`day${type}`] = item.month[m][key];
              }
            }
            obj.totalMonthAttendance = item.month[m].totalMonthAttendance;
            item.monthList.push(obj);
          }
          return item;
        });
      });
    },
    onMouseEnter(index) {
      this.currentUserIndex = index;
    },
    confirmScheduling() {
      if (!this.schedulingQuery.week) {
        this.$message.error("请选择周次");
        return;
      }
      let time = this.schedulingQuery.week.getTime();
      let startWeek =
        getYearAndMonthAndDays(new Date(time - 24 * 60 * 60 * 1000)) +
        " 00:00:00";
      let endWeek =
        getYearAndMonthAndDays(new Date(time + 24 * 60 * 60 * 1000 * 5)) +
        " 00:00:00";
      if (
        !this.schedulingQuery.userId ||
        this.schedulingQuery.userId.length == 0
      ) {
        this.$message.error("请选择人员");
        return;
      }
      if (!this.schedulingQuery.shift) {
        this.$message.error("请选择班次");
        return;
      }
      this.loading = true;
      let data = {
        startWeek,
        endWeek,
        userId: this.schedulingQuery.userId.join(","),
        shift: this.schedulingQuery.shift,
      };
      add(data).then((res) => {
        this.loading = false;
        if (res.code == 201) return;
        this.$message.success("操作成功");
        this.schedulingVisible = false;
        this.schedulingQuery = {
          week: "",
          userId: null,
          shift: "",
        };
        this.refresh();
      });
    },
    configTime() {
      getDicts('sys_class_type').then((res) => {
        console.log("res---", res);
        this.timeTypeList = res.data;
      });
      this.getTimeList();
      this.configTimeVisible = true;
    },
    getTimeList() {
      this.configTimeVisibleLoading = true;
      list()
        .then((res) => {
          if (res.code == 201) return;
          if (res.data.length > 0) {
            res.data.forEach((item) => {
              item.isEdit = false;
              const index = this.timeTypeList.findIndex(
                (val) => val.value === item.shift
              );
              if (index > -1) {
                item.type = this.timeTypeList[index].label;
              }
            });
            this.timeQuery = res.data;
          }
          this.configTimeVisibleLoading = false;
        })
        .catch((e) => {
          this.configTimeVisibleLoading = false;
          console.log("e--", e);
        });
    },
    addTimeForm() {
      this.timeQuery.push({
        type: "",
        shift: "",
        time: null,
        isEdit: true,
      });
    },
    saveEdit(item, index) {
      if (item.shift) {
        const index = this.timeTypeList.findIndex(
          (val) => val.value === item.shift
        );
        if (index > -1) {
          item.type = this.timeTypeList[index].label;
        }
      }
      delete item.orderBy;
      delete item.time;
      const isEmpty = this.isObjectEmpty(item);
      if (isEmpty) {
        this.$message.error("请填写完整");
        return;
      }
      let newObj = {};
      newObj.shift = item.shift;
      newObj.startTime = item.startTime;
      newObj.endTime = item.endTime;
      if (item.id) {
        // æœ‰id为修改
        newObj.id = item.id;
        url = this.$api.performanceShift.shiftUpdate;
      }
      shiftAdd(newObj).then((res) => {
        if (res.code == 201) return;
        this.$message.success("操作成功");
        this.getTimeList();
      });
    },
    deleteTime(item, index) {
      if (item.id) {
        remove(item.id).then((res) => {
          if (res.code == 201) return;
          this.$message.success("操作成功");
          this.getTimeList();
        });
      } else {
        this.timeQuery.splice(index, 1);
      }
    },
    isObjectEmpty(obj) {
      return Object.keys(obj).some((key) => !obj[key]);
    },
    handleDown() {
      let year = this.query.year.getFullYear();
      let time = "";
      if (this.query.month) {
        let month =
          this.query.month > 9 ? this.query.month : "0" + this.query.month;
        time = year + "-" + month + "-01 00:00:00";
      } else {
        time = year + "-01-01 00:00:00";
      }
      this.downLoading = true;
      exportExcel(
        `?time=${time}&userName=${this.query.userName}&laboratory=${
          this.query.laboratory
        }&isMonth=${this.query.month ? true : false}`
      ).then((res) => {
        this.$message.success("下载成功");
        this.downLoading = false;
        const blob = new Blob([res], {
          type: "application/force-download",
        });
        let fileName = "";
        if (this.query.month) {
          fileName = year + "-" + this.query.month + " ç­æ¬¡ä¿¡æ¯";
        } else {
          fileName = year + " ç­æ¬¡æ±‡æ€»";
        }
        const filename = decodeURI(fileName + ".xlsx");
        // åˆ›å»ºä¸€ä¸ªè¶…链接,将文件流赋进去,然后实现这个超链接的单击事件
        const elink = document.createElement("a");
        elink.download = filename;
        elink.style.display = "none";
        elink.href = URL.createObjectURL(blob);
        document.body.appendChild(elink);
        elink.click();
        URL.revokeObjectURL(elink.href); // é‡Šæ”¾URL å¯¹è±¡
        document.body.removeChild(elink);
      });
    },
    selectEnumByCategory() {
      getDicts("sys_class_type").then((res) => {
        this.classType = res.data;
        console.log('班次类型', this.classType);
      });
    },
    obtainItemParameterList() {
      if (this.PROJECT == "检测中心") {
        this.laboratory = [
          {
            label: "通信产品实验室",
            value: "通信产品实验室",
          },
          {
            label: "电力产品实验室",
            value: "电力产品实验室",
          },
        ];
      } else {
        obtainItemParameterList().then((res) => {
          let data = [];
          res.data.forEach((a) => {
            data.push({
              label: a.laboratoryName,
              value: a.id,
            });
          });
          this.laboratory = data;
          console.log('laboratory', this.laboratory);
        });
      }
    },
    handleCommand(e, m) {
      if (e != m.shift) {
        update({ id: m.id, shift: e }).then((res) => {
          if (res.code == 201) return;
          this.$message.success("操作成功");
          m.shift = e;
        });
      }
    },
    getUsers() {
      getUserList().then((res) => {
        if (res.code === 201) {
          return;
        }
        this.personList = res.data;
      });
    },
    getDayByDic(e) {
      let obj = this.classType.find((m) => m.dictLabel == e);
      if (obj) {
        return obj.dictValue;
      }
    },
    getShiftByDic(e) {
      let obj = this.classType.find((m) => m.dictValue == e.toString());
      if (obj) {
        return obj.dictLabel;
      }
      return "无";
    },
    scrollInit() {
      // èŽ·å–è¦ç»‘å®šäº‹ä»¶çš„å…ƒç´ 
      const nav = document.getElementById("nav");
      var flag; // é¼ æ ‡æŒ‰ä¸‹
      var downX; // é¼ æ ‡ç‚¹å‡»çš„x下标
      var scrollLeft; // å½“前元素滚动条的偏移量
      nav.addEventListener("mousedown", function (event) {
        flag = true;
        downX = event.clientX; // èŽ·å–åˆ°ç‚¹å‡»çš„x下标
        scrollLeft = this.scrollLeft; // èŽ·å–å½“å‰å…ƒç´ æ»šåŠ¨æ¡çš„åç§»é‡
      });
      nav.addEventListener("mousemove", function (event) {
        if (flag) {
          // åˆ¤æ–­æ˜¯å¦æ˜¯é¼ æ ‡æŒ‰ä¸‹æ»šåŠ¨å…ƒç´ åŒºåŸŸ
          var moveX = event.clientX; // èŽ·å–ç§»åŠ¨çš„xè½´
          var scrollX = moveX - downX; // å½“前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
          this.scrollLeft = scrollLeft - scrollX; // é¼ æ ‡æŒ‰ä¸‹çš„æ»šåŠ¨æ¡åç§»é‡å‡åŽ»å½“å‰é¼ æ ‡çš„æ»‘åŠ¨è·ç¦»
        }
      });
      // é¼ æ ‡æŠ¬èµ·åœæ­¢æ‹–动
      nav.addEventListener("mouseup", function () {
        flag = false;
      });
      // é¼ æ ‡ç¦»å¼€å…ƒç´ åœæ­¢æ‹–动
      nav.addEventListener("mouseleave", function (event) {
        flag = false;
      });
    },
  },
};
</script>
  <style scoped>
.form_title {
  height: 36px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-weight: 800;
}
.search {
  height: 50px;
  display: flex;
  align-items: center;
  position: relative;
}
<style></style>
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
}
.search_label {
  width: 70px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  display: flex;
  align-items: center;
}
.btns {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translate(0, -50%);
}
.center {
  width: 100%;
  height: 500px;
  background-color: #fff;
  overflow-y: auto;
  display: flex;
}
>>> .scroll-pagination {
  overflow-y: scroll;
  scrollbar-width: none;
}
>>> .scroll-pagination::-webkit-scrollbar {
  display: none;
}
.fixed-left {
  float: left;
  width: 220px; /* å·¦è¾¹åŒºåŸŸå®½åº¦ */
  background-color: #fff;
  box-shadow: 2px -2px 5px rgba(51, 51, 51, 0.12); /* å·¦è¾¹é˜´å½± */
}
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}
.scroll-right {
  width: calc(100% - 220px); /* å‡åŽ»å·¦è¾¹åŒºåŸŸå®½åº¦ */
  min-height: calc(100% - 10px); /* è§†å£é«˜åº¦ */
  margin-left: 220px;
  overflow-x: scroll;
  /* overflow-x: hidden; */
}
.content {
  min-height: calc(100% - 10px); /* è§†å£é«˜åº¦ */
}
.content-title {
  height: 52px;
  line-height: 52px;
  border-bottom: 1px solid #eeeeee;
}
.content-title-right {
  display: flex;
  align-items: center;
}
.content-title-item {
  height: 100%;
  width: 50px;
  flex-shrink: 0;
  border-bottom: 1px solid #eeeeee;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}
.content-title-item .month {
  font-size: 12px;
  color: #3a7bfa;
  box-sizing: border-box;
  padding: 0 1px;
  border-radius: 50%;
  background: #d6e4ff;
  text-align: center;
  line-height: 22px;
}
.content-title-item .day {
  font-size: 14px;
  color: #333333;
  /* margin-right: 4px; */
}
.content-title-item .week {
  font-size: 12px;
  color: #999999;
}
.content-body {
  display: flex;
  align-items: center;
}
.content-body-item {
  height: 70px;
  width: 50px;
  flex-shrink: 0;
  font-size: 12px;
  box-sizing: border-box;
  padding: 4px;
  border-right: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}
.work-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #edeff2;
  border-radius: 8px 8px 8px 8px;
  color: #999;
  font-size: 14px;
}
.work-box.type0 {
  background: rgba(58, 123, 250, 0.15);
  color: #3a7bfa !important;
}
.work-box.type0 span {
  color: #3a7bfa !important;
}
.work-box.type1 {
  background: #e3dcfe;
  color: #635998 !important;
}
.work-box.type1 span {
  color: #635998 !important;
}
.work-box.type2 {
  background: #fae2ca;
  color: #bc8d5e !important;
}
.work-box.type2 span {
  color: #bc8d5e !important;
}
.work-box.type3 {
  background: #e1f3d8;
  color: #67c23a !important;
}
.work-box.type3 span {
  color: #67c23a !important;
}
.work-box.type4 {
  background: #fde2e2;
  color: #f56c6c !important;
}
.work-box.type4 span {
  color: #f56c6c !important;
}
.work-box.type5 {
  background: #ff46c145;
  color: #ff46c0 !important;
}
.work-box.type5 span {
  color: #ff46c0 !important;
}
.work-box.type6 {
  background: #00036418;
  color: #000464 !important;
}
.work-box.type6 span {
  color: #000464 !important;
}
.work-box-left {
  display: flex;
  justify-content: center;
  flex-direction: column;
  line-height: 24px;
}
.content-user {
  width: 100%;
  height: 70px;
  box-sizing: border-box;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: center;
}
.user-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #c0c4cc;
  color: #fff;
  font-size: 18px;
  text-align: center;
  line-height: 40px;
  margin-left: 10px;
}
.user-info {
  flex: 1;
  margin-left: 10px;
}
.hoverType {
  background: rgba(58, 123, 250, 0.03);
}
.year-table {
  width: 100%;
}
/* .year-table .scroll-right{
    width: calc(100% -220px);
  } */
.year-table .scroll-right {
  flex: 1;
}
.year-table .month {
  font-size: 14px;
  color: #3a7bfa;
  box-sizing: border-box;
  padding: 0 4px;
  border-radius: 50%;
  background: #d6e4ff;
  text-align: center;
  line-height: 30px;
}
.year-table .content-title-item {
  width: 100%;
}
.year-table .content-body {
  /* width: calc(100% -220px) !important; */
}
.year-table .content-body-item {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}
</style>
src/views/performance/manHour/workTimeConfig.vue
@@ -139,7 +139,7 @@
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity);
    this.getPower();
    //this.getPower();
    this.obtainItemParameterList();
    this.selectEnumByCategoryForUnit();
  },
@@ -174,30 +174,30 @@
      this.page.current = 1;
      this.getList();
    },
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem("power"));
      let up = false;
      let del = false;
      let add = false;
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == "upDeviceParameter") {
          up = true;
        }
        if (power[i].menuMethod == "delDeviceParameter") {
          del = true;
        }
        if (power[i].menuMethod == "addDeviceParameter") {
          add = true;
        }
      }
      if (!up) {
        this.componentData.do.splice(1, 1);
      }
      if (!del) {
        this.componentData.do.splice(0, 1);
      }
      this.addPower = add;
    },
    // getPower(radio) {
    //   let power = JSON.parse(sessionStorage.getItem("power"));
    //   let up = false;
    //   let del = false;
    //   let add = false;
    //   for (var i = 0; i < power.length; i++) {
    //     if (power[i].menuMethod == "upDeviceParameter") {
    //       up = true;
    //     }
    //     if (power[i].menuMethod == "delDeviceParameter") {
    //       del = true;
    //     }
    //     if (power[i].menuMethod == "addDeviceParameter") {
    //       add = true;
    //     }
    //   }
    //   if (!up) {
    //     this.componentData.do.splice(1, 1);
    //   }
    //   if (!del) {
    //     this.componentData.do.splice(0, 1);
    //   }
    //   this.addPower = add;
    // },
    openAdd() {
      // this.$refs.ValueTable0.openAddDia(
      //   this.$api.auxiliaryWorkingHours.insertAuxiliaryWorkingHours
src/views/performance/staffAttendance/index.vue
@@ -6,4 +6,4 @@
export default {};
</script>
<style></style>
<style></style>
src/views/performance/staffEvaluate/employee-mutual-evaluation.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,220 @@
<template>
    <div class="table-item">
      <p style="text-align: center;margin-bottom: 10px;">{{ entity.departLims }} {{ Number(entity.month.split('-')[1]) }} æœˆä»½å‘˜å·¥äº’评打分表</p>
      <el-table
      :data="tableData"
      style="width: 100%" height="380" v-loading="loading">
        <el-table-column
          type="index"
          label="序号"
          width="55">
        </el-table-column>
        <el-table-column label="姓名">
        </el-table-column>
        <el-table-column label="检测及时性">
          <el-table-column label="及时完成">
            <el-table-column label="20" width="90px">
              <template slot-scope="scope">
                <el-radio :label="20" v-model="scope.row.seasonable" @input="m=>handleChange(m,scope.row,'seasonable')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="催促完成">
            <el-table-column label="15" width="90px">
              <template slot-scope="scope">
                <el-radio :label="15" v-model="scope.row.seasonable" @input="m=>handleChange(m,scope.row,'seasonable')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="延期较长">
            <el-table-column label="10" width="90px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.seasonable" @input="m=>handleChange(m,scope.row,'seasonable')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="检测准确性">
          <el-table-column label="全月无错">
            <el-table-column label="20" width="90px">
              <template slot-scope="scope">
                <el-radio :label="20" v-model="scope.row.exact" @input="m=>handleChange(m,scope.row,'exact')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="偶有失误">
            <el-table-column label="15" width="90px">
              <template slot-scope="scope">
                <el-radio :label="15" v-model="scope.row.exact" @input="m=>handleChange(m,scope.row,'exact')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="频繁错误">
            <el-table-column label="10" width="90px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.exact" @input="m=>handleChange(m,scope.row,'exact')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="操作技能">
          <el-table-column label="操作熟练">
            <el-table-column label="20" width="90px">
              <template slot-scope="scope">
                <el-radio :label="20" v-model="scope.row.skill" @input="m=>handleChange(m,scope.row,'skill')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="操作基本熟练">
            <el-table-column label="15" width="120px">
              <template slot-scope="scope">
                <el-radio :label="15" v-model="scope.row.skill" @input="m=>handleChange(m,scope.row,'skill')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="需要指导">
            <el-table-column label="12" width="90px">
              <template slot-scope="scope">
                <el-radio :label="12" v-model="scope.row.skill" @input="m=>handleChange(m,scope.row,'skill')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="设备维护">
          <el-table-column label="自觉维护">
            <el-table-column label="10" width="90px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.preserve" @input="m=>handleChange(m,scope.row,'preserve')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="能维护">
            <el-table-column label="5" width="80px">
              <template slot-scope="scope">
                <el-radio :label="5" v-model="scope.row.preserve" @input="m=>handleChange(m,scope.row,'preserve')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="无意识">
            <el-table-column label="2" width="80px">
              <template slot-scope="scope">
                <el-radio :label="2" v-model="scope.row.preserve" @input="m=>handleChange(m,scope.row,'preserve')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="遵章守纪">
          <el-table-column label="自觉遵守" >
            <el-table-column label="10" width="90px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.discipline" @input="m=>handleChange(m,scope.row,'discipline')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="被动遵守">
            <el-table-column label="7" width="90px">
              <template slot-scope="scope">
                <el-radio :label="7" v-model="scope.row.discipline" @input="m=>handleChange(m,scope.row,'discipline')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="经常违纪">
            <el-table-column label="5" width="90px">
              <template slot-scope="scope">
                <el-radio :label="5" v-model="scope.row.discipline" @input="m=>handleChange(m,scope.row,'discipline')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="团结协作">
          <el-table-column label="团结协作">
            <el-table-column label="10" width="90px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.solidarity" @input="m=>handleChange(m,scope.row,'solidarity')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="基本融洽">
            <el-table-column label="8" width="90px">
              <template slot-scope="scope">
                <el-radio :label="8" v-model="scope.row.solidarity" @input="m=>handleChange(m,scope.row,'solidarity')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="5S-3定">
          <el-table-column label="包干区整洁">
            <el-table-column label="10" width="110px">
              <template slot-scope="scope">
                <el-radio :label="10" v-model="scope.row.tidy" @input="m=>handleChange(m,scope.row,'tidy')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column label="存在不清洁点">
            <el-table-column label="7" width="130px">
              <template slot-scope="scope">
                <el-radio :label="7" v-model="scope.row.tidy" @input="m=>handleChange(m,scope.row,'tidy')">{{ '' }}</el-radio>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table-column>
        <el-table-column label="得分" fixed="right">
          <el-table-column label="100" width="70px" prop="total">
          </el-table-column>
        </el-table-column>
      </el-table>
    </div>
  </template>
  <script>
import {
    getEvaluateGroup
} from '../../../api/cnas/performance/staffEvaluate'
  export default {
    props:{
      entity:Object,
    },
    data(){
      return{
        tableData:[],
        loading:false,
      }
    },
    created(){
      this.refreshTable()
    },
    methods:{
      handleChange(value,row,prop){
        row[prop] = Number(value)
        getEvaluateGroup(...row).then(res => {
            row.total = res.data
          })
      },
      refreshTable(){
        this.loading = true
        getEvaluateGroup(this.entity).then(res => {
            this.loading = false
            this.tableData = res.data
          })
      },
      refresh(){
        this.refreshTable()
      }
    }
  }
  </script>
  <style scoped>
  .table-item{
    width: 100%;
    height: 100%;
  }
  >>>.el-table--border th.el-table__cell, .el-table__fixed-right-patch{
    border-color: rgb(225, 223, 223);
  }
  >>>.el-table .cell, .el-table--border .el-table__cell .cell{
    text-align: center;
  }
  </style>
src/views/performance/staffEvaluate/evaluation.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
<template>
  <div class="table-item">
    <lims-table
      :tableData="tableData"
      :column="column"
      :tableLoading="tableLoading"
      :height="'calc(100vh - 270px)'"
      :page="page"
      @pagination="pagination"
    ></lims-table>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import {
  page
} from '../../../api/cnas/performance/staffEvaluate'
export default {
  components: {
    limsTable,
  },
  props: {
     entity : {
        type: Object,
        default: () => {
          return {};
        },
      }
    },
  data() {
    return {
      tableData: [],
      tableLoading: false,
      column: [
        { label: "工号", prop: "account" },
        { label: "姓名", prop: "name" },
        {
          label: "员工互评",
          prop: "groupTotal",
        },
        { label: "组长评分", prop: "leaderTotal" },
        { label: "主管评分", prop: "competentTotal" },
        { label: "考评得分", prop: "score" },
        { label: "考评等级", prop: "grade" },
      ],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
    };
  },
  methods: {
    getList() {
      this.tableLoading = true;
      let param = { ...this.entity, ...this.page };
      delete param.total;
      page({ ...param })
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total;
          }
        })
        .catch((err) => {
          this.tableLoading = false;
        });
    },
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    refreshTable() {
        this.getList();
    }
  },
  mounted() {},
};
</script>
<style scoped>
.table-item {
  width: 100%;
  height: 100%;
}
</style>
src/views/performance/staffEvaluate/index.vue
@@ -1,9 +1,225 @@
<template>
  <div>人员考评</div>
  <div class="personnel-evaluation">
    <basicContainer>
      <div class="search">
      <div class="search_thing">
                <div class="search_label">月份:</div>
                <div class="search_input">
          <el-date-picker
            v-model="entity.month"
            format="yyyy-MM"
            placeholder="选择月"
            size="small"
            type="month"
            value-format="yyyy-MM"
            @change="refreshTable()">
          </el-date-picker>
        </div>
            </div>
      <div class="search_thing">
                <div class="search_label">实验室:</div>
                <div class="search_input">
          <el-select v-model="entity.departLims" placeholder="全部" size="small" @change="refreshTable()">
                    <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
        </div>
            </div>
            <div class="search_thing">
                <div class="search_label">人员名称:</div>
                <div class="search_input"><el-input v-model="entity.name" clearable placeholder="请输入"
                        size="small" @keyup.enter.native="refreshTable()"></el-input></div>
            </div>
            <div class="search_thing" style="padding-left: 30px;">
                <el-button size="small" @click="refresh()">重 ç½®</el-button>
                <el-button size="small" type="primary" @click="refreshTable()">查 è¯¢</el-button>
            </div>
        </div>
    <div class="tabs" style="margin-top: 10px;">
      <el-radio-group v-model="tabValue" size="small" >
        <el-radio-button v-hasPermi="['staffEvaluate:evaluation:list']" label="evaluation">考评</el-radio-button>
        <el-radio-button v-hasPermi="['staffEvaluate:employeeMutualEvaluation:list']" label="employeeMutualEvaluation">员工互评</el-radio-button>
        <el-radio-button v-hasPermi="['staffEvaluate:leaderRate:list']" label="leaderRate">组长评分</el-radio-button>
        <el-radio-button v-hasPermi="['staffEvaluate:supervisorRate:list']" label="supervisorRate">主管打分</el-radio-button>
      </el-radio-group>
      <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导 å‡º</el-button>
    </div>
    </basicContainer>
    <div class="table">
      <component :is="tabValue" v-if="laboratoryList.length>0" ref="component" :entity="entity"></component>
    </div>
  </div>
</template>
<script>
export default {};
 import evaluation from '../staffEvaluate/evaluation.vue'
import employeeMutualEvaluation from '../staffEvaluate/employee-mutual-evaluation.vue'
import leaderRate from '../staffEvaluate/leader-rate.vue'
import supervisorRate from '../staffEvaluate/supervisor-rate.vue'
import {
  obtainItemParameterList,
  exportEvaluate,
  exportEvaluateLeader,
  exportEvaluateCompetent
} from '../../../api/cnas/performance/staffEvaluate'
export default {
  components: {
     evaluation,
    employeeMutualEvaluation,
    leaderRate,
    supervisorRate,
  },
  data(){
    return{
      // isPermission: isPermission,
      entity:{
        month:new Date().getFullYear()+'-'+((new Date().getMonth() + 1) < 10 ? '0'+(new Date().getMonth() + 1):(new Date().getMonth() + 1)),
        departLims:'',
        name:''
      },
      tabValue:'evaluation',
      laboratoryList:[],
      outLoading:false,
      copyEntity:null
    }
  },
  created(){
    this.obtainItemParameterList()
    this.tabValue = this.initTabValueByPermissions()
  },
  methods: {
    initTabValueByPermissions(){
      // const per1 = this.isPermission('page')//查询考评
      // const per2 = this.isPermission('getEvaluateGroup')//员工互评
      // const per3 = this.isPermission('getEvaluateLeader')//组长评分
      // const per4 = this.isPermission('getEvaluateCompetent')//主管打分
      // return per1?'evaluation':per2?'employeeMutualEvaluation':per3?'leaderRate':per4?'supervisorRate':''
      return 'evaluation'
    },
    refreshTable(){
      this.$refs.component.refreshTable()
    },
    refresh(){
      this.entity = this.HaveJson(this.copyEntity)
      this.$refs.component.refresh()
    },
    obtainItemParameterList() {
      obtainItemParameterList().then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.laboratoryName,
            value: a.laboratoryName
          })
        })
        this.laboratoryList = data
        this.entity.departLims = data[0].value
        this.copyEntity = this.HaveJson(this.entity)
      })
    },
    handleDown(){
      let url = null;
      let title = ''
      if(this.tabValue=='evaluation'){
        url = exportEvaluate
        title = '考评表'
      }else if(this.tabValue=='employeeMutualEvaluation'){
        url = exportEvaluate
        title = '考评表'
      }else if(this.tabValue=='leaderRate'){
        url = exportEvaluateLeader
        title = '组长评分表'
      }else if(this.tabValue=='supervisorRate'){
        url = exportEvaluateCompetent
        title = '主管评分表'
      }
      let entity = {...this.entity}
      this.outLoading = true
      url(entity).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/octet-stream' });
        //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = entity.departLims+'-'+entity.month+title+'.xlsx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = entity.departLims+'-'+entity.month+title+'.xlsx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
  }
}
</script>
<style></style>
<style scoped>
.personnel-evaluation {
  height: 100%;
  overflow-y: auto;
}
.title {
  height: 60px;
  line-height: 60px;
}
.search {
        background-color: #ffffff;
        height: 80px;
        display: flex;
        align-items: center;
    margin-top: 20px;
    }
    .search_thing {
        width: 350px;
        display: flex;
        align-items: center;
    }
    .search_label {
        width: 110px;
        font-size: 14px;
        text-align: right;
    }
    .search_input {
        width: calc(100% - 110px);
    }
  .tabs{
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .table {
        margin-top: 10px;
        background-color: #ffffff;
        width: calc(100% - 40px);
        height: calc(100% - 60px - 80px - 10px - 42px);
        padding: 20px;
    }
</style>
src/views/performance/staffEvaluate/leader-rate.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,155 @@
<template>
  <div class="table-item">
    <p style="text-align: center; margin-bottom: 10px">
      {{ entity.departLims }}
      {{ Number(entity.month.split("-")[1]) }} æœˆä»½ç»„长打分表
    </p>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="380"
      v-loading="loading"
    >
      <el-table-column type="index" label="序号" width="55"> </el-table-column>
      <el-table-column label="姓名" prop="name"> </el-table-column>
      <el-table-column label="工作责任心">
        <el-table-column label="25">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.responsibility"
              @change="(m) => handleChange(m, scope.row, 'responsibility')"
              :min="0"
              :max="25"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="服从分工">
        <el-table-column label="25">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.compliance"
              @change="(m) => handleChange(m, scope.row, 'compliance')"
              :min="0"
              :max="25"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="积极性">
        <el-table-column label="20">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.positive"
              @change="(m) => handleChange(m, scope.row, 'positive')"
              :min="0"
              :max="20"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="团结同事">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.solidarity"
              @change="(m) => handleChange(m, scope.row, 'solidarity')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="试验及时性">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.seasonable"
              @change="(m) => handleChange(m, scope.row, 'seasonable')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="结果准确性">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.exact"
              @change="(m) => handleChange(m, scope.row, 'exact')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="得分" prop="total"> </el-table-column>
    </el-table>
  </div>
</template>
  <script>
import {
  writeEvaluateLeader,
  getEvaluateLeader,
} from "../../../api/cnas/performance/staffEvaluate";
export default {
  props: {
    entity: Object,
  },
  data() {
    return {
      tableData: [],
      loading: false,
    };
  },
  created() {
    this.refreshTable();
  },
  methods: {
    handleChange(value, row, prop) {
      row[prop] = Number(value);
      writeEvaluateLeader({ ...row }).then((res) => {
        row.total = res.data;
      });
    },
    refreshTable() {
      this.loading = true;
      getEvaluateLeader(this.entity).then((res) => {
        this.loading = false;
        this.tableData = res.data;
      });
    },
    refresh() {
      this.refreshTable();
    },
  },
};
</script>
  <style scoped>
.table-item {
  width: 100%;
  height: 100%;
}
>>> .el-table--border th.el-table__cell,
.el-table__fixed-right-patch {
  border-color: rgb(225, 223, 223);
}
>>> .el-table .cell,
.el-table--border .el-table__cell .cell {
  text-align: center;
}
.el-input-number {
  width: 110px;
}
</style>
src/views/performance/staffEvaluate/supervisor-rate.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,168 @@
<template>
  <div class="table-item">
    <p style="text-align: center; margin-bottom: 10px">
      {{ entity.departLims }}
      {{ Number(entity.month.split("-")[1]) }} æœˆä»½ä¸»ç®¡æ‰“分表
    </p>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="380"
      v-loading="loading"
    >
      <el-table-column type="index" label="序号" width="55"> </el-table-column>
      <el-table-column label="姓名" prop="name"> </el-table-column>
      <el-table-column label="技能水平">
        <el-table-column label="20">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.skill"
              @change="(m) => handleChange(m, scope.row, 'skill')"
              :min="0"
              :max="20"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="服从分工">
        <el-table-column label="20">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.compliance"
              @change="(m) => handleChange(m, scope.row, 'compliance')"
              :min="0"
              :max="20"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="积极性">
        <el-table-column label="20">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.positive"
              @change="(m) => handleChange(m, scope.row, 'positive')"
              :min="0"
              :max="20"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="5S-3定">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.tidy"
              @change="(m) => handleChange(m, scope.row, 'tidy')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="规章制度">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.discipline"
              @change="(m) => handleChange(m, scope.row, 'discipline')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="团结协作">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.solidarity"
              @change="(m) => handleChange(m, scope.row, 'solidarity')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="提案积分">
        <el-table-column label="10">
          <template slot-scope="scope">
            <el-input-number
              size="small"
              v-model="scope.row.proposal"
              @change="(m) => handleChange(m, scope.row, 'proposal')"
              :min="0"
              :max="10"
            ></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="得分" prop="total"> </el-table-column>
    </el-table>
  </div>
</template>
  <script>
import {
  getEvaluateCompetent,
  writeEvaluateCompetent,
} from "../../../api/cnas/performance/staffEvaluate";
export default {
  props: {
    entity: Object,
  },
  data() {
    return {
      tableData: [],
      loading: false,
    };
  },
  created() {
    this.refreshTable();
  },
  methods: {
    handleChange(value, row, prop) {
      row[prop] = Number(value);
      writeEvaluateCompetent(...row).then((res) => {
        row.total = res.data;
      });
    },
    refreshTable() {
      this.loading = true;
      getEvaluateCompetent(this.entity).then((res) => {
        this.loading = false;
        this.tableData = res.data;
      });
    },
    refresh() {
      this.refreshTable();
    },
  },
};
</script>
  <style scoped>
.table-item {
  width: 100%;
  height: 100%;
}
>>> .el-table--border th.el-table__cell,
.el-table__fixed-right-patch {
  border-color: rgb(225, 223, 223);
}
>>> .el-table .cell,
.el-table--border .el-table__cell .cell {
  text-align: center;
}
.el-input-number {
  width: 110px;
}
</style>
vue.config.js
@@ -36,7 +36,7 @@
    proxy: {
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        target: `http://192.168.0.104:8002`,
        target: `http://127.0.0.1:8002`,
        // target: `http://127.0.0.1:8002`,
        changeOrigin: true,
        pathRewrite: {