zouyu
2026-04-20 df3902e7eae5dd38a2d47aa63e5f27131f701db9
绩效管理模块调整
已修改13个文件
473 ■■■■ 文件已修改
src/api/performance/attendance.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/performance/class.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/date.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionTask/inspection.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrder/index.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrderComponents/materialOrder/printDialog.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/components/addOrder.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/productOrder/components/printDialog.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/attendance/components/staffClockInRecord.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/attendance/index.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/performance/class/index.vue 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/performance/attendance.js
@@ -64,3 +64,13 @@
    data: data
  });
}
// 绩效管理-人员考勤-导出考勤记录
export function exportStaffAttendanceRecords(query) {
  return request({
    url: "/staff/attendance/exportStaffAttendanceRecords",
    method: "get",
    params: query,
    responseType:'blob'
  });
}
src/api/performance/class.js
@@ -88,6 +88,7 @@
    url: "/performanceShift/export",
    method: "get",
    params: query,
    responseType:'blob'
  });
}
src/api/system/user.js
@@ -203,3 +203,21 @@
    method: "get",
  });
}
// 获取用户列表
export function selectUserListByPerformance(query) {
  return request({
    url: "/system/newUser/selectUserListByPerformance",
    method: "get",
    params:query
  });
}
// 更新用户排序
export function updateUserSort(data) {
  return request({
    url: "/system/user/updateUserSort",
    method: "post",
    data:data
  });
}
src/utils/date.js
@@ -130,3 +130,47 @@
  }
  return workMonth
}
/**
 * 判断时间区间是否超过 1 个自然月
 * @param {string} startTime - 开始时间 yyyy-MM-dd HH:mm:ss
 * @param {string} endTime - 结束时间 yyyy-MM-dd HH:mm:ss
 * @returns {boolean} true=超过一个月,false=未超过
 */
export function isOverOneMonth(startTime, endTime) {
  // 1. 解析为日期对象
  const start = new Date(startTime);
  const end = new Date(endTime);
  // 2. 校验日期合法性
  if (isNaN(start.getTime()) || isNaN(end.getTime())) {
    throw new Error("时间格式错误,请使用 yyyy-MM-dd HH:mm:ss 格式");
  }
  // 3. 如果结束时间早于开始时间,直接返回false
  if (end < start) return false;
  // 4. 计算年份差、月份差
  const startYear = start.getFullYear();
  const startMonth = start.getMonth();
  const startDay = start.getDate();
  const startRest = start.getTime() - new Date(startYear, startMonth, startDay).getTime(); // 时分秒毫秒
  const endYear = end.getFullYear();
  const endMonth = end.getMonth();
  const endDay = end.getDate();
  const endRest = end.getTime() - new Date(endYear, endMonth, endDay).getTime();
  // 总月份差值
  const monthDiff = (endYear - startYear) * 12 + (endMonth - startMonth);
  // 5. 判断逻辑
  if (monthDiff > 1) {
    return true; // 月份差>1 → 超过
  } else if (monthDiff === 1) {
    // 月份差=1 → 比较 日+时分秒,超过则判定超时
    return endDay > startDay || (endDay === startDay && endRest > startRest);
  } else {
    return false; // 月份差<1 → 未超过
  }
}
src/views/business/inspectionTask/inspection.vue
@@ -422,6 +422,19 @@
      <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
        :height="'calc(100vh - 90px)'" :currentChange="handleChangeTask"></lims-table>
    </el-drawer>
    <el-dialog
      title="哑铃片设备试样类型"
      :visible.sync="dialogVisible"
      :before-close="handleDialogCancel"
      width="30%">
      <el-select v-model="deviceDbTableName" placeholder="请选择试样类型" style="width:100%" size="small">
        <el-option label="片状" value="TestData"></el-option>
        <el-option label="管状" value="TestData2"></el-option>
      </el-select>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleDialogConfirm">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="reviewDia" title="检验复核" width="500px">
      <div v-if="reviewDia" class="body" style="display: flex; padding: 10px">
        <div class="search_label" style="width: 150px">
