小程序开发

dev_xd
lj7788@126.com 2025-08-02 15:44:20 +08:00
parent e9653574d6
commit daf407f5af
16 changed files with 1293 additions and 929 deletions

View File

@ -1,6 +1,6 @@
{
"files.associations": {
"*.wxml": "xml",
"*.wxml": "html",
"*.wxss": "css",
"*.wxs": "javascript"
},

View File

@ -1,4 +1,4 @@
<!--components/bar-chart/index.wxml-->
<view class="chart_canvas" style="height:{{height+'rpx'}}">
<ec-canvas id="{{ chartId }}" ec="{{ ec }}"></ec-canvas>
<ec-canvas id="{{ chartId }}" ec="{{ ec }}" force-use-old-canvas="true"></ec-canvas>
</view>

View File

@ -18,6 +18,10 @@ Component({
showCheckBox: { // 是否显示选择框
type: Boolean,
value: true
},
multiple: { // 是否多选
type: Boolean,
value: true
}
},
observers: {
@ -59,7 +63,7 @@ Component({
select(e) {
this._initSourceData(this.data.tree);
let item = e.currentTarget.dataset.item
if(item.children && item.children.length>0){
if (item.children && item.children.length > 0) {
wx.showToast({
title: "请选择进度计划任务!",
icon: 'none',
@ -119,6 +123,15 @@ Component({
composed: true
})
},
handleClickItem(e) {
let item = e.detail.item;
this.triggerEvent('clickItem', {
item: item
}, {
bubbles: true,
composed: true
})
},
/**
* @method 处理点击选择
* @param {Object} node 节点对象

View File

@ -1,22 +1,28 @@
<view wx:for="{{tree}}" wx:key="id" class="tree_container">
<!-- 一级菜单 -->
<view style="margin-left: {{treeListIndex*20}}rpx" class="tree-item">
<view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" bindtap="isOpen" data-index="{{index}}">
<view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" bindtap="isOpen"
data-index="{{index}}">
<van-icon name="arrow-down" s class="{{item.open ? 'expand' : 'collapse'}}" />
</view>
<view class="tree-item-onOff" wx:else></view>
<view class="block_" bindtap="select" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{showCheckBox}}">
<image wx:if="{{item.checked === 1}}" src="https://xiangguan.sxyanzhu.com/profile/static/images/choice.png" class="check-box"></image>
<image wx:if="{{item.checked === 1}}" src="https://xiangguan.sxyanzhu.com/profile/static/images/choice.png"
class="check-box"></image>
<image wx:if="{{item.checked === 0}}" src="/images/unchoice.png" class="check-box"></image>
<image wx:if="{{item.checked === -1}}" src="/images/unfullChoice.png" class="check-box"></image>
</block>
<view class="tree-item-name">
<text class="tree-item-title {{item.checked === 1 ? 'tree-item-name-select' : '' }}">{{item.taskName}}<text class="tree-item-suffix"> {{item.scheduleNode}} % </text></text>
<text
class="tree-item-title {{item.checked === 1 && multiple ? 'tree-item-name-select' : '' }}">{{item.taskName}}<text
class="tree-item-suffix"> {{item.scheduleNode}} % </text></text>
</view>
</view>
</view>
<!-- 二级菜单 -->
<categoryTree wx:if="{{item.children && item.children.length > 0 && item.open}}" data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" showCheckBox="{{showCheckBox}}" treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" />
<categoryTree wx:if="{{item.children && item.children.length > 0 && item.open}}" multiple="{{multiple}}"
data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" showCheckBox="{{showCheckBox}}"
treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" catch:clickItem="handleClickItem" />
</view>

View File

@ -1,20 +1,145 @@
// pageage/project_checked/add/index.js
import config from '../../../config'
import fmt from '../../../utils/date.js'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
projectCheckedList,
projectCheckedListCount
} from '../../../api/project'
import {
findPlanDatas,
findRecursionPlan,
findPreviousSchedule,
submitPlanSchedule
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime() + (3600 * 48 * 1000),
form: {
taskName: '',
task: null,
intro: '',//验收描述
imageUrls: [],
groupDeptUser: '',//班组长
checkingDate: '',//验收时间
technicianUser: '',//技术专员
superviseUser: '',//监理专员
},
projectUserInfo: {},
projectId: "",
projectName: "",
initData: {},
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
//任务计划
picker: false,
planOptions: [],
},
/**
* 生命周期函数--监听页面加载
*/
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,
},
pageNum: 1,
pageSize: 10,
listData: [],
total: 0,
form: {
taskName: '',
task: null,
intro: '',
checkingDate: fmt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
}
});
this.initPlanDatas();
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 初始化计划
*/
initPlanDatas() {
findPlanDatas(app.globalData.useProjectId).then((res) => {
let treeDatas = this.buildTree(res.data, 1, "");
this.setData({
planOptions: treeDatas
})
});
},
closePicker() {
this.setData({
picker: false
})
},
/**
* 打开选择窗
*/
openPicker() {
this.setData({
picker: true
})
},
/**
* 构建树结构
* @param {*} all
* @param {*} id
*/
buildTree(all, id, path) {
let tmps = all.filter((d) => d.parentId == id);
if (tmps.length > 0) {
tmps.forEach((it) => {
it.fullPath = path ? path + "/" + it.taskName : it.taskName;
it.children = this.buildTree(all, it.taskId, it.fullPath);
});
}
return tmps;
},
handleClick: function (e) {
let item = e.detail.item;
if (item) {
this.setData({
form: {
task: item,
taskName: item.fullPath
},
picker: false
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -62,5 +187,23 @@ Page({
*/
onShareAppMessage() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../list/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,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,47 @@
/* pageage/project_checked/add/index.wxss */
.project-checked-add {
.max_content_scroll {
color: #89a4eb;
font-size: 28rpx;
padding: 60rpx 30rpx 30rpx;
width: calc(100% - 60rpx);
position: relative;
top: 140rpx;
.mt40 {
margin-top: 40rpx;
}
.add-info {
background-color: #514f4f8a;
color: #888;
margin-top: 16rpx;
line-height: 60rpx;
border-radius: 30rpx;
padding: 0rpx 30rpx;
}
.rectifier_title {
position: relative;
background: #27304f;
border-radius: 15rpx;
text-align: center;
padding: 20rpx 15rpx;
}
.rectifier_close {
position: absolute;
width: 50rpx;
height: 50rpx;
right: 20rpx;
top: 12rpx;
line-height: 60rpx;
text-align: center;
}
.add_textarea {
height: 60rpx;
}
}
}

View File

@ -1,2 +1,124 @@
<!--pageage/project_checked/add/index.wxml-->
<text>pageage/project_checked/add/index.wxml</text>
<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="project-checked-add">
<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"
style="padding:30rpx">
<project-select init="{{initData}}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="mt40">分包单位</view>
<view class="add-info">{{projectUserInfo.subDeptName}}</view>
<view class="mt40 markers inspect_info_title">工程部位</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">技术专员</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">监理员</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">结果描述</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写结果描述" placeholder-style="color:#6777aa;"
model:value="{{form.intro}}" />
</view>
<view class="mt40 markers inspect_info_title">验收时间</view>
<view class="inspect_info_content">
<voucher-datetime counts="5" placeholder="请选择完成时间" minDate="{{minDate}}" maxDate="{{maxDate}}"
model:value="{{form.checkingDate}}" currentDate="{{form.checkingDate}}"></voucher-datetime>
</view>
<view class="mt40 markers inspect_info_title">验收照片</view>
<view class="inspect_info_content">
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">确认</view>
</view>
</scroll-view>
</view>

View File

@ -1 +1,39 @@
/* pageage/project_checked/add/index.wxss */
.project-checked-add .max_content_scroll {
color: #89a4eb;
font-size: 28rpx;
padding: 60rpx 30rpx 30rpx;
width: calc(100% - 60rpx);
position: relative;
top: 140rpx;
}
.project-checked-add .max_content_scroll .mt40 {
margin-top: 40rpx;
}
.project-checked-add .max_content_scroll .add-info {
background-color: #514f4f8a;
color: #888;
margin-top: 16rpx;
line-height: 60rpx;
border-radius: 30rpx;
padding: 0rpx 30rpx;
}
.project-checked-add .max_content_scroll .rectifier_title {
position: relative;
background: #27304f;
border-radius: 15rpx;
text-align: center;
padding: 20rpx 15rpx;
}
.project-checked-add .max_content_scroll .rectifier_close {
position: absolute;
width: 50rpx;
height: 50rpx;
right: 20rpx;
top: 12rpx;
line-height: 60rpx;
text-align: center;
}
.project-checked-add .max_content_scroll .add_textarea {
height: 60rpx;
}

View File

@ -19,47 +19,59 @@
</view>
<!-- 中间内容 -->
<view class="max_content">
<view class="max_content" style="max-height: calc(100% - 360rpx);overflow-y: auto;">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="gk_open" style="margin-top: 5rpx;border: 1px solid transparent;">
<van-collapse value="{{activeNames}}" bind:change="onCollChange">
<van-collapse-item title="项目基本信息" name="base">
<view class="gk_open_con">
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_12.png"></image>项目单位:<text>{{projectInfo.comName}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_12.png"></image>
项目单位:<text>{{projectInfo.comName}}</text>
</view>
<view wx:if="{{projectInfo.province && projectInfo.city}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>所属区域:<text>{{projectInfo.province+' - '+projectInfo.city}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>
所属区域:<text>{{projectInfo.province+' - '+projectInfo.city}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>详细地址:<text>{{projectInfo.projectAddress}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>
详细地址:<text>{{projectInfo.projectAddress}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_3.png"></image>项目类型:<text>{{projectInfo.projectTypeName}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_3.png"></image>
项目类型:<text>{{projectInfo.projectTypeName}}</text>
</view>
<view wx:if="{{false}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_4.png"></image>总建筑面积:<text>{{projectInfo.totalBuildingArea}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_4.png"></image>
总建筑面积:<text>{{projectInfo.totalBuildingArea}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_5.png"></image>计划开工日期:<text>{{projectInfo.scheduledStartTime}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_5.png"></image>
计划开工日期:<text>{{projectInfo.scheduledStartTime}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>实际开工日期:<text>{{projectInfo.actualOperatingTime}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>
实际开工日期:<text>{{projectInfo.actualOperatingTime}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>计划竣工日期:<text>{{projectInfo.plannedCompletionTime}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>
计划竣工日期:<text>{{projectInfo.plannedCompletionTime}}</text>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_8.png"></image>总工期:<text>{{projectInfo.projectTimeLimit + ' 天'}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_8.png"></image>
总工期:<text>{{projectInfo.projectTimeLimit + ' 天'}}</text>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_10.png"></image>项目负责人:<text>{{projectInfo.projectPerson}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_10.png"></image>
项目负责人:<text>{{projectInfo.projectPerson}}</text>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_11.png"></image>负责人手机号:<text>{{projectInfo.projectPersonPhone}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_11.png"></image>
负责人手机号:<text>{{projectInfo.projectPersonPhone}}</text>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_15.png"></image>项目概述:<text>{{projectInfo.projectSummarize}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_15.png"></image>
项目概述:<text>{{projectInfo.projectSummarize}}</text>
</view>
</view>
</van-collapse-item>
@ -71,14 +83,16 @@
<view class="construction_unit_list">
<view class="construction_unit_title">{{item.deptType}}</view>
<view class="construction_unit_name">{{item.deptName}}</view>
<view class="construction_unit_phone" bindtap="calling" data-phone="{{item.phone}}">{{item.leader}} {{item.phone}}</view>
<view class="construction_unit_phone" bindtap="calling" data-phone="{{item.phone}}">{{item.leader}}
{{item.phone}}</view>
</view>
</view>
</van-collapse-item>
</van-collapse>
</view>
<view class="echarts_max" wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_max"
wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_min">
<view class="eharts_title module_title_flex">
劳务人员
@ -114,7 +128,8 @@
</view>
</view>
<view class="echarts_max" wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_max"
wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_min">
<view class="eharts_title module_title_flex">
今日出勤
@ -143,7 +158,8 @@
</view>
</view>
</view>
<view class="echarts_max bt30" wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_max bt30"
wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="echarts_min">
<view class="eharts_title module_title_flex">
我的二维码
@ -151,12 +167,16 @@
<view class="video_ai_survey">
<van-row>
<van-col span="10" class="qrcode">
<image bindtap='showImg' data-set="{{subDeptUserInfo.qrCode}}" src="{{imgBaseUrl+subDeptUserInfo.qrCode}}"></image>
<image bindtap='showImg' data-set="{{subDeptUserInfo.qrCode}}" src="{{imgBaseUrl+subDeptUserInfo.qrCode}}">
</image>
</van-col>
<van-col span="14">
<view wx:if="{{subDeptUserInfo.userPost=='1'}}" class="qrtext"><text class="zz">项目经理 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
<view wx:if="{{subDeptUserInfo.userPost=='2'}}" class="qrtext"><text class="zz">班组组长 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
<view wx:if="{{subDeptUserInfo.userPost=='3'}}" class="qrtext"><text class="zz">劳务人员 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
<view wx:if="{{subDeptUserInfo.userPost=='1'}}" class="qrtext"><text class="zz">项目经理
</text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
<view wx:if="{{subDeptUserInfo.userPost=='2'}}" class="qrtext"><text class="zz">班组组长
</text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
<view wx:if="{{subDeptUserInfo.userPost=='3'}}" class="qrtext"><text class="zz">劳务人员
</text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
</van-col>
</van-row>
</view>
@ -177,7 +197,8 @@
</view>
</view>
<view class="echarts_max" wx:if="{{subDeptUserInfo.userPost=='4' || subDeptUserInfo.userPost=='5' || subDeptUserInfo.userPost=='6' || subDeptUserInfo.userPost=='8'}}">
<view class="echarts_max"
wx:if="{{subDeptUserInfo.userPost=='4' || subDeptUserInfo.userPost=='5' || subDeptUserInfo.userPost=='6' || subDeptUserInfo.userPost=='8'}}">
<view class="echarts_min">
<view class="eharts_title module_title_flex">
最近出勤
@ -190,19 +211,23 @@
<view class="safety_prop module_title_flex summury">
<text class="color_orange">默认展示近7天考勤数据</text>
</view>
<view class="inspect_for_scroll" v-if="{{ attendanceListData.length>0 }}" wx:for="{{attendanceListData}}" wx:key="index">
<view class="inspect_for_scroll" v-if="{{ attendanceListData.length>0 }}" wx:for="{{attendanceListData}}"
wx:key="index">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_label">考勤时间:{{format.dateStrEv(item.inTime,item.outTime)}}</view>
<view class="module_title module_title_flex inspect_list_title_label">
考勤时间:{{format.dateStrEv(item.inTime,item.outTime)}}</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image wx:if="{{item.inPhoto}}" width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.inPhoto}}" />
<van-image wx:else width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.outPhoto}}" />
<van-image wx:if="{{item.inPhoto}}" width="120rpx" height="120rpx" fit="cover"
src="{{imgBaseUrl+item.inPhoto}}" />
<van-image wx:else width="120rpx" height="120rpx" fit="cover"
src="{{imgBaseUrl+item.outPhoto}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">人员姓名:<text>{{item.userName}}</text></view>
@ -224,7 +249,8 @@
</view>
<view wx:if="{{attendanceListData.length==0}}">
<view style="padding-top: 5px;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>
</view>
@ -232,10 +258,11 @@
</view>
</view>
</view>
</view>
</view>
<!-- 底部导航 -->
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<!-- 底部导航 -->
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange"
active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item>
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
@ -268,10 +295,12 @@
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>
</van-tabbar>
<!-- 底部导航 -->
<van-tabbar wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<!-- 底部导航 -->
<van-tabbar
wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5'}}"
active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item>
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
@ -284,4 +313,4 @@
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>
</van-tabbar>

View File

@ -1,51 +1,52 @@
// pages/components/voucher-select/index.js
import fmt from '../../../utils/date.js'
Component({
/**
* 组件的属性列表
*/
properties: {
width:{
type:String
width: {
type: String
},
counts:{
type:Number
counts: {
type: Number
},
placeholder:{
type:String
placeholder: {
type: String
},
time:{
type:String
time: {
type: String
},
maxDate:{
type:Number,
value:new Date().getTime()
maxDate: {
type: Number,
value: new Date().getTime()
},
value:{
type:String,
value:''
value: {
type: String,
value: ''
},
currentDate:{
type:Number
currentDate: {
type: Number
}
},
/**数据监听 */
observers: {
counts: function (val) {
this.setData({
item:val[0],
item: val[0],
})
},
time:function(val){
time: function (val) {
var that = this
that.setData({
value:val,
value: val,
// date:val
})
// that.onConfirm()
}
},
lifetimes: {
created: function(){
created: function () {
//在组件实例刚刚被创建时执行,注意此时不能调用 setData
},
attached: function () {
@ -65,9 +66,10 @@ Component({
*/
data: {
show: false,
date:'',
minDate: new Date(2022,1,1).getTime(),
counts:'5',
date: '',
currDate: 0,
minDate: new Date(2022, 1, 1).getTime(),
counts: '5',
formatter(type, value) {
if (type === 'year') {
return `${value}`;
@ -85,7 +87,10 @@ Component({
*/
methods: {
showPopup() {
debugger
let cDate = this.properties.currentDate ? this.properties.currentDate : this.properties.value ? +fmt(this.properties.value) : +(new Date())
this.setData({
currDate: cDate,
show: true
});
},
@ -115,7 +120,7 @@ Component({
},
/**
* 组件的方法列表
*/
*/
onInput(event) {
let date = new Date(event.detail)
let Y = date.getFullYear();
@ -123,7 +128,7 @@ Component({
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '';
let H = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + '';
let I = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + '';
var lot = Y + '-' + M + '-' + D + ' ' + H + ':' + I +':00';
var lot = Y + '-' + M + '-' + D + ' ' + H + ':' + I + ':00';
this.setData({
date: lot,
});

View File

@ -2,7 +2,8 @@
<view class="voucher_select_max" bindtap="showPopup" style="width: {{width}};">
<view class="voucher_select_min">
<input class="celect_frame_min" placeholder="{{placeholder}}" placeholder-style="color:#6777aa;" value="{{value}}" disabled="true"/>
<input class="celect_frame_min" placeholder="{{placeholder}}" placeholder-style="color:#6777aa;" value="{{value}}"
disabled="true" />
</view>
<view class="voucher_select_icon">
<image src="../../../images/web_select_date.png"></image>
@ -16,53 +17,8 @@
<view>{{placeholder}}</view>
<view class="option_list_title_btn" bindtap="onConfirm">确认</view>
</view>
<van-datetime-picker
type="datetime"
show-toolbar="{{fales}}"
value="{{ currentDate }}"
bind:input="onInput"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
formatter="{{ formatter }}"
visible-item-count="{{counts}}"
custom-class="time_select_style"
column-class="time_list_style"
active-class="time_active_style"
/>
<van-datetime-picker type="datetime" show-toolbar="{{fales}}" value="{{ currDate }}" bind:input="onInput"
min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" visible-item-count="{{counts}}"
custom-class="time_select_style" column-class="time_list_style" active-class="time_active_style" />
<!-- <select-date-copy bindchange="onChangeDate" maxDate="{{maxDate}}" currentDate="{{newCurrentDate}}" counts="{{counts}}"></select-date-copy> -->
</van-popup>

View File

@ -0,0 +1,2 @@
var moment = require('./moment.min.js');
export default moment;

View File

@ -78,58 +78,58 @@ function findDurationDate(val) {
module.exports = {
indexNumFormat: indexNumFormat,
findDurationDate: findDurationDate,
split:function(str,sign){
split: function (str, sign) {
return str.split(sign);
},
parseStr:function(str){
parseStr: function (str) {
return JSON.parse(str);
},
evalStr:function(str){
evalStr: function (str) {
return eval(str);
},
dateStrEv:function(startDate,endDate){
if(startDate){
dateStrEv: function (startDate, endDate) {
if (startDate) {
return startDate.split(" ")[0];
}else if(endDate){
} else if (endDate) {
return endDate.split(" ")[0];
}else{
} else {
return "未找到记录";
}
},
dateStr:function(str){
if(str){
dateStr: function (str) {
if (str) {
return str.split(" ")[0];
}else{
} else {
return "";
}
},
timeStr:function(str){
timeStr: function (str) {
return str.split(" ")[1];
},
isHttpImg:function(str){
if(str.indexOf("http:")>-1 || str.indexOf("https:")>-1){
isHttpImg: function (str) {
if (str.indexOf("http:") > -1 || str.indexOf("https:") > -1) {
return true;
}else{
} else {
return false;
}
},
httpImg:function(str){
if(str.indexOf("https:")>-1){
httpImg: function (str) {
if (str.indexOf("https:") > -1) {
return str;
}else{
return "https://xiangguan.sxyanzhu.com"+str;
} else {
return "https://xiangguan.sxyanzhu.com" + str;
}
},
birthDate:function(timestamp){
birthDate: function (timestamp) {
var date = getDate(parseInt(timestamp));
var mm = date.getMonth()+1;
if(mm<10){
mm = '0'+mm;
var mm = date.getMonth() + 1;
if (mm < 10) {
mm = '0' + mm;
}
var dd = date.getDate();
if(dd<10){
dd = '0'+dd;
if (dd < 10) {
dd = '0' + dd;
}
return date.getFullYear()+"-"+mm+"-"+dd;
return date.getFullYear() + "-" + mm + "-" + dd;
}
}

File diff suppressed because one or more lines are too long