移动端考勤配置开发

lj7788@126.com 2025-09-01 16:45:24 +08:00
parent 282bdf98d5
commit bed122c13d
18 changed files with 569 additions and 185 deletions

View File

@ -98,8 +98,18 @@ export default {
this.$bus.$on('projectChange', debounce(res => { this.$bus.$on('projectChange', debounce(res => {
this.prjInfo = res; this.prjInfo = res;
//this.getMonitAndWarning(); //this.getMonitAndWarning();
debugger this.loadData();
this.$api.safety.selectCountForBGByProjectId(res.id).then(d => {
}));
this.prjInfo = this.$store.getters.selProject;
this.loadData();
},
methods: {
loadData(){
if(!this.prjInfo){
return
}
this.$api.safety.selectCountForBGByProjectId(this.prjInfo.id).then(d => {
this.baseData = d.data || []; this.baseData = d.data || [];
this.warningType[0].total = this.getBaseData("a"); this.warningType[0].total = this.getBaseData("a");
this.warningType[1].total = this.getBaseData("c"); this.warningType[1].total = this.getBaseData("c");
@ -109,9 +119,7 @@ export default {
this.todayCnt = this.getBaseData("g"); this.todayCnt = this.getBaseData("g");
this.weekCnt = this.getBaseData("h"); this.weekCnt = this.getBaseData("h");
}); });
})); },
},
methods: {
getBaseData(type) { getBaseData(type) {
let tmp = this.baseData.find(item => item.projectName == type); let tmp = this.baseData.find(item => item.projectName == type);
return tmp ? tmp.id || 0 : 0; return tmp ? tmp.id || 0 : 0;

View File

@ -38,7 +38,7 @@ public class ProMobileAttendanceConfig extends BaseEntity
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date starteDate; private Date startDate;
/** 结束时间 */ /** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -47,6 +47,24 @@ public class ProMobileAttendanceConfig extends BaseEntity
private List<ProMobileAttendanceConfigGroup> groupList; private List<ProMobileAttendanceConfigGroup> groupList;
private Integer isDel;
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Integer getIsDel() {
return isDel;
}
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
public List<ProMobileAttendanceConfigGroup> getGroupList() { public List<ProMobileAttendanceConfigGroup> getGroupList() {
return groupList; return groupList;
} }
@ -115,15 +133,7 @@ public class ProMobileAttendanceConfig extends BaseEntity
{ {
return title; return title;
} }
public void setStarteDate(Date starteDate)
{
this.starteDate = starteDate;
}
public Date getStarteDate()
{
return starteDate;
}
public void setEndDate(Date endDate) public void setEndDate(Date endDate)
{ {
this.endDate = endDate; this.endDate = endDate;
@ -195,7 +205,7 @@ public class ProMobileAttendanceConfig extends BaseEntity
.append("comId", getComId()) .append("comId", getComId())
.append("projectId", getProjectId()) .append("projectId", getProjectId())
.append("title", getTitle()) .append("title", getTitle())
.append("starteDate", getStarteDate()) .append("startDate", getStartDate())
.append("endDate", getEndDate()) .append("endDate", getEndDate())
.append("address", getAddress()) .append("address", getAddress())
.append("longitude", getLongitude()) .append("longitude", getLongitude())

View File

@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper;
import java.util.List; import java.util.List;
import com.yanzhu.manage.domain.ProMobileAttendanceConfigGroup; import com.yanzhu.manage.domain.ProMobileAttendanceConfigGroup;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -67,5 +68,5 @@ public interface ProMobileAttendanceConfigGroupMapper
*/ */
public int deleteProMobileAttendanceConfigGroupByCfgId(Long cfgId); public int deleteProMobileAttendanceConfigGroupByCfgId(Long cfgId);
public int insertProMobileAttendanceConfigGroupBatch(List<ProMobileAttendanceConfigGroup> groupList); public int insertProMobileAttendanceConfigGroupBatch(@Param("groupList") List<ProMobileAttendanceConfigGroup> groupList);
} }

View File

@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper;
import java.util.List; import java.util.List;
import com.yanzhu.manage.domain.ProMobileAttendanceConfig; import com.yanzhu.manage.domain.ProMobileAttendanceConfig;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -58,4 +59,8 @@ public interface ProMobileAttendanceConfigMapper
* @return * @return
*/ */
public int deleteProMobileAttendanceConfigByIds(Long[] ids); public int deleteProMobileAttendanceConfigByIds(Long[] ids);
/**
*
*/
List<Long> selectCountByValid(@Param("projectId") Long projectId);
} }

View File

