Commit 13d4abe4 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 112a7107 f08c3370
...@@ -2,21 +2,34 @@ ...@@ -2,21 +2,34 @@
<div class="container" v-if="open"> <div class="container" v-if="open">
<el-card style="min-height:80vh;padding:15px"> <el-card style="min-height:80vh;padding:15px">
<div class="flex flex_end"> <div class="flex flex_end">
<el-button type="primary" size="mini" @click="backTo">返回上一级</el-button> <el-button type="primary" size="mini" @click="backTo"
>返回上一级</el-button
>
</div> </div>
<tab-pane :activeName="activeName" :thirdList="thirdList"></tab-pane> <tab-pane :activeName="activeName" :thirdList="thirdList"></tab-pane>
<div class="mt20"> <div class="mt20">
<div>考勤组名称</div> <div>考勤组名称</div>
<el-input placeholder="请输入考勤组名称" maxlength="20" <el-input
v-model="setParams.groupName" style="width:320px" class="mt10"></el-input> placeholder="请输入考勤组名称"
maxlength="20"
v-model="setParams.groupName"
style="width:320px"
class="mt10"
></el-input>
</div> </div>
<div class="flex flex-align-center mt20"> <div class="flex flex-align-center mt20">
<div>考勤人员</div> <div>考勤人员</div>
<el-button type="text" class="ml20" @click="drawershow('drawer1')">设置</el-button> <el-button type="text" class="ml20" @click="drawershow('drawer1')"
>设置</el-button
>
</div> </div>
<div class="flex flex-align-center mt10" style="color:#999;font-size:14px" v-if="attendArr.length < 1"> <div
class="flex flex-align-center mt10"
style="color:#999;font-size:14px"
v-if="attendArr.length < 1"
>
<div>参与考勤人员</div> <div>参与考勤人员</div>
<div class="ml20">未设置</div> <div class="ml20">未设置</div>
</div> </div>
...@@ -30,10 +43,16 @@ ...@@ -30,10 +43,16 @@
<div class="flex flex-align-center mt20"> <div class="flex flex-align-center mt20">
<div>考勤组负责人</div> <div>考勤组负责人</div>
<el-button type="text" class="ml20" @click="drawershow('drawer2')">设置</el-button> <el-button type="text" class="ml20" @click="drawershow('drawer2')"
>设置</el-button
>
</div> </div>
<div class="flex flex-align-center mt10" style="color:#999;font-size:14px" v-if="!groupResponsibleEntity.responsibleId"> <div
class="flex flex-align-center mt10"
style="color:#999;font-size:14px"
v-if="!groupResponsibleEntity.responsibleId"
>
<div>主负责人</div> <div>主负责人</div>
<div class="ml20">未设置</div> <div class="ml20">未设置</div>
</div> </div>
...@@ -50,15 +69,25 @@ ...@@ -50,15 +69,25 @@
<div class="flex flex-align-center mt20"> <div class="flex flex-align-center mt20">
<div>考勤时间</div> <div>考勤时间</div>
<el-button type="text" class="ml20" @click="drawershow('drawer3')">设置</el-button> <el-button type="text" class="ml20" @click="drawershow('drawer3')"
>设置</el-button
>
</div> </div>
<div class="flex flex-align-center mt10" v-if="setParams.type === ''" style="color:#999;font-size:14px"> <div
class="flex flex-align-center mt10"
v-if="setParams.type === ''"
style="color:#999;font-size:14px"
>
<div>考勤类型</div> <div>考勤类型</div>
<div class="ml20">未设置</div> <div class="ml20">未设置</div>
</div> </div>
<div class="flex flex-align-center mt10" style="color:#999;font-size:14px" v-if="setParams.type === ''"> <div
class="flex flex-align-center mt10"
style="color:#999;font-size:14px"
v-if="setParams.type === ''"
>
<div>工作日设置</div> <div>工作日设置</div>
<div class="ml20">未设置</div> <div class="ml20">未设置</div>
</div> </div>
...@@ -67,11 +96,16 @@ ...@@ -67,11 +96,16 @@
<div class="flex flex-align-center mt20"> <div class="flex flex-align-center mt20">
<div>打卡方式</div> <div>打卡方式</div>
<el-button type="text" class="ml20" @click="drawershow('drawer4')">设置</el-button> <el-button type="text" class="ml20" @click="drawershow('drawer4')"
>设置</el-button
>
</div> </div>
<div class="flex flex-align-center mt10" style="color:#999;font-size:14px" <div
v-if="setParams.attendanceType == ''"> class="flex flex-align-center mt10"
style="color:#999;font-size:14px"
v-if="setParams.attendanceType == ''"
>
<div>考勤方式</div> <div>考勤方式</div>
<div class="ml20">未设置</div> <div class="ml20">未设置</div>
</div> </div>
...@@ -86,13 +120,22 @@ ...@@ -86,13 +120,22 @@
size="70%" size="70%"
:beforeClose="closedrawer" :beforeClose="closedrawer"
:visible.sync="drawer" :visible.sync="drawer"
direction="rtl"> direction="rtl"
>
<div style="padding:20px"> <div style="padding:20px">
<!-- 考勤人员 --> <!-- 考勤人员 -->
<div v-if="drawer1"> <div v-if="drawer1">
<div>参与考勤人员({{this.attendArr.length}})</div> <div>参与考勤人员({{ this.attendArr.length }})</div>
<el-input @focus="selectGroup(true)" type="textarea" maxlength="20" <el-input
v-model="persons" style="width:80%" size="mini" placeholder="请选择"> @focus="selectGroup(true)"
type="textarea"
maxlength="20"
autosize
v-model="persons"
style="width:80%"
size="mini"
placeholder="请选择"
>
</el-input> </el-input>
</div> </div>
...@@ -127,15 +170,14 @@ ...@@ -127,15 +170,14 @@
<div class="mt20" v-if="drawer3"> <div class="mt20" v-if="drawer3">
<!-- --> <!-- -->
<el-radio-group v-model="setParams.type" @change="changeRadio"> <el-radio-group v-model="setParams.type" @change="changeRadio">
<div class="mt10" v-for="(item,index) in paibanType" :key="index"> <div class="mt10" v-for="(item, index) in paibanType" :key="index">
<el-radio :label="item.value">{{item.label}}</el-radio> <el-radio :label="item.value">{{ item.label }}</el-radio>
<div class="tips">{{item.des}}</div> <div class="tips">{{ item.des }}</div>
</div> </div>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="mt20" v-if="drawer3"> <div class="mt20" v-if="drawer3">
<!-- 固定班次设置 --> <!-- 固定班次设置 -->
<div v-if="setParams.type == 1"> <div v-if="setParams.type == 1">
<div>工作日设置:</div> <div>工作日设置:</div>
...@@ -145,33 +187,75 @@ ...@@ -145,33 +187,75 @@
<el-button type="text" @click="changeBanci('1')">更改班次</el-button> <el-button type="text" @click="changeBanci('1')">更改班次</el-button>
</div> --> </div> -->
<!-- 固定班次表 --> <!-- 固定班次表 -->
<banci-table :setParams="groupFixedworkEntity" @changebanci="changeBanci"></banci-table> <banci-table
:setParams="groupFixedworkEntity"
@changebanci="changeBanci"
></banci-table>
</div> </div>
<!-- 自用工时设置 --> <!-- 自用工时设置 -->
<div v-if="setParams.type == 3"> <div v-if="setParams.type == 3">
<div class="mt20">工作日</div> <div class="mt20">工作日</div>
<div class="mt10"> <div class="mt10">
<el-checkbox v-model="attendanceGroupFreeworkEntity.monday" :true-label="1" :false-label="0">周一</el-checkbox> <el-checkbox
<el-checkbox v-model="attendanceGroupFreeworkEntity.tuesday" :true-label="1" :false-label="0">周二</el-checkbox> v-model="attendanceGroupFreeworkEntity.monday"
<el-checkbox v-model="attendanceGroupFreeworkEntity.wednesday" :true-label="1" :false-label="0">周三</el-checkbox> :true-label="1"
<el-checkbox v-model="attendanceGroupFreeworkEntity.thursday" :true-label="1" :false-label="0">周四</el-checkbox> :false-label="0"
<el-checkbox v-model="attendanceGroupFreeworkEntity.friday" :true-label="1" :false-label="0">周五</el-checkbox> >周一</el-checkbox
<el-checkbox v-model="attendanceGroupFreeworkEntity.saturday" :true-label="1" :false-label="0">周六</el-checkbox> >
<el-checkbox v-model="attendanceGroupFreeworkEntity.sunday" :true-label="1" :false-label="0">周日</el-checkbox> <el-checkbox
v-model="attendanceGroupFreeworkEntity.tuesday"
:true-label="1"
:false-label="0"
>周二</el-checkbox
>
<el-checkbox
v-model="attendanceGroupFreeworkEntity.wednesday"
:true-label="1"
:false-label="0"
>周三</el-checkbox
>
<el-checkbox
v-model="attendanceGroupFreeworkEntity.thursday"
:true-label="1"
:false-label="0"
>周四</el-checkbox
>
<el-checkbox
v-model="attendanceGroupFreeworkEntity.friday"
:true-label="1"
:false-label="0"
>周五</el-checkbox
>
<el-checkbox
v-model="attendanceGroupFreeworkEntity.saturday"
:true-label="1"
:false-label="0"
>周六</el-checkbox
>
<el-checkbox
v-model="attendanceGroupFreeworkEntity.sunday"
:true-label="1"
:false-label="0"
>周日</el-checkbox
>
</div> </div>
<div class="mt20">工作时长</div> <div class="mt20">工作时长</div>
<div class="mt10"> <div class="mt10">
<el-input style="width:100px" v-model="attendanceGroupFreeworkEntity.workTime" minlength="5"></el-input> <el-input
style="width:100px"
v-model="attendanceGroupFreeworkEntity.workTime"
minlength="5"
></el-input>
<span class="ml20">小时</span> <span class="ml20">小时</span>
</div> </div>
</div> </div>
<div v-if="setParams.type != 2"> <div v-if="setParams.type != 2">
<div class="mt10"> <div class="mt10">
<el-checkbox v-model="holidays" :true-label="1" :false-label="0">法定节假日自动排休</el-checkbox> <el-checkbox v-model="holidays" :true-label="1" :false-label="0"
>法定节假日自动排休</el-checkbox
>
</div> </div>
<div class="mt10"> <div class="mt10">
...@@ -183,38 +267,53 @@ ...@@ -183,38 +267,53 @@
+新增必须打卡的日期 +新增必须打卡的日期
</el-button> </el-button>
<div class="el-tag ml20" type="primary" size="mini" plain <div
v-if="mustDakaObj"> class="el-tag ml20"
{{mustDakaObj.specialTime? type="primary"
mustDakaObj.specialTime:'未设置'}} size="mini"
plain
v-if="mustDakaObj"
>
{{
mustDakaObj.specialTime ? mustDakaObj.specialTime : "未设置"
}}
<i class="el-icon-close" @click="deleteSpecal('must')"></i> <i class="el-icon-close" @click="deleteSpecal('must')"></i>
</div> </div>
</div> </div>
<div class="mt10"> <div class="mt10">
<el-button @click="setMustTimes('noneed')"> <el-button @click="setMustTimes('noneed')">
+新增无需打卡的日期 +新增无需打卡的日期
</el-button> </el-button>
<div class="el-tag ml20" type="primary" size="mini" plain <div
v-if="noneedDakaObj&&noneedDakaObj.specialTime"> class="el-tag ml20"
{{noneedDakaObj.specialTime}} type="primary"
size="mini"
plain
v-if="noneedDakaObj && noneedDakaObj.specialTime"
>
{{ noneedDakaObj.specialTime }}
<i class="el-icon-close" @click="deleteSpecal('must')"></i> <i class="el-icon-close" @click="deleteSpecal('must')"></i>
</div> </div>
<div class="el-tag ml20" <div
v-else-if="noneedDakaObj&&noneedDakaObj.specialStartTime"> class="el-tag ml20"
{{noneedDakaObj.specialStartTime}} v-else-if="noneedDakaObj && noneedDakaObj.specialStartTime"
{{noneedDakaObj.specialEndTime}} >
{{ noneedDakaObj.specialStartTime }}
{{ noneedDakaObj.specialEndTime }}
<i class="el-icon-close" @click="deleteSpecal('noneed')"></i> <i class="el-icon-close" @click="deleteSpecal('noneed')"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="mt20" v-if="drawer4"> <div class="mt20" v-if="drawer4">
<div>考勤方式</div> <div>考勤方式</div>
<el-radio-group v-model="setParams.attendanceType"> <el-radio-group v-model="setParams.attendanceType">
<div class="mt10" v-for="(item,index) in attendanceType" :key="index"> <div
<el-radio :label="item.value">{{item.label}}</el-radio> class="mt10"
v-for="(item, index) in attendanceType"
:key="index"
>
<el-radio :label="item.value">{{ item.label }}</el-radio>
</div> </div>
</el-radio-group> </el-radio-group>
</div> </div>
...@@ -222,12 +321,16 @@ ...@@ -222,12 +321,16 @@
</el-drawer> </el-drawer>
<!-- 选择成员 --> <!-- 选择成员 -->
<el-dialog :visible.sync="isshowgroup" title="选择人员" width="80%" :show-close="false"> <el-dialog
:visible.sync="isshowgroup"
title="选择人员"
width="80%"
:show-close="false"
>
<div> <div>
<el-row type="flex"> <el-row type="flex">
<!-- 左1 --> <!-- 左1 -->
<el-col :span="16"> <el-col :span="16">
<el-row type="flex"> <el-row type="flex">
<el-col :span="12"> <el-col :span="12">
<div class="titles">选择部门</div> <div class="titles">选择部门</div>
...@@ -250,14 +353,27 @@ ...@@ -250,14 +353,27 @@
<el-col :span="12"> <el-col :span="12">
<div class="titles">人员列表</div> <div class="titles">人员列表</div>
<el-scrollbar style="height: 50vh"> <el-scrollbar style="height: 50vh">
<div v-if="currentSelect.length>0"> <div v-if="currentSelect.length > 0">
<el-checkbox label="0" v-model="CurrentAllchecked" @change="currentChangeAll">全部</el-checkbox> <el-checkbox
label="0"
v-model="CurrentAllchecked"
@change="currentChangeAll"
>全部</el-checkbox
>
</div> </div>
<el-checkbox-group v-model="allSelectId" v-if="currentSelect.length>0"> <el-checkbox-group
<el-checkbox :label="item.staffId" @change="changegroupId" v-model="allSelectId"
v-for="(item,index) in currentSelect" :key="index"> v-if="currentSelect.length > 0"
{{item.staffName}}</el-checkbox> >
<el-checkbox
:label="item.staffId"
@change="changegroupId"
v-for="(item, index) in currentSelect"
:key="index"
>
{{ item.staffName }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
<div v-else class="tips mt10"> <div v-else class="tips mt10">
...@@ -265,28 +381,30 @@ ...@@ -265,28 +381,30 @@
</div> </div>
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<!-- 右1 --> <!-- 右1 -->
<el-col :span="8"> <el-col :span="8">
<div style="border-left:1px dotted #eee;padding-left:20px"> <div style="border-left:1px dotted #eee;padding-left:20px">
<div class="titles">已选择</div> <div class="titles">已选择</div>
<el-scrollbar style="height: 50vh"> <el-scrollbar style="height: 50vh">
<div class="el-tag ml10 mt10" :key="index" <div
v-for="(item,index) in allSelect"> class="el-tag ml10 mt10"
<span class="tags">{{item.staffName}}</span> :key="index"
v-for="(item, index) in allSelect"
>
<span class="tags">{{ item.staffName }}</span>
<i class="el-icon-close" @click="deleteOne(index)"></i> <i class="el-icon-close" @click="deleteOne(index)"></i>
</div> </div>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="mt20"> <div class="mt20">
<el-button type="primary" size="mini" @click="saveBtnchoice">确定</el-button> <el-button type="primary" size="mini" @click="saveBtnchoice"
>确定</el-button
>
<el-button size="mini" @click="cancelChoice">取消</el-button> <el-button size="mini" @click="cancelChoice">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -294,30 +412,56 @@ ...@@ -294,30 +412,56 @@
<!-- 选择班次 --> <!-- 选择班次 -->
<el-dialog :visible.sync="isshowBanci" title="选择班次" :show-close="false"> <el-dialog :visible.sync="isshowBanci" title="选择班次" :show-close="false">
选择班次 选择班次
<banci-select :classArr="classArr" :currentArr="currentselectBanciRow" v-if="isshowBanci" <banci-select
@saveRowBanci="saveRowBanci" @cancelBanci="cancelBanci"></banci-select> :classArr="classArr"
:currentArr="currentselectBanciRow"
v-if="isshowBanci"
@saveRowBanci="saveRowBanci"
@cancelBanci="cancelBanci"
></banci-select>
</el-dialog> </el-dialog>
<!-- 新增必须打卡时间 --> <!-- 新增必须打卡时间 -->
<el-dialog :visible.sync="mustDaka" title="新增必须打卡日期" :show-close="false"> <el-dialog
:visible.sync="mustDaka"
title="新增必须打卡日期"
:show-close="false"
>
<div> <div>
<span>选择日期</span> <span>选择日期</span>
<el-date-picker type="date" placeholder="年/月/日" class="ml10" value-format="yyyy-MM-dd" <el-date-picker
v-model="currentParams.specialTime"></el-date-picker> type="date"
placeholder="年/月/日"
class="ml10"
value-format="yyyy-MM-dd"
v-model="currentParams.specialTime"
></el-date-picker>
</div> </div>
<div> <div>
<!-- 选择日期 --> <!-- 选择日期 -->
<banci-select :classArr="classArr" :currentArr="currentselectBanciRow" :isshow="mustDaka" <banci-select
@saveRowBanci="saveCurrentSpecial" @cancelBanci="cancelSpecial"></banci-select> :classArr="classArr"
:currentArr="currentselectBanciRow"
:isshow="mustDaka"
@saveRowBanci="saveCurrentSpecial"
@cancelBanci="cancelSpecial"
></banci-select>
</div> </div>
</el-dialog> </el-dialog>
<!-- 新增无需打卡时间 --> <!-- 新增无需打卡时间 -->
<el-dialog :visible.sync="noneedDaka" title="新增无需打卡日期" :show-close="false"> <el-dialog
:visible.sync="noneedDaka"
title="新增无需打卡日期"
:show-close="false"
>
<div> <div>
<span>选择添加方式</span> <span>选择添加方式</span>
<el-radio-group class="ml20" v-model="currentParams.addWay" @change="currentParams.specialTime = ''"> <el-radio-group
class="ml20"
v-model="currentParams.addWay"
@change="currentParams.specialTime = ''"
>
<el-radio :label="0">单个日期</el-radio> <el-radio :label="0">单个日期</el-radio>
<el-radio :label="1">时间段</el-radio> <el-radio :label="1">时间段</el-radio>
</el-radio-group> </el-radio-group>
...@@ -326,8 +470,12 @@ ...@@ -326,8 +470,12 @@
<div v-if="currentParams.addWay === 0" class="mt20"> <div v-if="currentParams.addWay === 0" class="mt20">
<span>选择日期</span> <span>选择日期</span>
<!-- 单个日期 --> <!-- 单个日期 -->
<el-date-picker type="date" class="ml20" value-format="yyyy-MM-dd" <el-date-picker
v-model="currentParams.specialTime"></el-date-picker> type="date"
class="ml20"
value-format="yyyy-MM-dd"
v-model="currentParams.specialTime"
></el-date-picker>
</div> </div>
<div v-else-if="currentParams.addWay === 1" class="mt20"> <div v-else-if="currentParams.addWay === 1" class="mt20">
<!-- 日期段 --> <!-- 日期段 -->
...@@ -338,12 +486,15 @@ ...@@ -338,12 +486,15 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
<div class="mt20"> <div class="mt20">
<el-button type="primary" size="mini" @click="saveNoneed">确定</el-button> <el-button type="primary" size="mini" @click="saveNoneed"
>确定</el-button
>
<el-button size="mini" @click="cancelSpecial">取消</el-button> <el-button size="mini" @click="cancelSpecial">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -351,809 +502,891 @@ ...@@ -351,809 +502,891 @@
</template> </template>
<script> <script>
import tabPane from '@/components/tabPane.vue' import tabPane from "@/components/tabPane.vue";
import banciTable from './banciTable/index' import banciTable from "./banciTable/index";
import banciSelect from './banciSelect/index.vue' import banciSelect from "./banciSelect/index.vue";
import form from "@/assets/mixins/formdialog" import form from "@/assets/mixins/formdialog";
export default { export default {
mixins: [form], mixins: [form],
components: { components: {
tabPane, tabPane,
banciTable, banciTable,
banciSelect banciSelect,
}, },
created(){ created() {
this.changePath("attendance/group") this.changePath("attendance/group");
}, },
methods: { methods: {
// 返回 // 返回
backTo(){ backTo() {
this.open = false this.open = false;
this.$emit('ok',true) this.$emit("ok", true);
}, },
// 渲染前置处理 // 渲染前置处理
beforeRender(data) { beforeRender(data) {
if(data.entity.attendanceGroupStaffList) { if (data.entity.attendanceGroupStaffList) {
this.attendanceGroupStaffList = data.entity.attendanceGroupStaffList; this.attendanceGroupStaffList = data.entity.attendanceGroupStaffList;
} }
return data return data;
}, },
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.allReset() this.allReset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="attendance/group/edit"; this.urls.currUrl = "attendance/group/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type = "edit";
this.open = true; this.open = true;
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.allReset() this.allReset();
this.urls.currUrl = "attendance/group/add"; this.urls.currUrl = "attendance/group/add";
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type = "add";
this.open = true; this.open = true;
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.allReset() this.allReset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="attendance/group/view"; this.urls.currUrl = "attendance/group/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type = "view";
}, },
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
console.log(this.form,'返回数据') console.log(this.form, "返回数据");
this.dealDic() this.dealDic();
let {attendanceGroupStaffList,groupName,type,attendanceType,groupFixedworkEntity,groupResponsibleEntity,attendanceGroupFreeworkEntity,id} = this.form let {
attendanceGroupStaffList,
if(id){ groupName,
this.setParams.id = id type,
} attendanceType,
if(attendanceGroupStaffList){ groupFixedworkEntity,
this.attendanceGroupStaffList = attendanceGroupStaffList//参与考勤的人 groupResponsibleEntity,
attendanceGroupFreeworkEntity,
id,
} = this.form;
if (id) {
this.setParams.id = id;
}
if (attendanceGroupStaffList) {
this.attendanceGroupStaffList = attendanceGroupStaffList; //参与考勤的人
} }
//固定班制 //固定班制
if(groupFixedworkEntity){ if (groupFixedworkEntity) {
this.groupFixedworkEntity = groupFixedworkEntity this.groupFixedworkEntity = groupFixedworkEntity;
let week = ['monday','tuesday','wednesday','thursday','friday','saturday','sunday'] let week = [
for(let value of week){ "monday",
if(this.groupFixedworkEntity[value]){ "tuesday",
this.classArr.map(item => { "wednesday",
if(item.id === this.groupFixedworkEntity[value+'ClassId']){ "thursday",
this.groupFixedworkEntity[value+'ClassTime'] = item "friday",
} "saturday",
}) "sunday",
}else{ ];
this.groupFixedworkEntity[value+'ClassTime'] = [] for (let value of week) {
} if (this.groupFixedworkEntity[value]) {
} this.classArr.map((item) => {
this.cancelBanci() if (item.id === this.groupFixedworkEntity[value + "ClassId"]) {
this.holidays = groupFixedworkEntity.holidays this.groupFixedworkEntity[value + "ClassTime"] = item;
}
});
} else {
this.groupFixedworkEntity[value + "ClassTime"] = [];
}
}
this.cancelBanci();
this.holidays = groupFixedworkEntity.holidays;
} }
// 特殊日期 // 特殊日期
if(groupFixedworkEntity && groupFixedworkEntity.attendanceGroupFixedworkSpecialList){ if (
groupFixedworkEntity &&
groupFixedworkEntity.attendanceGroupFixedworkSpecialList
) {
// 固定班制 // 固定班制
this.noneedDakaObj = groupFixedworkEntity.attendanceGroupFixedworkSpecialList.find(item => item.must === 0) this.noneedDakaObj = groupFixedworkEntity.attendanceGroupFixedworkSpecialList.find(
this.mustDakaObj = groupFixedworkEntity.attendanceGroupFixedworkSpecialList.find(item => item.must === 1) (item) => item.must === 0
);
this.mustDakaObj = groupFixedworkEntity.attendanceGroupFixedworkSpecialList.find(
(item) => item.must === 1
);
} }
// 自由工时 // 自由工时
if(attendanceGroupFreeworkEntity){ if (attendanceGroupFreeworkEntity) {
this.attendanceGroupFreeworkEntity = attendanceGroupFreeworkEntity this.attendanceGroupFreeworkEntity = attendanceGroupFreeworkEntity;
this.holidays = attendanceGroupFreeworkEntity.holidays this.holidays = attendanceGroupFreeworkEntity.holidays;
} }
if(attendanceGroupFreeworkEntity && attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList){ if (
attendanceGroupFreeworkEntity &&
this.noneedDakaObj = attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList.find(item => item.must === 0) attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList
this.mustDakaObj = attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList.find(item => item.must === 1) ) {
this.noneedDakaObj = attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList.find(
(item) => item.must === 0
);
this.mustDakaObj = attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList.find(
(item) => item.must === 1
);
} }
//负责人 //负责人
if(groupResponsibleEntity){ if (groupResponsibleEntity) {
this.groupResponsibleEntity = groupResponsibleEntity this.groupResponsibleEntity = groupResponsibleEntity;
this.groupResponsibleEntity.responsibleId = this.groupResponsibleEntity.responsibleId.toString() this.groupResponsibleEntity.responsibleId = this.groupResponsibleEntity.responsibleId.toString();
} }
// 处理考勤人回显 // 处理考勤人回显
this.attendArrId = this.attendanceGroupStaffList.map(item => item.staffId) this.attendArrId = this.attendanceGroupStaffList.map(
this.attendArr = this.attendanceGroupStaffList (item) => item.staffId
this.setParams.groupName = groupName//考勤组名称 );
this.setParams.type = type//考勤类型 this.attendArr = this.attendanceGroupStaffList;
this.setParams.attendanceType = attendanceType//打卡类型 this.setParams.groupName = groupName; //考勤组名称
this.setParams.type = type; //考勤类型
this.setParams.attendanceType = attendanceType; //打卡类型
}, },
afterSubmit(data) { afterSubmit(data) {
this.open = false; this.open = false;
this.allReset() this.allReset();
this.$emit("ok",true); this.$emit("ok", true);
}, },
// 处理字典 // 处理字典
dealDic(){ dealDic() {
this.attendanceType = [] this.attendanceType = [];
this.classArr = this.dict.classId this.classArr = this.dict.classId;
this.responsiableList = this.dict.workMan this.responsiableList = this.dict.workMan;
this.areaData = this.dict.deptId this.areaData = this.dict.deptId;
for(let key in this.dict.attendanceType){ for (let key in this.dict.attendanceType) {
let obj = { let obj = {
label:this.dict.attendanceType[key], label: this.dict.attendanceType[key],
value:key value: key,
} };
this.attendanceType.push(obj) this.attendanceType.push(obj);
} }
// 类型 // 类型
let typearr = [] let typearr = [];
for(let key in this.dict.type){ for (let key in this.dict.type) {
let obj = { let obj = {
label:this.dict.type[key], label: this.dict.type[key],
value:Number(key) value: Number(key),
} };
typearr.push(obj) typearr.push(obj);
} }
typearr.forEach((item,index) => { typearr.forEach((item, index) => {
let res = this.paibanType.filter(item1 => item1.label.indexOf(item.label) != -1) let res = this.paibanType.filter(
if(res.length>0){ (item1) => item1.label.indexOf(item.label) != -1
res[0].value = typearr[index].value );
if (res.length > 0) {
res[0].value = typearr[index].value;
} }
}) });
}, },
// ---- 班次选择 ------- // ---- 班次选择 -------
// 当前班次选择 // 当前班次选择
saveRowBanci(val){ saveRowBanci(val) {
this.groupFixedworkEntity[this.currentWorkName+'ClassId'] = val.id//存储班次id this.groupFixedworkEntity[this.currentWorkName + "ClassId"] = val.id; //存储班次id
this.groupFixedworkEntity[this.currentWorkName+'ClassName'] = val.className//存储班次名称 this.groupFixedworkEntity[this.currentWorkName + "ClassName"] =
val.className; //存储班次名称
// this.groupFixedworkEntity[this.currentWorkName+'ClassTime'] = val // this.groupFixedworkEntity[this.currentWorkName+'ClassTime'] = val
this.$set( this.$set(
this.groupFixedworkEntity, this.groupFixedworkEntity,
this.currentWorkName+'ClassTime', this.currentWorkName + "ClassTime",
val val
) );
console.log(this.groupFixedworkEntity[this.currentWorkName+'ClassTime'],'当前更改') console.log(
this.cancelBanci() this.groupFixedworkEntity[this.currentWorkName + "ClassTime"],
"当前更改"
);
this.cancelBanci();
}, },
// 固定班制 ---- 触发班次选择 // 固定班制 ---- 触发班次选择
changeBanci(row){ changeBanci(row) {
this.currentWorkName = row this.currentWorkName = row;
this.currentselectBanciRow = JSON.parse(JSON.stringify(this.groupFixedworkEntity[this.currentWorkName+'ClassTime'])) this.currentselectBanciRow = JSON.parse(
this.isshowBanci = true JSON.stringify(
this.groupFixedworkEntity[this.currentWorkName + "ClassTime"]
)
);
this.isshowBanci = true;
}, },
// 置空 // 置空
cancelBanci(){ cancelBanci() {
this.isshowBanci = false this.isshowBanci = false;
this.currentselectBanciRow = null this.currentselectBanciRow = null;
}, },
// ----end ---- // ----end ----
// ----- 特殊日期选择 ---- // ----- 特殊日期选择 ----
// 删除必须 // 删除必须
deleteSpecal(from){ deleteSpecal(from) {
if(from == 'must'){ if (from == "must") {
this.mustDakaObj = null this.mustDakaObj = null;
}else{ } else {
this.noneedDakaObj = null this.noneedDakaObj = null;
} }
}, },
// 新增必须打卡 --- 触发班次 // 新增必须打卡 --- 触发班次
setMustTimes(from){ setMustTimes(from) {
if(from == 'must' && !this.mustDakaObj){ if (from == "must" && !this.mustDakaObj) {
this.mustDakaObj = { this.mustDakaObj = {
must:1,//必需打卡 must: 1, //必需打卡
specialStartTime:'',//时间段 specialStartTime: "", //时间段
specialEndTime:'',// specialEndTime: "", //
specialTime:'',//必须打卡日期 specialTime: "", //必须打卡日期
addWay:0,//日期还是时间段 addWay: 0, //日期还是时间段
classId:'', classId: "",
classArr:{} classArr: {},
} };
}else if (from == 'noneed' && !this.noneedDakaObj){ } else if (from == "noneed" && !this.noneedDakaObj) {
this.noneedDakaObj = { this.noneedDakaObj = {
must:0,//无需打卡 must: 0, //无需打卡
specialStartTime:'',//时间段 specialStartTime: "", //时间段
specialEndTime:'',// specialEndTime: "", //
specialTime:'',//必须打卡日期 specialTime: "", //必须打卡日期
addWay:0,//日期还是时间段 addWay: 0, //日期还是时间段
classId:'', classId: "",
classArr:{} classArr: {},
};
} }
if (from == "must") {
this.mustDaka = true;
this.currentParams = this.mustDakaObj;
this.currentselectBanciRow = this.currentParams.classArr;
} else {
this.currentParams = this.noneedDakaObj;
if (this.currentParams.specialStartTime) {
this.noneedRange = [
this.currentParams.specialStartTime,
this.currentParams.specialEndTime,
];
} else {
this.noneedRange = [];
}
this.noneedDaka = true;
} }
if(from == 'must'){
this.mustDaka = true
this.currentParams = this.mustDakaObj
this.currentselectBanciRow = this.currentParams.classArr
}else{
this.currentParams = this.noneedDakaObj
if(this.currentParams.specialStartTime){
this.noneedRange = [this.currentParams.specialStartTime,this.currentParams.specialEndTime]
}else{
this.noneedRange = []
}
this.noneedDaka = true
}
}, },
// 保存必须打卡 // 保存必须打卡
saveCurrentSpecial(val){ saveCurrentSpecial(val) {
this.currentParams.classArr = val this.currentParams.classArr = val;
this.currentParams.classId = val.id this.currentParams.classId = val.id;
if(!this.currentParams.specialTime){ if (!this.currentParams.specialTime) {
this.$message.error('请选择日期') this.$message.error("请选择日期");
return return;
} }
if(!this.currentParams.classId){ if (!this.currentParams.classId) {
this.$message.error('请选择班次') this.$message.error("请选择班次");
return return;
} }
if(this.noneedDakaObj){ if (this.noneedDakaObj) {
if(this.noneedDakaObj.specialTime === this.currentParams.specialTime){ if (this.noneedDakaObj.specialTime === this.currentParams.specialTime) {
this.$message.error('该日期已设置为无需打卡日,请重新选择') this.$message.error("该日期已设置为无需打卡日,请重新选择");
return return;
} }
let timeStart = Date.parse(this.noneedDakaObj.specialStartTime)//无需开始时间戳 let timeStart = Date.parse(this.noneedDakaObj.specialStartTime); //无需开始时间戳
let timeEnd = Date.parse(this.noneedDakaObj.specialEndTime)//无需结束时间戳 let timeEnd = Date.parse(this.noneedDakaObj.specialEndTime); //无需结束时间戳
let mustTime = Date.parse(this.currentParams.specialTime)//必须时间戳 let mustTime = Date.parse(this.currentParams.specialTime); //必须时间戳
if(mustTime >= timeStart && mustTime <= timeEnd){ if (mustTime >= timeStart && mustTime <= timeEnd) {
this.$message.error('必须打卡日期不能设置在无需打卡时间段内,请重新选择') this.$message.error(
return false "必须打卡日期不能设置在无需打卡时间段内,请重新选择"
);
return false;
} }
} }
this.mustDakaObj = JSON.parse(JSON.stringify(this.currentParams)) this.mustDakaObj = JSON.parse(JSON.stringify(this.currentParams));
this.cancelSpecial() this.cancelSpecial();
}, },
// 取消当前特殊日期设置 // 取消当前特殊日期设置
cancelSpecial(){ cancelSpecial() {
this.currentParams = {} this.currentParams = {};
this.noneedRange = [] this.noneedRange = [];
this.mustDaka = false this.mustDaka = false;
this.noneedDaka = false this.noneedDaka = false;
this.currentselectBanciRow = null this.currentselectBanciRow = null;
}, },
// 无需时间段 // 无需时间段
changeneedRange(){ changeneedRange() {
if(this.noneedRange){ if (this.noneedRange) {
this.currentParams.specialStartTime = this.noneedRange[0] this.currentParams.specialStartTime = this.noneedRange[0];
this.currentParams.specialEndTime = this.noneedRange[1] this.currentParams.specialEndTime = this.noneedRange[1];
}else{ } else {
this.currentParams.specialStartTime = '' this.currentParams.specialStartTime = "";
this.currentParams.specialEndTime = '' this.currentParams.specialEndTime = "";
} }
}, },
// 保存 无需打卡 // 保存 无需打卡
saveNoneed(){ saveNoneed() {
if(this.currentParams.addWay === 0 && this.currentParams.specialTime == ''){ if (
this.$message.error('请选择日期') this.currentParams.addWay === 0 &&
return this.currentParams.specialTime == ""
} ) {
if(this.currentParams.addWay === 1 && this.currentParams.specialStartTime == ''){ this.$message.error("请选择日期");
this.$message.error('请选择时间段') return;
return }
} if (
this.currentParams.addWay === 1 &&
if(this.mustDakaObj){ this.currentParams.specialStartTime == ""
if(this.mustDakaObj.specialTime === this.currentParams.specialTime && ) {
this.mustDakaObj.specialTime != ''){ this.$message.error("请选择时间段");
this.$message.error('该日期已设置为必须打卡日,请重新选择') return;
return }
}
let timeStart = Date.parse(this.currentParams.specialStartTime)//无需开始时间戳 if (this.mustDakaObj) {
let timeEnd = Date.parse(this.currentParams.specialEndTime)//无需结束时间戳 if (
let mustTime = Date.parse(this.mustDakaObj.specialTime)//必须时间戳 this.mustDakaObj.specialTime === this.currentParams.specialTime &&
if(mustTime >= timeStart && mustTime <= timeEnd){ this.mustDakaObj.specialTime != ""
this.$message.error('无需打卡时间段内不能含有[必须打卡日期],请重新选择') ) {
return false this.$message.error("该日期已设置为必须打卡日,请重新选择");
} return;
} }
this.noneedDakaObj = JSON.parse(JSON.stringify(this.currentParams)) let timeStart = Date.parse(this.currentParams.specialStartTime); //无需开始时间戳
this.cancelSpecial() let timeEnd = Date.parse(this.currentParams.specialEndTime); //无需结束时间戳
let mustTime = Date.parse(this.mustDakaObj.specialTime); //必须时间戳
if (mustTime >= timeStart && mustTime <= timeEnd) {
this.$message.error(
"无需打卡时间段内不能含有[必须打卡日期],请重新选择"
);
return false;
}
}
this.noneedDakaObj = JSON.parse(JSON.stringify(this.currentParams));
this.cancelSpecial();
}, },
// ---- end ------- // ---- end -------
// ---- 部门-人员选择 ------ // ---- 部门-人员选择 ------
// 触发部门选择 // 触发部门选择
selectGroup(from){ selectGroup(from) {
this.selectTyep = from this.selectTyep = from;
if(this.selectTyep){ if (this.selectTyep) {
this.allSelect = this.attendArr this.allSelect = this.attendArr;
this.allSelectId = this.attendArrId this.allSelectId = this.attendArrId;
}else{ } else {
this.allSelect = this.noattendArr this.allSelect = this.noattendArr;
this.allSelectId = this.attendArrId this.allSelectId = this.attendArrId;
} }
this.isshowgroup = true this.isshowgroup = true;
}, },
// 取消选择 // 取消选择
cancelChoice(){ cancelChoice() {
this.isshowgroup = false this.isshowgroup = false;
this.currentSelect = [] this.currentSelect = [];
this.allSelect = [] this.allSelect = [];
this.allSelectId = [] this.allSelectId = [];
this.CurrentAllchecked = false this.CurrentAllchecked = false;
}, },
// 确定当前选择 // 确定当前选择
saveBtnchoice(){ saveBtnchoice() {
this.CurrentAllchecked = false this.CurrentAllchecked = false;
if(this.selectTyep){ if (this.selectTyep) {
this.attendArr = this.allSelect this.attendArr = this.allSelect;
this.attendArrId = this.allSelectId this.attendArrId = this.allSelectId;
// 参与考勤 // 参与考勤
}else{ } else {
// 不参与考勤 // 不参与考勤
this.noattendArr = this.allSelect this.noattendArr = this.allSelect;
this.attendArrId = this.allSelectId this.attendArrId = this.allSelectId;
} }
this.cancelChoice() this.cancelChoice();
}, },
// 单独选择 // 单独选择
changegroupId(val){ changegroupId(val) {
let value let value;
if(val){ if (val) {
// id // id
value = this.allSelectId.filter(item1 => !this.allSelect.some(item2 => item2.staffId === item1)) value = this.allSelectId.filter(
let obj = this.currentSelect.find(item => item.staffId === value[0]) (item1) => !this.allSelect.some((item2) => item2.staffId === item1)
this.allSelect.push(obj) );
}else{ let obj = this.currentSelect.find((item) => item.staffId === value[0]);
this.allSelect.push(obj);
} else {
// 对象 // 对象
value = this.allSelect.filter(item1 => !this.allSelectId.some(item2 => item2 === item1.staffId)) value = this.allSelect.filter(
let index = this.allSelect.findIndex(item => item.staffId == value[0].staffId) (item1) => !this.allSelectId.some((item2) => item2 === item1.staffId)
this.allSelect.splice(index,1) );
} let index = this.allSelect.findIndex(
this.CurrentAllchecked = this.currentSelect.every(val => this.allSelectId.includes(val.staffId)) (item) => item.staffId == value[0].staffId
console.log(value,'当前选择值') );
this.allSelect.splice(index, 1);
}
this.CurrentAllchecked = this.currentSelect.every((val) =>
this.allSelectId.includes(val.staffId)
);
console.log(value, "当前选择值");
}, },
// 点击触发 // 点击触发
handleNodeClickBumen(val){ handleNodeClickBumen(val) {
if(this.selectTyep){ if (this.selectTyep) {
} else {
}else{
} }
this.currentSelect = val.personList//人员信息 this.currentSelect = val.personList; //人员信息
// 判断当前是不是全选 // 判断当前是不是全选
this.CurrentAllchecked = this.currentSelect.every(val => this.allSelectId.includes(val.staffId)) this.CurrentAllchecked = this.currentSelect.every((val) =>
this.allSelectId.includes(val.staffId)
);
}, },
// 全选操作 // 全选操作
currentChangeAll(){ currentChangeAll() {
if(this.CurrentAllchecked){ if (this.CurrentAllchecked) {
// 当前全选 // 当前全选
let arr1 = this.currentSelect.filter(item => !this.allSelect.some(item2 => item2 === item)) let arr1 = this.currentSelect.filter(
(item) => !this.allSelect.some((item2) => item2 === item)
);
this.allSelect = [...this.allSelect,...arr1]//渲染列表 this.allSelect = [...this.allSelect, ...arr1]; //渲染列表
let arr2 = this.currentSelect.filter(item1 => !this.allSelectId.some(item2 => item2 === item1.staffId)) let arr2 = this.currentSelect.filter(
(item1) => !this.allSelectId.some((item2) => item2 === item1.staffId)
);
this.allSelectId = [...this.allSelectId,...arr2.map(item=>item.staffId)]//id信息 this.allSelectId = [
}else{ ...this.allSelectId,
...arr2.map((item) => item.staffId),
]; //id信息
} else {
//取消当前全选 //取消当前全选
this.allSelect = this.allSelect.filter(item1 => !this.currentSelect.some(item2 => item2 === item1)) this.allSelect = this.allSelect.filter(
(item1) => !this.currentSelect.some((item2) => item2 === item1)
);
this.allSelectId = this.allSelectId.filter(item1 => !this.currentSelect.some(item2 => item2.staffId === item1)) this.allSelectId = this.allSelectId.filter(
(item1) =>
!this.currentSelect.some((item2) => item2.staffId === item1)
);
} }
}, },
// 删除某个选择 // 删除某个选择
deleteOne(index){ deleteOne(index) {
this.allSelect.splice(index,1) this.allSelect.splice(index, 1);
this.allSelectId.splice(index,1) this.allSelectId.splice(index, 1);
this.CurrentAllchecked = this.currentSelect.every(val => this.allSelectId.includes(val.staffId)) //判断全选 this.CurrentAllchecked = this.currentSelect.every((val) =>
this.allSelectId.includes(val.staffId)
); //判断全选
}, },
// ---- end ------- // ---- end -------
// 考勤方式发生改变 -置空其他类别选项 // 考勤方式发生改变 -置空其他类别选项
changeRadio(){ changeRadio() {
// 自由工时置空 // 自由工时置空
for(let key in this.attendanceGroupFreeworkEntity){ for (let key in this.attendanceGroupFreeworkEntity) {
this.attendanceGroupFreeworkEntity[key] = 0 this.attendanceGroupFreeworkEntity[key] = 0;
} }
this.attendanceGroupFreeworkEntity.workTime = '' this.attendanceGroupFreeworkEntity.workTime = "";
this.attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList = [] this.attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList = [];
// 固定班制置空 // 固定班制置空
for(let key in this.groupFixedworkEntity){ for (let key in this.groupFixedworkEntity) {
this.groupFixedworkEntity[key] = '' this.groupFixedworkEntity[key] = "";
} }
for(let item of this.typeList){ for (let item of this.typeList) {
this.groupFixedworkEntity[item.value] = 0 this.groupFixedworkEntity[item.value] = 0;
this.groupFixedworkEntity[item.value+'ClassTime'] = [] this.groupFixedworkEntity[item.value + "ClassTime"] = [];
this.groupFixedworkEntity[item.value+'ClassName'] = '' this.groupFixedworkEntity[item.value + "ClassName"] = "";
this.groupFixedworkEntity[item.value+'ClassId'] = '' this.groupFixedworkEntity[item.value + "ClassId"] = "";
} }
this.attendanceGroupFixedworkSpecialList = [] this.attendanceGroupFixedworkSpecialList = [];
}, },
// 触发对应流程设置 // 触发对应流程设置
drawershow(from){ drawershow(from) {
switch(from){ switch (from) {
case 'drawer1': case "drawer1":
this.drawer = true this.drawer = true;
this.drawer1 = true this.drawer1 = true;
break; break;
case 'drawer2': case "drawer2":
this.drawer = true this.drawer = true;
this.drawer2 = true this.drawer2 = true;
break; break;
case 'drawer3': case "drawer3":
this.drawer = true this.drawer = true;
this.drawer3 = true this.drawer3 = true;
break; break;
case 'drawer4': case "drawer4":
this.drawer = true this.drawer = true;
this.drawer4 = true this.drawer4 = true;
break; break;
default: default:
break; break;
} }
}, },
// 关闭流程设置 // 关闭流程设置
closedrawer(){ closedrawer() {
this.drawer = false this.drawer = false;
this.drawer1 = false this.drawer1 = false;
this.drawer2 = false this.drawer2 = false;
this.drawer3 = false this.drawer3 = false;
this.drawer4 = false this.drawer4 = false;
}, },
// 全部置空 // 全部置空
allReset(){ allReset() {
// 置空无关项 // 置空无关项
this.changeRadio() this.changeRadio();
// 先大概处理 // 先大概处理
for(let key in this.setParams){ for (let key in this.setParams) {
this.setParams[key] = '' this.setParams[key] = "";
} }
this.setParams.attendanceGroupStaffList = [] this.setParams.attendanceGroupStaffList = [];
this.attendArr = [] this.attendArr = [];
this.attendArrId = [] this.attendArrId = [];
this.allSelectId = [] this.allSelectId = [];
this.allSelect = [] this.allSelect = [];
this.currentSelect = [] this.currentSelect = [];
this.cancelBanci() this.cancelBanci();
}, },
// 提交保存 // 提交保存
saveSetform(){ saveSetform() {
// 校验 考勤组名称、参与考勤人员、考勤组负责人、 // 校验 考勤组名称、参与考勤人员、考勤组负责人、
// 考勤时间 固定班制 -- 校验 排班是否设置 排班id 日期是否参与考勤 // 考勤时间 固定班制 -- 校验 排班是否设置 排班id 日期是否参与考勤
// 自由时间 -- 是否参与考勤 工作时长 // 自由时间 -- 是否参与考勤 工作时长
// 排班制 -- 不确定 // 排班制 -- 不确定
// ---- 基础判断 --- // ---- 基础判断 ---
if(this.setParams.groupName === ''){ if (this.setParams.groupName === "") {
this.$message.error('请输入考勤组名称') this.$message.error("请输入考勤组名称");
return return;
} }
if(this.attendArr.length<1){ if (this.attendArr.length < 1) {
this.$message.error('请设置参与考勤人员') this.$message.error("请设置参与考勤人员");
return return;
} }
if(this.groupResponsibleEntity.responsibleId == ''){ if (this.groupResponsibleEntity.responsibleId == "") {
this.$message.error('请设置考勤负责人') this.$message.error("请设置考勤负责人");
return return;
} }
if(this.setParams.type === ''){ if (this.setParams.type === "") {
this.$message.error('请设置考勤方式') this.$message.error("请设置考勤方式");
return return;
} }
if(this.setParams.attendanceType === ''){ if (this.setParams.attendanceType === "") {
this.$message.error('请设置打卡方式') this.$message.error("请设置打卡方式");
return false return false;
} }
// -----end --- // -----end ---
// 处理特殊日期 // 处理特殊日期
if(this.mustDakaObj){ if (this.mustDakaObj) {
this.attendanceGroupFixedworkSpecialList.push(this.mustDakaObj) this.attendanceGroupFixedworkSpecialList.push(this.mustDakaObj);
} }
if(this.noneedDakaObj){ if (this.noneedDakaObj) {
this.attendanceGroupFixedworkSpecialList.push(this.noneedDakaObj) this.attendanceGroupFixedworkSpecialList.push(this.noneedDakaObj);
} }
// ---- 根据类型判断 --- // ---- 根据类型判断 ---
// 固定班制校验 // 固定班制校验
if(this.setParams.type == 1){ if (this.setParams.type == 1) {
for(let item of this.typeList){ for (let item of this.typeList) {
if(this.groupFixedworkEntity[item.value] && !this.groupFixedworkEntity[item.value+'ClassId']){ if (
this.$message.error(`${item.name} 考勤班次未设置`) this.groupFixedworkEntity[item.value] &&
return false !this.groupFixedworkEntity[item.value + "ClassId"]
) {
this.$message.error(`${item.name} 考勤班次未设置`);
return false;
} }
} }
} }
// 自由工时校验 // 自由工时校验
if(this.setParams.type == 3){ if (this.setParams.type == 3) {
if(this.attendanceGroupFreeworkEntity.workTime == '' ){ if (this.attendanceGroupFreeworkEntity.workTime == "") {
this.$message.error('请设置工作时长') this.$message.error("请设置工作时长");
return false return false;
} }
} }
// ---- end ---- // ---- end ----
// ---- 处理数据 ---- // ---- 处理数据 ----
if(this.attendArr.length > 0){ if (this.attendArr.length > 0) {
this.setParams.attendanceGroupStaffList = this.attendArr.map(item => { this.setParams.attendanceGroupStaffList = this.attendArr.map((item) => {
return{ return {
staffId:item.staffId, staffId: item.staffId,
staffName:item.staffName staffName: item.staffName,
} };
}) });
} }
if(this.groupResponsibleEntity.responsibleId){ if (this.groupResponsibleEntity.responsibleId) {
// 给负责人进行赋值 // 给负责人进行赋值
this.groupResponsibleEntity.responsibleName = this.responsiableList[this.groupResponsibleEntity.responsibleId] this.groupResponsibleEntity.responsibleName = this.responsiableList[
this.groupResponsibleEntity.responsibleId
];
} }
// 固定工时 // 固定工时
if(this.setParams.type == 1){ if (this.setParams.type == 1) {
if(this.attendanceGroupFixedworkSpecialList&&this.attendanceGroupFixedworkSpecialList.length>0){ if (
this.groupFixedworkEntity.attendanceGroupFixedworkSpecialList = this.attendanceGroupFixedworkSpecialList &&
this.attendanceGroupFixedworkSpecialList//特殊日期设置 this.attendanceGroupFixedworkSpecialList.length > 0
) {
this.groupFixedworkEntity.attendanceGroupFixedworkSpecialList = this.attendanceGroupFixedworkSpecialList; //特殊日期设置
} }
this.setParams.groupFixedworkEntity = this.groupFixedworkEntity this.setParams.groupFixedworkEntity = this.groupFixedworkEntity;
if(this.setParams.hasOwnProperty('attendanceGroupFreeworkEntity')){ if (this.setParams.hasOwnProperty("attendanceGroupFreeworkEntity")) {
delete this.setParams.attendanceGroupFreeworkEntity delete this.setParams.attendanceGroupFreeworkEntity;
} }
} }
// 自由工时 // 自由工时
if(this.setParams.type == 3){ if (this.setParams.type == 3) {
if(this.attendanceGroupFixedworkSpecialList && this.attendanceGroupFixedworkSpecialList.length>0){ if (
this.attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList = this.attendanceGroupFixedworkSpecialList &&
this.attendanceGroupFixedworkSpecialList//特殊日期 this.attendanceGroupFixedworkSpecialList.length > 0
) {
this.attendanceGroupFreeworkEntity.attendanceGroupFreeworkSpecialList = this.attendanceGroupFixedworkSpecialList; //特殊日期
} }
this.setParams.attendanceGroupFreeworkEntity = this.attendanceGroupFreeworkEntity this.setParams.attendanceGroupFreeworkEntity = this.attendanceGroupFreeworkEntity;
if(this.setParams.hasOwnProperty('groupFixedworkEntity')){ if (this.setParams.hasOwnProperty("groupFixedworkEntity")) {
delete this.setParams.groupFixedworkEntity delete this.setParams.groupFixedworkEntity;
} }
} }
// 考勤负责人 // 考勤负责人
this.setParams.groupResponsibleEntity = this.groupResponsibleEntity this.setParams.groupResponsibleEntity = this.groupResponsibleEntity;
// ----- end ---- // ----- end ----
this.$post(this.urls.saveUrl || this.pageInfo.saveUrl,this.setParams).then(res => { this.$post(
if(res.code == 1){ this.urls.saveUrl || this.pageInfo.saveUrl,
this.afterSubmit() this.setParams
).then((res) => {
if (res.code == 1) {
this.afterSubmit();
} }
}) });
}, },
}, },
computed:{ computed: {
persons(){ persons() {
let arrName = this.attendArr.map(item => item.staffName) let arrName = this.attendArr.map((item) => item.staffName);
return arrName.join(',') return arrName.join(",");
} },
}, },
data() { data() {
return { return {
open:false, open: false,
activeName:'/attendance/group/view', activeName: "/attendance/group/view",
thirdList:[ thirdList: [
{ {
name:'新增考勤组', name: "新增考勤组",
path:'/attendance/group/view' path: "/attendance/group/view",
} },
], ],
paibanType:[ paibanType: [
{ {
label:'固定班制(固定时间上下班)', label: "固定班制(固定时间上下班)",
value:1, value: 1,
des:'考勤组中所有人按照相同的时间打卡,适用于办公室坐班,例如朝九晚五' des:
"考勤组中所有人按照相同的时间打卡,适用于办公室坐班,例如朝九晚五",
}, },
{ {
label:'排班制(按排班上下班)', label: "排班制(按排班上下班)",
value:2, value: 2,
des:'自定义设置每人的班次,适用于工厂、门店等,例如三班倒' des: "自定义设置每人的班次,适用于工厂、门店等,例如三班倒",
}, },
{ {
label:'自由工时(不固定时间上下班)', label: "自由工时(不固定时间上下班)",
value:3, value: 3,
des:'上下班时间不固定,可随时打卡,适用于销售以及装修、家政等计时工' des: "上下班时间不固定,可随时打卡,适用于销售以及装修、家政等计时工",
} },
], ],
typeList:[ typeList: [
{ {
name:'周一', name: "周一",
value:'monday' value: "monday",
}, },
{ {
name:'周二', name: "周二",
value:'tuesday' value: "tuesday",
}, },
{ {
name:'周三', name: "周三",
value:'wednesday' value: "wednesday",
}, },
{ {
name:'周四', name: "周四",
value:'thursday' value: "thursday",
}, },
{ {
name:'周五', name: "周五",
value:'friday' value: "friday",
}, },
{ {
name:'周六', name: "周六",
value:'saturday' value: "saturday",
}, },
{ {
name:'周日', name: "周日",
value:'sunday' value: "sunday",
} },
], ],
classArr:[],//公共字典 - 班次选择 classArr: [], //公共字典 - 班次选择
attendanceType:[],//打卡类型 - 公共字典 attendanceType: [], //打卡类型 - 公共字典
areaData:[],//部门信息 - 公共字典 areaData: [], //部门信息 - 公共字典
responsiableList:[],//负责人选择 -公共字典 responsiableList: [], //负责人选择 -公共字典
// 当前选择员工 // 当前选择员工
currentSelect:[], currentSelect: [],
// 员工总表 // 员工总表
allSelect:[],//选择的列表 allSelect: [], //选择的列表
allSelectId:[],//选择的id allSelectId: [], //选择的id
CurrentAllchecked:false, CurrentAllchecked: false,
// 存储当前参与考勤人员 // 存储当前参与考勤人员
attendArr:[], attendArr: [],
attendArrId:[], attendArrId: [],
// 存储当前不参与考勤人员 // 存储当前不参与考勤人员
noattendArr:[], noattendArr: [],
noattendArrIc:[], noattendArrIc: [],
selectTyep:'',//选择人员类型 true参与考勤人员//false不参与考勤人员 selectTyep: "", //选择人员类型 true参与考勤人员//false不参与考勤人员
drawer1:false, drawer1: false,
drawer2:false, drawer2: false,
drawer3:false, drawer3: false,
drawer4:false, drawer4: false,
drawer:false, drawer: false,
isshowBanci:false,//班次展示 isshowBanci: false, //班次展示
isshowgroup:false,//人员选择 isshowgroup: false, //人员选择
mustDaka:false,//必须打卡设置 mustDaka: false, //必须打卡设置
noneedDaka:false,//无需打卡 noneedDaka: false, //无需打卡
setParams:{ setParams: {
groupName:'',//考勤名称 groupName: "", //考勤名称
attendanceGroupStaffList:[],//参与考勤人员 attendanceGroupStaffList: [], //参与考勤人员
type:'',//考勤方式 type: "", //考勤方式
attendanceType:'',//打卡类型 attendanceType: "", //打卡类型
}, },
// 考勤赋值 // 考勤赋值
groupResponsibleEntity:{ groupResponsibleEntity: {
responsibleId:'',//考勤负责人 responsibleId: "", //考勤负责人
responsibleName:''//考勤负责人姓名 responsibleName: "", //考勤负责人姓名
}, },
type:[], type: [],
currentselectBanciRow:'',//当前班次 currentselectBanciRow: "", //当前班次
// 当前工作日名称 // 当前工作日名称
currentWorkName:'', currentWorkName: "",
noneedRange:[],//时间段选择 noneedRange: [], //时间段选择
// 当前特殊日期 // 当前特殊日期
currentParams:{}, currentParams: {},
// 自由工时配置 // 自由工时配置
attendanceGroupFreeworkEntity:{ attendanceGroupFreeworkEntity: {
monday:0, monday: 0,
tuesday:0, tuesday: 0,
wednesday:0, wednesday: 0,
thursday:0, thursday: 0,
friday:0, friday: 0,
saturday:0, saturday: 0,
sunday:0, sunday: 0,
workTime:'', workTime: "",
// attendanceGroupFreeworkSpecialList:[] // attendanceGroupFreeworkSpecialList:[]
}, },
//固定班制 //固定班制
groupFixedworkEntity:{ groupFixedworkEntity: {
monday:0,//是否考勤(0.否,1,是) monday: 0, //是否考勤(0.否,1,是)
mondayClassId:'', mondayClassId: "",
mondayClassName:'', mondayClassName: "",
mondayClassTime:[],//便于选择-传参删除 mondayClassTime: [], //便于选择-传参删除
tuesday:0,//是否考勤(0.否,1,是) tuesday: 0, //是否考勤(0.否,1,是)
tuesdayClassId:'', tuesdayClassId: "",
tuesdayClassName:'', tuesdayClassName: "",
tuesdayClassTime:[],//便于选择-传参删除 tuesdayClassTime: [], //便于选择-传参删除
wednesday:0,//是否考勤(0.否,1,是) wednesday: 0, //是否考勤(0.否,1,是)
wednesdayClassId:'', wednesdayClassId: "",
wednesdayClassName:'', wednesdayClassName: "",
wednesdayClassTime:[],//便于选择-传参删除 wednesdayClassTime: [], //便于选择-传参删除
thursday:0,//是否考勤(0.否,1,是) thursday: 0, //是否考勤(0.否,1,是)
thursdayClassId:'', thursdayClassId: "",
thursdayClassName:'', thursdayClassName: "",
thursdayClassTime:[], thursdayClassTime: [],
friday:0,//是否考勤(0.否,1,是) friday: 0, //是否考勤(0.否,1,是)
fridayClassId:'', fridayClassId: "",
fridayClassName:'', fridayClassName: "",
fridayClassTime:'',//便于选择-传参删除 fridayClassTime: "", //便于选择-传参删除
saturday:0,//是否考勤(0.否,1,是) saturday: 0, //是否考勤(0.否,1,是)
saturdayClassId:'', saturdayClassId: "",
saturdayClassName:'', saturdayClassName: "",
saturdayClassTime:[],//便于选择-传参删除 saturdayClassTime: [], //便于选择-传参删除
sunday:0,//是否考勤(0.否,1,是) sunday: 0, //是否考勤(0.否,1,是)
sundayClassId:'', sundayClassId: "",
sundayClassName:'', sundayClassName: "",
sundayClassTime:[],//便于选择-传参删除 sundayClassTime: [], //便于选择-传参删除
holidays:"", holidays: "",
// attendanceGroupFixedworkSpecialList:[], // attendanceGroupFixedworkSpecialList:[],
}, },
holidays:0,// 假期排休 法定节假日自动排休(0.否,1.是) holidays: 0, // 假期排休 法定节假日自动排休(0.否,1.是)
// 公共 - 特殊日期设置 // 公共 - 特殊日期设置
attendanceGroupFixedworkSpecialList:[], attendanceGroupFixedworkSpecialList: [],
// 必须打卡日期 // 必须打卡日期
mustDakaObj:{ mustDakaObj: {
must:1,//必需打卡 must: 1, //必需打卡
specialStartTime:'',//时间段 specialStartTime: "", //时间段
specialEndTime:'',// specialEndTime: "", //
specialTime:'',//必须打卡日期 specialTime: "", //必须打卡日期
addWay:0,//日期还是时间段 addWay: 0, //日期还是时间段
classId:'', classId: "",
classArr:{} classArr: {},
}, },
// 无需打卡日期 // 无需打卡日期
noneedDakaObj:{ noneedDakaObj: {
must:0,//无需打卡 must: 0, //无需打卡
specialStartTime:'',//时间段 specialStartTime: "", //时间段
specialEndTime:'',// specialEndTime: "", //
specialTime:'',//必须打卡日期 specialTime: "", //必须打卡日期
addWay:0,//日期还是时间段 addWay: 0, //日期还是时间段
classId:'', classId: "",
classArr:{} classArr: {},
} },
} };
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
.container{ .container {
font-size: 15px; font-size: 15px;
} }
.labelClass{ .labelClass {
width: 200px; width: 200px;
} }
.el-descriptions__body{ .el-descriptions__body {
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
color: #606266; color: #606266;
background-color: #FFF; background-color: #fff;
} }
.contentClass{ .contentClass {
width: 600px; width: 600px;
} }
.titles{ .titles {
color: #409EFF; color: #409eff;
font-size: 16px; font-size: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.titles::before{ .titles::before {
content: ''; content: "";
width:6px; width: 6px;
height: 16px; height: 16px;
background-color: #409EFF; background-color: #409eff;
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
} }
.tips{ .tips {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
......
...@@ -453,15 +453,16 @@ export default { ...@@ -453,15 +453,16 @@ export default {
: ""; : "";
} }
this.form.checkResult = 1; this.form.checkResult = 1;
this.form.view = "核查";
this.$post("/perform/rules/list", { this.$post("/perform/rules/list", {
page: 1, page: 1,
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
});
this.form.view = "核查";
this.open = true; this.open = true;
});
} }
); );
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
......
...@@ -492,7 +492,7 @@ export default { ...@@ -492,7 +492,7 @@ export default {
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
}); });
this.form.view = "核查"; this.form.view = "核查";
this.open = true; this.open = true;
......
...@@ -465,7 +465,7 @@ export default { ...@@ -465,7 +465,7 @@ export default {
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
}); });
this.form.view = "核查"; this.form.view = "核查";
this.open = true; this.open = true;
......
...@@ -458,7 +458,7 @@ export default { ...@@ -458,7 +458,7 @@ export default {
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
}); });
this.form.view = "核查"; this.form.view = "核查";
this.open = true; this.open = true;
......
...@@ -457,7 +457,7 @@ export default { ...@@ -457,7 +457,7 @@ export default {
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
}); });
this.form.view = "核查"; this.form.view = "核查";
this.open = true; this.open = true;
......
...@@ -458,7 +458,7 @@ export default { ...@@ -458,7 +458,7 @@ export default {
size: -1, size: -1,
categoryId: this.form.categoryId, categoryId: this.form.categoryId,
}).then((res) => { }).then((res) => {
this.ruleArr = res.data.data; this.kaoqinArr = res.data.data;
}); });
this.form.view = "核查"; this.form.view = "核查";
this.open = true; this.open = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment