移动端考勤配置开发-配置详情页面-失效功能

dev_xd
lj7788@126.com 2025-09-02 15:51:01 +08:00
parent 4823d75b28
commit 6fce3ed81b
24 changed files with 673 additions and 267 deletions

View File

@ -57,6 +57,25 @@ public class ProMobileAttendanceConfig extends BaseEntity
this.startDate = startDate;
}
private Long groupId;
private Long userId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getGroupId() {
return groupId;
}
public void setGroupId(Long groupId) {
this.groupId = groupId;
}
public Integer getIsDel() {
return isDel;
}
@ -91,7 +110,11 @@ public class ProMobileAttendanceConfig extends BaseEntity
/** 考勤范围 */
@Excel(name = "考勤范围")
private BigDecimal rang;
private BigDecimal range;
/** 是否全部班组 1-是 0-否 */
@Excel(name = "是否全部班组", readConverterExp = "1=是,0=否")
private Integer isAll;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
@ -179,14 +202,24 @@ public class ProMobileAttendanceConfig extends BaseEntity
{
return valid;
}
public void setRang(BigDecimal rang)
public void setRange(BigDecimal range)
{
this.rang = rang;
this.range = range;
}
public BigDecimal getRang()
public BigDecimal getRange()
{
return rang;
return range;
}
public void setIsAll(Integer isAll)
{
this.isAll = isAll;
}
public Integer getIsAll()
{
return isAll;
}
public void setState(Long state)
{
@ -211,7 +244,8 @@ public class ProMobileAttendanceConfig extends BaseEntity
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("valid", getValid())
.append("rang", getRang())
.append("range", getRange())
.append("isAll", getIsAll())
.append("state", getState())
.append("remark", getRemark())
.append("createBy", getCreateBy())

View File

@ -15,7 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="valid" column="valid" />
<result property="rang" column="rang" />
<result property="range" column="range" />
<result property="isAll" column="is_all" />
<result property="state" column="state" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
@ -33,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProMobileAttendanceConfigVo">
select c.id, c.com_id, c.project_id, c.title, c.start_date, c.end_date, c.address, c.longitude, c.latitude, c.valid, c.rang, c.state, c.is_del, c.remark, c.create_by, c.create_time, c.update_by, c.update_time, g.id as group_id, g.cfg_id, g.group_id as group_id, pg.group_name, pg.sub_dept_name as dept_name
select c.id, c.com_id, c.project_id, c.title, c.start_date, c.end_date, c.address, c.longitude, c.latitude, c.valid, c.range, c.is_all, c.state, c.is_del, c.remark, c.create_by, c.create_time, c.update_by, c.update_time, g.cfg_id, pg.id as group_id, pg.group_name, pg.sub_dept_name as dept_name
from pro_mobile_attendance_config c
left join pro_mobile_attendance_config_group g on c.id=g.cfg_id
left join pro_project_info_subdepts_group pg on g.group_id=pg.id
@ -55,8 +56,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<when test="valid==null or valid==0">and c.valid=0 and date(c.end_date) &gt;=CURRENT_DATE()</when>
<otherwise>and ( c.valid!=0 or date(c.end_date) &lt; CURRENT_DATE() )</otherwise>
</choose>
<if test="rang != null "> and c.rang = #{rang}</if>
<if test="range != null "> and c.range = #{range}</if>
<if test="isAll != null "> and c.is_all = #{isAll}</if>
<if test="state != null "> and c.state = #{state}</if>
<if test="groupId!=null">
and ( (c.is_all=1 and c.valid=0 ) or g.group_id= #{groupId})
</if>
<if test="userId!=null">
and ( (c.is_all=1 and c.valid=0 ) or g.group_id in (SELECT sub_dept_group from pro_project_info_subdepts_users where user_id=#{userId}) )
</if>
</where>
</select>
<select id="selectCountByValid" resultType="java.lang.Long" parameterType="Long">
@ -82,7 +90,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="valid != null">valid,</if>
<if test="rang != null">rang,</if>
<if test="range != null">`range`,</if>
<if test="isAll != null">is_all,</if>
<if test="state != null">state,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
@ -101,7 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="valid != null">#{valid},</if>
<if test="rang != null">#{rang},</if>
<if test="range != null">#{range},</if>
<if test="isAll != null">#{isAll},</if>
<if test="state != null">#{state},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
@ -124,7 +134,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="valid != null">valid = #{valid},</if>
<if test="rang != null">rang = #{rang},</if>
<if test="range != null">`range` = #{range},</if>
<if test="isAll != null">is_all = #{isAll},</if>
<if test="state != null">state = #{state},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>

View File

@ -1,7 +1,9 @@
package com.yanzhu.manage.service.impl;
import java.util.Collections;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.manage.domain.ProMobileAttendanceConfigGroup;
@ -59,6 +61,7 @@ public class ProMobileAttendanceConfigServiceImpl implements IProMobileAttendanc
@Override
public int insertProMobileAttendanceConfig(ProMobileAttendanceConfig proMobileAttendanceConfig)
{
proMobileAttendanceConfig.setIsAll(CollectionUtil.isEmpty(proMobileAttendanceConfig.getGroupList())?1:0);
proMobileAttendanceConfig.setCreateBy(SecurityContextHolder.getUserName());
proMobileAttendanceConfig.setCreateTime(DateUtils.getNowDate());
int cnt= proMobileAttendanceConfigMapper.insertProMobileAttendanceConfig(proMobileAttendanceConfig);
@ -83,6 +86,7 @@ public class ProMobileAttendanceConfigServiceImpl implements IProMobileAttendanc
@Override
public int updateProMobileAttendanceConfig(ProMobileAttendanceConfig proMobileAttendanceConfig)
{
proMobileAttendanceConfig.setIsAll(CollectionUtil.isEmpty(proMobileAttendanceConfig.getGroupList())?1:0);
proMobileAttendanceConfig.setUpdateBy(SecurityContextHolder.getUserName());
proMobileAttendanceConfig.setUpdateTime(DateUtils.getNowDate());
int cnt= proMobileAttendanceConfigMapper.updateProMobileAttendanceConfig(proMobileAttendanceConfig);

View File

@ -1,128 +1,127 @@
{
"pages": [
"pages/login/login",
"pages/project_qr/index",
"pages/test-stepper/index"
],
"subpackages": [
{
"root": "pageage",
"name": "pageage",
"pages": [
"project_flowable/approveTask/index",
"project_flowable/detailTask/index",
"project_flowable/subDepts/index",
"project_flowable/subDeptsUsers/index",
"project_video/list/index",
"project_video/info/index",
"project_list/index",
"project_info/index",
"project_more/index",
"project_safety/index",
"project_quality/index",
"sign_mags/index",
"project_problemmodify/list/index",
"project_problemmodify/info/index",
"project_problemmodify/modify/index",
"project_problemmodify/check/index",
"project_problemmodify/add/index",
"project_problemmodify/draft/index",
"project_subdepts/list/index",
"project_subdepts/add/index",
"project_subdepts/info/index",
"project_subgroups/list/index",
"project_subgroups/add/index",
"project_subgroups/info/index",
"project_subusers/list/index",
"project_subusers/add/index",
"project_subusers/info/index",
"project_magusers/list/index",
"project_magusers/add/index",
"project_magusers/info/index",
"project_schedule/list/index",
"project_schedule/add/index",
"project_schedule/info/index",
"project_checked/list/index",
"project_checked/add/index",
"project_checked/info/index",
"mobile_attendance/attendance/index",
"mobile_attendance/attendance_config/list/index",
"mobile_attendance/attendance_config/add/index",
"mobile_attendance/attendance_config/info/index"
],
"independent": false
}
],
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-toast": "@vant/weapp/toast/index",
"ec-canvas": "ec-canvas/ec-canvas",
"van-sticky": "@vant/weapp/sticky",
"van-calendar": "@vant/weapp/calendar/index",
"van-icon": "@vant/weapp/icon/index",
"van-image": "@vant/weapp/image/index",
"pie-chart": "pages/components/pie-chart/index",
"deep-select": "pages/components/deep-select/index",
"select-btn": "pages/components/select-btn/index",
"bar-chart": "pages/components/bar-chart/index",
"bar-chart-warning": "pages/components/bar-chart-warning/index",
"pz-screen": "pages/components/pz-screen/index",
"pz-screen-training": "pages/components/pz-screen-training/index",
"pz-screen-training-index": "pages/components/pz-screen-training-index/index",
"select-date": "pages/components/select-date/index",
"voucher-select": "pages/components/voucher-select/index",
"voucher-selects": "pages/components/voucher-selects/index",
"voucher-selected": "pages/components/voucher-selected/index",
"voucher-date": "pages/components/voucher-date/index",
"voucher-datetime": "pages/components/voucher-datetime/index",
"file-uploader": "pages/components/file-uploader/index",
"file-uploader-all": "pages/components/file-uploader-all/index",
"project-select": "pages/components/project-select/index",
"safety-pie-chart": "./components/safety-pie-chart/index",
"safety-pie-charts": "./components/safety-pie-charts/index",
"safety-bar-chart": "./components/safety-bar-chart/index",
"safety-bar-charts": "./components/safety-bar-charts/index",
"safety-bar-chartss": "./components/safety-bar-chartss/index",
"voucher-many-select": "pages/components/voucher-many-select/index",
"sign": "pages/components/sign/sign",
"jyq-result": "pages/components/jyq-result/index",
"safety-number": "./components/number/index",
"select-person": "./components/select-person/index",
"select-roles": "./components/select-roles/index",
"select-group-person": "./components/select-group-person/index",
"select-group-position": "./components/select-group-position/index",
"select-group-plan": "./components/select-group-plan/index",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index",
"curve-echarts": "pages/components/curve-echarts/index",
"user-infos": "pages/components/user-infos/index"
},
"plugins": {
"ezplayer": {
"version": "1.0.9",
"provider": "wxf2b3a0262975d8c2"
}
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#191d28",
"navigationBarTextStyle": "white"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos": [
"getLocation"
],
"lazyCodeLoading": "requiredComponents"
}
"pages": [
"pages/login/login",
"pages/project_qr/index",
"pages/test-stepper/index"
],
"subpackages": [
{
"root": "pageage",
"name": "pageage",
"pages": [
"project_flowable/approveTask/index",
"project_flowable/detailTask/index",
"project_flowable/subDepts/index",
"project_flowable/subDeptsUsers/index",
"project_video/list/index",
"project_video/info/index",
"project_list/index",
"project_info/index",
"project_more/index",
"project_safety/index",
"project_quality/index",
"sign_mags/index",
"project_problemmodify/list/index",
"project_problemmodify/info/index",
"project_problemmodify/modify/index",
"project_problemmodify/check/index",
"project_problemmodify/add/index",
"project_problemmodify/draft/index",
"project_subdepts/list/index",
"project_subdepts/add/index",
"project_subdepts/info/index",
"project_subgroups/list/index",
"project_subgroups/add/index",
"project_subgroups/info/index",
"project_subusers/list/index",
"project_subusers/add/index",
"project_subusers/info/index",
"project_magusers/list/index",
"project_magusers/add/index",
"project_magusers/info/index",
"project_schedule/list/index",
"project_schedule/add/index",
"project_schedule/info/index",
"project_checked/list/index",
"project_checked/add/index",
"project_checked/info/index",
"mobile_attendance/attendance/list/index",
"mobile_attendance/attendance/add/index",
"mobile_attendance/attendance_config/list/index",
"mobile_attendance/attendance_config/add/index",
"mobile_attendance/attendance_config/info/index"
],
"independent": false
}
],
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-toast": "@vant/weapp/toast/index",
"ec-canvas": "ec-canvas/ec-canvas",
"van-sticky": "@vant/weapp/sticky",
"van-calendar": "@vant/weapp/calendar/index",
"van-icon": "@vant/weapp/icon/index",
"van-image": "@vant/weapp/image/index",
"pie-chart": "pages/components/pie-chart/index",
"deep-select": "pages/components/deep-select/index",
"select-btn": "pages/components/select-btn/index",
"bar-chart": "pages/components/bar-chart/index",
"bar-chart-warning": "pages/components/bar-chart-warning/index",
"pz-screen": "pages/components/pz-screen/index",
"pz-screen-training": "pages/components/pz-screen-training/index",
"pz-screen-training-index": "pages/components/pz-screen-training-index/index",
"select-date": "pages/components/select-date/index",
"voucher-select": "pages/components/voucher-select/index",
"voucher-selects": "pages/components/voucher-selects/index",
"voucher-selected": "pages/components/voucher-selected/index",
"voucher-date": "pages/components/voucher-date/index",
"voucher-datetime": "pages/components/voucher-datetime/index",
"file-uploader": "pages/components/file-uploader/index",
"file-uploader-all": "pages/components/file-uploader-all/index",
"project-select": "pages/components/project-select/index",
"safety-pie-chart": "./components/safety-pie-chart/index",
"safety-pie-charts": "./components/safety-pie-charts/index",
"safety-bar-chart": "./components/safety-bar-chart/index",
"safety-bar-charts": "./components/safety-bar-charts/index",
"safety-bar-chartss": "./components/safety-bar-chartss/index",
"voucher-many-select": "pages/components/voucher-many-select/index",
"sign": "pages/components/sign/sign",
"jyq-result": "pages/components/jyq-result/index",
"safety-number": "./components/number/index",
"select-person": "./components/select-person/index",
"select-roles": "./components/select-roles/index",
"select-group-person": "./components/select-group-person/index",
"select-group-position": "./components/select-group-position/index",
"select-group-plan": "./components/select-group-plan/index",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index",
"curve-echarts": "pages/components/curve-echarts/index",
"user-infos": "pages/components/user-infos/index"
},
"plugins": {
"ezplayer": {
"version": "1.0.9",
"provider": "wxf2b3a0262975d8c2"
}
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#191d28",
"navigationBarTextStyle": "white"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents"
}

View File

@ -2,8 +2,8 @@
module.exports = {
timeout: 60000,
appId: "wx46466c7828eede2b",
baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
//baseUrl: 'http://127.0.0.1:8080',
//baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
baseUrl: "http://127.0.0.1:8080",
baseImgUrl: "https://xiangguan.sxyanzhu.com",
//baseImgUrl: 'http://127.0.0.1:9300',
noSecuritys: [

View File

@ -0,0 +1 @@
<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="4150"><path d="M942.666249 717.668023c-36.670631-26.374544-88.792071-47.994992-154.908711-64.233699a29.379238 29.379238 0 1 0-14.021909 57.009077c108.556286 26.708399 173.364215 68.907668 173.364215 112.98988 0 36.563798-46.552739 72.79374-127.719562 99.40866-82.061555 26.908712-194.103286 42.346166-307.373605 42.346165-113.510694 0-225.685968-15.437454-307.627334-42.346165-81.019927-26.534794-127.479186-62.764737-127.479187-99.355243 0-43.401148 64.46072-85.466875 172.416067-112.535837a29.379238 29.379238 0 1 0-14.288993-56.995723c-65.742723 16.492436-117.516954 38.166302-154.000626 64.434012C29.052061 755.847679 18.14168 796.230777 18.14168 823.486698c0 45.684716 29.125509 109.691393 167.915701 155.242566 87.656964 28.764945 206.455921 45.270736 325.949296 45.270736 119.239645 0 237.945123-16.50579 325.682212-45.270736 139.00386-45.577882 168.169431-109.504434 168.169431-155.242566 0-27.576421-10.963798-68.226604-63.192071-105.818675zM474.855295 871.628586l0.961502 1.148461a48.075117 48.075117 0 0 0 36.056338 16.532499A44.843401 44.843401 0 0 0 548.303391 871.32144c19.790923-23.890662 88.271257-108.088889 154.815232-207.404069C799.362337 520.226187 848.198644 409.973918 848.198644 336.272092 848.198644 150.902452 697.135942 0 511.432447 0S174.666249 150.902452 174.666249 336.272092c0 73.701826 48.863015 184.03422 145.280334 327.792175C386.71758 763.860198 455.398226 848.151904 474.855295 871.628586zM511.432447 58.758477c153.306208 0 278.00772 124.487846 278.00772 277.513615 0 116.702347-170.733438 356.183203-278.00772 487.348148-107.274283-131.151591-278.00772-370.605738-278.007721-487.348148C233.424726 183.246322 358.139593 58.758477 511.432447 58.758477zM681.164319 322.664163c0-93.011998-75.87856-168.690245-169.157642-168.690245S342.835681 229.692227 342.835681 322.664163a168.930621 168.930621 0 0 0 169.170996 168.676891c93.279082 0 169.157642-75.664893 169.157642-168.676891z m-247.252999 77.708085a107.982055 107.982055 0 0 1-32.317162-77.708085c0-60.61471 49.530725-109.931768 110.412519-109.931769s110.399165 49.317058 110.399165 109.931769-49.517371 109.918414-110.399165 109.918414a109.330829 109.330829 0 0 1-77.908398-32.050078z" p-id="4151" fill="#ccc"></path></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,18 +1,6 @@
// pageage/mobile_attendance/attendance_config/index.js
import config from "../../../config";
import fmt from "../../utils/date.js";
import { getToken, getUserInfo } from "../../../utils/auth";
import { uploadFiles } from "../../utils/upload.js";
import { tryToJson } from '../../utils/tools'
import {
getProjectChecked,
findPlanDatas,
listProProjectInfoSubdeptsUsers,
updateProjectChecked,
addProjectChecked,
} from "../../../api/project";
import { getToken, getUserInfo } from "../../../../utils/auth.js";
const app = getApp();
import { getMobileAttendanceConfigById } from "../../../../api/project.js";
Page({
/**
@ -24,8 +12,8 @@ Page({
projectId: "",
projectName: "",
initData: {},
total: 0,
listData: [],
type: "",
cfgData: null,
},
/**
@ -46,44 +34,61 @@ Page({
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
type: options.type,
});
if (options.id) {
this.loadData(options.id);
} else {
app.toast("参数错误!");
this.returnToPage();
}
},
loadData(id) {
getMobileAttendanceConfigById(id).then((res) => {
if (res.code == 200) {
this.setData({
cfgData: res.data,
});
} else {
app.toast("参数错误!");
this.returnToPage();
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() { },
//项目切换 返回值
onShareAppMessage() {},
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
@ -91,16 +96,9 @@ Page({
app.globalData.useProjectName = projectName;
this.onLoad();
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
if (wx.getStorageSync('nav-menu') == "xmgl") {
wx.redirectTo({
url: '../../project_more/index',
})
} else {
wx.redirectTo({
url: '../../project_quality/index',
})
}
returnToPage() {
wx.redirectTo({
url: "../list/index",
});
},
});

View File

@ -1,6 +1,6 @@
{
"usingComponents": {},
"usingComponents": {},
"navigationStyle": "custom",
"styleIsolation": "apply-shared",
"backgroundColor": "#191d28"
}
"backgroundColor": "#191d28"
}

View File

@ -0,0 +1,19 @@
<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">移动考勤配置详情</view>
</van-col>
</van-row>
</view>
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
</scroll-view>

View File

@ -0,0 +1 @@
/* pageage/mobile_attendance/attendance_config/info/index.wxss */

View File

@ -1,35 +0,0 @@
<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">移动考勤打卡</view>
</van-col>
</van-row>
</view>
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y>
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx;">
<view>
<text>生效中的考勤点({{total}})</text>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
</scroll-view>

View File

@ -1,8 +0,0 @@
/* pageage/mobile_attendance/attendance/index.wxss */
.modify_video_nav{
margin-top: 2px;
justify-content: left;
padding-left: 40rpx;
color: #fff;
}

View File

@ -0,0 +1,88 @@
import { getToken, getUserInfo } from "../../../../utils/auth.js";
import { getMobileAttendanceConfig } from "../../../../api/project.js";
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
projectUserInfo: {},
projectUserInfo: {},
projectId: "",
projectName: "",
initData: {},
total: 0,
listData: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: "../../../pages/login/login",
});
}
const proUserInfo = getUserInfo();
this.setData({
projectUserInfo: proUserInfo.projectUserInfo,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
});
this.getListData();
},
getListData() {
let postData = {
pageNum: this.data.pageNum,
pageSize: this.data.pageSize,
projectId: app.globalData.useProjectId,
groupId: this.data.projectUserInfo.subDeptGroup,
};
getMobileAttendanceConfig(postData).then((res) => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows),
});
}
});
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
if (wx.getStorageSync("nav-menu") == "xmgl") {
wx.redirectTo({
url: "../../project_more/index",
});
} else {
wx.redirectTo({
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();
} else {
console.log("已经到底了,没有数据可加载!!!");
}
},
});

View File

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

View File

@ -0,0 +1,72 @@
<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">移动考勤打卡</view>
</van-col>
</van-row>
</view>
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx;">
<view>
<text>生效中的考勤点({{total}})</text>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</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_list_content">
<svg-icon src="position" color="#45affb" size="120" class="left-img"/>
<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>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,28 @@
.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;
line-height:50rpx;
}
.content-row.first{
color: #728ce3;
font-weight: bold;
font-size: 30rpx;
}
.inspect_for_bgd{
padding:30rpx 30rpx;
}
.left-img{
position: relative;
top:36rpx;
}

View File

@ -5,8 +5,8 @@ import { uploadFiles } from "../../../utils/upload.js";
import { tryToJson } from "../../../utils/tools";
import {
findSubGroupsList,
subdeptsList,
addMobileAttendanceConfig,
updateMobileAttendanceConfig,
} from "../../../../api/project";
import { findDictCache } from "../../../../api/publics";
const app = getApp();
@ -53,6 +53,7 @@ Page({
subDeptTypeList: [],
// 添加成功标识
isAddSuccess: false,
cfgData: null,
},
/**
@ -77,6 +78,41 @@ Page({
// 获取当前位置作为初始位置
this.getUserLocation();
this.getSubGroupList();
if (options.id && options.type == "edit") {
this.toEditMode();
}
},
toEditMode() {
try {
let cfgData = wx.getStorageSync("editAttCfg");
if (cfgData) {
let form = {};
form.title = cfgData.title;
form.startDate = cfgData.startDate;
form.endDate = cfgData.endDate;
form.longitude = cfgData.longitude;
form.latitude = cfgData.latitude;
form.address = cfgData.address;
form.range = cfgData.range;
let groupList = (cfgData.groupList || []).map((it) => {
it.status = true;
it.userId = it.id;
it.userName = it.groupName;
it.subDeptName = it.deptName;
return it;
});
form.subGroup = groupList;
form.groupIds = groupList.map((it) => it.id).join(",");
form.groupNames = groupList.map((it) => it.groupName).join(",");
this.setData({
cfgData: cfgData,
form: form,
});
}
} catch (e) {
app.toast("参数错误!");
this.returnToPage();
}
},
getSubGroupList() {
findDictCache("sub_dept_type").then((dict) => {
@ -475,9 +511,9 @@ Page({
},
doBack(isRefresh) {
/*返回列表页面并刷新*/
if (isRefresh) {
if (this.data.cfgData) {
wx.redirectTo({
url: "../list/index",
url: "../info/index?type=cfg&id=" + this.data.cfgData.id,
});
} else {
wx.redirectTo({
@ -514,7 +550,14 @@ Page({
};
}),
};
addMobileAttendanceConfig(postData).then((res) => {
let ajax = null;
if (this.data.cfgData) {
postData.id = this.data.cfgData.id;
ajax = updateMobileAttendanceConfig(postData);
} else {
ajax = addMobileAttendanceConfig(postData);
}
ajax.then((res) => {
if (res.code == 200) {
app.toast("保存成功!");
this.doBack(true);
@ -581,4 +624,45 @@ Page({
}
return true;
},
doDelete() {
// 添加确认提示
wx.showModal({
title: "确认失效",
content: "确定要将此考勤配置设置为失效状态吗?",
confirmColor: "#FF0000",
success: (res) => {
if (res.confirm) {
// 用户点击确定,执行失效操作
this.performDelete();
}
},
});
},
performDelete() {
// 实现失效功能
if (this.data.cfgData) {
// 创建失效的数据副本
let updateData = Object.assign({}, this.data.cfgData);
// 设置为失效状态 (1表示失效0表示有效)
updateData.valid = 1;
updateMobileAttendanceConfig(updateData)
.then((res) => {
if (res.code == 200) {
app.toast("考勤配置已失效!");
// 返回列表页面并刷新
wx.redirectTo({
url: "../list/index",
});
} else {
app.toast("操作失败,请重试");
}
})
.catch((error) => {
console.error("失效操作出错:", error);
app.toast("操作失败,请重试");
});
}
},
});

View File

@ -74,8 +74,9 @@
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to {{cfgData?'is-edit':''}}">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view class="problem_submit_to_btn problem_submit_to_delete" wx:if="{{cfgData}}" bindtap="doDelete">失效</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">保存</view>
</view>
</view>

View File

@ -220,4 +220,8 @@
.search-result-address {
color: #999999;
font-size: 24rpx;
}
.problem_submit_to.is-edit .problem_submit_to_btn{
width:180rpx;
}

View File

@ -1,6 +1,9 @@
import { getToken, getUserInfo } from "../../../../utils/auth.js";
const app = getApp();
import { getMobileAttendanceConfigById } from "../../../../api/project.js";
import {
getMobileAttendanceConfigById,
updateMobileAttendanceConfig,
} from "../../../../api/project.js";
Page({
/**
@ -48,6 +51,7 @@ Page({
if (res.code == 200) {
this.setData({
cfgData: res.data,
type: res.data.valid == 0 ? "cfg" : "",
});
} else {
app.toast("参数错误!");
@ -55,40 +59,7 @@ Page({
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
@ -101,4 +72,55 @@ Page({
url: "../list/index",
});
},
doDelete() {
// 添加确认提示
wx.showModal({
title: "确认失效",
content: "确定要将此考勤配置设置为失效状态吗?",
confirmColor: "#FF0000",
success: (res) => {
if (res.confirm) {
// 用户点击确定,执行失效操作
this.performDelete();
}
},
});
},
performDelete() {
// 实现失效功能
if (this.data.cfgData) {
// 创建失效的数据副本
let updateData = Object.assign({}, this.data.cfgData);
// 设置为失效状态 (1表示失效0表示有效)
updateData.valid = 1;
updateMobileAttendanceConfig(updateData)
.then((res) => {
if (res.code == 200) {
app.toast("考勤配置已失效!");
// 返回列表页面并刷新
this.returnToPage();
} else {
app.toast("操作失败,请重试");
}
})
.catch((error) => {
console.error("失效操作出错:", error);
app.toast("操作失败,请重试");
});
}
},
doEdit() {
try {
wx.setStorageSync("editAttCfg", this.data.cfgData);
wx.redirectTo({
url: "../add/index?type=edit&id=" + this.data.cfgData.id,
});
} catch (e) {
app.toast("参数错误!");
this.returnToPage();
}
},
});

View File

@ -16,4 +16,44 @@
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="content_box">
<view class="box-row">
<view class="box-title">考勤标题</view>
<view class="box-content">{{ cfgData.title }}</view>
</view>
<view class="box-row">
<view class="box-title">开始时间</view>
<view class="box-content">{{ cfgData.startDate }}</view>
</view>
<view class="box-row">
<view class="box-title">结束时间</view>
<view class="box-content">{{ cfgData.endDate }}</view>
</view>
<view class="box-row">
<view class="box-title">指定考勤地点</view>
<view class="box-content">{{ cfgData.address }}</view>
</view>
<view class="box-row">
<view class="box-title">考勤范围</view>
<view class="box-content">{{ cfgData.range }}</view>
</view>
<view class="box-row">
<view class="box-title">考勤班组</view>
<view class="box-content" wx:if="{{!cfgData.groupList||cfgData.groupList.length==0}}">全部</view>
<view class="box-content" wx:else>
<view class="group-item" wx:for="{{cfgData.groupList}}" wx:key="id">
{{item.groupName}}
<text class="dept-name">({{item.deptName}})</text>
</view>
</view>
</view>
<view class="problem_submit_to">
<view wx:if="{{type=='cfg' }}" class="problem_submit_to_btn problem_submit_to_save" bindtap="doEdit">编辑</view>
<view wx:if="{{type=='cfg' }}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="doDelete">失效</view>
<view class="problem_submit_to_btn" bindtap="returnToPage">返回</view>
</view>
</view>
</scroll-view>

View File

@ -1 +1,28 @@
/* pageage/mobile_attendance/attendance_config/info/index.wxss */
.box-row{
display: flex;
line-height: 60rpx;
}
.box-title{
width:30%;
min-width: 30%;
text-align: right;
padding-right:20rpx;
color:#728ce3;
}
.dept-name{
color:#ff711e;
}
.box-content{
width:70%;
min-width: 70%;
}
.problem_submit_to_btn{
width:180rpx;
}
.group-item{
padding-right: 20rpx;
}

View File

@ -47,7 +47,7 @@
</view>
<view class="inspect_list_content">
<svg-icon src="attendance" color="#45affb" size="140" />
<svg-icon src="attendance" color="#45affb" size="120" class="left-img"/>
<view class="content-right">
<view class="content-row first">
考勤标题:

View File

@ -1,4 +1,3 @@
/* pageage/mobile_attendance/attendance_config/index.wxss */
.inspect_list_title{
justify-content: left;
}
@ -13,8 +12,17 @@
}
.content-row{
font-size:24rpx;
line-height:50rpx;
}
.content-row.first{
color: #03a9f4;
color: #728ce3;
font-weight: bold;
font-size: 30rpx;
}
.inspect_for_bgd{
padding:30rpx 30rpx;
}
.left-img{
position: relative;
top:36rpx;
}