@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertProMobileAttendanceConfigGroupBatch"> <insert id="insertProMobileAttendanceConfigGroupBatch">
insert into pro_mobile_attendance_config_group (cfg_id, group_id) insert into pro_mobile_attendance_config_group (cfg_id, group_id)
values values
<foreach collection="groupList" item="item" index="index" separator=";"> <foreach collection="groupList" item="item" index="index" separator=",">
(#{item.cfgId}, #{item.groupId}) (#{item.cfgId}, #{item.groupId})
</foreach> </foreach>
</insert> </insert>

View File

@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="comId" column="com_id" /> <result property="comId" column="com_id" />
<result property="projectId" column="project_id" /> <result property="projectId" column="project_id" />
<result property="title" column="title" /> <result property="title" column="title" />
<result property="starteDate" column="starte_date" /> <result property="startDate" column="start_date" />
<result property="endDate" column="end_date" /> <result property="endDate" column="end_date" />
<result property="address" column="address" /> <result property="address" column="address" />
<result property="longitude" column="longitude" /> <result property="longitude" column="longitude" />
@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="valid" column="valid" /> <result property="valid" column="valid" />
<result property="rang" column="rang" /> <result property="rang" column="rang" />
<result property="state" column="state" /> <result property="state" column="state" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -25,26 +26,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectProMobileAttendanceConfigVo"> <sql id="selectProMobileAttendanceConfigVo">
select id, com_id, project_id, title, starte_date, end_date, address, longitude, latitude, valid, rang, state, remark, create_by, create_time, update_by, update_time from pro_mobile_attendance_config select id, com_id, project_id, title, start_date, end_date, address, longitude, latitude, valid, rang, state, is_del, remark, create_by, create_time, update_by, update_time from pro_mobile_attendance_config
</sql> </sql>
<select id="selectProMobileAttendanceConfigList" parameterType="ProMobileAttendanceConfig" resultMap="ProMobileAttendanceConfigResult"> <select id="selectProMobileAttendanceConfigList" parameterType="ProMobileAttendanceConfig" resultMap="ProMobileAttendanceConfigResult">
<include refid="selectProMobileAttendanceConfigVo"/> <include refid="selectProMobileAttendanceConfigVo"/>
<where> <where>
is_del = 0
<if test="comId != null "> and com_id = #{comId}</if> <if test="comId != null "> and com_id = #{comId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if> <if test="projectId != null "> and project_id = #{projectId}</if>
<if test="title != null and title != ''"> and title = #{title}</if> <if test="title != null and title != ''"> and title = #{title}</if>
<if test="starteDate != null "> and starte_date = #{starteDate}</if> <if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if> <if test="endDate != null "> and end_date = #{endDate}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="longitude != null "> and longitude = #{longitude}</if> <if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if> <if test="latitude != null "> and latitude = #{latitude}</if>
<if test="valid != null "> and valid = #{valid}</if> <choose>
<when test="valid==null or valid==0">and valid=0 and date(end_date) &gt;=CURRENT_DATE()</when>
<otherwise>and ( valid!=0 or date(end_date) &lt; CURRENT_DATE() )</otherwise>
</choose>
<if test="rang != null "> and rang = #{rang}</if> <if test="rang != null "> and rang = #{rang}</if>
<if test="state != null "> and state = #{state}</if> <if test="state != null "> and state = #{state}</if>
</where> </where>
</select> </select>
<select id="selectCountByValid" resultType="java.lang.Long" parameterType="Long">
select count(1) cnt from pro_mobile_attendance_config where is_del=0 and valid=0 and date(end_date) &gt;=CURRENT_DATE() and project_id = #{projectId}
union
select count(1) cnt from pro_mobile_attendance_config where is_del=0 and ( valid!=0 or date(end_date) &lt; CURRENT_DATE() ) and project_id = #{projectId}
</select>
<select id="selectProMobileAttendanceConfigById" parameterType="Long" resultMap="ProMobileAttendanceConfigResult"> <select id="selectProMobileAttendanceConfigById" parameterType="Long" resultMap="ProMobileAttendanceConfigResult">
<include refid="selectProMobileAttendanceConfigVo"/> <include refid="selectProMobileAttendanceConfigVo"/>
where id = #{id} where id = #{id}
@ -56,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="comId != null">com_id,</if> <if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if> <if test="projectId != null">project_id,</if>
<if test="title != null and title != ''">title,</if> <if test="title != null and title != ''">title,</if>
<if test="starteDate != null">starte_date,</if> <if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if> <if test="endDate != null">end_date,</if>
<if test="address != null">address,</if> <if test="address != null">address,</if>
<if test="longitude != null">longitude,</if> <if test="longitude != null">longitude,</if>
@ -64,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valid != null">valid,</if> <if test="valid != null">valid,</if>
<if test="rang != null">rang,</if> <if test="rang != null">rang,</if>
<if test="state != null">state,</if> <if test="state != null">state,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -74,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="comId != null">#{comId},</if> <if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if> <if test="projectId != null">#{projectId},</if>
<if test="title != null and title != ''">#{title},</if> <if test="title != null and title != ''">#{title},</if>
<if test="starteDate != null">#{starteDate},</if> <if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if> <if test="endDate != null">#{endDate},</if>
<if test="address != null">#{address},</if> <if test="address != null">#{address},</if>
<if test="longitude != null">#{longitude},</if> <if test="longitude != null">#{longitude},</if>
@ -82,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valid != null">#{valid},</if> <if test="valid != null">#{valid},</if>
<if test="rang != null">#{rang},</if> <if test="rang != null">#{rang},</if>
<if test="state != null">#{state},</if> <if test="state != null">#{state},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -96,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="comId != null">com_id = #{comId},</if> <if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if> <if test="projectId != null">project_id = #{projectId},</if>
<if test="title != null and title != ''">title = #{title},</if> <if test="title != null and title != ''">title = #{title},</if>
<if test="starteDate != null">starte_date = #{starteDate},</if> <if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if> <if test="endDate != null">end_date = #{endDate},</if>
<if test="address != null">address = #{address},</if> <if test="address != null">address = #{address},</if>
<if test="longitude != null">longitude = #{longitude},</if> <if test="longitude != null">longitude = #{longitude},</if>
@ -104,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valid != null">valid = #{valid},</if> <if test="valid != null">valid = #{valid},</if>
<if test="rang != null">rang = #{rang},</if> <if test="rang != null">rang = #{rang},</if>
<if test="state != null">state = #{state},</if> <if test="state != null">state = #{state},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>

View File

@ -528,9 +528,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="infoType != null "> and dic.remark = #{infoType}</if> <if test="infoType != null "> and dic.remark = #{infoType}</if>
</select> </select>
<select id="selectCountForBGByProjectId" parameterType="Long" resultMap="SmzSspProblemmodifyResult"> <select id="selectCountForBGByProjectId" parameterType="Long" resultMap="SmzSspProblemmodifyResult">
SELECT 'a' projectName, count(1) id,'全部' remark from smz_ssp_problemmodify where projectId=#{projectId} and isDel=0 SELECT 'a' projectName, count(1) id,'AI全部' remark from dev_ai_project_data where project_id=#{projectId} and is_del!=2
union
SELECT 'b' projectName, count(1) id,'全部已完成' remark from smz_ssp_problemmodify where projectId=#{projectId} and isDel=0 and checkState not in (4)
UNION UNION
SELECT 'c' projectName, count(1) id,'安全全部' remark from smz_ssp_problemmodify where projectId=#{projectId} and isDel=0 and infoType=0 SELECT 'c' projectName, count(1) id,'安全全部' remark from smz_ssp_problemmodify where projectId=#{projectId} and isDel=0 and infoType=0
UNION UNION

View File

@ -49,6 +49,15 @@ public class ProMobileAttendanceConfigController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
*
*/
@RequiresPermissions("manage:mobileAttendConfig:list")
@GetMapping("/selectCountByValid")
public AjaxResult selectCountByValid(Long projectId){
List<Long> list=proMobileAttendanceConfigService.selectCountByValid(projectId);
return AjaxResult.success(list);
}
/** /**
* *
*/ */

View File

@ -58,4 +58,9 @@ public interface IProMobileAttendanceConfigService
* @return * @return
*/ */
public int deleteProMobileAttendanceConfigById(Long id); public int deleteProMobileAttendanceConfigById(Long id);
/**
*
*/
List<Long> selectCountByValid(Long projectId);
} }

