|
@@ -13,10 +13,11 @@
|
|
|
</a-col>
|
|
|
<a-col :xl="6" :lg="6" :md="6" :sm="6">
|
|
|
<a-form-item label="部门名称">
|
|
|
- <j-tree-select style="width: 200px" v-model="queryParam.dept" dict="sys_depart,depart_name,id"
|
|
|
- pid-field="parent_id" placeholder="请选择部门">
|
|
|
- </j-tree-select>
|
|
|
-
|
|
|
+ <a-input @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly>
|
|
|
+ <a-icon slot="prefix" type="cluster" title="部门选择控件" />
|
|
|
+ <a-icon v-if="queryParam.dept!=null&&queryParam.dept!=''" slot="suffix" type="close-circle"
|
|
|
+ @click="handleEmpty" title="清空" />
|
|
|
+ </a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :xl="6" :lg="6" :md="6" :sm="6">
|
|
@@ -41,8 +42,8 @@
|
|
|
<a-button @click="handleAddts()" type="primary" icon="plus" v-has="'UserShift:add'" v-if="isColse">调整</a-button>
|
|
|
<a-tabs default-active-key="2" @change="callback">
|
|
|
<a-tab-pane key="2" tab="按班次上下班">
|
|
|
- <a-table bordered rowKey="id" :loading="loading" :data-source="dataSource" :columns="columns" :scroll="{ x:300,y:400}"
|
|
|
- :pagination="ipagination" @change="handleTableChange"
|
|
|
+ <a-table bordered rowKey="id" :loading="loading" :data-source="dataSource" :columns="columns"
|
|
|
+ :scroll="{ x:300,y:400}" :pagination="ipagination" @change="handleTableChange"
|
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
|
|
|
<template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
|
|
|
<div style="height: 35px;">
|
|
@@ -69,7 +70,8 @@
|
|
|
</span>
|
|
|
</a-table>
|
|
|
|
|
|
- <a-table bordered :data-source="dataSources" :loading="loading" :columns="columnst" :scroll="{ x:300 }" :pagination="ipaginations" @change="handleTableChanges">
|
|
|
+ <a-table bordered :data-source="dataSources" :loading="loading" :columns="columnst" :scroll="{ x:300 }"
|
|
|
+ :pagination="ipaginations" @change="handleTableChanges">
|
|
|
<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;">
|
|
@@ -89,9 +91,8 @@
|
|
|
</a-table>
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane key="1" tab="固定时间上下班">
|
|
|
- <a-table bordered rowKey="id" :loading="loading" :data-source="dataSource" :columns="columns" :scroll="{ x:300 }"
|
|
|
- :pagination="ipagination" @change="handleTableChange"
|
|
|
- >
|
|
|
+ <a-table bordered rowKey="id" :loading="loading" :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;">
|
|
@@ -165,7 +166,7 @@
|
|
|
|
|
|
<!-- 表单区域 -->
|
|
|
<attendanceRule-modal ref="modalForm" @ok="modalFormOk"></attendanceRule-modal>
|
|
|
-
|
|
|
+ <depart-window ref="departWindow" @ok="modalFormOks"></depart-window>
|
|
|
<userShift-modal ref="userShiftModal"></userShift-modal>
|
|
|
</a-card>
|
|
|
</template>
|
|
@@ -179,6 +180,7 @@
|
|
|
} from '@/api/manage'
|
|
|
import '@/assets/less/TableExpand.less'
|
|
|
import AttendanceRuleModal from './modules/AttendanceRuleModal'
|
|
|
+ import departWindow from './modules/DepartWindow'
|
|
|
import {
|
|
|
JeecgListMixin
|
|
|
} from '@/mixins/JeecgListMixin'
|
|
@@ -189,17 +191,20 @@
|
|
|
mixins: [JeecgListMixin],
|
|
|
components: {
|
|
|
AttendanceRuleModal,
|
|
|
- UserShiftModal
|
|
|
+ UserShiftModal,
|
|
|
+ departWindow
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ departNames: null,
|
|
|
queryParam: {
|
|
|
ShiftDate: moment(new Date()).format('yyyy-MM-DD HH:mm:ss'),
|
|
|
- type: "2"
|
|
|
+ type: "2",
|
|
|
+ dept: null
|
|
|
},
|
|
|
description: '打卡规则管理页面',
|
|
|
tts: false,
|
|
|
- isColse:true,
|
|
|
+ isColse: true,
|
|
|
tpdata: [],
|
|
|
currentMonth: new Date().getMonth(),
|
|
|
currentYear: new Date().getYear(),
|
|
@@ -222,7 +227,7 @@
|
|
|
isShow: true,
|
|
|
listData: [],
|
|
|
is: "1",
|
|
|
- ipaginations:{
|
|
|
+ ipaginations: {
|
|
|
current: 1,
|
|
|
pageSize: 10,
|
|
|
pageSizeOptions: ['10', '20', '30'],
|
|
@@ -245,11 +250,11 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- dataSource:{
|
|
|
- handler (newName, oldName) {
|
|
|
- this.queryMothByCount();
|
|
|
- },
|
|
|
+ watch: {
|
|
|
+ dataSource: {
|
|
|
+ handler(newName, oldName) {
|
|
|
+ this.queryMothByCount();
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -263,8 +268,28 @@
|
|
|
this.queryShift()
|
|
|
this.queryMothByCount();
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
methods: {
|
|
|
+ modalFormOks(formData) {
|
|
|
+ if (formData.departIdList != null && formData.departIdList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.departIdList.length; i++) {
|
|
|
+ this.queryParam.dept = formData.departIdList[i].key;
|
|
|
+ this.departNames = formData.departIdList[i].title;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ openModal() {
|
|
|
+ var ls = [];
|
|
|
+ ls.push(this.queryParam.dept);
|
|
|
+ this.$refs.departWindow.add(ls, {});
|
|
|
+ },
|
|
|
+ handleEmpty() {
|
|
|
+ this.queryParam.dept = null;
|
|
|
+ this.departNames = null;
|
|
|
+ },
|
|
|
handleAddts() {
|
|
|
if (this.selectedRowKeys.length < 1 && this.queryParam.type == "4") {
|
|
|
this.$message.warning("请勾选需要排班人员");
|
|
@@ -290,10 +315,10 @@
|
|
|
|
|
|
},
|
|
|
callback(key) {
|
|
|
- if(key=="1"||key==1){
|
|
|
- this.isColse=false;
|
|
|
- }else{
|
|
|
- this.isColse=true;
|
|
|
+ if (key == "1" || key == 1) {
|
|
|
+ this.isColse = false;
|
|
|
+ } else {
|
|
|
+ this.isColse = true;
|
|
|
}
|
|
|
this.queryParam.type = key;
|
|
|
this.selectedRowKeys = [];
|
|
@@ -307,17 +332,17 @@
|
|
|
this.initData(this.queryParam.ShiftDate)
|
|
|
|
|
|
},
|
|
|
- handleTableChanges(pagination, filters, sorter) {
|
|
|
- //分页、排序、筛选变化时触发
|
|
|
- //TODO 筛选
|
|
|
- if (Object.keys(sorter).length > 0) {
|
|
|
- this.isorter.column = sorter.field;
|
|
|
- this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
|
|
- }
|
|
|
- this.ipaginations = pagination;
|
|
|
- console.log(pagination)
|
|
|
- this.queryMothByCount();
|
|
|
- },
|
|
|
+ handleTableChanges(pagination, filters, sorter) {
|
|
|
+ //分页、排序、筛选变化时触发
|
|
|
+ //TODO 筛选
|
|
|
+ if (Object.keys(sorter).length > 0) {
|
|
|
+ this.isorter.column = sorter.field;
|
|
|
+ this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
|
|
+ }
|
|
|
+ this.ipaginations = pagination;
|
|
|
+ console.log(pagination)
|
|
|
+ this.queryMothByCount();
|
|
|
+ },
|
|
|
|
|
|
initData: function(cur) {
|
|
|
this.columns = [];
|
|
@@ -383,7 +408,7 @@
|
|
|
// return name;
|
|
|
// }
|
|
|
// })
|
|
|
- if(this.queryParam.type == "1"){
|
|
|
+ if (this.queryParam.type == "1") {
|
|
|
this.columns.push({
|
|
|
title: '上班时间',
|
|
|
dataIndex: 'startDate',
|
|
@@ -391,9 +416,9 @@
|
|
|
fixed: 'left',
|
|
|
customRender: function(t, r, index) {
|
|
|
var date = "";
|
|
|
- if (t!=null&&t!="") {
|
|
|
- date=moment(new Date(t)).format('HH:mm:ss')
|
|
|
- }
|
|
|
+ if (t != null && t != "") {
|
|
|
+ date = moment(new Date(t)).format('HH:mm:ss')
|
|
|
+ }
|
|
|
return date;
|
|
|
}
|
|
|
})
|
|
@@ -402,17 +427,17 @@
|
|
|
dataIndex: 'endDate',
|
|
|
width: '100px',
|
|
|
fixed: 'left',
|
|
|
- customRender: function(t, r, index) {
|
|
|
- var date = "";
|
|
|
- if (t!=null&&t!="") {
|
|
|
- date=moment(new Date(t)).format('HH:mm:ss')
|
|
|
+ customRender: function(t, r, index) {
|
|
|
+ var date = "";
|
|
|
+ if (t != null && t != "") {
|
|
|
+ date = moment(new Date(t)).format('HH:mm:ss')
|
|
|
}
|
|
|
- return date;
|
|
|
- }
|
|
|
+ return date;
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if (this.queryParam.type == "2") {
|
|
|
for (var i = 1; i <= moth.getDate(); i++) {
|
|
@@ -498,19 +523,18 @@
|
|
|
queryMothByCount() {
|
|
|
getAction(this.url.lists, {
|
|
|
shiftDate: moment(this.queryParam.ShiftDate).format('yyyy-MM-DD HH:mm:ss'),
|
|
|
- userId:this.ipaginations.current,
|
|
|
+ userId: this.ipaginations.current,
|
|
|
shiftId: this.ipaginations.pageSize,
|
|
|
- realname:this.queryParam.name,
|
|
|
- deptid:this.queryParam.dept
|
|
|
+ realname: this.queryParam.name,
|
|
|
+ deptid: this.queryParam.dept
|
|
|
}, "post").then((res) => {
|
|
|
if (res.success) {
|
|
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
- this.dataSources = res.result.records||res.result;
|
|
|
- if(res.result.total)
|
|
|
- {
|
|
|
- this.ipaginations.total = res.result.total+1;
|
|
|
- }else{
|
|
|
- this.ipaginationstotal = 0+1;
|
|
|
+ this.dataSources = res.result.records || res.result;
|
|
|
+ if (res.result.total) {
|
|
|
+ this.ipaginations.total = res.result.total + 1;
|
|
|
+ } else {
|
|
|
+ this.ipaginationstotal = 0 + 1;
|
|
|
}
|
|
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
}
|