@@ -664,6 +677,11 @@
  },
  data() {
    return {
      // 存储 Promise 的 resolve/reject,用于弹框确认/取消时调用
      dialogResolve: null,
      dialogReject: null,
      dialogVisible: false,
      deviceDbTableName: '',
      outerColorList:[],
      insulationColorList:[],
      letteringInfoList: [],
@@ -1313,10 +1331,53 @@
      this.$refs.purchaseDialog.$refs["purchaseForm"].resetFields();
      this.purchaseDialog = false;
    },
    openDialog() {
      this.dialogVisible = true;
      this.deviceDbTableName = ''; // 重置表单
      // 返回 Promise,等待用户操作
      return new Promise((resolve, reject) => {
        this.dialogResolve = resolve;
        this.dialogReject = reject;
      });
    },
    // 弹框确认提交
    handleDialogConfirm() {
      // 关闭弹框
      this.dialogVisible = false;
      // 调用 resolve,传递表单数据,恢复执行后续代码
      this.dialogResolve(this.deviceDbTableName);
    },
    // 弹框取消/关闭
    handleDialogCancel() {
      console.log(111)
      this.dialogVisible = false;
      // 调用 reject,终止后续代码
      this.dialogReject();
    },
    // 数据采集
  getDataAcquisitionDevice() {
    async getDataAcquisitionDevice() {
      //过滤选中的设备列表
    let deviceList = []
    for (let item in this.param){
      let val1 = this.param[item]
      for(let item2 in val1){
        if(item2==='equipName'){
          let equipName = val1[item2]
          equipName.forEach(item=>{
            if(item.v.v && Array.isArray(item.v.v)){
              deviceList.push(...item.v.v)
            }
          })
        }
      }
    }
    //数组去重
    let deviceSetList = [...new Set(deviceList)]
    try{
      if(deviceSetList.includes('NS-YL3141') && !this.deviceDbTableName){
        await this.openDialog();
      }
    let itemIds = [];
    this.currentSample.insProduct.forEach((item) => {
      if (item.inspectionItemType === "1") {
@@ -1329,6 +1390,7 @@
      sampleCode: this.currentSample.sampleCode,
      id: this.currentSample.id,
      itemIds: itemIds,
        dbTable: this.deviceDbTableName,
    };
    this.dataAcquisitionLoading = true;
    dataCollection(params).then((res) => {
@@ -1342,6 +1404,9 @@
    }).catch(err => {
      this.dataAcquisitionLoading = false;
    });
    }catch (error){
      console.error('数据采集设备列表处理失败',error)
    }
  },
    objectOrder(obj) {
      let newkey = Object.keys(obj).sort();
src/views/business/materialOrder/index.vue
@@ -1135,8 +1135,6 @@
        if (res.code === 200) {
          this.tableData = res.data.records
          this.page.total = res.data.total
          console.log('data ======> ', this.tableData)
        }
      }).catch(err => {
        this.tableLoading = false
@@ -1597,7 +1595,6 @@
      this.multipleSelection = val
    },
    changeRowClass({ row, rowIndex }) {
      console.log(row,row.isFirst==1)
      if (row.isFirst == 1) {
        return 'highlight-danger-row-border'
      }
src/views/business/materialOrderComponents/materialOrder/printDialog.vue
@@ -77,7 +77,7 @@
          <div>
            <div class="titleH1" style="text-align: center;margin-bottom: 1px">检测中心样品标识卡</div>
            <div style="text-align: center;">
              <barcode :value="item.barcode" :height="22" :width="1.6" :displayValue="false"></barcode>
              <barcode :margin="1" :value="item.barcode" :height="22" :width="1.6" :displayValue="false"></barcode>
            </div>
            <div style="margin-left: 12px;text-align: left">
              <div class="item">
@@ -225,7 +225,7 @@
        targetStyles: ["*"], // 使用dom的所有样式,很重要
        printable: 'printOrder',//页面
        type: "html",//文档类型
        maxWidth:360,
        maxWidth:440,
        header: '',
        style:
          `@page {
@@ -234,14 +234,13 @@
            margin-top: 0.4cm;
            margin-bottom: 0.4cm;
            padding-bottom: 0px;
            size: 400px 75px collapse;
            size: 440px 75px collapse;
          }
          html{
            zoom:100%;
          }
          @media print{
            width: 400px;
            width: 440px;
            height: 75px;
            margin:0;
          }`,
src/views/business/productOrder/components/addOrder.vue
@@ -88,19 +88,25 @@
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="零件号" prop="partNo">
                <el-input v-model="addObj.partNo" clearable placeholder="请输入零件号" size="small">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="零件描述:" prop="partDesc">
                <el-input v-model="addObj.partDesc" clearable placeholder="请输入零件描述" size="small">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="供应商名称:" prop="supplierName">
                <el-input v-model="addObj.supplierName" clearable placeholder="请输入供应商名称" size="small">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="联系方式:" prop="phone">
                <el-input v-model="addObj.phone" :disabled="active>1&&tabIndex!=4" clearable placeholder="选择委托客户" size="small"></el-input>
@@ -121,14 +127,15 @@
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="样品数量:" prop="sampleNum" style="margin-right: 0">
                <el-input-number v-model="addObj.sampleNum" :disabled="active>1" :max="100" :min="1" :precision="0"
                                 size="small" @change="addStandardTree"></el-input-number>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="样品状态:" prop="sampleStatus">
                <el-select v-model="addObj.sampleStatus" :disabled="active>1&&tabIndex!=4" size="small">
@@ -148,6 +155,8 @@
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="报告发送方式:" prop="send">
                <el-radio-group v-model="addObj.send" :disabled="active>1&&tabIndex!=4" size="mini">
@@ -156,8 +165,6 @@
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="样品处理方式:" prop="processing">
                <el-radio-group v-model="addObj.processing" :disabled="active>1&&tabIndex!=4" size="mini" style="display: flex; flex-direction: column;">
@@ -178,6 +185,8 @@
                          size="small"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="是否留样:" prop="isLeave">
                <el-radio-group v-model="addObj.isLeave" border :disabled="active>1&&tabIndex!=4" size="mini">
@@ -186,8 +195,6 @@
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="委托人:" prop="prepareUser">
                <el-input v-model="addObj.prepareUser" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '请输入'" clearable size="small"></el-input>
@@ -204,14 +211,14 @@
                          size="small" style="width: 100%" type="textarea"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="备注英文:" prop="remarkEn">
                <el-input v-model="addObj.remarkEn" :autosize="{ minRows: 2, maxRows: 2}" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '请输入'" clearable
                          size="small" type="textarea"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="样品名称:" prop="sampleView">
                <el-input v-model="addObj.sampleView" :disabled="active>1&&tabIndex!=4" :placeholder="active>1 ? '' : '请输入'" clearable
@@ -658,6 +665,7 @@
        contract:null,
        updateBatchNo: null,
        partDesc: null,
        partNo: null,
        supplierName: null,
        custom: null,
        company: null,
src/views/business/productOrder/components/printDialog.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <el-dialog :visible.sync="isShow" title="标签打印" top="5vh" width="600px" @close="$emit('closePrintDialog')">
    <el-dialog :visible.sync="isShow" title="标签打印" top="5vh" width="800px" @close="$emit('closePrintDialog')">
      <div style="width:100%;height: 400px;overflow-y: auto;text-align: left">
        <div class="dia_body">
          <el-checkbox
@@ -75,7 +75,7 @@
          <div>
            <div class="titleH1" style="text-align: center;margin-bottom: 1px">检测中心样品标识卡</div>
            <div style="text-align: center;">
              <barcode :displayValue="false" :height="22" :value="item.barcode" :width="1.6"></barcode>
              <barcode :displayValue="false" :height="30" :value="item.barcode" :width="1.5"></barcode>
            </div>
            <div style="margin-left: 12px;text-align: left">
              <div class="item">
@@ -124,6 +124,7 @@
<script>
import PrintJS from "print-js";
import {labelOrderPrinting} from "@/api/business/productOrder";
import {stringToBase64} from '@/utils/base64Util'
export default {
  name: "printDialog",
@@ -165,7 +166,7 @@
            res.data.forEach(item => {
              item.sendTime = item.sendTime && item.sendTime.substring(0, 10)
              item.sampleNumber = item.qtyArrived + item.buyUnitMeas
              this.$set(item, 'barcode', item.entrustCode)
              this.$set(item, 'barcode', item.entrustCode+","+stringToBase64(item.partColor))
              this.$set(item, 'isLeave', item.insState === '2')
            })
            this.barcodeData = res.data
@@ -221,7 +222,7 @@
        targetStyles: ["*"], // 使用dom的所有样式,很重要
        printable: 'printOrder',//页面
        type: "html",//文档类型
        maxWidth: 360,
        maxWidth: 440,
        header: '',
        style:
          `@page {
@@ -230,14 +231,14 @@
            margin-top: 0.4cm;
            margin-bottom: 0.4cm;
            padding-bottom: 0px;
            size: 400px 75px collapse;
            size: 440px 75px collapse;
          }
          html{
            zoom:100%;
          }
          @media print{
            width: 400px;
            width: 440px;
            height: 75px;
            margin:0;
          }`,
src/views/performance/attendance/components/staffClockInRecord.vue
@@ -20,19 +20,19 @@
      //进出门类型列表
      enterOrExitList:[
        {
          effect:'',
          effect:'light',
          type:'success',
          label:'进门',
          value:1
        },
        {
          effect:'',
          effect:'light',
          type:'',
          label:'出门',
          value:2
        },
        {
          effect:'',
          effect:'light',
          type:'info',
          label:'进/出门',
          value:3
src/views/performance/attendance/index.vue
@@ -30,12 +30,12 @@
        </div>
      </div>
      <div class="search_thing">
        <el-button size="mini" type="primary" @click="refreshTable()"
          >查 询</el-button
        <el-button icon="el-icon-search" size="mini" type="primary" @click="refreshTable()">查 询</el-button
        >
        <el-button size="mini" @click="resetQuery">重置</el-button>
        <el-button size="mini" type="primary" @click="openAddAttendanceDialog()">手动新增</el-button>
        <el-button size="mini" type="success" @click="openSyncAttendanceDialog()">同步考勤记录</el-button>
        <el-button icon="el-icon-refresh-left" size="mini" @click="resetQuery">重置</el-button>
        <el-button icon="el-icon-plus" size="mini" type="primary" @click="openAddAttendanceDialog()">手动新增</el-button>
        <el-button icon="el-icon-refresh" size="mini" type="success" @click="openSyncAttendanceDialog()">同步考勤记录</el-button>
        <el-button plain icon="el-icon-download" size="mini" type="primary" @click="openAttendanceRecordDialog()">导出</el-button>
      </div>
    </div>
    <div class="container">
@@ -211,6 +211,45 @@
    <el-button type="primary" @click="confirmSyncAttendance">确 定</el-button>
  </span>
    </el-dialog>
    <el-dialog
      title="导出考勤记录"
      :visible.sync="attendanceRecordVisible"
      width="40%">
      <el-row>
        <el-col :span="4">
          <label>统计维度:</label>
        </el-col>
        <el-col :span="20">
            <el-radio-group v-model="reportType" size="mini" disabled>
              <el-radio label="YEAR">年度</el-radio>
              <el-radio label="MONTH">月度</el-radio>
            </el-radio-group>
        </el-col>
      </el-row>
      <el-row style="margin-top:20px">
        <el-col :span="4">
          <label>统计日期:</label>
        </el-col>
        <el-col :span="20">
          <el-date-picker
            size="small"
            v-model="reportDateRange"
            style="width:100%"
            @change="changeReportDateRange"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00','23:59:59']"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="attendanceRecordVisible = false">取 消</el-button>
        <el-button :loading="exportLoading" type="primary" @click="exportStaffAttendanceRecords()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -222,10 +261,12 @@
  checkDutyDate,
  saveOrUpdateStaffAttendanceTrackingRecord,
  removeStaffAttendanceTrackingRecord,
  syncAttendanceRecord
  syncAttendanceRecord,
  exportStaffAttendanceRecords
} from '@/api/performance/attendance'
import {getDicts} from "@/api/system/dict/data";
import {getTimeRange} from "@/utils/date";
import {getTimeRange,isOverOneMonth} from "@/utils/date";
import {transformExcel} from '@/utils/file'
export default {
  name: "Attendance",
  components: {
@@ -233,8 +274,12 @@
  },
  data() {
    return {
      reportDateRange:[],
      reportType:"MONTH",
      attendanceRecordVisible:false,
      syncDateRange:[],
      syncAttendanceVisible: false,
      exportLoading: false,
      attendanceForm:{
        workDataId: null,
        offWorkDataId: null,
@@ -313,6 +358,41 @@
    window.removeEventListener("resize",this.resizeHandler)
  },
  methods: {
    changeReportDateRange(val){
      //判断时间区间是否超过一个月
      if(val && val.length===2){
        const flag = isOverOneMonth(val[0],val[1]);
        this.reportType = flag?'YEAR':'MONTH'
      }
    },
    openAttendanceRecordDialog (){
      this.reportDateRange = getTimeRange()
      this.$nextTick(()=>{
        this.attendanceRecordVisible = true
      })
    },
    //导出考勤记录
    exportStaffAttendanceRecords(){
      this.exportLoading = true
      let params = {
        attendanceReportType:this.reportType,
      }
      if (this.reportDateRange && this.reportDateRange.length === 2) {
        params.startDate = this.reportDateRange[0];
        params.endDate = this.reportDateRange[1];
      } else {
        params.startDate = "";
        params.endDate = "";
      }
      exportStaffAttendanceRecords({...params}).then(res=>{
        transformExcel(res, "中天耐丝质量考勤汇总.xlsx")
        this.$message.success("导出成功")
      }).catch(error=>{
        console.error(error)
      }).finally(()=>{
        this.exportLoading = false
      })
    },
    getShiftByDic(e) {
      let obj = this.dailyTypeList.find((m) => m.dictValue == e);
      if (obj) {
src/views/performance/class/index.vue
@@ -41,8 +41,7 @@
            人员名称
            <span style="color:#ff4949">(人员数量:{{list.length}})</span>
          </div>
          <div class="content-user" :class="{ hoverType: currentUserIndex == index }" v-for="(item, index) in list"
            :key="'e' + index" v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
          <div class="content-user" v-for="(item, index) in list">
            <div class="user-pic">
              {{ item.userName ? item.userName.charAt(0) : "" }}
            </div>
@@ -55,13 +54,7 @@
                ">
                {{ item.userName }}
              </p>
              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;">
                <span>早:{{ item.monthlyAttendance.morningShift}},</span>
                <span>中:{{ item.monthlyAttendance.swingShift}},</span>
                <span>夜:{{ item.monthlyAttendance.nightShift}},</span>
                <span>休:{{ item.monthlyAttendance.holidayShift}},</span>
                <span>假:{{ item.monthlyAttendance.leaveShift}},</span>
                <span>差:0</span>
              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;" v-text="item.monthlyAttendanceStr">
              </p>
              <p style="margin-top: 4px; margin: 0">
                <span style="
@@ -69,7 +62,7 @@
                    font-size: 12px;
                    display: inline-block;
                    transform: scale(0.8) translateX(-10px);
                  ">合计出勤: </span><span style="font-size: 16px; color: #ff4902">{{item.monthlyAttendance.morningShift+item.monthlyAttendance.swingShift+item.monthlyAttendance.nightShift}}天</span>
                  ">合计出勤: </span><span style="font-size: 16px; color: #ff4902">{{item.monthlyAttendance.totalCount}}天</span>
              </p>
            </div>
          </div>
@@ -86,8 +79,7 @@
                </p>
              </div>
            </div>
            <div class="content-body" v-for="(item, index) in list" :key="'c' + index"
              v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
            <div class="content-body" v-for="(item, index) in list" :key="'c' + index">
              <div class="content-body-item" v-for="(m, i) in item.list" :key="'d' + i"
                :class="{ hoverType: currentUserIndex == index }">
                <el-dropdown trigger="click" placement="bottom" @command="(e) => handleCommand(e, m)"
@@ -115,8 +107,8 @@
            人员名称
            <span style="color:#ff4949">(人员数量:{{yearList.length}})</span>
          </div>
          <div class="content-user" :class="{ hoverType: currentUserIndex == index }" v-for="(item, index) in yearList"
            :key="'e' + index" v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
          <div class="content-user" v-for="(item, index) in yearList"
            :key="'e' + index">
            <div class="user-pic">
              {{ item.userName ? item.userName.charAt(0) : "" }}
            </div>
@@ -129,21 +121,14 @@
                ">
                {{ item.userName }}
              </p>
              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;">
                <span>早:{{ item.sidebarAnnualAttendance.morningShift}},</span>
                <span>中:{{ item.sidebarAnnualAttendance.swingShift}},</span>
                <span>夜:{{ item.sidebarAnnualAttendance.nightShift}},</span>
                <span>休:{{ item.sidebarAnnualAttendance.holidayShift}},</span>
                <span>假:{{ item.sidebarAnnualAttendance.leaveShift}},</span>
                <span>差:0</span>
              </p>
              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;" v-text="item.sidebarAnnualAttendanceStr"></p>
              <p style="margin-top: 4px; margin: 0">
                <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.sidebarAnnualAttendance.morningShift+item.sidebarAnnualAttendance.swingShift+item.sidebarAnnualAttendance.nightShift}}天</span>
                  ">合计出勤: </span><span style="font-size: 16px; color: #ff4902">{{item.sidebarAnnualAttendance.totalCount}}天</span>
              </p>
            </div>
          </div>
@@ -158,21 +143,15 @@
                  <span class="month">{{ item }}月</span>
                </div>
              </div>
              <div class="content-body" v-for="(item, index) in yearList" :key="'c' + index"
                v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null" :style="`display: grid;
              <div class="content-body" v-for="(item, index) in yearList" :key="'c' + index" :style="`display: grid;
              grid-template-columns: repeat(${monthList.length}, 1fr);`">
                <div class="content-body-item" v-for="(m, i) in item.monthlyAttendance" :key="'d' + i"
                <div class="content-body-item" v-for="(m, i) in item.monthlyAttendances" :key="'d' + i"
                  :class="{ hoverType: currentUserIndex == index }">
                  <p style="color: rgb(153, 153, 153); font-size: 12px">
                    合计出勤:<span style="font-size: 14px; color: #000">{{m.morningShift+m.swingShift+m.nightShift}}</span>
                    合计出勤:<span style="font-size: 14px; color: #000">{{m.monthlyAttendance.totalCount}}</span>
                  </p>
                  <p style="color: rgb(153, 153, 153); font-size: 12px">
                    <span>早:{{ m.morningShift}},</span>
                    <span>中:{{ m.swingShift}},</span>
                    <span>夜:{{ m.nightShift}},</span>
                    <span>休:{{ m.holidayShift}},</span>
                    <span>假:{{ m.leaveShift}},</span>
                    <span>差:0</span>
                    <span>{{m.monthlyAttendanceStr}}</span>
                  </p>
                </div>
              </div>
@@ -265,9 +244,7 @@
          <span style="color: red; margin-right: 4px">*</span>人员名称:
        </div>
        <div class="search_input" style="width: calc(100% - 90px)">
          <el-select v-model="schedulingQuery.userId" popper-class="select-with-all" placeholder="请选择" style="width: 100%" multiple collapse-tags clearable>
<!--            <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">-->
<!--            </el-option>-->
          <el-select v-model="schedulingQuery.userIdList" popper-class="select-with-all" placeholder="请选择" style="width: 100%" multiple collapse-tags clearable>
            <template slot="prefix">
              <el-button
                type="text"
@@ -284,7 +261,10 @@
              :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.account }}</span>
            </el-option>
          </el-select>
        </div>
      </div>
@@ -320,11 +300,12 @@
  exportFile,
  obtainItemParameterList,
  update,
  selectUserCondition,
  editAnnotationText,
  delAnnotationText
} from "@/api/performance/class";
import {selectUserListByPerformance} from '@/api/system/user'
import {getWorkMonth} from "@/utils/date";
import {transformExcel} from '@/utils/file'
export default {
  name: 'Class',
  data() {
@@ -394,7 +375,7 @@
      loading: false,
      schedulingQuery: {
        week: "",
        userId: [],
        userIdList: [],
        shift: "",
      },
      list: [],
@@ -418,7 +399,7 @@
  },
  computed:{
    isAllSelected() {
      return this.schedulingQuery.userId.length === this.personList.length && this.personList.length > 0;
      return this.schedulingQuery.userIdList.length === this.personList.length && this.personList.length > 0;
    },
  },
  watch: {
@@ -446,10 +427,10 @@
  methods: {
    handleSelectAll() {
      if (this.isAllSelected) {
        this.schedulingQuery.userId = [];
        this.schedulingQuery.userIdList = [];
      } else {
        // 只选中可用选项的value
        this.schedulingQuery.userId = this.personList.map(item => item.id);
        this.schedulingQuery.userIdList = this.personList.map(item => item.id);
      }
    },
    handleContextMenu(target,e) {
@@ -595,9 +576,6 @@
        this.yearList = res.data
      });
    },
    onMouseEnter(index) {
      this.currentUserIndex = index;
    },
    confirmScheduling() {
      if (!this.schedulingQuery.week) {
        this.$message.error("请选择周次");
@@ -611,8 +589,8 @@
        getYearAndMonthAndDays(new Date(time + 24 * 60 * 60 * 1000 * 5)) +
        " 00:00:00";
      if (
        !this.schedulingQuery.userId ||
        this.schedulingQuery.userId.length == 0
        !this.schedulingQuery.userIdList ||
        this.schedulingQuery.userIdList.length == 0
      ) {
        this.$message.error("请选择人员");
        return;
@@ -625,7 +603,7 @@
      add({
        startWeek,
        endWeek,
        userId: this.schedulingQuery.userId.join(","),
        userIdList: this.schedulingQuery.userIdList,
        shift: this.schedulingQuery.shift,
      })
        .then((res) => {
@@ -634,7 +612,7 @@
          this.schedulingVisible = false;
          this.schedulingQuery = {
            week: "",
            userId: [],
            userIdList: [],
            shift: "",
          };
          this.refresh();
@@ -746,21 +724,18 @@
        time,
        userName: this.query.userName,
        laboratory: this.query.laboratory,
        isMonth: this.query.month ? true : false,
        isMonth: !!this.query.month,
      })
        .then((res) => {
          this.$message.success("下载成功");
          this.downLoading = false;
          const blob = new Blob([res], {
            type: "application/force-download",
          });
          let fileName = "";
          let fileName = "中天耐丝质量部";
          if (this.query.month) {
            fileName = year + "-" + this.query.month + " 班次信息";
            fileName += this.query.month + "月班次信息";
          } else {
            fileName = year + " 班次汇总";
            fileName += year + "年班次汇总";
          }
          this.$download.saveAs(blob, fileName + ".xlsx");
          transformExcel(res, fileName + ".xlsx");
          this.$message.success("导出成功");
        })
        .catch((err) => {
          this.downLoading = false;
@@ -772,18 +747,6 @@
      });
    },
    obtainItemParameterList() {
      if (this.PROJECT == "检测中心") {
        this.laboratory = [
          {
            label: "通信产品实验室",
            value: "通信产品实验室",
          },
          {
            label: "电力产品实验室",
            value: "电力产品实验室",
          },
        ];
      } else {
        obtainItemParameterList().then((res) => {
          let data = [];
          res.data.forEach((a) => {
@@ -794,7 +757,6 @@
          });
          this.laboratory = data;
        });
      }
    },
    handleCommand(e, m) {
      if (e != m.shift) {
@@ -808,16 +770,9 @@
      }
    },
    getUsers() {
      selectUserCondition({ type: 1 }).then((res) => {
        let arr = res.data;
        this.personList = arr;
      selectUserListByPerformance().then((res) => {
        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);
src/views/system/user/index.vue
@@ -47,7 +47,7 @@
            </div>
          </div>
          <el-col>
            <el-table v-loading="loading" :data="userList" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
            <el-table row-id="userId" ref="dragTable" v-loading="loading" :data="userList" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
              <el-table-column label="序号" align="center" type="index" />
              <el-table-column label="姓名" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
              <el-table-column label="账号" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" />
@@ -75,6 +75,7 @@
              </el-table-column>
            </el-table>
            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
                        :page-sizes="[20,50,100,200,500]"
              :limit.sync="queryParams.pageSize" @pagination="getList" />
          </el-col>
        </pane>
@@ -299,7 +300,8 @@
  uploadFile,
  selectRoleList,
  selectCustomEnum,
  addDepartment
  addDepartment,
  updateUserSort
} from "@/api/system/user";
import {optionSelect} from '@/api/system/post'
import { getToken } from "@/utils/auth";
@@ -307,6 +309,7 @@
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
import Sortable from "sortablejs";
export default {
  nickName: "User",
@@ -378,7 +381,7 @@
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        pageSize: 20,
        nickName: undefined,
        phonenumber: undefined,
        status: undefined,
@@ -467,6 +470,7 @@
        fatherId: 10001,
        nickName: '',
      },
      sortTable: null,
    };
  },
  watch: {
@@ -482,7 +486,52 @@
      this.initPassword = response.msg;
    });
  },
  mounted(){
    // 挂载后初始化拖拽
    this.initDrag()
  },
  methods: {
    //表格行拖拽排序
    initDrag() {
      // 获取 el-table 的 tbody 元素(拖拽的目标容器)
      const tbody = this.$refs.dragTable.$el.querySelector(
        '.el-table__body-wrapper tbody'
      )
      // 初始化 Sortable
      this.sortable = Sortable.create(tbody, {
        animation: 150, // 拖拽动画过渡时长
        ghostClass: 'sortable-ghost', // 拖拽占位符样式
        chosenClass: 'sortable-chosen', // 选中行样式
        dragClass: 'sortable-drag', // 拖拽元素样式
        // 拖拽结束触发(核心逻辑)
        onEnd: ({ oldIndex, newIndex }) => {
          // oldIndex:原索引,newIndex:新索引
          const defNum = (this.queryParams.pageNum-1)*this.queryParams.pageSize
          // const row = this.userList[oldIndex]
          // let sort = newIndex+defNum;//排序下标
          const row = this.userList.splice(oldIndex, 1)[0]
          this.userList.splice(newIndex, 0, row)
          const data = this.userList.map(item=>{return {userId:item.userId,userName:item.userName}})
          console.log(data)
          console.log(this.userList)
          // 调用接口更新排序
          // let data = {
          //   userId:row.userId,
          //   sort: sort
          // }
          // updateUserSort(data).then(res=>{
          //   if(res.code===200){
          //     this.$message.success("更新成功")
          //     this.$nextTick(()=>{
          //       this.getList()
          //     })
          //   }
          // })
        },
      })
    },
    /** 查询用户列表 */
    getList() {
      this.loading = true;
@@ -909,6 +958,14 @@
</script>
<style scoped lang="scss">
:deep(.sortable-ghost) {
  opacity: 0.8;
  background: #f0f9eb;
}
:deep(.sortable-chosen) {
  cursor: move;
  background: #e1f3d8;
}
.search_form {
  display: flex;
  justify-content: space-between;