View File

@ -19,7 +19,7 @@ import com.yanzhu.manage.service.IProMobileAttendanceConfigService;
* @date 2025-08-29 * @date 2025-08-29
*/ */
@Service @Service
public class ProMobileAttendanceConfigServiceImpl implements IProMobileAttendanceConfigService public class ProMobileAttendanceConfigServiceImpl implements IProMobileAttendanceConfigService
{ {
@Autowired @Autowired
private ProMobileAttendanceConfigMapper proMobileAttendanceConfigMapper; private ProMobileAttendanceConfigMapper proMobileAttendanceConfigMapper;
@ -124,4 +124,11 @@ public class ProMobileAttendanceConfigServiceImpl implements IProMobileAttendanc
{ {
return proMobileAttendanceConfigMapper.deleteProMobileAttendanceConfigById(id); return proMobileAttendanceConfigMapper.deleteProMobileAttendanceConfigById(id);
} }
/**
*
*/
@Override
public List<Long> selectCountByValid(Long projectId) {
return proMobileAttendanceConfigMapper.selectCountByValid(projectId);
}
} }

View File

@ -429,3 +429,44 @@ export function countTechByStatus(query) {
method: "get", method: "get",
}); });
} }
/**
* 增加移动考勤配置
*/
export function addMobileAttendanceConfig(data) {
return request({
url: "/manage/mobileAttendConfig",
method: "post",
data: data,
});
}
/**
* 修改移动考勤配置
*/
export function updateMobileAttendanceConfig(data) {
return request({
url: "/manage/mobileAttendConfig",
method: "put",
data: data,
});
}
/**
* 获取移动考勤配置
*/
export function getMobileAttendanceConfig(data) {
return request({
url: "/manage/mobileAttendConfig/list",
method: "get",
params: data,
});
}
export function selectMobileAttendanceCountByValid(data) {
return request({
url: "/manage/mobileAttendConfig/selectCountByValid",
method: "get",
params: data,
});
}

View File

@ -0,0 +1,7 @@
<svg class="icon"
style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="6196">
<path d="M864 192H704v-64h-64v64H384v-64h-64v64H160c-17.6 0-32 14.4-32 32v640c0 17.6 14.4 32 32 32h704c17.6 0 32-14.4 32-32V224c0-17.6-14.4-32-32-32z m-32 640H192V384h640v448zM403.2 707.2L320.8 624.8l45.6-45.6L448 661.6l210.4-210.4 45.6 45.6-210.4 210.4L448 752l-44.8-44.8z"
fill="#ccc" p-id="6197"></path>
</svg>

After

Width:  |  Height:  |  Size: 516 B

View File

