优化代码

This commit is contained in:
java110 2022-09-15 19:38:42 +08:00
parent 420eccbc32
commit ebac7be531
3 changed files with 42 additions and 15 deletions

4
app.js
View File

@ -32,8 +32,8 @@ let opts = {
}
app.use('/callComponent', proxy('http://192.168.100.108:8008', opts));
app.use('/app', proxy('http://192.168.100.108:8008', opts));
app.use('/callComponent', proxy('http://192.168.100.108:8088', opts));
app.use('/app', proxy('http://192.168.100.108:8088', opts));
app.use('/ws', createProxyMiddleware({
target: 'http://192.168.100.108:8008',
changeOrigin: true,

View File

@ -3,8 +3,8 @@
data: {
staffAttendanceReplenishCheckInInfo: {
details: [],
remark:'',
detailId:'',
remark: '',
detailId: '',
}
},
_initMethod: function() {},
@ -15,7 +15,34 @@
});
},
methods: {
_doReplenishCheckIn: function() {
let _data = {
detailId: $that.staffAttendanceReplenishCheckInInfo.detailId,
remark: $that.staffAttendanceReplenishCheckInInfo.remark
}
vc.http.apiPost(
'/attendanceClasses.attendanceReplenishCheckIn',
JSON.stringify(_data), {
emulateJSON: true
},
function(json, res) {
let _json = JSON.parse(json)
if (_json.code == 0) {
//关闭model
$('#staffAttendanceReplenishCheckInModel').modal('hide');
vc.emit('staffAttendanceManage', 'listMonthAttendance', {});
vc.toast("添加成功");
return;
}
},
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
}
}
});

View File

@ -25,10 +25,10 @@
},
_initEvent: function() {
vc.on('staffAttendanceManage', 'listMonthAttendance', function(_param) {
vc.component._listMonthAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
vc.component._loadStaffAttendances(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listMonthAttendances(_currentPage, DEFAULT_ROWS);
vc.component._loadStaffAttendances(_currentPage, DEFAULT_ROWS);
});
vc.on('staffAttendanceManage', 'switchOrg', function(_org) {
$that.staffAttendanceManageInfo.orgId = _org.orgId;
@ -165,26 +165,26 @@
date: $that.staffAttendanceManageInfo.curYear + "-" + _curMonth + '-' + _day
});
},
_replenishCheckIn:function(_day){
_replenishCheckIn: function(_day) {
let _details = $that._getAttendanceDetail(_day);
if(!_details || _details.length<1){
if (!_details || _details.length < 1) {
vc.toast('不存在 补考勤任务');
return ;
return;
}
let _newDetails = [];
_details.forEach(item=>{
if(item.state == '10000'){
_details.forEach(item => {
if (item.state == '10000') {
_newDetails.push(item)
}
});
if(_newDetails.length<1){
if (_newDetails.length < 1) {
vc.toast('不存在 补考勤任务');
return ;
return;
}
vc.emit('staffAttendanceReplenishCheckIn', 'openModel',_newDetails);
vc.emit('staffAttendanceReplenishCheckIn', 'openModel', _newDetails);
}
}
});