|
@@ -1,161 +1,163 @@
|
|
|
<template>
|
|
|
- <a-drawer :title="title" :maskClosable="true" :width="drawerWidth" placement="right" :closable="true"
|
|
|
- @close="handleCancel" :visible="visible" style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
|
|
-
|
|
|
- <template slot="title">
|
|
|
- <div style="width: 100%;">
|
|
|
- <span>{{ title }}</span>
|
|
|
- <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
|
|
|
- <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
-
|
|
|
- </template>
|
|
|
+ <j-modal title="排班" :width="1000" :visible="visible" @ok="save()" switchFullscreen @cancel="handleCancel">
|
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
<a-form :form="form">
|
|
|
-
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*规则名称">
|
|
|
- <a-input placeholder="请输入规则名称" v-model="name" />
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*上班类型">
|
|
|
- <a-radio-group v-model="type">
|
|
|
+ <a-radio-group v-model="types">
|
|
|
<a-radio value="1">固定时间上下班</a-radio>
|
|
|
<a-radio value="2">按班次上下班</a-radio>
|
|
|
<a-radio value="3">自由上下班</a-radio>
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
-
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*定制类型">
|
|
|
- <a-radio-group v-model="ruletype" >
|
|
|
- <a-radio value="1">人员</a-radio>
|
|
|
- <a-radio value="2">部门</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item v-if="ruletype=='1'" label="*打卡人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
- <a-input-search placeholder="点击选择参与打卡人员" v-model="selectedUserName" readOnly @search="onSearch2">
|
|
|
- <a-button slot="enterButton" icon="search">选择</a-button>
|
|
|
- </a-input-search>
|
|
|
- </a-form-item>
|
|
|
- <!--部门分配-->
|
|
|
- <a-form-item v-if="ruletype=='2'" label="*打卡部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
|
|
|
- <a-input-search placeholder="点击选择部门" v-model="checkedDepartNameString" readOnly @search="onSearch">
|
|
|
- <a-button slot="enterButton" icon="search">选择</a-button>
|
|
|
- </a-input-search>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*上班时间" v-if="type==1">
|
|
|
+
|
|
|
+ <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*上班时间" v-if="types==1">
|
|
|
<a-time-picker showTime format='HH:mm:ss' v-model="startDate" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*下班时间" v-if="type==1">
|
|
|
+
|
|
|
+ <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*下班时间" v-if="types==1">
|
|
|
<a-time-picker showTime format='HH:mm:ss' v-model="endDate" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*工作日" v-if="type!=2">
|
|
|
- <a-checkbox-group
|
|
|
- v-model="values"
|
|
|
- name="checkboxgroup"
|
|
|
- @change="onChangets"
|
|
|
- >
|
|
|
- <a-checkbox value="1">星期一</a-checkbox>
|
|
|
- <a-checkbox value="2">星期二</a-checkbox>
|
|
|
- <a-checkbox value="3">星期三</a-checkbox>
|
|
|
- <a-checkbox value="4">星期四</a-checkbox>
|
|
|
- <a-checkbox value="5">星期五</a-checkbox>
|
|
|
- </br>
|
|
|
- <a-checkbox value="6">星期六</a-checkbox>
|
|
|
- <a-checkbox value="0">星期日</a-checkbox>
|
|
|
- </a-checkbox-group>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item v-if="ruletype=='2'" label="白名单" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
- <a-input-search placeholder="点击选择不参与打卡人员" v-model="checkeUserName" readOnly @search="onSearch2">
|
|
|
- <a-button slot="enterButton" icon="search">选择</a-button>
|
|
|
- </a-input-search>
|
|
|
- </a-form-item>
|
|
|
</a-form>
|
|
|
+ <a-form-item v-if="types!=2" label="*打卡人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-tag v-for='(user,i) in selectUsers' :key="user.id" closable @close="tagBtnCloseFunc(user)">{{user.realname}}
|
|
|
+ </a-tag>
|
|
|
+
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <div v-if="types=='2'">
|
|
|
+ <div class='month'>
|
|
|
+ <ul>
|
|
|
+ <!--点击会触发pickpre函数,重新刷新当前日期 @click(vue v-on:click缩写) -->
|
|
|
+ <li class='arrow' @click='pickPre(currentYear,currentMonth)'>上个月</li>
|
|
|
+ <li class='year-month'>
|
|
|
+ <span class='choose-year'>{{ currentYear }}年</span>
|
|
|
+ <span class='choose-month'>{{ currentMonth }}月</span>
|
|
|
+ </li>
|
|
|
+ <li class='arrow' @click='pickNext(currentYear,currentMonth)'>下个月</li>
|
|
|
+ </ul>
|
|
|
+ <br>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a-table bordered :data-source="dataSource" :columns="columns" :scroll="{ x:300 }" :pagination="ipagination"
|
|
|
+ @change="handleTableChange">
|
|
|
+ <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
|
+ <div style="height: 35px;">
|
|
|
+ <div style="text-align: center;margin-top: -10px;">
|
|
|
+ <p>{{dayobject.day.getDate()}}</p>
|
|
|
+ <div style="margin-top: -10px;">
|
|
|
+ <p v-if='dayobject.day.getDay()==0'>日</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==1'>一</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==2'>二</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==3'>三</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==4'>四</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==5'>五</p>
|
|
|
+ <p v-else-if='dayobject.day.getDay()==6'>六</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ <span v-for='(d,i) in tpdata' style="margin-left: -11px;" :slot="d" slot-scope="text, record, index">
|
|
|
+ <a-dropdown :trigger="['click']">
|
|
|
+ <a-tag color="blue" v-if="text=='休息'" @click="UserType(d,record)">{{text}}</a-tag>
|
|
|
+ <a-tag color="#87d068" v-else-if="text!='休息'&&text!=''&&text!=null" @click="UserType(d,record)">{{text}}
|
|
|
+ </a-tag>
|
|
|
+ <a-tag color="#FFFFFF" v-else @click="UserType(d,record)" style="width: 40px;">.</a-tag>
|
|
|
+ <a-menu slot="overlay">
|
|
|
+ <a-menu-item key="0">
|
|
|
+ <a @click="shiftOks(0,d,record,index)">休息</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="isShow" v-for="(item,index) in shiftlist" :key="item.id">
|
|
|
+ <a @click="shiftOks(item,d,record,index)">{{item.name}} ({{item.startDate}} - {{item.endDate}})</a>
|
|
|
+ </a-menu-item>
|
|
|
+
|
|
|
+ </a-menu>
|
|
|
+ </a-dropdown>
|
|
|
+
|
|
|
+
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </a-calendar>
|
|
|
+ <a-modal v-model="visibles" title="班次" @ok="shiftOk()">
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline">
|
|
|
+ <a-row :gutter="24">
|
|
|
+
|
|
|
+ <a-col :xl="10" :lg="10" :md="8" :sm="24">
|
|
|
+ <a-form-item label="班次名称">
|
|
|
+ <a-select v-model="shiftname" placeholder="请选择班次">
|
|
|
+ <a-select-option value="">请选择</a-select-option>
|
|
|
+ <a-select-option value="a">休息</a-select-option>
|
|
|
+ <a-select-option v-for="(item,index) in shiftlist" :value="item.id">{{item.name}}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
</a-spin>
|
|
|
- <depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
|
|
|
- <user-shift-list-modal ref="userShiftListModal" @ok="modalFormOk2"></user-shift-list-modal>
|
|
|
- <div class="drawer-bootom-button" v-show="!disableSubmit">
|
|
|
- <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
|
|
|
- </a-popconfirm>
|
|
|
- <a-button @click="handleSubmits()" type="primary" :loading="confirmLoading">提交</a-button>
|
|
|
- </div>
|
|
|
- </a-drawer>
|
|
|
+ </j-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import pick from 'lodash.pick'
|
|
|
- import moment from 'moment'
|
|
|
- import Vue from 'vue'
|
|
|
- // 引入搜索部门弹出框的组件
|
|
|
- import departWindow from './DepartWindow'
|
|
|
- import userShiftListModal from './UserShiftListModal'
|
|
|
- import JSelectPosition from '@/components/jeecgbiz/JSelectPosition'
|
|
|
- import {
|
|
|
- ACCESS_TOKEN
|
|
|
- } from "@/store/mutation-types"
|
|
|
import {
|
|
|
+ httpAction,
|
|
|
+ getFileAccessHttpUrl,
|
|
|
getAction,
|
|
|
- httpAction
|
|
|
+ deleteAction
|
|
|
} from '@/api/manage'
|
|
|
+ import pick from 'lodash.pick'
|
|
|
+ import moment from "moment"
|
|
|
import {
|
|
|
- disabledAuthFilter
|
|
|
- } from "@/utils/authFilter"
|
|
|
- import {
|
|
|
- duplicateCheck
|
|
|
- } from '@/api/api'
|
|
|
- import JImageUpload from '../../../components/jeecg/JImageUpload'
|
|
|
+ JeecgListMixin
|
|
|
+ } from '@/mixins/JeecgListMixin'
|
|
|
+ import '@/assets/less/TableExpand.less'
|
|
|
|
|
|
export default {
|
|
|
- name: "AttendanceRuleModal",
|
|
|
- components: {
|
|
|
- departWindow,
|
|
|
- userShiftListModal
|
|
|
- },
|
|
|
+ name: "UserShiftModal",
|
|
|
+ mixins: [JeecgListMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- values:[],
|
|
|
- ruletype:"1",
|
|
|
- work:"2",
|
|
|
- workday:"",
|
|
|
- type: "1",
|
|
|
- id: null,
|
|
|
- name: "",
|
|
|
+ tts: false,
|
|
|
+ tpdata: [],
|
|
|
+ dataSource: [],
|
|
|
+ columns: [],
|
|
|
+ queryParam: {
|
|
|
+ shiftDate: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ type: "1"
|
|
|
+ },
|
|
|
+ types: "1",
|
|
|
+ currentMonth: new Date().getMonth(),
|
|
|
+ currentYear: new Date().getYear(),
|
|
|
+ days: [],
|
|
|
+ selectUsers: [],
|
|
|
+ checkUserIds:"",
|
|
|
+ visibles: false,
|
|
|
+ shiftDate: null,
|
|
|
startDate: "",
|
|
|
endDate: "",
|
|
|
- deptids: "",
|
|
|
- checkeUserids: [],
|
|
|
- checkeUserNames: [],
|
|
|
- checkeUserid: "",
|
|
|
- checkeUserName: "",
|
|
|
- selectedUserids: [],
|
|
|
- selectedUserNames: [],
|
|
|
- selectedUserid: "",
|
|
|
- selectedUserName: "",
|
|
|
- departDisabled: false, //是否是我的部门调用该页面
|
|
|
- modalWidth: 800,
|
|
|
- drawerWidth: 700,
|
|
|
- modaltoggleFlag: true,
|
|
|
- confirmDirty: false,
|
|
|
- selectedDepartKeys: [], //保存用户选择部门id
|
|
|
- checkedDepartKeys: [],
|
|
|
- checkedDepartNames: [], // 保存部门的名称 =>title
|
|
|
- checkedDepartNameString: "", // 保存部门的名称 =>title
|
|
|
- resultDepartOptions: [],
|
|
|
- userId: "", //保存用户id
|
|
|
- disableSubmit: false,
|
|
|
- userDepartModel: {
|
|
|
- userId: '',
|
|
|
- departIdList: []
|
|
|
- }, // 保存SysUserDepart的用户部门中间表数据需要的对象
|
|
|
- dateFormat: "YYYY-MM-DD",
|
|
|
- validatorRules: {},
|
|
|
- departIdShow: false,
|
|
|
+ show: 1,
|
|
|
+ id: null,
|
|
|
+ shiftname: "",
|
|
|
+ username: "",
|
|
|
+ deptlist: null,
|
|
|
+ shiftlist: null,
|
|
|
title: "操作",
|
|
|
visible: false,
|
|
|
+ key: null,
|
|
|
+ index: null,
|
|
|
+ vs: false,
|
|
|
model: {},
|
|
|
- roleList: [],
|
|
|
- selectedRole: [],
|
|
|
labelCol: {
|
|
|
xs: {
|
|
|
span: 24
|
|
@@ -172,148 +174,539 @@
|
|
|
span: 16
|
|
|
},
|
|
|
},
|
|
|
- uploadLoading: false,
|
|
|
+ isShow: true,
|
|
|
+ listData: [],
|
|
|
confirmLoading: false,
|
|
|
- headers: {},
|
|
|
form: this.$form.createForm(this),
|
|
|
-
|
|
|
+ validatorRules: {},
|
|
|
url: {
|
|
|
add: "/attendanceRule/attendanceRule/add",
|
|
|
- edit: "/attendanceRule/attendanceRule/edit",
|
|
|
- users:"/userRule/userRule/lists",
|
|
|
- usersids:"/sys/user/queryUsersByIds"
|
|
|
+ userShift: "/userShift/userShift/queryMothByUser",
|
|
|
+ shift: "/shift/shift/lists",
|
|
|
+ list: "/sys/user/queryMothByUsers",
|
|
|
+ moth: "/userShift/userShift/queryMothByUser",
|
|
|
+ deptlist: "/sys/sysDepart/listAll",
|
|
|
+ delUserShift: '/userShift/userShift/delete',
|
|
|
+ edit:'/attendanceRule/attendanceRule/edit'
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.initData(null)
|
|
|
+ this.queryShift()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tagBtnCloseFunc(e) {
|
|
|
+ const tags = this.selectUsers.filter(tag => tag !== e);
|
|
|
+ this.selectUsers = tags;
|
|
|
+ },
|
|
|
+ UserType(e, a) {
|
|
|
+ this.isShow = true;
|
|
|
+ var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e))
|
|
|
+ if (a.category == 106) {
|
|
|
+ if (d.getDay() == 0) {
|
|
|
+ this.isShow = false;
|
|
|
+ }
|
|
|
|
|
|
+ } else {
|
|
|
+ if (d.getDay() == 0 || d.getDay() == 6) {
|
|
|
+ this.isShow = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ shiftOks(a, b, c, d) {
|
|
|
+ var date = this.currentYear + "-" + this.currentMonth + "-" + b + " 00:00:000";
|
|
|
+ var name = a.name;
|
|
|
+ var shift=a.id;
|
|
|
+ if (a == 0 || a == "0") {
|
|
|
+ name = "休息";
|
|
|
+ shift="0";
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- computed: {
|
|
|
|
|
|
- },
|
|
|
- methods: {
|
|
|
- queryuserName(e){
|
|
|
- getAction(this.url.users, {
|
|
|
- ruleId:e
|
|
|
- }).then((res) => {
|
|
|
+ if (b == 1) {
|
|
|
+ c.a1 = name;
|
|
|
+ c.shiftid1=shift;
|
|
|
+ } else if (b == 2) {
|
|
|
+ c.a2 = name;
|
|
|
+ c.shiftid2=shift;
|
|
|
+ } else if (b == 3) {
|
|
|
+ c.a3 = name;
|
|
|
+ c.shiftid3=shift;
|
|
|
+ } else if (b == 4) {
|
|
|
+ c.a4 = name;
|
|
|
+ c.shiftid4=shift;
|
|
|
+ } else if (b == 5) {
|
|
|
+ c.a5 = name;
|
|
|
+ c.shiftid5=shift;
|
|
|
+ } else if (b == 6) {
|
|
|
+ c.a6 = name;
|
|
|
+ c.shiftid6=shift;
|
|
|
+ } else if (b == 7) {
|
|
|
+ c.a7 = name;
|
|
|
+ c.shiftid7=shift;
|
|
|
+ } else if (b == 8) {
|
|
|
+ c.a8 = name;
|
|
|
+ c.shiftid8=shift;
|
|
|
+ } else if (b == 9) {
|
|
|
+ c.a9 = name;
|
|
|
+ c.shiftid9=shift;
|
|
|
+ } else if (b == 10) {
|
|
|
+ c.a10 = name;
|
|
|
+ c.shiftid10=shift;
|
|
|
+ } else if (b == 11) {
|
|
|
+ c.a11 = name;
|
|
|
+ c.shiftid11=shift;
|
|
|
+ } else if (b == 12) {
|
|
|
+ c.a12 = name;
|
|
|
+ c.shiftid12=shift;
|
|
|
+ } else if (b == 13) {
|
|
|
+ c.a13 = name;
|
|
|
+ c.shiftid13=shift;
|
|
|
+ } else if (b == 14) {
|
|
|
+ c.a14 = name;
|
|
|
+ c.shiftid14=shift;
|
|
|
+ } else if (b == 15) {
|
|
|
+ c.a15 = name;
|
|
|
+ c.shiftid15=shift;
|
|
|
+ } else if (b == 16) {
|
|
|
+ c.a16 = name;
|
|
|
+ c.shiftid16=shift;
|
|
|
+ } else if (b == 17) {
|
|
|
+ c.a17 = name;
|
|
|
+ c.shiftid17=shift;
|
|
|
+ } else if (b == 18) {
|
|
|
+ c.a18 = name;
|
|
|
+ c.shiftid18=shift;
|
|
|
+ } else if (b == 19) {
|
|
|
+ c.a19 = name;
|
|
|
+ c.shiftid19=shift;
|
|
|
+ } else if (b == 20) {
|
|
|
+ c.a20 = name;
|
|
|
+ c.shiftid20=shift;
|
|
|
+ } else if (b == 21) {
|
|
|
+ c.a21 = name;
|
|
|
+ c.shiftid21=shift;
|
|
|
+ } else if (b == 22) {
|
|
|
+ c.a22 = name;
|
|
|
+ c.shiftid22=shift;
|
|
|
+ } else if (b == 23) {
|
|
|
+ c.a23 = name;
|
|
|
+ c.shiftid23=shift;
|
|
|
+ } else if (b == 24) {
|
|
|
+ c.a24 = name;
|
|
|
+ c.shiftid24=shift;
|
|
|
+ } else if (b == 25) {
|
|
|
+ c.a25 = name;
|
|
|
+ c.shiftid25=shift;
|
|
|
+ } else if (b == 26) {
|
|
|
+ c.a26 = name;
|
|
|
+ c.shiftid26=shift;
|
|
|
+ } else if (b == 27) {
|
|
|
+ c.a27 = name;
|
|
|
+ c.shiftid27=shift;
|
|
|
+ } else if (b == 28) {
|
|
|
+ c.a28 = name;
|
|
|
+ c.shiftid28=shift;
|
|
|
+ } else if (b == 29) {
|
|
|
+ c.a29 = name;
|
|
|
+ c.shiftid29=shift;
|
|
|
+ } else if (b == 30) {
|
|
|
+ c.a30 = name;
|
|
|
+ c.shiftid30=shift;
|
|
|
+ } else if (b == 31) {
|
|
|
+ c.a31 = name;
|
|
|
+ c.shiftid31=shift;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ pickPre: function(year, month) {
|
|
|
+ var d = new Date(this.formatDate(year, month, 1))
|
|
|
+ d.setDate(0)
|
|
|
+ this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
|
|
|
+ this.queryParam.shiftDate = this.formatDate(d.getFullYear(), d.getMonth() + 1, 1) + " 00:00:000";
|
|
|
+ this.$options.methods.searchQuery.call(this)
|
|
|
+ },
|
|
|
+
|
|
|
+ pickNext: function(year, month) {
|
|
|
+ var d = new Date(this.formatDate(year, month + 1, 1))
|
|
|
+ this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
|
|
|
+ this.queryParam.shiftDate = this.formatDate(d.getFullYear(), d.getMonth() + 1, 1) + " 00:00:000";
|
|
|
+ this.$options.methods.searchQuery.call(this)
|
|
|
+ },
|
|
|
+
|
|
|
+ initData: function(cur) {
|
|
|
+ this.columns = [];
|
|
|
+ var date
|
|
|
+ if (cur) {
|
|
|
+ date = new Date(cur)
|
|
|
+ } else {
|
|
|
+ var now = new Date()
|
|
|
+ date = now;
|
|
|
+ }
|
|
|
+ this.currentDay = date.getDate()
|
|
|
+ this.currentYear = date.getFullYear()
|
|
|
+ this.currentMonth = date.getMonth() + 1
|
|
|
+ this.currentWeek = date.getDay() // 1...6,0
|
|
|
+
|
|
|
+ var str = this.formatDate(
|
|
|
+ this.currentYear,
|
|
|
+ this.currentMonth,
|
|
|
+ this.currentDay
|
|
|
+ )
|
|
|
+ this.days.length = 0
|
|
|
+ var moth = new Date(str);
|
|
|
+ moth.setDate(28)
|
|
|
+
|
|
|
+ moth.setMonth(moth.getMonth() + 1);
|
|
|
+ moth.setDate(0);
|
|
|
+ this.columns.push({
|
|
|
+ title: '名称',
|
|
|
+ dataIndex: 'realname',
|
|
|
+ width: '100px'
|
|
|
+ })
|
|
|
+ for (var i = 1; i <= moth.getDate(); i++) {
|
|
|
+ var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
|
|
|
+ this.tpdata.push(i)
|
|
|
+ var dayobjectSelf = {
|
|
|
+ width: '49px',
|
|
|
+ slots: {
|
|
|
+ title: d.getDate()
|
|
|
+ },
|
|
|
+ dataIndex: "a" + d.getDate(),
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: i
|
|
|
+ },
|
|
|
+
|
|
|
+ } // 用一个对象包装Date对象 以便为以后预定功能添加属性
|
|
|
+ var dat = {};
|
|
|
+ dat.day = d;
|
|
|
+
|
|
|
+ this.days.push(dat)
|
|
|
+ this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 返回 类似 2016-01-02 格式的字符串
|
|
|
+ formatDate: function(year, month, day) {
|
|
|
+ var y = year
|
|
|
+ if (month > 12) {
|
|
|
+ y = y + 1;
|
|
|
+ month = 1;
|
|
|
+ };
|
|
|
+ var m = month
|
|
|
+ if (m < 10) m = '0' + m
|
|
|
+ var d = day
|
|
|
+ if (d < 10) d = '0' + d
|
|
|
+ return y + '-' + m + '-' + d
|
|
|
+ },
|
|
|
+
|
|
|
+ delUserShift(e) {
|
|
|
+ this.vs = true;
|
|
|
+ console.log(e)
|
|
|
+ deleteAction(this.url.delUserShift, {
|
|
|
+ id: e
|
|
|
+ }).then((res) => {
|
|
|
if (res.success) {
|
|
|
- if(res.result.length>0){
|
|
|
- for(var i=0;i<res.result.length;i++){
|
|
|
- this.selectedUserids.push(res.result[i].id);
|
|
|
- this.selectedUserNames.push(res.result[i].realname);
|
|
|
- this.selectedUserid=this.selectedUserids.join(",");
|
|
|
- this.selectedUserName=this.selectedUserNames.join(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.$message.success(res.message);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.vs = false;
|
|
|
+ this.getListData(moment(this.queryParam.entryDate).format('YYYY-MM-DD HH:mm:ss'));
|
|
|
})
|
|
|
},
|
|
|
- queryUsersids(e){
|
|
|
- getAction(this.url.usersids, {
|
|
|
- id:e
|
|
|
- }).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- if(res.result.length>0){
|
|
|
- var selectedUserids=[];
|
|
|
- var selectedUserNames=[];
|
|
|
- var selectedUserid="";
|
|
|
- var selectedUserName="";
|
|
|
- for(var i=0;i<res.result.length;i++){
|
|
|
- selectedUserids.push(res.result[i].id);
|
|
|
- selectedUserNames.push(res.result[i].realname);
|
|
|
- selectedUserid=selectedUserids.join(",");
|
|
|
- selectedUserName=selectedUserNames.join(",");
|
|
|
- }
|
|
|
- if(this.ruletype=="1"||this.ruletype==1){
|
|
|
- this.selectedUserids=selectedUserids;
|
|
|
- this.selectedUserNames=selectedUserNames;
|
|
|
- this.selectedUserid=selectedUserid;
|
|
|
- this.selectedUserName=selectedUserName;
|
|
|
- }else if(this.ruletype=="2"||this.ruletype==2){
|
|
|
- this.checkeUserids=selectedUserids;
|
|
|
- this.checkeUserNames=selectedUserNames;
|
|
|
- this.checkeUserid=selectedUserid;
|
|
|
- this.checkeUserName=selectedUserName;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- onChangets(checkedValues) {
|
|
|
- console.log('checked = ', checkedValues);
|
|
|
- this.values=checkedValues;
|
|
|
- },
|
|
|
- handleSubmits() {
|
|
|
- if(this.name==null||this.name==""){
|
|
|
- this.$message.warning("请输入规则名称!");
|
|
|
- return;
|
|
|
- }if(this.ruletype=="2"){
|
|
|
- if (this.checkedDepartKeys == null || this.checkedDepartKeys.length == 0) {
|
|
|
- this.$message.warning("请选择打卡部门!");
|
|
|
+ queryUserShifts() {
|
|
|
+ this.queryParam.shiftDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ this.$options.methods.searchQuery.call(this);
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ close() {
|
|
|
+ this.selectedRowKeys = [];
|
|
|
+ this.queryParam = {};
|
|
|
+ this.shiftname = "";
|
|
|
+ this.id = null;
|
|
|
+ this.$emit('close');
|
|
|
+ this.dataSource = [];
|
|
|
+ this.visible = false;
|
|
|
+ this.selectUsers=[];
|
|
|
+ this.startDate="";
|
|
|
+ this.endDate="";
|
|
|
+
|
|
|
+ },
|
|
|
+ queryShift() {
|
|
|
+ httpAction(this.url.shift, "", "get").then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.shiftlist = res.result;
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCancel() {
|
|
|
+ this.close()
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ var userid = "";
|
|
|
+ var startDate = "";
|
|
|
+ var endDate = "";
|
|
|
+ var workDay = "";
|
|
|
+ var obj="";
|
|
|
+ var year=this.currentYear+"-"+this.currentMonth;
|
|
|
+ if (this.types != '2' && this.types != 2) {
|
|
|
+ if (this.selectUsers == [] || this.selectUsers.length < 1) {
|
|
|
+ this.$message.warning('人员不能为空');
|
|
|
return;
|
|
|
+ } else if (this.types == '1' || this.types == 1) {
|
|
|
+ if (this.startDate == null || this.startDate == "") {
|
|
|
+ this.$message.warning('请选择上班时间');
|
|
|
+ return;
|
|
|
+ } else if (this.endDate == null || this.endDate == "") {
|
|
|
+ this.$message.warning('请选择下班时间');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ startDate = moment(this.startDate).format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ endDate = moment(this.endDate).format('YYYY-MM-DD HH:mm:ss');
|
|
|
}
|
|
|
+ var ids = [];
|
|
|
+ for (var i = 0; i < this.selectUsers.length; i++) {
|
|
|
+ ids.push(this.selectUsers[i].id);
|
|
|
+ }
|
|
|
+ userid = ids.join(',');
|
|
|
+ workDay = "1,2,3,4,5";
|
|
|
+ } else if (this.types == '2' || this.types == 2) {
|
|
|
+ var data=[];
|
|
|
+ var uids=[];
|
|
|
+ userid=this.checkUserIds;
|
|
|
+ for(var i=0;i<this.dataSource.length;i++){
|
|
|
+ uids.push(this.dataSource[i].id);
|
|
|
+ if(this.dataSource[i].shiftid1!=""&&this.dataSource[i].shiftid1!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid1,
|
|
|
+ date:year+"-1 00:00:00"
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid2!=""&&this.dataSource[i].shiftid2!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid2,
|
|
|
+ date:year+"-2 00:00:00"
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid3!=""&&this.dataSource[i].shiftid3!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid3,
|
|
|
+ date:year+"-3 00:00:00",
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid4!=""&&this.dataSource[i].shiftid4!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid4,
|
|
|
+ date:year+"-4 00:00:00"
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid5!=""&&this.dataSource[i].shiftid5!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid5,
|
|
|
+ date:year+"-5 00:00:00",
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid6!=""&&this.dataSource[i].shiftid6!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid6,
|
|
|
+ date:year+"-6 00:00:00",
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid7!=""&&this.dataSource[i].shiftid7!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid7,
|
|
|
+ date:year+"-7 00:00:00"
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid8!=""&&this.dataSource[i].shiftid8!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid8,
|
|
|
+ date:year+"-8 00:00:00"
|
|
|
+ };
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid9!=""&&this.dataSource[i].shiftid9!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid9,
|
|
|
+ date:year+"-9 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid10!=""&&this.dataSource[i].shiftid10!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid10,
|
|
|
+ date:year+"-10 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid11!=""&&this.dataSource[i].shiftid11!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid11,
|
|
|
+ date:year+"-11 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid12!=""&&this.dataSource[i].shiftid12!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid12,
|
|
|
+ date:year+"-12 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid13!=""&&this.dataSource[i].shiftid13!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid13,
|
|
|
+ date:year+"-13 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid14!=""&&this.dataSource[i].shiftid14!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid14,
|
|
|
+ date:year+"-14 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid15!=""&&this.dataSource[i].shiftid15!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid15,
|
|
|
+ date:year+"-15 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid16!=""&&this.dataSource[i].shiftid16!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid16,
|
|
|
+ date:year+"-16 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid17!=""&&this.dataSource[i].shiftid17!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid17,
|
|
|
+ date:year+"-17 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid18!=""&&this.dataSource[i].shiftid18!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid18,
|
|
|
+ date:year+"-18 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid19!=""&&this.dataSource[i].shiftid19!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid19,
|
|
|
+ date:year+"-19 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid20!=""&&this.dataSource[i].shiftid20!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid20,
|
|
|
+ date:year+"-20 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid21!=""&&this.dataSource[i].shiftid21!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid21,
|
|
|
+ date:year+"-21 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid22!=""&&this.dataSource[i].shiftid22!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid22,
|
|
|
+ date:year+"-22 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid23!=""&&this.dataSource[i].shiftid23!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid23,
|
|
|
+ date:year+"-23 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid24!=""&&this.dataSource[i].shiftid24!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid24,
|
|
|
+ date:year+"-24 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid25!=""&&this.dataSource[i].shiftid25!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid25,
|
|
|
+ date:year+"-25 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid26!=""&&this.dataSource[i].shiftid26!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid26,
|
|
|
+ date:year+"-26 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid27!=""&&this.dataSource[i].shiftid27!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid27,
|
|
|
+ date:year+"-27 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid28!=""&&this.dataSource[i].shiftid28!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid28,
|
|
|
+ date:year+"-28 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid29!=""&&this.dataSource[i].shiftid29!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid29,
|
|
|
+ date:year+"-29 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid30!=""&&this.dataSource[i].shiftid30!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid30,
|
|
|
+ date:year+"-30 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }if(this.dataSource[i].shiftid31!=""&&this.dataSource[i].shiftid31!=null){
|
|
|
+ var str={
|
|
|
+ userid:this.dataSource[i].id,
|
|
|
+ shiftid:this.dataSource[i].shiftid31,
|
|
|
+ date:year+"-31 00:00:00"};
|
|
|
+ data.push(str)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ obj =JSON.stringify(data);
|
|
|
+ userid=uids.join(",");
|
|
|
}
|
|
|
- if (this.type == "1" && this.startDate == null) {
|
|
|
- this.$message.warning("请选择上班时间!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.type == "1" && this.endDate == null) {
|
|
|
- this.$message.warning("请选择下班时间!");
|
|
|
- return;
|
|
|
- }if(this.type != "2"&&this.values.length==0){
|
|
|
- this.$message.warning("请选择工作日!");
|
|
|
- return;
|
|
|
- }if(this.ruletype=="1"&&this.selectedUserid==""){
|
|
|
- this.$message.warning("请选择打卡人员!");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
var url = this.url.add;
|
|
|
- var types="post"
|
|
|
- if (this.id!=null&&this.id!="") {
|
|
|
+ var typet = "post"
|
|
|
+ if (this.id != null && this.id != "") {
|
|
|
url = this.url.edit;
|
|
|
- types="put";
|
|
|
+ typet = "put";
|
|
|
}
|
|
|
- var adate=null;
|
|
|
- var edate=null;
|
|
|
- var workday="";
|
|
|
- var dept="";
|
|
|
- var deptName="";
|
|
|
- var userId="";
|
|
|
- var userName="";
|
|
|
- if(this.type == "1"&&this.startDate != null&&this.startDate!=""){
|
|
|
- adate=moment(this.startDate).format('YYYY-MM-DD HH:mm:ss');
|
|
|
- }if(this.type == "1"&&this.endDate != null&&this.endDate!=""){
|
|
|
- edate=moment(this.endDate).format('YYYY-MM-DD HH:mm:ss');
|
|
|
- } if(this.type!="2"){
|
|
|
- workday=this.values.join(",");
|
|
|
- }if(this.ruletype=="1"){
|
|
|
- userId=this.selectedUserid
|
|
|
- }if(this.ruletype=="2"){
|
|
|
- dept=this.deptids;
|
|
|
- deptName=this.checkedDepartNameString;
|
|
|
- userId=this.checkeUserid;
|
|
|
- userName=this.checkeUserName;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
this.confirmLoading=true;
|
|
|
httpAction(url, {
|
|
|
id: this.id,
|
|
|
- type: this.type,
|
|
|
- name: this.name,
|
|
|
- dept:dept ,
|
|
|
- startDate: adate,
|
|
|
- endDate: edate,
|
|
|
- deptName:deptName ,
|
|
|
- userId:userId,
|
|
|
- userName:userName,
|
|
|
- workDay:workday,
|
|
|
- ruleType:this.ruletype
|
|
|
+ type: this.types,
|
|
|
+ startDate: startDate,
|
|
|
+ endDate: endDate,
|
|
|
+ userId: userid,
|
|
|
+ workDay: workDay,
|
|
|
+ ruleType:obj
|
|
|
},
|
|
|
- types).then((res) => {
|
|
|
+ typet).then((res) => {
|
|
|
if (res.success) {
|
|
|
this.$message.success(res.message);
|
|
|
this.$emit('ok');
|
|
@@ -325,196 +718,134 @@
|
|
|
this.close();
|
|
|
})
|
|
|
},
|
|
|
- //窗口最大化切换
|
|
|
- toggleScreen() {
|
|
|
- if (this.modaltoggleFlag) {
|
|
|
- this.modalWidth = window.innerWidth;
|
|
|
- } else {
|
|
|
- this.modalWidth = 800;
|
|
|
- }
|
|
|
- this.modaltoggleFlag = !this.modaltoggleFlag;
|
|
|
- },
|
|
|
- add() {
|
|
|
- this.refresh();
|
|
|
+ add(e, a) {
|
|
|
this.visible = true;
|
|
|
+ this.queryParam.usertid = e.join(",");
|
|
|
+ this.checkUserIds=e.join(",");
|
|
|
+ this.selectUsers = a;
|
|
|
+ this.queryParam.shiftDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ this.queryParam.type="1";
|
|
|
+ this.$options.methods.searchQuery.call(this)
|
|
|
},
|
|
|
- edit(record) {
|
|
|
- console.log(record)
|
|
|
+ edit(e,a){
|
|
|
this.visible = true;
|
|
|
- this.name = record.name;
|
|
|
- this.type = record.type;
|
|
|
- this.checkedDepartNameString = record.deptName;
|
|
|
- this.deptids = record.dept;
|
|
|
- this.id = record.id;
|
|
|
- this.ruletype=record.ruleType;
|
|
|
- this.checkeUserid=record.userId;
|
|
|
- this.checkeUserids=record.userId.split(",");
|
|
|
- this.checkeUserName=record.userName;
|
|
|
- //时间格式化
|
|
|
- if(record.type=="1"){
|
|
|
- this.startDate = record.startDate ? moment(record.startDate).format('YYYY-MM-DD HH:mm:ss') : null
|
|
|
- this.endDate = record.endDate ? moment(record.endDate).format('YYYY-MM-DD HH:mm:ss') : null
|
|
|
- }
|
|
|
- if(record.dept!=null&&record.dept!=""){
|
|
|
- this.checkedDepartKeys= record.dept.split(",");
|
|
|
- }if(record.workDay!=null&&record.workDay!=""){
|
|
|
- this.values=record.workDay.split(",");
|
|
|
- }if(record.ruleType=="1"){
|
|
|
- this.queryuserName(record.id);
|
|
|
- }
|
|
|
+ this.queryParam.usertid = e.join(",");
|
|
|
+ this.checkUserIds=e.join(",");
|
|
|
+ this.selectUsers = a;
|
|
|
+ this.types=a[0].type;
|
|
|
+ this.id=a[0].id;
|
|
|
+ this.queryParam.shiftDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ this.queryParam.type="2";
|
|
|
+ this.$options.methods.searchQuery.call(this)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- },
|
|
|
- onSearch2() {
|
|
|
- var dept="";
|
|
|
- if(this.ruletype=="2"){
|
|
|
- if(this.deptids==null||this.deptids==""){
|
|
|
- this.$message.warning("请先选择部门!");
|
|
|
- return;
|
|
|
- }
|
|
|
- dept=this.deptids;
|
|
|
- this.$refs.userShiftListModal.selectedKeys=this.checkeUserids;
|
|
|
- }else{
|
|
|
- this.$refs.userShiftListModal.selectedKeys=this.selectedUserids;
|
|
|
- }
|
|
|
- this.$refs.userShiftListModal.add(dept);
|
|
|
-
|
|
|
- },
|
|
|
- // 搜索用户对应的部门API
|
|
|
- onSearch() {
|
|
|
- console.log(this.checkedDepartKeys)
|
|
|
-
|
|
|
- this.$refs.departWindow.add(this.checkedDepartKeys, "","2");
|
|
|
- departWindow.data.departList = this.checkedDepartKeys;
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- modalFormOk2(e) {
|
|
|
- this.checkeUserids=[];
|
|
|
- this.checkeUserNames=[];
|
|
|
- this.checkeUserid= "";
|
|
|
- this.checkeUserName="";
|
|
|
- this.selectedUserids= [];
|
|
|
- this.selectedUserNames=[];
|
|
|
- this.selectedUserid="";
|
|
|
- this.selectedUserName= "";
|
|
|
- if(e!=null&&e.length>0){
|
|
|
- var ids=e.join(",");
|
|
|
- this.queryUsersids(ids)
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取用户对应部门弹出框提交给返回的数据
|
|
|
- modalFormOk(formData) {
|
|
|
- console.log(formData)
|
|
|
- this.checkedDepartNames = [];
|
|
|
- this.selectedDepartKeys = [];
|
|
|
- this.checkedDepartNameString = '';
|
|
|
- this.userId = formData.userId;
|
|
|
- this.userDepartModel.userId = formData.userId;
|
|
|
- this.departIds = [];
|
|
|
- this.checkedDepartKeys = [];
|
|
|
- this.deptids = "";
|
|
|
- this.resultDepartOptions = [];
|
|
|
- var depart = [];
|
|
|
- if (formData.departIdList != null && formData.departIdList.length > 0) {
|
|
|
- for (let i = 0; i < formData.departIdList.length; i++) {
|
|
|
- this.selectedDepartKeys.push(formData.departIdList[i].key);
|
|
|
- this.checkedDepartNames.push(formData.departIdList[i].title);
|
|
|
- this.checkedDepartNameString = this.checkedDepartNames.join(",");
|
|
|
- this.deptids = this.selectedDepartKeys.join(",");
|
|
|
- //新增部门选择,如果上面部门选择后不为空直接付给负责部门
|
|
|
- depart.push({
|
|
|
- key: formData.departIdList[i].key,
|
|
|
- title: formData.departIdList[i].title
|
|
|
- })
|
|
|
- this.departIds.push(formData.departIdList[i].key)
|
|
|
- }
|
|
|
- this.resultDepartOptions = depart;
|
|
|
- this.userDepartModel.departIdList = this.selectedDepartKeys;
|
|
|
- this.checkedDepartKeys = this.selectedDepartKeys //更新当前的选择keys
|
|
|
- }
|
|
|
- this.$refs.departWindow.close();
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- // 根据屏幕变化,设置抽屉尺寸
|
|
|
- resetScreenSize() {
|
|
|
- let screenWidth = document.body.clientWidth;
|
|
|
- if (screenWidth < 500) {
|
|
|
- this.drawerWidth = screenWidth;
|
|
|
- } else {
|
|
|
- this.drawerWidth = 700;
|
|
|
- }
|
|
|
- },
|
|
|
- handleCancel() {
|
|
|
- this.close()
|
|
|
- },
|
|
|
- refresh() {
|
|
|
- this.selectedDepartKeys = [];
|
|
|
- this.checkedDepartKeys = [];
|
|
|
- this.checkedDepartNames = [];
|
|
|
- this.checkedDepartNameString = "";
|
|
|
- this.userId = ""
|
|
|
- this.resultDepartOptions = [];
|
|
|
- this.departId = [];
|
|
|
- this.departIdShow = false;
|
|
|
- this.currentTenant = []
|
|
|
- this.type = "1";
|
|
|
- this.name = "";
|
|
|
- this.startDate = null;
|
|
|
- this.endDate = null;
|
|
|
- this.id = null;
|
|
|
- this.checkeUserName="";
|
|
|
- this.checkeUserNames=[];
|
|
|
- this.checkeUserid="";
|
|
|
- this.checkeUserids=[];
|
|
|
- this.deptids="";
|
|
|
- this.values=[];
|
|
|
- this.ruletype="1";
|
|
|
- this.selectedUserids=[];
|
|
|
- this.selectedUserNames=[];
|
|
|
- this.selectedUserid="";
|
|
|
- this.selectedUserName="";
|
|
|
- },
|
|
|
- close() {
|
|
|
- this.$emit('close');
|
|
|
- this.visible = false;
|
|
|
- this.refresh();
|
|
|
- },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
- .avatar-uploader>.ant-upload {
|
|
|
- width: 104px;
|
|
|
- height: 104px;
|
|
|
+<style lang="less" scoped>
|
|
|
+ .month {
|
|
|
+ width: 100%;
|
|
|
+ color: #333333;
|
|
|
+ background: #ffffff;
|
|
|
+ margin-top: -20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .month ul {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 30px;
|
|
|
+ list-style-type: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .year-month {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-around;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .choose-month {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
|
|
|
- .ant-upload-select-picture-card i {
|
|
|
- font-size: 49px;
|
|
|
+ .arrow {
|
|
|
+ padding: 15px;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .month ul li {
|
|
|
+ font-size: 12px;
|
|
|
+ text-transform: uppercase;
|
|
|
+ letter-spacing: 3px;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ .weekdays {
|
|
|
+ margin: 0;
|
|
|
+ padding: 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
color: #999;
|
|
|
+ justify-content: space-around;
|
|
|
+ background: #ffffff;
|
|
|
}
|
|
|
|
|
|
- .ant-upload-select-picture-card .ant-upload-text {
|
|
|
- margin-top: 8px;
|
|
|
- color: #666;
|
|
|
+ .weekdays li {
|
|
|
+ display: inline-block;
|
|
|
+ width: 13.6%;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
|
|
|
- .ant-table-tbody .ant-table-row td {
|
|
|
- padding-top: 10px;
|
|
|
- padding-bottom: 10px;
|
|
|
+ .days {
|
|
|
+ padding: 10px;
|
|
|
+ background: #ffffff;
|
|
|
+ margin: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
}
|
|
|
|
|
|
- .drawer-bootom-button {
|
|
|
- position: absolute;
|
|
|
- bottom: -8px;
|
|
|
- width: 100%;
|
|
|
- border-top: 1px solid #e8e8e8;
|
|
|
- padding: 10px 16px;
|
|
|
- text-align: right;
|
|
|
- left: 0;
|
|
|
- background: #fff;
|
|
|
- border-radius: 0 0 2px 2px;
|
|
|
+ .ts {
|
|
|
+ padding: 20px;
|
|
|
+ background: #ffffff;
|
|
|
+ margin: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .days li {
|
|
|
+ list-style-type: none;
|
|
|
+ display: inline-block;
|
|
|
+ width: 14.2%;
|
|
|
+ text-align: center;
|
|
|
+ padding-bottom: 4px;
|
|
|
+ padding-top: 5px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #000;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .days li .active {
|
|
|
+ padding: 8px 10px;
|
|
|
+ border-radius: 5%;
|
|
|
+ background: #00b8ec;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .days li .other-month {
|
|
|
+ padding: 5px;
|
|
|
+ color: gainsboro;
|
|
|
+ }
|
|
|
+
|
|
|
+ .days li:hover .act {
|
|
|
+ padding: 6px 10px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #e1e1e1;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
</style>
|