@ -2,11 +2,13 @@
import { getToken, getUserInfo } from "../../../../utils/auth"; import { getToken, getUserInfo } from "../../../../utils/auth";
import { uploadFiles } from "../../../utils/upload.js"; import { uploadFiles } from "../../../utils/upload.js";
import { tryToJson } from '../../../utils/tools' import { tryToJson } from "../../../utils/tools";
import { findSubGroupsList, subdeptsList } from '../../../../api/project'
import { import {
findDictCache findSubGroupsList,
} from '../../../../api/publics' subdeptsList,
addMobileAttendanceConfig,
} from "../../../../api/project";
import { findDictCache } from "../../../../api/publics";
const app = getApp(); const app = getApp();
// 添加防抖变量避免频繁请求API // 添加防抖变量避免频繁请求API
@ -25,15 +27,15 @@ Page({
projectName: "", projectName: "",
initData: {}, initData: {},
form: { form: {
title: '', title: "",
startDate: '', startDate: "",
endDate: '', endDate: "",
longitude: 0, longitude: 0,
latitude: 0, latitude: 0,
range: 50, range: 50,
address: '', address: "",
subGroup: [], subGroup: [],
groupIds: '', groupIds: "",
groupNames: [], groupNames: [],
}, },
markers: [], markers: [],
@ -42,13 +44,15 @@ Page({
mapLongitude: 0, mapLongitude: 0,
mapLatitude: 0, mapLatitude: 0,
fullScreenMarkers: [], fullScreenMarkers: [],
selectedAddress: '', selectedAddress: "",
// 搜索相关数据 // 搜索相关数据
searchKeyword: '', searchKeyword: "",
searchResults: [], searchResults: [],
subGroupList: [], subGroupList: [],
groupList: [], groupList: [],
subDeptTypeList: [], subDeptTypeList: [],
// 添加成功标识
isAddSuccess: false,
}, },
/** /**
@ -75,23 +79,23 @@ Page({
this.getSubGroupList(); this.getSubGroupList();
}, },
getSubGroupList() { getSubGroupList() {
findDictCache("sub_dept_type").then(dict => { findDictCache("sub_dept_type").then((dict) => {
this.setData({ this.setData({
subDeptTypeList: dict.data subDeptTypeList: dict.data,
}) });
findSubGroupsList({ findSubGroupsList({
projectId: app.globalData.useProjectId, projectId: app.globalData.useProjectId,
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
}).then(res => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let tmps = res.rows || []; let tmps = res.rows || [];
this.setData({ this.setData({
groupList: tmps groupList: tmps,
}) });
let obj = {}; let obj = {};
tmps.forEach(it => { tmps.forEach((it) => {
let name = it.subDeptType == 1 ? '施工单位' : it.subDeptName; let name = it.subDeptType == 1 ? "施工单位" : it.subDeptName;
if (!obj[name]) { if (!obj[name]) {
obj[name] = [it]; obj[name] = [it];
} else { } else {
@ -100,19 +104,21 @@ Page({
}); });
let subGroupList = []; let subGroupList = [];
for (let key in obj) { for (let key in obj) {
let val = obj[key][0] let val = obj[key][0];
let deptType = this.data.subDeptTypeList.find(dict => dict.dictValue == val.subDeptType) let deptType = this.data.subDeptTypeList.find(
(dict) => dict.dictValue == val.subDeptType
);
subGroupList.push({ subGroupList.push({
subDeptId: val.subDeptId, subDeptId: val.subDeptId,
subDeptName: val.subDeptName, subDeptName: val.subDeptName,
subDeptType: val.subDeptType, subDeptType: val.subDeptType,
subDeptTypeName: deptType?.dictLabel || '', subDeptTypeName: deptType?.dictLabel || "",
userList: (obj[key]).map(it => { userList: obj[key].map((it) => {
it.status = false; it.status = false;
it.userId = it.id; it.userId = it.id;
it.userName = it.groupName; it.userName = it.groupName;
return it; return it;
}) }),
}); });
} }
this.setData({ this.setData({
@ -125,37 +131,37 @@ Page({
// 获取用户当前位置 // 获取用户当前位置
getUserLocation() { getUserLocation() {
wx.getLocation({ wx.getLocation({
type: 'gcj02', // 腾讯地图坐标系 type: "gcj02", // 腾讯地图坐标系
success: (res) => { success: (res) => {
const { latitude, longitude } = res; const { latitude, longitude } = res;
// 设置地图初始位置 // 设置地图初始位置
this.setData({ this.setData({
mapLatitude: latitude, mapLatitude: latitude,
mapLongitude: longitude, mapLongitude: longitude,
'form.latitude': latitude, "form.latitude": latitude,
'form.longitude': longitude "form.longitude": longitude,
}); });
// 获取地址信息 // 获取地址信息
this.getAddressInfo(latitude, longitude); this.getAddressInfo(latitude, longitude);
}, },
fail: (err) => { fail: (err) => {
console.error('获取位置失败', err); console.error("获取位置失败", err);
wx.showToast({ wx.showToast({
title: '请允许位置权限', title: "请允许位置权限",
icon: 'none' icon: "none",
}); });
// 引导用户开启权限 // 引导用户开启权限
setTimeout(() => { setTimeout(() => {
wx.openSetting({ wx.openSetting({
success: (setting) => { success: (setting) => {
if (setting.authSetting['scope.userLocation']) { if (setting.authSetting["scope.userLocation"]) {
this.getUserLocation(); this.getUserLocation();
} }
} },
}); });
}, 1500); }, 1500);
} },
}); });
}, },
// 获取地址信息(逆地理编码)- 带重试机制 // 获取地址信息(逆地理编码)- 带重试机制
@ -163,46 +169,46 @@ Page({
const now = Date.now(); const now = Date.now();
// 检查请求间隔,避免频繁请求 // 检查请求间隔,避免频繁请求
if (now - lastRequestTime < REQUEST_INTERVAL) { if (now - lastRequestTime < REQUEST_INTERVAL) {
console.log('请求过于频繁,跳过本次请求'); console.log("请求过于频繁,跳过本次请求");
return; return;
} }
lastRequestTime = now; lastRequestTime = now;
// 使用腾讯地图API进行逆地理编码 // 使用腾讯地图API进行逆地理编码
// 注意需要替换为你自己的腾讯地图API密钥 // 注意需要替换为你自己的腾讯地图API密钥
const apiKey = 'NUQBZ-UIYCW-H7GRI-YXOXA-WNZB7-IGFLY'; const apiKey = "NUQBZ-UIYCW-H7GRI-YXOXA-WNZB7-IGFLY";
const url = `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=${apiKey}&get_poi=0`; const url = `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=${apiKey}&get_poi=0`;
// 添加重试机制 // 添加重试机制
this.requestWithRetry(url, 3, (success, data) => { this.requestWithRetry(url, 3, (success, data) => {
if (success) { if (success) {
const address = data.result.address || '获取地址失败'; const address = data.result.address || "获取地址失败";
if (isFullScreen) { if (isFullScreen) {
// 全屏地图模式下更新选中地址 // 全屏地图模式下更新选中地址
this.setData({ this.setData({
selectedAddress: address selectedAddress: address,
}); });
} else { } else {
// 普通模式下更新表单地址 // 普通模式下更新表单地址
this.setData({ this.setData({
"form.address": address "form.address": address,
}); });
} }
} else { } else {
console.error('逆地理编码失败', data); console.error("逆地理编码失败", data);
const errorMsg = '获取地址失败'; const errorMsg = "获取地址失败";
if (isFullScreen) { if (isFullScreen) {
this.setData({ this.setData({
selectedAddress: errorMsg selectedAddress: errorMsg,
}); });
} else { } else {
this.setData({ this.setData({
"form.address": errorMsg "form.address": errorMsg,
}); });
} }
wx.showToast({ wx.showToast({
title: '地址获取失败,请手动输入', title: "地址获取失败,请手动输入",
icon: 'none' icon: "none",
}); });
} }
}); });
@ -216,8 +222,16 @@ Page({
callback(true, res.data); callback(true, res.data);
} else { } else {
// 如果是因为请求频率限制导致的失败,进行重试 // 如果是因为请求频率限制导致的失败,进行重试
if (res.data.message && res.data.message.includes('请求量') && retryCount < maxRetries) { if (
console.log(`请求失败,${(retryCount + 1) * 1000}ms后进行第${retryCount + 1}次重试`); res.data.message &&
res.data.message.includes("请求量") &&
retryCount < maxRetries
) {
console.log(
`请求失败,${(retryCount + 1) * 1000}ms后进行第${
retryCount + 1
}次重试`
);
setTimeout(() => { setTimeout(() => {
this.requestWithRetry(url, maxRetries, callback, retryCount + 1); this.requestWithRetry(url, maxRetries, callback, retryCount + 1);
}, (retryCount + 1) * 1000); // 递增延迟重试 }, (retryCount + 1) * 1000); // 递增延迟重试
@ -229,14 +243,18 @@ Page({
fail: (err) => { fail: (err) => {
// 网络错误时进行重试 // 网络错误时进行重试
if (retryCount < maxRetries) { if (retryCount < maxRetries) {
console.log(`网络请求失败,${(retryCount + 1) * 1000}ms后进行第${retryCount + 1}次重试`); console.log(
`网络请求失败,${(retryCount + 1) * 1000}ms后进行第${
retryCount + 1
}次重试`
);
setTimeout(() => { setTimeout(() => {
this.requestWithRetry(url, maxRetries, callback, retryCount + 1); this.requestWithRetry(url, maxRetries, callback, retryCount + 1);
}, (retryCount + 1) * 1000); // 递增延迟重试 }, (retryCount + 1) * 1000); // 递增延迟重试
} else { } else {
callback(false, err); callback(false, err);
} }
} },
}); });
}, },
// 显示全屏地图 // 显示全屏地图
@ -245,28 +263,37 @@ Page({
showFullScreenMap: true, showFullScreenMap: true,
mapLatitude: this.data.form.latitude || this.data.mapLatitude, mapLatitude: this.data.form.latitude || this.data.mapLatitude,
mapLongitude: this.data.form.longitude || this.data.mapLongitude, mapLongitude: this.data.form.longitude || this.data.mapLongitude,
fullScreenMarkers: this.data.form.latitude && this.data.form.longitude ? [{ fullScreenMarkers:
id: 1, this.data.form.latitude && this.data.form.longitude
latitude: this.data.form.latitude, ? [
longitude: this.data.form.longitude, {
title: '考勤点', id: 1,
iconPath: '/images/location-marker.png', latitude: this.data.form.latitude,
width: 30, longitude: this.data.form.longitude,
height: 30 title: "考勤点",
}] : [] iconPath: "/images/location-marker.png",
width: 30,
height: 30,
},
]
: [],
}); });
// 如果已有坐标,获取地址信息 // 如果已有坐标,获取地址信息
if (this.data.form.latitude && this.data.form.longitude) { if (this.data.form.latitude && this.data.form.longitude) {
this.getAddressInfo(this.data.form.latitude, this.data.form.longitude, true); this.getAddressInfo(
this.data.form.latitude,
this.data.form.longitude,
true
);
} }
}, },
// 隐藏全屏地图 // 隐藏全屏地图
hideFullScreenMap() { hideFullScreenMap() {
this.setData({ this.setData({
showFullScreenMap: false, showFullScreenMap: false,
searchKeyword: '', searchKeyword: "",
searchResults: [] searchResults: [],
}); });
}, },
// 全屏地图点击事件 // 全屏地图点击事件
@ -275,15 +302,17 @@ Page({
this.setData({ this.setData({
mapLatitude: latitude, mapLatitude: latitude,
mapLongitude: longitude, mapLongitude: longitude,
fullScreenMarkers: [{ fullScreenMarkers: [
id: 1, {
latitude: latitude, id: 1,
longitude: longitude, latitude: latitude,
title: '考勤点', longitude: longitude,
iconPath: '/images/location-marker.png', title: "考勤点",
width: 30, iconPath: "/images/location-marker.png",
height: 30 width: 30,
}] height: 30,
},
],
}); });
// 获取点击位置的地址信息 // 获取点击位置的地址信息
@ -292,27 +321,29 @@ Page({
// 确认选择的位置 // 确认选择的位置
confirmLocation() { confirmLocation() {
this.setData({ this.setData({
'form.latitude': this.data.mapLatitude, "form.latitude": this.data.mapLatitude,
'form.longitude': this.data.mapLongitude, "form.longitude": this.data.mapLongitude,
'form.address': this.data.selectedAddress, "form.address": this.data.selectedAddress,
showFullScreenMap: false, showFullScreenMap: false,
markers: [{ markers: [
id: 1, {
latitude: this.data.mapLatitude, id: 1,
longitude: this.data.mapLongitude, latitude: this.data.mapLatitude,
title: '考勤点', longitude: this.data.mapLongitude,
iconPath: '/images/location-marker.png', title: "考勤点",
width: 30, iconPath: "/images/location-marker.png",
height: 30 width: 30,
}], height: 30,
searchKeyword: '', },
searchResults: [] ],
searchKeyword: "",
searchResults: [],
}); });
}, },
// 搜索输入事件 // 搜索输入事件
onSearchInput(e) { onSearchInput(e) {
this.setData({ this.setData({
searchKeyword: e.detail.value searchKeyword: e.detail.value,
}); });
}, },
// 搜索确认事件 // 搜索确认事件
@ -320,38 +351,44 @@ Page({
const keyword = this.data.searchKeyword.trim(); const keyword = this.data.searchKeyword.trim();
if (!keyword) { if (!keyword) {
wx.showToast({ wx.showToast({
title: '请输入搜索关键词', title: "请输入搜索关键词",
icon: 'none' icon: "none",
}); });
return; return;
} }
// 使用腾讯地图API进行地址搜索 // 使用腾讯地图API进行地址搜索
const apiKey = 'NUQBZ-UIYCW-H7GRI-YXOXA-WNZB7-IGFLY'; const apiKey = "NUQBZ-UIYCW-H7GRI-YXOXA-WNZB7-IGFLY";
const url = `https://apis.map.qq.com/ws/place/v1/suggestion/?keyword=${encodeURIComponent(keyword)}&key=${apiKey}&region=全国`; const url = `https://apis.map.qq.com/ws/place/v1/suggestion/?keyword=${encodeURIComponent(
keyword
)}&key=${apiKey}&region=全国`;
wx.request({ wx.request({
url: url, url: url,
success: (res) => { success: (res) => {
if (res.data.status === 0 && res.data.data && res.data.data.length > 0) { if (
res.data.status === 0 &&
res.data.data &&
res.data.data.length > 0
) {
// 更新搜索结果 // 更新搜索结果
this.setData({ this.setData({
searchResults: res.data.data searchResults: res.data.data,
}); });
} else { } else {
wx.showToast({ wx.showToast({
title: '未找到相关地址', title: "未找到相关地址",
icon: 'none' icon: "none",
}); });
} }
}, },
fail: (err) => { fail: (err) => {
console.error('搜索地址失败', err); console.error("搜索地址失败", err);
wx.showToast({ wx.showToast({
title: '搜索失败,请重试', title: "搜索失败,请重试",
icon: 'none' icon: "none",
}); });
} },
}); });
}, },
// 选择搜索结果 // 选择搜索结果
@ -363,17 +400,19 @@ Page({
this.setData({ this.setData({
mapLatitude: lat, mapLatitude: lat,
mapLongitude: lng, mapLongitude: lng,
fullScreenMarkers: [{ fullScreenMarkers: [
id: 1, {
latitude: lat, id: 1,
longitude: lng, latitude: lat,
title: item.title, longitude: lng,
iconPath: '/images/location-marker.png', title: item.title,
width: 30, iconPath: "/images/location-marker.png",
height: 30 width: 30,
}], height: 30,
},
],
searchResults: [], // 清空搜索结果 searchResults: [], // 清空搜索结果
searchKeyword: item.title // 更新搜索框内容 searchKeyword: item.title, // 更新搜索框内容
}); });
// 获取地址信息 // 获取地址信息
@ -381,49 +420,49 @@ Page({
}, },
onTitleInput(e) { onTitleInput(e) {
this.setData({ this.setData({
'form.title': e.detail.value "form.title": e.detail.value,
}) });
}, },
onStartDateInput(e) { onStartDateInput(e) {
this.setData({ this.setData({
'form.startDate': e.detail.value "form.startDate": e.detail,
}) });
}, },
onEndDateInput(e) { onEndDateInput(e) {
this.setData({ this.setData({
'form.endDate': e.detail.value "form.endDate": e.detail,
}) });
}, },
onAddGroupList(e) { onAddGroupList(e) {
if (e.detail.length > 0) { if (e.detail.length > 0) {
let _userIds = ""; let _userIds = "";
let _userNames = ""; let _userNames = "";
let groups = []; let groups = [];
e.detail.forEach(it => { e.detail.forEach((it) => {
let item = this.data.groupList.find(item => item.id == it.userId); let item = this.data.groupList.find((item) => item.id == it.userId);
groups.push(item); groups.push(item);
_userIds += "," + item.id; _userIds += "," + item.id;
_userNames += "," + item.userName //+ `[${item.subDeptName}]`; _userNames += "," + item.userName; //+ `[${item.subDeptName}]`;
}); });
this.setData({ this.setData({
"form.subGroup": groups, "form.subGroup": groups,
"form.groupIds": _userIds.substring(1), "form.groupIds": _userIds.substring(1),
"form.groupNames": _userNames.substring(1) "form.groupNames": _userNames.substring(1),
}) });
} else { } else {
this.setData({ this.setData({
"form.subGroup": [], "form.subGroup": [],
"form.groupIds": "", "form.groupIds": "",
"form.groupNames": "" "form.groupNames": "",
}) });
} }
}, },
onRangeChange(e) { onRangeChange(e) {
// 正确处理步进器的值变化 // 正确处理步进器的值变化
this.setData({ this.setData({
'form.range': e.detail.value "form.range": e.detail.value,
}) });
}, },
//项目切换 返回值 //项目切换 返回值
@ -438,18 +477,116 @@ Page({
/*返回列表页面并刷新*/ /*返回列表页面并刷新*/
if (isRefresh) { if (isRefresh) {
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1,
}); });
} else { } else {
wx.redirectTo({ wx.redirectTo({
url: "../list/index", url: "../list/index",
}) });
} }
}, },
returnToPage: function () { returnToPage: function () {
this.doBack(false); this.doBack(false);
}, },
submitSave() { submitSave() {
// 数据验证
if (!this.validateForm()) {
return;
}
let postData = {
projectId: app.globalData.useProjectId,
comId: app.globalData.userData.activeComId,
title: this.data.form.title,
startDate: this.data.form.startDate,
endDate: this.data.form.endDate,
address: this.data.form.address,
longitude: this.data.form.longitude,
latitude: this.data.form.latitude,
valid: 0,
range: this.data.form.range,
state: 0,
remark: "",
groupList: this.data.form.subGroup.map((it) => {
return {
groupId: it.id,
groupName: it.userName,
cfgId: -1,
};
}),
};
addMobileAttendanceConfig(postData).then((res) => {
if (res.code == 200) {
app.toast("保存成功!");
// 设置添加成功的标识
this.setData({
isAddSuccess: true,
});
this.doBack(true);
} else {
app.toast("保存失败,请重试");
// 设置添加失败的标识
this.setData({
isAddSuccess: false,
});
}
});
},
} /**
}); * 表单数据验证
*/
validateForm() {
const form = this.data.form;
// 验证考勤标题
if (!form.title || form.title.trim() === "") {
wx.showToast({
title: "请输入考勤标题",
icon: "none",
duration: 2000,
});
return false;
}
// 验证开始时间
if (!form.startDate) {
wx.showToast({
title: "请选择开始时间",
icon: "none",
duration: 2000,
});
return false;
}
// 验证结束时间
if (!form.endDate) {
wx.showToast({
title: "请选择结束时间",
icon: "none",
duration: 2000,
});
return false;
}
// 验证结束时间是否晚于开始时间
if (form.startDate && form.endDate && form.startDate > form.endDate) {
wx.showToast({
title: "结束时间必须晚于开始时间",
icon: "none",
duration: 2000,
});
return false;
}
// 验证考勤地点
if (!form.address || form.address.trim() === "") {
wx.showToast({
title: "请选择考勤地点",
icon: "none",
duration: 2000,
});
return false;
}
return true;
},
});

