优化考勤

This commit is contained in:
java110 2022-12-13 03:29:53 +08:00
parent 0edc3c6a54
commit 1f99b2e007
2 changed files with 20 additions and 26 deletions

View File

@ -1,7 +1,7 @@
/** /**
入驻小区 入驻小区
**/ **/
(function (vc) { (function(vc) {
var DEFAULT_PAGE = 1; var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10; var DEFAULT_ROWS = 10;
vc.extends({ vc.extends({
@ -19,28 +19,28 @@
} }
} }
}, },
_initMethod: function () { _initMethod: function() {
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
let _date = new Date(new Date()); let _date = new Date(new Date());
$that.monthAttendanceManageInfo.conditions.date = _date.getFullYear() + "-" + (_date.getMonth() + 1); $that.monthAttendanceManageInfo.conditions.date = _date.getFullYear() + "-" + (_date.getMonth() + 1);
vc.initDateMonth('queryDate', function (_value) { vc.initDateMonth('queryDate', function(_value) {
$that.monthAttendanceManageInfo.conditions.date = _value; $that.monthAttendanceManageInfo.conditions.date = _value;
}) })
}, },
_initEvent: function () { _initEvent: function() {
vc.on('monthAttendanceManage', 'listMonthAttendance', function (_param) { vc.on('monthAttendanceManage', 'listMonthAttendance', function(_param) {
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
}); });
vc.on('pagination', 'page_event', function (_currentPage) { vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listMonthAttendances(_currentPage, DEFAULT_ROWS); vc.component._listMonthAttendances(_currentPage, DEFAULT_ROWS);
}); });
}, },
methods: { methods: {
_listMonthAttendances: function (_page, _rows) { _listMonthAttendances: function(_page, _rows) {
vc.component.monthAttendanceManageInfo.conditions.page = _page; vc.component.monthAttendanceManageInfo.conditions.page = _page;
vc.component.monthAttendanceManageInfo.conditions.row = _rows; vc.component.monthAttendanceManageInfo.conditions.row = _rows;
let param = { let param = {
params: vc.component.monthAttendanceManageInfo.conditions params: vc.deepClone($that.monthAttendanceManageInfo.conditions)
}; };
param.params.classesName = param.params.classesName.trim(); param.params.classesName = param.params.classesName.trim();
param.params.date = param.params.date + "-01"; param.params.date = param.params.date + "-01";
@ -48,7 +48,7 @@
//发送get请求 //发送get请求
vc.http.apiGet('/attendanceClass/getMonthAttendance', vc.http.apiGet('/attendanceClass/getMonthAttendance',
param, param,
function (json, res) { function(json, res) {
var _monthAttendanceManageInfo = JSON.parse(json); var _monthAttendanceManageInfo = JSON.parse(json);
vc.component.monthAttendanceManageInfo.total = _monthAttendanceManageInfo.total; vc.component.monthAttendanceManageInfo.total = _monthAttendanceManageInfo.total;
vc.component.monthAttendanceManageInfo.records = _monthAttendanceManageInfo.records; vc.component.monthAttendanceManageInfo.records = _monthAttendanceManageInfo.records;
@ -58,23 +58,24 @@
dataCount: vc.component.monthAttendanceManageInfo.total, dataCount: vc.component.monthAttendanceManageInfo.total,
currentPage: _page currentPage: _page
}); });
}, function (errInfo, error) { },
function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
} }
); );
}, },
//查询 //查询
_queryMonthAttendanceMethod: function () { _queryMonthAttendanceMethod: function() {
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
}, },
//重置 //重置
_resetMonthAttendanceMethod: function () { _resetMonthAttendanceMethod: function() {
vc.component.monthAttendanceManageInfo.conditions.classesName = ""; vc.component.monthAttendanceManageInfo.conditions.classesName = "";
vc.component.monthAttendanceManageInfo.conditions.departmentName = ""; vc.component.monthAttendanceManageInfo.conditions.departmentName = "";
vc.component.monthAttendanceManageInfo.conditions.date = vc.dateFormat(new Date()); vc.component.monthAttendanceManageInfo.conditions.date = vc.dateFormat(new Date());
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
}, },
_moreCondition: function () { _moreCondition: function() {
if (vc.component.monthAttendanceManageInfo.moreCondition) { if (vc.component.monthAttendanceManageInfo.moreCondition) {
vc.component.monthAttendanceManageInfo.moreCondition = false; vc.component.monthAttendanceManageInfo.moreCondition = false;
} else { } else {

View File

@ -3,18 +3,14 @@
<div class="col-md-2"> <div class="col-md-2">
<div class=" border-radius bg-white padding"> <div class=" border-radius bg-white padding">
<div class="margin-xs margin-bottom"> <div class="margin-xs margin-bottom">
<input type="text" :placeholder="vc.i18n('请选择月份','monthAttendanceManage')" <input type="text" :placeholder="vc.i18n('请选择月份','monthAttendanceManage')" v-model="staffAttendanceManageInfo.curDate" class=" form-control queryDate">
v-model="staffAttendanceManageInfo.curDate" class=" form-control queryDate">
</div> </div>
<div class="margin-xs margin-bottom"> <div class="margin-xs margin-bottom">
<input v-model="staffAttendanceManageInfo.orgName" readonly @focus="_staffAttendanceChangeOrg()" <input v-model="staffAttendanceManageInfo.orgName" readonly @focus="_staffAttendanceChangeOrg()" type="text" :placeholder="vc.i18n('填写组织','staffAttendanceManage')" class="form-control">
type="text" :placeholder="vc.i18n('填写组织','staffAttendanceManage')" class="form-control">
</div> </div>
<div class="margin-xs-r bg-white treeview attendance-staff"> <div class="margin-xs-r bg-white treeview attendance-staff">
<ul class="list-group text-center border-radius"> <ul class="list-group text-center border-radius">
<li class="list-group-item node-orgTree " <li class="list-group-item node-orgTree " v-for="(item,index) in staffAttendanceManageInfo.staffs" @click="swatchStaff(item)" :class="{'vc-node-selected':staffAttendanceManageInfo.curStaffId==item.userId}">
v-for="(item,index) in staffAttendanceManageInfo.staffs" @click="swatchStaff(item)"
:class="{'vc-node-selected':staffAttendanceManageInfo.curStaffId==item.userId}">
{{item.name}} {{item.name}}
</li> </li>
</ul> </ul>
@ -23,10 +19,7 @@
</div> </div>
<div class="col-md-10 "> <div class="col-md-10 ">
<div class="row bg-white border-radius padding "> <div class="row bg-white border-radius padding ">
<div class="col-md-2 text-center border padding-lg labeling-strip" <div class="col-md-2 text-center border padding-lg labeling-strip" v-for="index in staffAttendanceManageInfo.maxDay" :key="index" :style="{'background-color': _getBgColor(index)}" style="border-radius: 5px;cursor:pointer">
v-for="index in staffAttendanceManageInfo.maxDay" :key="index"
:style="{'background-color': _getBgColor(index)}"
style="border-radius: 5px;cursor:pointer">
<div class="strip" v-if="_getDayAttendance(index) && _getDayAttendance(index).state != '30000'"> <div class="strip" v-if="_getDayAttendance(index) && _getDayAttendance(index).state != '30000'">
<span @click="_replenishCheckIn(index)">补考勤</span> <span @click="_replenishCheckIn(index)">补考勤</span>
</div> </div>
@ -34,7 +27,7 @@
<div>状态: <div>状态:
<span v-html="_getAttendanceState(index)"></span> <span v-html="_getAttendanceState(index)"></span>
</div> </div>
<div v-for="(item,detailIndex) in _getAttendanceDetail(index)">{{item.specName}}{{item.stateName}} <div v-for="(item,detailIndex) in _getAttendanceDetail(index)">{{item.specCd=='1001'?'上班':'下班'}}{{item.stateName}}
<span v-if="item.checkTime">({{item.checkTime}})</span> <span v-if="item.checkTime">({{item.checkTime}})</span>
</div> </div>
<div> <div>