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