View File

@ -31,7 +31,7 @@
<view class="markers inspect_info_title">开始时间</view> <view class="markers inspect_info_title">开始时间</view>
<view class="inspect_info_content"> <view class="inspect_info_content">
<voucher-date counts="5" placeholder="请选择开始时间" time="{{form.startDate}}" minDate="{{ minDate }}" <voucher-date counts="5" placeholder="请选择开始时间" time="{{form.startDate}}" minDate="{{ minDate }}"
maxDate="{{ maxDate||form.endDate }}" bindchange="onStartDateInput"></voucher-date> maxDate="{{ maxDate }}" bindchange="onStartDateInput"></voucher-date>
</view> </view>
</view> </view>
@ -39,7 +39,7 @@
<view class="markers inspect_info_title">结束时间</view> <view class="markers inspect_info_title">结束时间</view>
<view class="inspect_info_content"> <view class="inspect_info_content">
<voucher-date counts="5" wx:key="form.startDate" placeholder="请选择结束时间" time="{{form.endDate}}" <voucher-date counts="5" wx:key="form.startDate" placeholder="请选择结束时间" time="{{form.endDate}}"
minDate="{{ form.startDate||minDate }}" maxDate="{{ maxDate }}" bindchange="onEndDateInput"></voucher-date> minDate="{{ minDate }}" maxDate="{{ maxDate }}" bindchange="onEndDateInput"></voucher-date>
</view> </view>
</view> </view>
@ -61,14 +61,14 @@
</view> </view>
<view class=" inspect_info_list"> <view class=" inspect_info_list">
<view class="markers inspect_info_title">指定考勤班组</view> <view class="inspect_info_title">指定考勤班组</view>
<view class="inspect_info_content"> <view class="inspect_info_content">
<select-group-person rectifierData="{{subGroupList}}" multiple="{{true}}" bindselected="onAddGroupList" <select-group-person rectifierData="{{subGroupList}}" multiple="{{true}}" bindselected="onAddGroupList"
index="3" :title="{{form.groupNames?form.groupNames:'请选择考勤班组'}}" choose="{{form.groupNames}}"> index="3" :title="{{form.groupNames?form.groupNames:'请选择考勤班组'}}" choose="{{form.groupNames}}">
</select-group-person> </select-group-person>
</view> </view>
<view wx:if="{{form.subGroup && form.subGroup.length>0}}"> <view wx:if="{{form.subGroup && form.subGroup.length>0}}">
<view wx:for="{{form.subGroup}}" wx:key="item.id"> <view wx:for="{{form.subGroup}}" wx:key="id">
{{item.groupName}} <view class="dept-name"> [{{item.subDeptName}}]</view> {{item.groupName}} <view class="dept-name"> [{{item.subDeptName}}]</view>
</view> </view>
</view> </view>

