158 lines
7.1 KiB
JavaScript
158 lines
7.1 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
scheduleClassesPageInfo: {
|
|
staffs: [],
|
|
scheduleClassess: [],
|
|
maxDay: 30,
|
|
curMonth: '',
|
|
curYear: '',
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
states: '',
|
|
conditions: {
|
|
staffNameLike: '',
|
|
scheduleId: '',
|
|
curDate: '',
|
|
orgId: '',
|
|
orgName: ''
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
$that.initStaffDate();
|
|
$that._listStaffScheduleClassess(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
$that._listScheduleClassess(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('scheduleClassesPage', 'listScheduleClasses', function (_param) {
|
|
$that._listStaffScheduleClassess(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
|
$that._listStaffScheduleClassess(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
vc.on('scheduleClassesPage', 'switchOrg', function (_org) {
|
|
$that.scheduleClassesPageInfo.conditions.orgId = _org.orgId;
|
|
$that.scheduleClassesPageInfo.conditions.orgName = _org.allOrgName;
|
|
});
|
|
},
|
|
methods: {
|
|
initStaffDate: function () {
|
|
let _date = new Date(new Date());
|
|
$that.scheduleClassesPageInfo.curMonth = _date.getMonth() + 1
|
|
$that.scheduleClassesPageInfo.curYear = _date.getFullYear();
|
|
$that.scheduleClassesPageInfo.conditions.curDate = _date.getFullYear() + "-" + (_date.getMonth() + 1);
|
|
$that.scheduleClassesPageInfo.maxDay = new Date(_date.getFullYear(), _date.getMonth() + 1, 0).getDate();
|
|
vc.initDateMonth('queryDate', function (_value) {
|
|
$that.scheduleClassesPageInfo.conditions.curDate = _value;
|
|
let _values = _value.split('-');
|
|
$that.scheduleClassesPageInfo.curYear = _values[0];
|
|
$that.scheduleClassesPageInfo.curMonth = _values[1];
|
|
$that._listStaffScheduleClassess(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
})
|
|
},
|
|
_listStaffScheduleClassess: function (_page, _rows) {
|
|
$that.scheduleClassesPageInfo.conditions.page = _page;
|
|
$that.scheduleClassesPageInfo.conditions.row = _rows;
|
|
let param = {
|
|
params: $that.scheduleClassesPageInfo.conditions
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/scheduleClasses.staffMonthScheduleClasses',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.scheduleClassesPageInfo.total = _json.total;
|
|
$that.scheduleClassesPageInfo.records = _json.records;
|
|
$that.scheduleClassesPageInfo.staffs = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.scheduleClassesPageInfo.records,
|
|
dataCount: $that.scheduleClassesPageInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//查询
|
|
_queryScheduleClassesMethod: function () {
|
|
$that._listStaffScheduleClassess(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_resetScheduleClassesMethod: function () {
|
|
$that.scheduleClassesPageInfo.conditions = {
|
|
staffNameLike: '',
|
|
scheduleId: '',
|
|
curDate: '',
|
|
orgId: '',
|
|
orgName: ''
|
|
}
|
|
let _date = new Date(new Date());
|
|
$that.scheduleClassesPageInfo.conditions.curDate = _date.getFullYear() + "-" + (_date.getMonth() + 1);
|
|
},
|
|
_moreCondition: function () {
|
|
if ($that.scheduleClassesPageInfo.moreCondition) {
|
|
$that.scheduleClassesPageInfo.moreCondition = false;
|
|
} else {
|
|
$that.scheduleClassesPageInfo.moreCondition = true;
|
|
}
|
|
},
|
|
_listScheduleClassess: function (_page, _rows) {
|
|
let param = {
|
|
params: {
|
|
page: 1,
|
|
row: 100
|
|
}
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/scheduleClasses.listScheduleClasses',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.scheduleClassesPageInfo.scheduleClassess = _json.data;
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_exportScheduleClasses: function () {
|
|
//vc.jumpToPage('/callComponent/exportReportFee/exportData?pagePath=reportPayFeeDetail&' + vc.objToGetParam($that.reportPayFeeDetailInfo.conditions));
|
|
$that.scheduleClassesPageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
|
$that.scheduleClassesPageInfo.conditions.pagePath = 'reportStaffMonthScheduleClasses';
|
|
let param = {
|
|
params: $that.scheduleClassesPageInfo.conditions
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/export.exportData', param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
vc.toast(_json.msg);
|
|
if (_json.code == 0) {
|
|
vc.jumpToPage('/#/pages/property/downloadTempFile?tab=下载中心')
|
|
}
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
});
|
|
},
|
|
_staffChangeOrg: function () {
|
|
vc.emit('chooseOrgTree', 'openOrgModal', {});
|
|
},
|
|
_computeTableDivWidth:function(){
|
|
let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
|
|
//let treeWidth = document.getElementsByClassName('room-floor-unit-tree')[0].offsetWidth;
|
|
mainWidth = mainWidth - 20 -15 - 20;
|
|
//document.getElementsByClassName('hc-table-div')[0].style.width=mainWidth+'px';
|
|
return mainWidth+'px';
|
|
},
|
|
}
|
|
});
|
|
})(window.vc); |