mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
b877d90384
commit
90356eae88
@ -0,0 +1,89 @@
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox ">
|
||||
<div class="ibox-title">
|
||||
<h5>查询条件</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="请输入班组名称"
|
||||
v-model="monthAttendanceManageInfo.conditions.classesName" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="请输入部门名称"
|
||||
v-model="monthAttendanceManageInfo.conditions.departmentName" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" placeholder="请选择打卡时间"
|
||||
v-model="monthAttendanceManageInfo.conditions.date" class=" form-control queryDate">
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-sm"
|
||||
v-on:click="_queryMonthAttendanceMethod()">
|
||||
<i class="glyphicon glyphicon-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<h5>月考勤</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">部门名称</th>
|
||||
<th class="text-center">员工名称</th>
|
||||
<th class="text-center">正常考勤</th>
|
||||
<th class="text-center">迟到</th>
|
||||
<th class="text-center">早退</th>
|
||||
<th class="text-center">旷工</th>
|
||||
<th class="text-center">免考勤</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="attendance in monthAttendanceManageInfo.attendances">
|
||||
<td class="text-center">{{attendance.departmentName}}</td>
|
||||
<td class="text-center">{{attendance.staffName}}</td>
|
||||
<td class="text-center">{{attendance.clockIn}}</td>
|
||||
<td class="text-center">{{attendance.late}}</td>
|
||||
<td class="text-center">{{attendance.early}}</td>
|
||||
<td class="text-center">{{attendance.noClockIn}}</td>
|
||||
<td class="text-center">{{attendance.free}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/pagination"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,79 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
vc.extends({
|
||||
data: {
|
||||
monthAttendanceManageInfo: {
|
||||
attendances: [],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
classesId: '',
|
||||
conditions: {
|
||||
classesName: '',
|
||||
departmentName: '',
|
||||
date: vc.dateFormat(new Date())
|
||||
}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
|
||||
vc.initDate('queryDate',function(value){
|
||||
$that.monthAttendanceManageInfo.conditions.date = value;
|
||||
});
|
||||
},
|
||||
_initEvent: function () {
|
||||
|
||||
vc.on('monthAttendanceManage', 'listMonthAttendance', function (_param) {
|
||||
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('pagination', 'page_event', function (_currentPage) {
|
||||
vc.component._listMonthAttendances(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listMonthAttendances: function (_page, _rows) {
|
||||
|
||||
vc.component.monthAttendanceManageInfo.conditions.page = _page;
|
||||
vc.component.monthAttendanceManageInfo.conditions.row = _rows;
|
||||
var param = {
|
||||
params: vc.component.monthAttendanceManageInfo.conditions
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/attendanceClass/getMonthAttendance',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _monthAttendanceManageInfo = JSON.parse(json);
|
||||
vc.component.monthAttendanceManageInfo.total = _monthAttendanceManageInfo.total;
|
||||
vc.component.monthAttendanceManageInfo.records = _monthAttendanceManageInfo.records;
|
||||
vc.component.monthAttendanceManageInfo.attendances = _monthAttendanceManageInfo.data;
|
||||
vc.emit('pagination', 'init', {
|
||||
total: vc.component.monthAttendanceManageInfo.records,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_queryMonthAttendanceMethod: function () {
|
||||
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_moreCondition: function () {
|
||||
if (vc.component.monthAttendanceManageInfo.moreCondition) {
|
||||
vc.component.monthAttendanceManageInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.monthAttendanceManageInfo.moreCondition = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user