View File

@ -3,13 +3,15 @@ import config from "../../../../config.js";
import fmt from "../../../utils/date.js"; import fmt from "../../../utils/date.js";
import { getToken, getUserInfo } from "../../../../utils/auth.js"; import { getToken, getUserInfo } from "../../../../utils/auth.js";
import { uploadFiles } from "../../../utils/upload.js"; import { uploadFiles } from "../../../utils/upload.js";
import { tryToJson } from '../../../utils/tools.js' import { tryToJson } from "../../../utils/tools.js";
import { import {
getProjectChecked, getProjectChecked,
findPlanDatas, findPlanDatas,
listProProjectInfoSubdeptsUsers, listProProjectInfoSubdeptsUsers,
updateProjectChecked, updateProjectChecked,
addProjectChecked, addProjectChecked,
getMobileAttendanceConfig,
selectMobileAttendanceCountByValid,
} from "../../../../api/project.js"; } from "../../../../api/project.js";
const app = getApp(); const app = getApp();
@ -26,9 +28,10 @@ Page({
initData: {}, initData: {},
listData: [], listData: [],
counts: [0, 0], counts: [0, 0],
activeState: 'vaild', activeState: "vaild",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0,
}, },
/** /**
@ -50,14 +53,27 @@ Page({
text: app.globalData.useProjectName, text: app.globalData.useProjectName,
}, },
}); });
this.getCount();
},
getCount() {
selectMobileAttendanceCountByValid({
projectId: app.globalData.useProjectId,
}).then((res) => {
let tmps = res.data || [];
if (tmps.length == 2) {
this.setData({
counts: tmps,
});
}
});
}, },
switchTabJump(e) { switchTabJump(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
let nav = ""; let nav = "";
if (index == 1) { if (index == 1) {
nav = 'vaild'; nav = "vaild";
} else { } else {
nav = 'invalid'; nav = "invalid";
} }
if (nav != this.data.activeState) { if (nav != this.data.activeState) {
this.setData({ this.setData({
@ -66,52 +82,111 @@ Page({
pageSize: 10, pageSize: 10,
listData: [], listData: [],
}); });
//this.getListData(); this.getListData();
} }
}, },
getListData() {
//TODO 获取列表数据
console.log("===>获取列表数据");
let data = {
projectId: app.globalData.useProjectId,
pageNum: this.data.pageNum,
pageSize: this.data.pageSize,
valid: this.data.activeState == "vaild" ? 0 : 1,
};
getMobileAttendanceConfig(data).then((res) => {
if (res.code == 200) {
if (this.data.activeState == "vaild") {
this.data.counts[0] = res.total;
} else {
this.data.counts[1] = res.total;
}
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows),
counts: this.data.counts,
});
}
});
},
/** /**
* 增加 * 增加
*/ */
doAddCfg() { doAddCfg() {
wx.redirectTo({ wx.navigateTo({
url: '../add/index', url: "../add/index",
}); });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { }, onReady() {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { }, onShow() {
// 获取页面栈
let pages = getCurrentPages();
let currPage = null;
// 如果页面栈存在且有前一个页面
if (pages.length > 1) {
// 获取前一个页面
let prevPage = pages[pages.length - 2];
// 检查前一个页面是否是添加页面,并且是否成功添加
if (prevPage && prevPage.route && prevPage.route.includes("add")) {
// 从前一个页面获取是否成功添加的标识
let isAddSuccess = prevPage.data.isAddSuccess || false;
if (isAddSuccess) {
// 只有添加成功时才刷新数据
this.setData({
pageNum: 1,
listData: [],
});
// 调用getListData方法刷新数据
if (this.getListData) {
this.getListData();
}
}
}
} else {
// 如果没有前一个页面,可能是首次进入,也刷新数据
this.setData({
pageNum: 1,
listData: [],
});
if (this.getListData) {
this.getListData();
}
}
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { }, onHide() {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { }, onUnload() {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { }, onPullDownRefresh() {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { }, onReachBottom() {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { }, onShareAppMessage() {},
//项目切换 返回值 //项目切换 返回值
onProjectSelect(e) { onProjectSelect(e) {
let projectId = e.detail.id; let projectId = e.detail.id;
@ -122,14 +197,25 @@ Page({
}, },
returnToPage() { returnToPage() {
/*关闭当前页面,跳转到其它页面。*/ /*关闭当前页面,跳转到其它页面。*/
if (wx.getStorageSync('nav-menu') == "xmgl") { if (wx.getStorageSync("nav-menu") == "xmgl") {
wx.redirectTo({ wx.redirectTo({
url: '../../../project_more/index', url: "../../../project_more/index",
}) });
} else { } else {
wx.redirectTo({ wx.redirectTo({
url: '../../../project_quality/index', url: "../../../project_quality/index",
}) });
}
},
onScrollToLower() {
let nal = Math.ceil(this.data.total / this.data.pageSize);
if (this.data.pageNum < nal) {
this.setData({
pageNum: this.data.pageNum + 1,
});
this.getListData(this.data.activeState);
} else {
console.log("已经到底了,没有数据可加载!!!");
} }
}, },
}); });

View File

@ -1,5 +1,7 @@
{ {
"usingComponents": {}, "usingComponents": {
"svg-icon": "/pageage/components/svg-icon/index"
},
"navigationStyle": "custom", "navigationStyle": "custom",
"styleIsolation": "apply-shared", "styleIsolation": "apply-shared",
"backgroundColor": "#191d28" "backgroundColor": "#191d28"

View File

@ -15,7 +15,7 @@
</view> </view>
</view> </view>
<scroll-view class="max_content_scroll" type="list" scroll-y> <scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select> <project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
@ -28,19 +28,55 @@
</view> </view>
</view> </view>
<view wx:if="{{listData.length==0}}"> <view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;"> <view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image> <image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view> <view style="color: #a5abbb;">暂无数据</view>
</view> </view>
</view> </view>
<view class="inspect_max_scroll" wx:else>
<view class="inspect_for_scroll" wx:for="{{ listData }}" wx:key="index" data-set="{{ item }}" bindtap="getInfo">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_number">{{
index < 10 ? "0" + (index + 1) : index + 1 }}</view>
<view class="module_title">
</view>
</view>
<view class="inspect_add_to" bindtap="doAddCfg"> <view class="inspect_list_content">
<svg-icon src="attendance" color="#45affb" size="140" />
<view class="content-right">
<view class="content-row first">
考勤标题:
{{item.title}}
</view>
<view class="content-row">
开始时间:
{{item.startDate}}
</view>
<view class="content-row">
结束时间:
{{item.endDate}}
</view>
<view class="content-row">
考勤位置:
{{item.address}}
</view>
</view>
</view>
<view style="padding-top: 22rpx"> </view>
<image src="/images/new_add.png"></image> </view>
<view>新增</view> </view>
<view class="inspect_add_to" bindtap="doAddCfg">
<view style="padding-top: 22rpx">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view> </view>
</view>
</scroll-view> </scroll-view>

View File

@ -1 +1,20 @@
/* pageage/mobile_attendance/attendance_config/index.wxss */ /* pageage/mobile_attendance/attendance_config/index.wxss */
.inspect_list_title{
justify-content: left;
}
.inspect_list_content{
display: flex;
padding-top: 20rpx;
}
.content-right{
padding-left: 20rpx;
line-height: 40rpx;
}
.content-row{
font-size:24rpx;
}
.content-row.first{
color: #03a9f4;
}