123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896 |
- <template>
- <a-card :bordered="false" style="background-color:transparent">
- <!-- table区域-begin -->
- <div class="ant-alert ant-alert-info" style="margin-bottom: 10px;margin-top: -40px;">
- <!--<i class="anticon anticon-info-circle ant-alert-icon"></i>
- 已选择 <a style="font-weight: 600">{{selectedRowKeys.length }}</a>项
- <a style="margin-left: 24px" @click="onClearSelected">清空</a> -->
-
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- 姓名: <span style="margin-right: 40px"> {{userName }}</span>
-
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- 部门: <span style="margin-right: 40px">{{deptName}}</span>
-
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- 员工类型: <span style="margin-right: 40px">{{userType}}</span>
-
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- 月份:
- <!-- <a style="font-weight: 600;margin-right: 6px" @click="onClearSelected"> < </a> -->
- <a-month-picker :allowClear="false" format="YYYY-MM" placeholder="请输入考勤月份" v-model="headMonth" @change="onDateChange"/>
- <!-- <a style="font-weight: 600;margin-left: 6px" @click="onClearSelected"> > </a> -->
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- <a style="margin-left: 20px" @click="errorInfoShow()">异常打卡</a>
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- <a style="margin-left: 20px" @click="jiaBanInfoShow()">加班打卡</a>
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- <a-dropdown style="margin-left: 20px" v-has="'viewClockUserInfo:more'">
- <a class="ant-dropdown-link">
- 更多操作 <a-icon type="down"/>
- </a>
- <!-- 123-->
- <a-menu slot="overlay">
- <a-menu-item v-has="'viewClockUserInfo:fuxin'">
- <!-- <a-popconfirm title="确定对所选记录付薪吗?" @confirm="() => handleInfo('1')"> -->
- <a @click="showModal3('top','1',null)">付薪</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
- <!-- <a-popconfirm title="确定对所选记录累计调休吗?" @confirm="() => handleInfo('2')"> -->
- <a @click="showModal3('top','2',null)">累计调休</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:hulue'">
- <a-popconfirm title="确定对所选记录忽略吗?" @confirm="() => handleInfo('3')">
- <a>忽略</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- </a-dropdown>
- <a style="margin-left: 20px" @click="handleExportXlsBegin('员工考勤信息')">导出</a>
- <a style="margin-left: 20px" @click="showModal4()">导出加班</a>
- <i class="anticon anticon-info-circle ant-alert-icon"></i>
- </div>
- <a-table
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
- ref="table"
- size="middle"
- bordered
- rowKey="viewDate"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- @change="handleTableChange">
- <span slot="ShiftTime" slot-scope="text, record, index">
- {{record.shiftRealTimeS}} - {{record.shiftRealTimeX}}
- <span v-if="record.shiftRealTime2S != null "><br/>{{record.shiftRealTime2S}} - {{record.shiftRealTime2X}}</span>
- </span>
- <span slot="customTime" slot-scope="text, record, index">
- <span v-if="text != null ">{{text.slice(10)}}</span>
- </span>
-
- <span slot="customDuration" slot-scope="text, record, index">
- <!-- <a-tag @click="workInfo(record)" color="pink" v-if="record.workOvertime != null && record.workOvertime > 0 ">
- {{text}}
- </a-tag>
- <a @click="workInfo(record)" v-else>{{text}}</a> -->
- <span v-if="record.setInfo > 0 ">
- <a-tag :title="record.multipleInfo" @click="workInfo(record)" color="pink" >{{text}}</a-tag>
- </span>
- <span v-if="record.setInfo == 0 ">
- <a-tag :title="record.multipleInfo" @click="workInfo(record)" color="#87d068" >{{text}}</a-tag>
- </span>
- </span>
-
- <a-badge slot="shiftType" slot-scope="text, record, index">
- <!-- ruleType 上班类型 1.固定时间上下班,2.按班次上下班,3.自由上下班 -->
-
- <a-tag color="pink" v-if="record.showState == '1'">
- 异常
- </a-tag>
- <a-tag color="#87d068" v-if="record.showState == '2'">
- 正常
- </a-tag>
- <a-icon v-if="record.showState == '2'" title="该员工在未排班或休息班打卡" slot="count" type="exclamation-circle" style="color: #f52b02" />
-
- <a-tag color="#87d068" v-if="record.showState == '0'">
- 正常
- </a-tag>
- </a-badge>
-
- <span slot="action" slot-scope="text, record">
- <!-- <a v-has="'viewClockUserInfo:jiaozhun'" @click="handleEdit(record)">校准</a> -->
- <a v-has="'viewClockUserInfo:jiaozhun'" @click="showModal(record)">校准</a>
- <!-- <a-popconfirm v-has="'viewClockUserInfo:jiaozhun'" title="确定忽略此异常吗?" @confirm="() => errorInfo(record)">
- <a>校准</a>
- </a-popconfirm>-->
-
- <a-divider type="vertical"/>
- <a-dropdown v-has="'viewClockUserInfo:more'">
-
- <a class="ant-dropdown-link">
- 更多 <a-icon type="down"/>
- </a>
- <a-menu slot="overlay">
- <a-menu-item v-has="'viewClockUserInfo:fuxin'">
- <!-- <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('2','1',record)"> -->
- <a @click="showModal3('right','1',record)">付薪</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
- <!-- <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('2','2',record)"> -->
- <a @click="showModal3('right','2',record)">累计调休</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:hulue'">
- <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('2','3',record)">
- <a>忽略</a>
- </a-popconfirm>
- </a-menu-item>
-
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- <!-- table区域-end -->
- <a-spin size="large" v-if="spinning == true" style="z-index:999;position:absolute;top:180px;left:50%;" tip="Loading..."></a-spin>
- <!-- 表单区域 -->
- <Jiao-Zhun-Modal ref="modalForm" @ok="modalFormOk"></Jiao-Zhun-Modal>
- <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
- <dept-role-user-modal ref="deptRoleUser"></dept-role-user-modal>
- <a-modal width="1200px"
- v-model="modal2Visible" title="加班信息详情" :footer="null"
- centered @ok="() => (modal2Visible = false)" >
- <a-table :columns="columns2" :data-source="data" rowKey="id">
-
- <span slot="action" slot-scope="text, record">
-
- <a-dropdown v-has="'viewClockUserInfo:more'">
-
- <a class="ant-dropdown-link">
- 更多 <a-icon type="down"/>
- </a>
- <a-menu slot="overlay">
- <a-menu-item v-has="'viewClockUserInfo:fuxin'">
- <!-- <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('1','1',record)"> -->
- <a @click="showModal3('in','1',record)">付薪</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
- <!-- <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('1','2',record)"> -->
- <a @click="showModal3('in','2',record)">累计调休</a>
- <!-- </a-popconfirm> -->
- </a-menu-item>
- <a-menu-item v-has="'viewClockUserInfo:hulue'">
- <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('1','3',record)">
- <a>忽略</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- </a-modal>
-
- <a-modal
- title="校准忽略本次异常"
- :visible="visible"
- :confirm-loading="confirmLoading"
- @ok="handleOk"
- @cancel="handleCancel"
- >
- <a-input placeholder="请填写忽略原因" v-model="errorText"></a-input>
- </a-modal>
-
- <a-modal style="z-index:auto"
- title="请选择倍数"
- :visible="visibleShowModal3"
- :confirm-loading="confirmLoading"
- @ok="handleOk3"
- @cancel="handleCancel3"
- >
- <j-dict-select-tag style="width:100%;" v-model="multiple" placeholder="请选择倍数"
- dictCode="multiple" />
- </a-modal>
-
- <a-modal style="z-index:999"
- title="请选择导出条件"
- :visible="visibleShowModal4"
- :confirm-loading="confirmLoading"
- @ok="handleOk4"
- @cancel="handleCancel4"
- >
- 姓名:
- <a-input placeholder="请输入姓名" v-model="par_name" style="width:100%;margin-bottom: 10px;" />
- 工号:
- <a-input placeholder="请输入工号" v-model="par_code" style="width:100%;margin-bottom: 10px;" />
- 部门:
- <j-tree-select style="width:100%;margin-bottom: 10px;" v-model="par_departIds" dict="sys_depart,depart_name,id"
- pid-field="parent_id" placeholder="请选择部门">
- </j-tree-select>
- 加班事由:
- <j-dict-select-tag style="width:100%;margin-bottom: 10px;" v-model="par_works_type" placeholder="请选择加班类型"
- dictCode="works_type" />
- 时间:
- <a-range-picker
- style="width:100%;margin-bottom: 10px;"
- format="YYYY-MM-DD"
- :placeholder="['开始时间', '结束时间']"
- @change="onDateChange2"
- @ok="onDateOk2"
- />
- 支付类型:
- <j-dict-select-tag style="width:100%;margin-bottom: 10px;" v-model="par_pay_type" placeholder="请选择支付类型"
- dictCode="pay_type" />
- 支付倍数:
- <j-dict-select-tag style="width:100%;margin-bottom: 10px;" v-model="par_multiple" placeholder="请选择倍数"
- dictCode="multiple" />
- </a-modal>
-
- </a-card>
-
- </template>
- <script>
- import {JeecgListMixin} from '@/mixins/JeecgListMixin'
- import {getAction, postAction, deleteAction,putAction} from '@/api/manage'
- import SelectUserModal from '../modules/SelectUserModal'
- import JiaoZhunModal from './JiaoZhunModal'
- import DeptRoleUserModal from '../modules/DeptRoleUserModal'
- import moment from 'moment';
- import 'moment/locale/zh-cn';
- import {
- fuXinInfo
- } from '@/api/api'
-
- export default {
- name: "DeptUserInfo",
- mixins: [JeecgListMixin],
- components: {
- DeptRoleUserModal,
- SelectUserModal,
- JiaoZhunModal
- },
- data() {
- return {
- spinning:false,
- par_name:'',//导出加班 姓名
- par_code:'',//导出加班 工号
- par_departIds:'',//导出加班 部门
- par_works_type:'',//导出加班 加班事由
- par_pay_type:'',//导出加班 支付类型
- par_multiple:'',//导出加班 支付倍数
- par_begin:'',//导出加班 开始时间
- par_end:'',//导出加班 结束时间
- errorViewDate:'',
- errorSt:'',
- errorUserId:'',
- errorText: '',//校准弹框属性
- visible: false,//校准弹框属性
- confirmLoading: false,//校准弹框属性
- durationCommitDate:'',//加班申请时间
- durationBeginDate:'',//加班开始时间
- durationEndDate:'',//加班结束时间
- duration:'',//加班时长
- demo:'',//加班事由
- modal2Visible: false,//加班信息详情
- visibleShowModal3:false,//薪资倍数选择框
- visibleShowModal4:false,//加班导出弹框
- multiple:2,//薪资倍数选择框倍数
- area:'',//点击倍数弹框的区域 top/right/in
- recordPar:'',//弹框参数
- stPar:null,//1付薪,2调休
- moment,
- description: '员工考勤信息',
- userName:'',//标题员工姓名
- deptName:'',//标题员工部门
- userType:'',//标题员工类型
- headMonth:'',//标题选择月份
- newMonth:'',//更改时选择的月份
- currentDeptId: '',
- data : [],//加班信息弹框
- ipagination:{
- pageSize: 31,
- },
- columns2:[{
- title: '加班申请时间',
- align: "center",
- dataIndex: 'commitDate'
- },{
- title: '加班开始时间',
- align: "center",
- dataIndex: 'beginDate'
- },{
- title: '加班结束时间',
- align: "center",
- dataIndex: 'endDate'
- },{
- title: '加班时长',
- align: "center",
- dataIndex: 'duration'
- },{
- title: '加班事由',
- align: "center",
- dataIndex: 'demo'
- },{
- title: '处理方式',
- align: "center",
- dataIndex: 'setInfo'
- },{
- title: '倍数',
- align: "center",
- dataIndex: 'multiple'
- },
- {
- title: '操作',
- dataIndex: 'action',
- scopedSlots: {customRender: 'action'},
- align: "center",
- width: 120
- }],
- // 表头
- columns: [{
- title: '日期',
- align: "center",
- dataIndex: 'viewDate', fixed: 'left', width: 100
- },
- {
- title: '星期',
- align: "center",
- dataIndex: 'weekDate'
- },
- {
- title: '班次',
- align: "center",
- dataIndex: 'name'
- },
- {
- title: '班次时间',
- align: "center",
- scopedSlots: {
- customRender: 'ShiftTime'
- }
- },
- {
- title: '状态',
- align: "center",
- scopedSlots: {customRender: 'shiftType'},
- },
- {
- title: '最早',
- align: "center",
- dataIndex: 'gotoTime',
- scopedSlots: {
- customRender: 'customTime'
- }
- },
- {
- title: '最晚',
- align: "center",
- dataIndex: 'closingTime',
- scopedSlots: {
- customRender: 'customTime'
- }
- },
- // {
- // title: '上班1',
- // align: "center",
- // dataIndex: 'oneTime',
- // scopedSlots: {
- // customRender: 'customTime'
- // }
- // },
- // {
- // title: '下班1',
- // align: "center",
- // dataIndex: 'twoTime',
- // scopedSlots: {
- // customRender: 'customTime'
- // }
- // },{
- // title: '上班2',
- // align: "center",
- // dataIndex: 'threeTime',
- // scopedSlots: {
- // customRender: 'customTime'
- // }
- // },
- // {
- // title: '下班2',
- // align: "center",
- // dataIndex: 'fourTime',
- // scopedSlots: {
- // customRender: 'customTime'
- // }
- // },
- {
- title: '打卡次数',
- align: "center",
- dataIndex: 'attendanceCount'
- },
-
- {
- title: '加班时间',
- align: "center",
- dataIndex: 'duration',
- width: 100,
- scopedSlots: {
- customRender: 'customDuration'
- }
- },{
- title: '请假',
- align: "center",
- dataIndex: 'holidayType'
- },
- {
- title: '校准人',
- align: "center",
- dataIndex: 'jzBy'
- },
- {
- title: '操作',
- dataIndex: 'action',fixed: 'right', width: 100,
- scopedSlots: {customRender: 'action'},
- align: "center",
- width: 120
- }],
- url: {
- exportXlsUrl: '/viewClockIn/viewClockIn/exportXls',
- handleInfo: '/viewClockIn/viewClockIn/handleInfo',
- errorInfo: '/viewClockIn/viewClockIn/errorInfo',
- getJiaBan: '/workOvertime/workOvertime/getJiaBan',
- list: '/viewClockIn/viewClockIn/list',
- // list: "/sys/user/departUserList",
- edit: "/sys/user/editSysDepartWithUser",
- delete: "/sys/user/deleteUserInDepart",
- deleteBatch: "/sys/user/deleteUserInDepartBatch",
- }
- }
- },
- created() {
- let yy = new Date().getFullYear();
- let mm = new Date().getMonth()+1;
- // let dd = new Date().getDate();
- this.headMonth = yy+"-"+mm;
- },
- methods: {
- handleExportXlsBegin(name){
- if(this.userName == '' || this.userName == null){
- this.$message.warning("请选择要导出的人员姓名");
- return;
- }
- if(this.headMonth == '' && this.newMonth == null){
- this.$message.warning("请选择要导出的月份");
- return;
- }
- this.queryParam.userType=this.userType;
- this.queryParam.excelType = "0";
- this.handleExportXls(name);
- },
- handleInfo(st){
- if(this.selectedRowKeys.length < 1){
- this.$message.warning("您没有选择任何数据");
- return;
- }
- let that = this;
- //st:1付薪 2累计调休 3忽略
- let ids = "";
- let username = "";
- let dataSource = this.dataSource;
- // console.log("-===="+this.dataSource);
- let userIds = "";
- this.selectUserRows = [];
- for (let i = 0, len = dataSource.length; i < len; i++) {
- if (this.selectedRowKeys.includes(dataSource[i].viewDate)) {
-
- if(dataSource[i].duration == null || dataSource[i].duration == ''){
- this.$message.warning(dataSource[i].viewDate+"该员工当日没有加班申请信息,请勿此操作");
- return;
- }
- username = dataSource[i].username;
- ids += dataSource[i].viewDate + ",";
- }
- }
- putAction(this.url.handleInfo, {multiple:this.multiple,viewDate:ids,st:st,username:username}).then((res) => {
- if (res.success) {
- that.$message.success("操作成功");
- that.loadData();
- } else {
- that.$message.warning(res.message);
- that.loadData();
- }
- }).finally(() => {
- that.multiple = 2;
- that.selectedRowKeys = [];
- })
- },
- onDateChange2: function (value, dateString) {
- // console.log(dateString[0],dateString[1]);
- this.par_begin=dateString[0];
- this.par_end=dateString[1];
- },
- onDateOk2(value) {
- // console.log(value);
- },
- errorInfoShow(){
- this.queryParam.showState=1;
- this.loadData(1);
- // this.queryParam.showState=null;
-
- },
- jiaBanInfoShow(){
- this.queryParam.duration=1;
- this.loadData(1);
- // this.queryParam.duration=null;
- },
- showModal(record) {
- this.errorViewDate = record.viewDate;
- this.errorUserId = record.userId;
- this.errorSt = record.errorState;
- this.errorText = record.errorText;
- this.visible = true;
- },
- showModal3(area,st,record) {//薪资倍数选择框
- if(area == 'top' && this.selectedRowKeys.length < 1){
- this.$message.warning("请选择一条含有加班信息的数据");
- return;
- }
- this.stPar = st;
- this.area = area;
- this.recordPar = record;
- this.visibleShowModal3 = true;
- },
- showModal4() {//加班导出选择框
- this.visibleShowModal4 = true;
- },
- handleOk(e) {
- if(this.errorSt == 0){
- this.$message.warning("已校准过,无需再次校准");
- return;
- }
- if(this.errorText == null || this.errorText == ''){
- this.$message.warning("请填写忽略原因");
- return;
- }
- let that = this;
- this.confirmLoading = true;
- putAction(this.url.errorInfo, {viewDate:this.errorViewDate,userId:this.errorUserId,errorText:this.errorText}).then((res) => {
- if (res.success) {
- that.$message.success("操作成功");
- that.loadData();
- } else {
- that.$message.warning(res.message);
- that.loadData();
- }
- }).finally(() => {
- this.confirmLoading = false;
- this.visible = false;
- })
- },
- handleOk3(e) {
- if(this.multiple == '' || this.multiple == null){
- this.$message.warning("请选择倍数");
- return;
- }
- this.modal2Visible = false;
- this.visibleShowModal3 = false;
- if(this.area == 'top'){
- this.handleInfo(this.stPar);
- }
- if(this.area == 'right'){
- this.fuXinInfo('2',this.stPar,this.recordPar);
- }
- if(this.area == 'in'){
- this.fuXinInfo('1',this.stPar,this.recordPar);
-
- }
- },
- handleOk4(e) {
- this.queryParam.par_name = this.par_name;//导出加班 姓名
- this.queryParam.par_code = this.par_code;//导出加班 工号
- this.queryParam.par_departIds = this.par_departIds;//导出加班 部门
- this.queryParam.par_works_type = this.par_works_type;//导出加班 加班事由
- this.queryParam.par_pay_type = this.par_pay_type;//导出加班 支付类型
- this.queryParam.par_multiple = this.par_multiple;//导出加班 支付倍数
- this.queryParam.par_begin = this.par_begin;//导出加班 开始时间
- this.queryParam.par_end = this.par_end;//导出加班 结束时间
-
- this.queryParam.excelType = "1";
- this.handleExportXls('员工加班信息');
- this.visibleShowModal4 = false;
- },
- handleCancel3(e) {
- this.multiple = 2;
- this.visibleShowModal3 = false;
-
- },
- handleCancel4(e) {
- this.visibleShowModal4 = false;
-
- },
- handleCancel(e) {
- console.log('Clicked cancel button');
- this.visible = false;
- },
- onDateChange: function (value, dateString) {
- this.newMonth = dateString;
- this.$emit('clearSelectedDepartKeys');
- // this.userName = e.node.dataRef.title;
- this.queryParam.mDate=dateString;
- this.loadData(1);
- // console.log(value+"------------"+dateString);
-
- },
- searchReset() {
- this.queryParam = {}
- this.loadData(1);
- },
- loadData(arg) {
- if (!this.url.list) {
- this.$message.error("请设置url.list属性!")
- return
- }
-
- if (!this.userName) {
- return
- }
- this.spinning = true;
- //加载数据 若传入参数1则加载第一页的内容
- if (arg === 1) {
- this.ipagination.current = 1;
- }
- //if (this.currentDeptId === '') return;
- let params = this.getQueryParams();//查询条件
- let that = this;
- params.depId = this.currentDeptId;
- // params = {'endViewDate':'userName'}
- // console.log("============="+params.userName);
- getAction(this.url.list, params).then((res) => {
- if (res.success && res.result) {
- this.dataSource = res.result.records;
- this.ipagination.total = res.result.total;
- }
- that.spinning = false;
- })
- },
- batchDel: function () {
- if (!this.url.deleteBatch) {
- this.$message.error("请设置url.deleteBatch属性!")
- return
- }
- if (!this.currentDeptId) {
- this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
- return
- }
- if (this.selectedRowKeys.length <= 0) {
- this.$message.warning('请选择一条记录!');
- return;
- } else {
- var ids = "";
- for (var a = 0; a < this.selectedRowKeys.length; a++) {
- ids += this.selectedRowKeys[a] + ",";
- }
- var that = this;
- console.log(this.currentDeptId);
- this.$confirm({
- title: "确认取消",
- content: "是否取消用户与选中部门的关联?",
- onOk: function () {
- deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => {
- if (res.success) {
- that.$message.success("删除用户与选中部门关系成功!");
- that.loadData();
- that.onClearSelected();
- } else {
- that.$message.warning(res.message);
- }
- });
- }
- });
- }
- },
- handleDelete: function (id) {
- if (!this.url.delete) {
- this.$message.error("请设置url.delete属性!")
- return
- }
- if (!this.currentDeptId) {
- this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
- return
- }
- var that = this;
- deleteAction(that.url.delete, {depId: this.currentDeptId, userId: id}).then((res) => {
- if (res.success) {
- that.$message.success("删除用户与选中部门关系成功!");
- if (this.selectedRowKeys.length>0){
- for(let i =0; i<this.selectedRowKeys.length;i++){
- if (this.selectedRowKeys[i] == id){
- this.selectedRowKeys.splice(i,1);
- break;
- }
- }
- }
- that.loadData();
- } else {
- that.$message.warning(res.message);
- }
- });
- },
- open(selectedKeys, e) {
-
- if(e.node.dataRef.orgType == 1 || e.node.dataRef.orgType == 2 || e.node.dataRef.orgType == 3){
- // this.$message.warn("点击左侧加减号,展开或者收起菜单!")
- return;
- }
- this.queryParam = {}
- let arr = e.node.dataRef.title.split('(');//姓名
- let arr2 = e.node.$parent.title.split('(');//上级部门
- this.userName = arr[0];//e.node.dataRef.title;
- this.deptName = arr2[0];//e.node.$parent.title;
- this.userType = e.node.dataRef.orgType;//员工类型
- this.queryParam.userName= arr[0];//e.node.dataRef.title;
- this.queryParam.mDate=moment(this.headMonth).format('YYYY-MM');
- this.loadData(1);
- },
- clearList() {
- this.currentDeptId = '';
- this.dataSource = [];
- },
- hasSelectDept() {
- if (this.currentDeptId == '') {
- this.$message.error("请选择一个部门!")
- return false;
- }
- return true;
- },
- handleAddUserDepart() {
- if (this.currentDeptId == '' ) {
- this.$message.error("请选择一个部门!")
- } else {
- this.$refs.selectUserModal.visible = true;
- }
- },
- handleEdit: function (record) {
- this.$refs.modalForm.title = "校准";
- this.$refs.modalForm.departDisabled = true;
- this.$refs.modalForm.disableSubmit = false;
- this.$refs.modalForm.startDate = record.gotoTime;
- this.$refs.modalForm.endDate = record.closingTime;
- if(record.gotoTime == null || record.gotoTime == ''){
- this.$refs.modalForm.startDate = record.viewDate;
- }
- if(record.closingTime == null || record.closingTime == ''){
- this.$refs.modalForm.endDate = record.viewDate;
- }
- this.$refs.modalForm.startDateYs = record.gotoTime;
- this.$refs.modalForm.endDateYs = record.closingTime;
- this.$refs.modalForm.jzTime = record.jzTime;
- this.$refs.modalForm.jzBy = record.jzBy;
-
- this.$refs.modalForm.viewDate = record.viewDate;
- this.$refs.modalForm.username = record.userId;
- this.$refs.modalForm.setInfo = record.setInfo;
- this.$refs.modalForm.add(record);
- },
- handleAdd: function () {
- if (this.currentDeptId == '') {
- this.$message.error("请选择一个部门!")
- } else {
- this.$refs.modalForm.departDisabled = true;
- this.$refs.modalForm.userDepartModel.departIdList = [this.currentDeptId]; //传入一个部门id
- this.$refs.modalForm.add();
- this.$refs.modalForm.title = "新增";
- }
- },
- selectOK(data) {
- let params = {};
- params.depId = this.currentDeptId;
- params.userIdList = [];
- for (var a = 0; a < data.length; a++) {
- params.userIdList.push(data[a]);
- }
-
- postAction(this.url.edit, params).then((res) => {
- if (res.success) {
- this.$message.success(res.message);
- this.loadData();
- } else {
- this.$message.warning(res.message);
- }
- })
- },
- errorInfo(record){//校准
- if(record.errorState == 0){
- this.$message.warning("已校准过,无需再次校准");
- return;
- }
- let that = this;
- putAction(this.url.errorInfo, {viewDate:record.viewDate,userId:record.userId}).then((res) => {
- if (res.success) {
- that.$message.success("操作成功");
- that.loadData();
- } else {
- that.$message.warning(res.message);
- that.loadData();
- }
- }).finally(() => {
-
- })
-
- },
- fuXinInfo(w,st,record){//薪资操作
-
- // w 1:弹框中方法,2列表中方法
- // st 1付薪,2累计调休,3忽略
- // if(record.setInfo != '' && record.setInfo != null){
- // this.$message.warning("已设置过,不能再次设置");
- // return;
- // }
- if(record.duration == '' || record.duration == null){
- this.$message.warning("该员工当日没有加班申请信息");
- return;
- }
- let userId = null;
- if(record.userId == '' || record.userId == null){
- userId = record.person;
- }else{
- userId = record.userId;
- }
- let that = this;
- fuXinInfo({multiple:this.multiple,viewDate:record.viewDate,viewDate1:record.beginDate,userId:userId,pkId:record.id,st:st,w:w}).then((res) => {
- if (res.success) {
- that.multiple = 2;
- that.$message.success("已成功设置");
- that.loadData();
- } else {
- that.multiple = 2;
- that.$message.warning(res.message);
- that.loadData();
- }
- });
- that.modal2Visible = false;
- },
- workInfo(record){//点击加班时间事件
-
- let that = this;
-
- putAction(this.url.getJiaBan, {viewDate:record.viewDate,username:record.username}).then((res) => {
- that.data = res;
- }).finally(() => {
- that.modal2Visible = true;
- })
-
- }
- }
- }
- </script>
- <style scoped>
- /** Button按钮间距 */
- .ant-btn {
- margin-left: 3px
- }
- .ant-card {
- margin-left: -30px;
- margin-right: -30px;
- }
- .table-page-search-wrapper {
- margin-top: -16px;
- margin-bottom: 16px;
- }
- </style>
|