| | |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // 绩效管理-人员考勤-导出考勤记录 |
| | | export function exportStaffAttendanceRecords(query) { |
| | | return request({ |
| | | url: "/staff/attendance/exportStaffAttendanceRecords", |
| | | method: "get", |
| | | params: query, |
| | | responseType:'blob' |
| | | }); |
| | | } |
| | |
| | | url: "/performanceShift/export", |
| | | method: "get", |
| | | params: query, |
| | | responseType:'blob' |
| | | }); |
| | | } |
| | | |
| | |
| | | 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 |
| | | }); |
| | | } |
| | |
| | | } |
| | | 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 → 未超过 |
| | | } |
| | | } |
| | |
| | | <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"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | // 存储 Promise 的 resolve/reject,用于弹框确认/取消时调用 |
| | | dialogResolve: null, |
| | | dialogReject: null, |
| | | dialogVisible: false, |
| | | deviceDbTableName: '', |
| | | outerColorList:[], |
| | | insulationColorList:[], |
| | | letteringInfoList: [], |
| | |
| | | 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") { |
| | |
| | | sampleCode: this.currentSample.sampleCode, |
| | | id: this.currentSample.id, |
| | | itemIds: itemIds, |
| | | dbTable: this.deviceDbTableName, |
| | | }; |
| | | this.dataAcquisitionLoading = true; |
| | | dataCollection(params).then((res) => { |
| | |
| | | }).catch(err => { |
| | | this.dataAcquisitionLoading = false; |
| | | }); |
| | | }catch (error){ |
| | | console.error('数据采集设备列表处理失败',error) |
| | | } |
| | | }, |
| | | objectOrder(obj) { |
| | | let newkey = Object.keys(obj).sort(); |
| | |
| | | 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 |
| | |
| | | this.multipleSelection = val |
| | | }, |
| | | changeRowClass({ row, rowIndex }) { |
| | | console.log(row,row.isFirst==1) |
| | | if (row.isFirst == 1) { |
| | | return 'highlight-danger-row-border' |
| | | } |
| | |
| | | <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"> |
| | |
| | | targetStyles: ["*"], // 使用dom的所有样式,很重要 |
| | | printable: 'printOrder',//页面 |
| | | type: "html",//文档类型 |
| | | maxWidth:360, |
| | | maxWidth:440, |
| | | header: '', |
| | | style: |
| | | `@page { |
| | |
| | | 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; |
| | | }`, |
| | |
| | | </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> |
| | |
| | | </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"> |
| | |
| | | </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"> |
| | |
| | | </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;"> |
| | |
| | | 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"> |
| | |
| | | </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> |
| | |
| | | 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 |
| | |
| | | contract:null, |
| | | updateBatchNo: null, |
| | | partDesc: null, |
| | | partNo: null, |
| | | supplierName: null, |
| | | custom: null, |
| | | company: null, |
| | |
| | | <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 |
| | |
| | | <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"> |
| | |
| | | <script> |
| | | import PrintJS from "print-js"; |
| | | import {labelOrderPrinting} from "@/api/business/productOrder"; |
| | | import {stringToBase64} from '@/utils/base64Util' |
| | | |
| | | export default { |
| | | name: "printDialog", |
| | |
| | | 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 |
| | |
| | | targetStyles: ["*"], // 使用dom的所有样式,很重要 |
| | | printable: 'printOrder',//页面 |
| | | type: "html",//文档类型 |
| | | maxWidth: 360, |
| | | maxWidth: 440, |
| | | header: '', |
| | | style: |
| | | `@page { |
| | |
| | | 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; |
| | | }`, |
| | |
| | | //进出门类型列表 |
| | | enterOrExitList:[ |
| | | { |
| | | effect:'', |
| | | effect:'light', |
| | | type:'success', |
| | | label:'进门', |
| | | value:1 |
| | | }, |
| | | { |
| | | effect:'', |
| | | effect:'light', |
| | | type:'', |
| | | label:'出门', |
| | | value:2 |
| | | }, |
| | | { |
| | | effect:'', |
| | | effect:'light', |
| | | type:'info', |
| | | label:'进/出门', |
| | | value:3 |
| | |
| | | </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"> |
| | |
| | | <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> |
| | | |
| | |
| | | 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: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | reportDateRange:[], |
| | | reportType:"MONTH", |
| | | attendanceRecordVisible:false, |
| | | syncDateRange:[], |
| | | syncAttendanceVisible: false, |
| | | exportLoading: false, |
| | | attendanceForm:{ |
| | | workDataId: null, |
| | | offWorkDataId: null, |
| | |
| | | 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) { |
| | |
| | | 人员名称 |
| | | <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> |
| | |
| | | "> |
| | | {{ 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=" |
| | |
| | | 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> |
| | |
| | | </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)" |
| | |
| | | 人员名称 |
| | | <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> |
| | |
| | | "> |
| | | {{ 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> |
| | |
| | | <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> |
| | |
| | | <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" |
| | |
| | | :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> |
| | |
| | | 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() { |
| | |
| | | loading: false, |
| | | schedulingQuery: { |
| | | week: "", |
| | | userId: [], |
| | | userIdList: [], |
| | | shift: "", |
| | | }, |
| | | list: [], |
| | |
| | | }, |
| | | 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: { |
| | |
| | | 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) { |
| | |
| | | this.yearList = res.data |
| | | }); |
| | | }, |
| | | onMouseEnter(index) { |
| | | this.currentUserIndex = index; |
| | | }, |
| | | confirmScheduling() { |
| | | if (!this.schedulingQuery.week) { |
| | | this.$message.error("请选择周次"); |
| | |
| | | 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; |
| | |
| | | add({ |
| | | startWeek, |
| | | endWeek, |
| | | userId: this.schedulingQuery.userId.join(","), |
| | | userIdList: this.schedulingQuery.userIdList, |
| | | shift: this.schedulingQuery.shift, |
| | | }) |
| | | .then((res) => { |
| | |
| | | this.schedulingVisible = false; |
| | | this.schedulingQuery = { |
| | | week: "", |
| | | userId: [], |
| | | userIdList: [], |
| | | shift: "", |
| | | }; |
| | | this.refresh(); |
| | |
| | | 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; |
| | |
| | | }); |
| | | }, |
| | | obtainItemParameterList() { |
| | | if (this.PROJECT == "检测中心") { |
| | | this.laboratory = [ |
| | | { |
| | | label: "通信产品实验室", |
| | | value: "通信产品实验室", |
| | | }, |
| | | { |
| | | label: "电力产品实验室", |
| | | value: "电力产品实验室", |
| | | }, |
| | | ]; |
| | | } else { |
| | | obtainItemParameterList().then((res) => { |
| | | let data = []; |
| | | res.data.forEach((a) => { |
| | |
| | | }); |
| | | this.laboratory = data; |
| | | }); |
| | | } |
| | | }, |
| | | handleCommand(e, m) { |
| | | if (e != m.shift) { |
| | |
| | | } |
| | | }, |
| | | 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); |
| | |
| | | </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" /> |
| | |
| | | </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> |
| | |
| | | uploadFile, |
| | | selectRoleList, |
| | | selectCustomEnum, |
| | | addDepartment |
| | | addDepartment, |
| | | updateUserSort |
| | | } from "@/api/system/user"; |
| | | import {optionSelect} from '@/api/system/post' |
| | | import { getToken } from "@/utils/auth"; |
| | |
| | | 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", |
| | |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | pageSize: 20, |
| | | nickName: undefined, |
| | | phonenumber: undefined, |
| | | status: undefined, |
| | |
| | | fatherId: 10001, |
| | | nickName: '', |
| | | }, |
| | | sortTable: null, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | 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; |
| | |
| | | </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; |