update code
parent
41a8a5179d
commit
cb0cb1fce7
|
@ -134,6 +134,7 @@
|
|||
<script>
|
||||
import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/project/attendance";
|
||||
import { listAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker";
|
||||
import {listAttendanceConfig} from '@/api/project/attendanceConfig.js'
|
||||
import attConfigDrawer from '../attendanceConfig/attendanceConfigDrawer.vue'
|
||||
export default {
|
||||
name: "Attendance",
|
||||
|
@ -178,12 +179,16 @@ export default {
|
|||
projectOptions: [],
|
||||
depts: [],
|
||||
prjDisabled:false,
|
||||
cfgList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
listAttendanceConfig({}).then(d=>{
|
||||
this.cfgList=d.rows||[];
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
init(prj){
|
||||
|
@ -233,8 +238,13 @@ export default {
|
|||
this.loading = true;
|
||||
let postData={};
|
||||
postData.attendanceTime=this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD");
|
||||
let tmps=this.cfgList.filter(d=>d.projectId==this.queryParams.projectId && d.subDeptId==this.queryParams.deptId);
|
||||
if(tmps.length>0){
|
||||
postData.cfgid=tmps[0].id;
|
||||
}else{
|
||||
postData.projectId=this.queryParams.projectId;
|
||||
postData.deptId=this.queryParams.deptId;
|
||||
}
|
||||
postData.pageNum=this.queryParams.pageNum;
|
||||
postData.pageSize=this.queryParams.pageSize;
|
||||
if(this.queryParams.companyTypeId && this.queryParams.companyTypeId>0){
|
||||
|
@ -242,7 +252,7 @@ export default {
|
|||
}
|
||||
listAttendance(postData).then(response=>{
|
||||
this.attendanceList = (response.rows||[]).map(it=>{
|
||||
it.scanPhoto=it.scanPhoto.indexOf("/profile")==0?"/jhapi"+it.scanPhoto:it.scanPhoto;
|
||||
it.scanPhoto=it.scanPhoto && it.scanPhoto.indexOf("/profile")==0?"/jhapi"+it.scanPhoto:it.scanPhoto;
|
||||
return it;
|
||||
});
|
||||
this.total = response.total;
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.yanzhu.jh.project.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -34,6 +39,8 @@ public class SurProjectAttendanceDataController extends BaseController
|
|||
@Autowired
|
||||
private ISurProjectAttendanceDataService surProjectAttendanceDataService;
|
||||
|
||||
@Autowired
|
||||
private ISurProjectAttendanceCfgService surProjectAttendanceCfgService;
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*/
|
||||
|
@ -42,6 +49,11 @@ public class SurProjectAttendanceDataController extends BaseController
|
|||
public TableDataInfo list(SurProjectAttendanceData surProjectAttendanceData)
|
||||
{
|
||||
startPage();
|
||||
String tmp=surProjectAttendanceData.getAttendanceTime();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
int year= DateUtil.parse(tmp).year();
|
||||
surProjectAttendanceData.setYear(year);
|
||||
}
|
||||
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue