|
@@ -3,10 +3,10 @@
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="95px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="95px">
|
|
<el-form-item label="考勤组名称" prop="name">
|
|
<el-form-item label="考勤组名称" prop="name">
|
|
<el-input
|
|
<el-input
|
|
- v-model="queryParams.name"
|
|
|
|
- placeholder="请输入考勤组名称"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
|
+ v-model="queryParams.name"
|
|
|
|
+ placeholder="请输入考勤组名称"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -18,47 +18,47 @@
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleAdd"
|
|
|
|
- v-hasPermi="['park:attendGroup:add']"
|
|
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleAdd"
|
|
|
|
+ v-hasPermi="['park:attendGroup:add']"
|
|
>新增
|
|
>新增
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
- type="success"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="single"
|
|
|
|
- @click="handleUpdate"
|
|
|
|
- v-hasPermi="['park:attendGroup:edit']"
|
|
|
|
|
|
+ type="success"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="single"
|
|
|
|
+ @click="handleUpdate"
|
|
|
|
+ v-hasPermi="['park:attendGroup:edit']"
|
|
>修改
|
|
>修改
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
- type="danger"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="multiple"
|
|
|
|
- @click="handleDelete"
|
|
|
|
- v-hasPermi="['park:attendGroup:remove']"
|
|
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="multiple"
|
|
|
|
+ @click="handleDelete"
|
|
|
|
+ v-hasPermi="['park:attendGroup:remove']"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
- type="warning"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleExport"
|
|
|
|
- v-hasPermi="['park:attendGroup:export']"
|
|
|
|
|
|
+ type="warning"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ v-hasPermi="['park:attendGroup:export']"
|
|
>导出
|
|
>导出
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -78,19 +78,28 @@
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['park:attendGroup:edit']"
|
|
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
|
+ @click="addAttendUsr(scope.row)"
|
|
|
|
+ v-hasPermi="['park:attendGroup:edit']"
|
|
|
|
+ >
|
|
|
|
+ 添加考勤人员
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
|
+ v-hasPermi="['park:attendGroup:edit']"
|
|
>修改
|
|
>修改
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
|
- v-hasPermi="['park:attendGroup:remove']"
|
|
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['park:attendGroup:remove']"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -98,11 +107,11 @@
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
<pagination
|
|
- v-show="total>0"
|
|
|
|
- :total="total"
|
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
|
|
+ v-show="total>0"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
|
+ @pagination="getList"
|
|
/>
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改考勤组对话框 -->
|
|
<!-- 添加或修改考勤组对话框 -->
|
|
@@ -115,9 +124,9 @@
|
|
<div class="time-range-wrap">
|
|
<div class="time-range-wrap">
|
|
<div class="time-range-item" v-for="(item, index) in form.timeRange" :key="index">
|
|
<div class="time-range-item" v-for="(item, index) in form.timeRange" :key="index">
|
|
<el-time-select
|
|
<el-time-select
|
|
- placeholder="起始时间"
|
|
|
|
- v-model="item.start"
|
|
|
|
- :picker-options="{
|
|
|
|
|
|
+ placeholder="起始时间"
|
|
|
|
+ v-model="item.start"
|
|
|
|
+ :picker-options="{
|
|
start: '00:00',
|
|
start: '00:00',
|
|
step: '00:15',
|
|
step: '00:15',
|
|
end: '18:30'
|
|
end: '18:30'
|
|
@@ -125,9 +134,9 @@
|
|
</el-time-select>
|
|
</el-time-select>
|
|
<span>-</span>
|
|
<span>-</span>
|
|
<el-time-select
|
|
<el-time-select
|
|
- placeholder="结束时间"
|
|
|
|
- v-model="item.end"
|
|
|
|
- :picker-options="{
|
|
|
|
|
|
+ placeholder="结束时间"
|
|
|
|
+ v-model="item.end"
|
|
|
|
+ :picker-options="{
|
|
start: '08:30',
|
|
start: '08:30',
|
|
step: '00:15',
|
|
step: '00:15',
|
|
end: '23:59',
|
|
end: '23:59',
|
|
@@ -135,18 +144,18 @@
|
|
}">
|
|
}">
|
|
</el-time-select>
|
|
</el-time-select>
|
|
<el-button
|
|
<el-button
|
|
- v-if="index==0"
|
|
|
|
- :style="{color: '#00afff'}"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-circle-plus"
|
|
|
|
- @click.prevent="addTimeRange(index)"
|
|
|
|
|
|
+ v-if="index==0"
|
|
|
|
+ :style="{color: '#00afff'}"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
|
+ @click.prevent="addTimeRange(index)"
|
|
></el-button>
|
|
></el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-else
|
|
|
|
- :style="{color: 'red'}"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-remove"
|
|
|
|
- @click.prevent="removeTimeRange(index)"
|
|
|
|
|
|
+ v-else
|
|
|
|
+ :style="{color: 'red'}"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-remove"
|
|
|
|
+ @click.prevent="removeTimeRange(index)"
|
|
></el-button>
|
|
></el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -158,9 +167,9 @@
|
|
<el-input class="poly-input" placeholder="请配置考勤范围" v-model="form.poly">
|
|
<el-input class="poly-input" placeholder="请配置考勤范围" v-model="form.poly">
|
|
<template v-slot:append>
|
|
<template v-slot:append>
|
|
<el-button
|
|
<el-button
|
|
- type="text"
|
|
|
|
- icon="el-icon-map-location"
|
|
|
|
- @click.prevent="removeTimeRange()"
|
|
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-map-location"
|
|
|
|
+ @click.prevent="removeTimeRange()"
|
|
></el-button>
|
|
></el-button>
|
|
</template>
|
|
</template>
|
|
</el-input>
|
|
</el-input>
|
|
@@ -171,6 +180,21 @@
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="添加考勤组人员"
|
|
|
|
+ @closed="()=>{
|
|
|
|
+ attendUsrDialogDestroy=true;
|
|
|
|
+ }"
|
|
|
|
+ :visible.sync="attendUsrOpen"
|
|
|
|
+ width="70vw"
|
|
|
|
+ append-to-body
|
|
|
|
+ >
|
|
|
|
+ <user-select v-if="!attendUsrDialogDestroy" ref="usrSelectRef"></user-select>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="confirmSelectUsr">确 定</el-button>
|
|
|
|
+ <el-button @click="()=>{attendUsrOpen=false}">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -182,9 +206,12 @@ import {
|
|
listAttendGroup,
|
|
listAttendGroup,
|
|
updateAttendGroup
|
|
updateAttendGroup
|
|
} from "@/api/park/attendGroup";
|
|
} from "@/api/park/attendGroup";
|
|
|
|
+import UserSelect from "@/components/UsrSelect/index.vue";
|
|
|
|
+import {batchAddAttendGroupUsr} from "@/api/park/attendGroupUsr";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "AttendGroup",
|
|
name: "AttendGroup",
|
|
|
|
+ components: {UserSelect},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -205,6 +232,10 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
|
|
+ attendUsrOpen: false,
|
|
|
|
+ attendUsrDialogDestroy: false,
|
|
|
|
+ selectAttendUsr: [],
|
|
|
|
+ selectedGroup: null,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -212,7 +243,9 @@ export default {
|
|
name: null,
|
|
name: null,
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
- form: {},
|
|
|
|
|
|
+ form: {
|
|
|
|
+ timeRange: [{}]
|
|
|
|
+ },
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {}
|
|
rules: {}
|
|
};
|
|
};
|
|
@@ -327,6 +360,33 @@ export default {
|
|
removeTimeRange(index) {
|
|
removeTimeRange(index) {
|
|
this.form.timeRange.splice(index, 1);
|
|
this.form.timeRange.splice(index, 1);
|
|
},
|
|
},
|
|
|
|
+ addAttendUsr(row) {
|
|
|
|
+ this.selectedGroup = row;
|
|
|
|
+ this.attendUsrOpen = true;
|
|
|
|
+ this.attendUsrDialogDestroy = false;
|
|
|
|
+ },
|
|
|
|
+ confirmSelectUsr() {
|
|
|
|
+ this.selectAttendUsr = this.$refs.usrSelectRef.getSelectUsrs();
|
|
|
|
+ if (this.selectAttendUsr && this.selectAttendUsr.length > 0) {
|
|
|
|
+ const attendGroupUsrs = this.selectAttendUsr.map(usr => {
|
|
|
|
+ return {
|
|
|
|
+ attendGroupId: this.selectedGroup.id,
|
|
|
|
+ usrId: usr.userId,
|
|
|
|
+ usrName: usr.nickName,
|
|
|
|
+ usrDeptId: usr.deptId,
|
|
|
|
+ usrDept: usr.dept.deptName,
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ batchAddAttendGroupUsr(attendGroupUsrs).then(response => {
|
|
|
|
+ this.$modal.msgSuccess("添加成功");
|
|
|
|
+ this.attendUsrOpen = false;
|
|
|
|
+ this.attendUsrDialogDestroy = true;
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|