提交代码

dev_xd
姜玉琦 2025-05-18 10:49:52 +08:00
parent 2a6abb3ad2
commit d1d003e7f4
132 changed files with 16424 additions and 0 deletions

View File

@ -0,0 +1,468 @@
import config from '../../../config'
import {
reject,
complete,
returnTask,
returnList,
readDeployNotes,
findCommentByProcInsId
} from '../../../api/flowable'
import {
editApproveStatus,
findProSubDeptsInfoById,
findProSubDeptsUserInfoById
} from '../../../api/project'
import {
getToken
} from '../../../utils/auth'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
options: {},
active: 0,
stepList: [],
rejectNode: false,
activeName: "",
flowRecordList: [],
subDeptData: {
subDeptInfos: {}
},
subDeptUserData: {
userInfos: {},
},
comment: "",
targetKey: "",
targetKeyList: [],
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
options: options
})
this.findFlowNodes();
this.findApplyDataInfo();
this.findCommentByProcInsId();
this.initTargetKeyList();
},
//查询工作流节点
findFlowNodes() {
readDeployNotes(this.data.options.deployId).then(res => {
let list = [{
text: '开始'
}];
let index = this.data.active;
res.data.forEach((item, idx) => {
if (this.data.options.taskName == item.name) {
index = idx + 1;
}
list.push({
text: item.name.substr(0,5),
desc: ''
});
});
list.push({
text: '结束'
});
this.setData({
active: index,
stepList: list
})
});
},
//查询审批日志
findCommentByProcInsId() {
findCommentByProcInsId({
procInsId: this.data.options.procInsId
}).then(res => {
this.setData({
flowRecordList: res.data
})
let list = [];
res.data.forEach((item, idx) => {
if (idx == 1 && (item.commentType == "3" || item.commentType == "2")) {
this.setData({
rejectNode: true
})
}
if (item.deleteReason) {
item.deleteReason = this.getDeleteReason(item.deleteReason);
}
if (item.duration) {
item.duration = app.getDurationDate(item.duration);
}
list.push(item);
})
this.setData({
flowRecordList: list
})
});
},
//查询审批表单参数
findApplyDataInfo() {
findProSubDeptsUserInfoById(this.data.options.businessKey).then(res => {
if (res.data.eduFilePath) {
let files = res.data.eduFilePath.split('/');
res.data.eduFileName = files[files.length - 1];
}
if(res.data.userInfos){
res.data.userInfos = JSON.parse(res.data.userInfos);
}
this.setData({
subDeptUserData: res.data
})
//查询单位信息
this.getSubDeptInfo(res.data.subDeptId);
})
},
//查询审批表单参数
getSubDeptInfo(subDeptId) {
findProSubDeptsInfoById(subDeptId).then(res => {
res.data.subDeptInfos = JSON.parse(res.data.subDeptInfos);
this.setData({
subDeptData: res.data
})
})
},
//初始化退回节点
initTargetKeyList() {
returnList({
taskId: this.data.options.taskId
}).then(res => {
if (res.data && res.data.length > 0) {
let list = [];
res.data.forEach(item => {
list.push({
id: item.id,
text: item.name
})
})
this.setData({
targetKey: list[0].id,
targetKeyList: list
})
}
});
},
//退回
onBack() {
let {
options,
comment
} = this.data;
//数据效验
if (!options.taskId) {
app.toast("数据异常,请刷新页面重试!")
return;
}
if (!comment) {
app.toast("请填写审批意见!")
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认审批驳回?',
success: function (sm) {
if (sm.confirm) {
that.submitBackTask();
}
}
})
},
/**
* 提交退回任务
*/
submitBackTask() {
let {
options,
comment,
targetKeyList
} = this.data;
returnTask({
taskId: options.taskId,
targetKey: targetKeyList[0].id,
comment
}).then(res => {
if (res.code == 200) {
editApproveStatus(this.data.options.businessKey);
app.toast("驳回申请成功!")
setTimeout(() => {
this.returnToPage();
}, 500)
}
});
},
//通过
onPass() {
let {
options,
comment
} = this.data;
//数据效验
if (!options.taskId) {
app.toast("数据异常,请刷新页面重试!")
return;
}
if (comment == "") {
app.toast("请填写审批意见!")
return;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认审批通过?',
success: function (sm) {
if (sm.confirm) {
that.submitPassTask();
}
}
})
},
/**
* 提交审核结果
*/
submitPassTask() {
let {
options,
procInsId,
comment
} = this.data;
complete({
taskId: options.taskId,
instanceId: procInsId,
comment
}).then(res => {
if (res.code == 200) {
app.toast("申请审批通过成功!")
setTimeout(() => {
this.returnToPage();
}, 500)
}
});
},
//驳回
onReject() {
let {
taskId,
procInsId,
comment
} = this.data;
//数据效验
if (!taskId || !procInsId) {
app.toast("数据异常,请刷新页面重试!")
return;
}
if (comment == "") {
app.toast("请填写审批意见!")
return;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认审批驳回?',
success: function (sm) {
if (sm.confirm) {
that.submitRejectTask();
}
}
})
},
/**
* 提交流程驳回
*/
submitRejectTask() {
let {
taskId,
procInsId,
comment
} = this.data;
reject({
taskId,
instanceId: procInsId,
comment
}).then(res => {
if (res.code == 200) {
app.toast("驳回申请流程成功!")
setTimeout(() => {
this.returnToPage();
}, 500)
}
});
},
//申请说明
commentInput: function (options) {
this.data.comment = options.detail.value;
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
},
/**
* 获取驳回节点
* @param {*} val
*/
getDeleteReason(val) {
val = val.replace("Change activity to ", "");
let flowRecordList = this.data.flowRecordList;
for (let i = 0; i < flowRecordList.length; i++) {
if (flowRecordList[i].taskDefKey == val) {
return "驳回至" + flowRecordList[i].taskName;
}
}
},
//终止原因
commentblur: function (options) {
this.data.comment = options.detail.value;
},
//展示图片
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseImgUrl + url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.subDeptUserData.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
//选择退回节点
onSelectTargetKey(e) {
this.setData({
targetKey: e.detail.id,
backName: e.detail.name
})
},
/**
* 返回页面
*/
returnToPage: function () {
if (wx.getStorageSync('nav-types') == "depts") {
wx.redirectTo({
url: '../subDepts/index',
})
} else if (wx.getStorageSync('nav-types') == "users") {
wx.redirectTo({
url: '../subDeptsUsers/index',
})
}
},
/**
* 修改申请
*/
onEditApply: function () {
wx.redirectTo({
url: `../editTask/index?deployId=${this.data.options.deployId}&procInsId=${this.data.options.procInsId}&nickName=${this.data.options.nickName}&deptName=${this.data.options.deptName}&procDefName=${this.data.options.procDefName}&taskId=${this.data.options.taskId}&taskName=${this.data.options.taskName}&category=${this.data.options.category}&projectName=${this.data.options.projectName}&businessKey=${this.data.options.businessKey}&businessKeyParName=${this.data.options.businessKeyParName}&businessDeptId=${this.data.options.businessDeptId}&startUserId=${this.data.options.startUserId}`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,347 @@
<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>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">流程申请详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ stepList }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
<van-collapse value="{{activeName}}" bind:change="onChange">
<van-collapse-item title="审批日志" name="2">
<view class="inspect_list">
<view class="inspect_for" wx:for="{{flowRecordList}}" 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">{{(flowRecordList.length-index) < 10 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}
<text wx:if="{{item.taskName!='提交申请' && item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='委派'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='转办'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='退回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
</view>
</view>
</view>
<view class="inspect_list_info gk_open_con">
<view wx:if="{{item.assigneeName}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text>
</view>
<view wx:if="{{item.assigneeName}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text>
</view>
<view wx:if="{{item.candidate}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text>
</view>
<view wx:if="{{item.deleteReason}}">
<image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text>
</view>
<view wx:if="{{item.endTime}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text>
</view>
<view wx:if="{{item.duration}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text>
</view>
<view wx:if="{{item.message}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>处理意见:<text>{{item.message}}</text>
</view>
</view>
</view>
</view>
</view>
</van-collapse-item>
</van-collapse>
</view>
<view class="module_title module_title_padding">
<view>{{subDeptData.projectName}}</view>
</view>
<view class="inspect_info" wx:if="{{options.category=='1' || options.category=='2' || options.category=='3' || options.category=='4' || options.category=='5' || options.category=='6' || options.category=='8'}}">
<!-- <view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">项目单位</text></van-col>
<van-col span="16" class="color_orange">{{ subDeptData.projectName}}</van-col>
</van-row>
</view> -->
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{subDeptData.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{subDeptData.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">信用代码</text></van-col>
<van-col span="16">{{subDeptData.subDeptCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">营业执照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptData.businessLicensePath}}" src="{{imgBaseUrl+subDeptData.businessLicensePath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人姓名</text></van-col>
<van-col span="16">{{subDeptData.subDeptInfos.legalPerson}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人身份证</text></van-col>
<van-col span="16">{{subDeptData.subDeptInfos.legalPersonCard}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptData.subDeptInfos.legalPersonCardImgPos}}" src="{{imgBaseUrl+subDeptData.subDeptInfos.legalPersonCardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptData.subDeptInfos.legalPersonCardImgInv}}" src="{{imgBaseUrl+subDeptData.subDeptInfos.legalPersonCardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">进入场地时间</text></van-col>
<van-col span="16">{{subDeptData.useDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">计划开工时间</text></van-col>
<van-col span="16">{{subDeptData.startWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">计划完工时间</text></van-col>
<van-col span="16">{{subDeptData.endWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">合同约定范围</text></van-col>
<van-col span="16">{{subDeptData.contractInfos}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">委托代理人</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">人员姓名</text>
</van-col>
<van-col span="16">{{subDeptUserData.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">代理人身份证</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{subDeptUserData.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8">
<text class="color_purple">工种岗位</text>
</van-col>
<van-col span="16">{{subDeptUserData.craftPostName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1' && options.category!='2'}}">
<van-row>
<van-col span="8">
<text class="color_purple">工种班组</text>
</van-col>
<van-col span="16">{{subDeptUserData.subDeptGroupName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">民族</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">代理人证件</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">人员证件照</text>
</van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgPos}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgInv}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">花名册近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userPicture}}" src="{{imgBaseUrl+subDeptUserData.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='3' && options.category!='4' && options.category!='5' && options.category!='8'}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.subDeptPowerPath}}" src="{{imgBaseUrl+subDeptUserData.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{subDeptUserData.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击查看安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<view class="markers inspect_overview_title">审批意见</view>
<view class="inspect_overview_content">
<textarea class="add_textarea" placeholder="请填写审批意见500字内" placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentInput" />
</view>
</view>
<view class="inspect_overview_list" wx:if="{{false}}">
<view class="markers inspect_overview_title">退回节点</view>
<view class="inspect_overview_content">
<voucher-select columns="{{targetKeyList}}" placeholder="请选择退回节点" bindchange="onSelectTargetKey"></voucher-select>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="onEditApply" wx:if="{{false}}">修改申请</view>
<view class="problem_submit_to_btn problem_submit_to_blue" bindtap="onAssign" wx:if="{{false}}">任务转办</view>
<view class="problem_submit_to_btn problem_submit_to_eq" bindtap="onDelegate" wx:if="{{false}}">任务委派</view>
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onBack">审批驳回</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onPass">审批通过</view>
</view>
<view class="problem_submit_to" wx:if="{{false}}">
<view class="problem_submit_to_btn" bindtap="onEditApply">修改申请信息</view>
</view>
<view class="safety_prop module_title_flex" style="margin-left: 30rpx;" wx:if="{{false}}">
<view class="color_orange">“任务转办” 指定人处理后由您继续审批。</view>
</view>
<view class="safety_prop module_title_flex" style="margin-left: 30rpx;" wx:if="{{false}}">
<view class="color_orange">“任务委派” 任务由指定人进行处理。</view>
</view>
</view>

View File

@ -0,0 +1,112 @@
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}
.radio_custom_class{
padding: 10rpx 100rpx 10rpx 0;
}
.radio_label_class{
color: #ffffff !important;
}
.max_tab_name{
padding: 0 40rpx;
font-size:30rpx;
height: 460rpx;
overflow: auto;
margin-top: 20rpx;
text-align: center;
}
.van-popup.van-popup--bottom{
background: #232a44;
}
.van-popup {
background-color: var(--popup-background-color,#232a44) !important;
}
.font_color{
padding: 15rpx 0;
color: #157dd2;
}
.active{
font-size:30rpx;
font-weight: 600;
color: #14feff
}
.van-collapse.van-hairline--top-bottom:after{
border-width: 0px 0;
}
.van-cell.van-cell--borderless{
background-color: #2b345b;
color: #fff;
margin-top: 30rpx;
border-radius: 5rpx;
}
.van-cell.van-cell--borderless:active{
background-color: #2b345b;
}
.van-collapse-item__title.van-collapse-item__title--expanded:active{
background-color: #2b345b;
}
.van-collapse-item .van-cell:after{
border-bottom: 0;
}
.van-collapse-item.van-hairline--top:after{
border-top-width:0
}
.van-cell.van-cell--clickable{
background-color: #2b345b;
margin-top: 30rpx;
color: #fff;
border-radius: 15rpx;
}
.van-cell.van-cell--clickable:active{
background-color: #2b345b;
}
.van-collapse-item__wrapper .van-collapse-item__content{
background-color: #1e2336;
color:#8ca4ec ;
border-width: 0px 0;
}
.gk_open_con view{
padding: 10rpx 0;
width: 100%;
}
.gk_open_con image{
width: 30rpx;
height: 30rpx;
margin-right: 5rpx;
position: relative;
top: 5rpx;
}
.pass{
background-color: #388a38;
}
.transact{
background-color: #8e6424;
}
.text_active{
padding-left: 5rpx;
color: #8369f5;
}
.van-steps{
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container{
background-color: transparent !important;
}
.van-steps--horizontal{
padding: 10px 20px !important;
}
.markers{
background: url("https://xiangguan.sxyanzhu.com/profile/icon/req.png") no-repeat left/40rpx;
height: 20px;
line-height: 20px;
padding-left: 42rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}

View File

@ -0,0 +1,391 @@
import config from '../../../config'
import {
readDeployNotes,
findCommentByProcInsId
} from '../../../api/flowable'
import {
findProSubDeptsInfoById,
findProSubDeptsUserInfoById
} from '../../../api/project'
import {
getToken
} from '../../../utils/auth'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
options: {},
active: 100,
rejectNode: false,
stepList: [],
activeName: "",
flowRecordList: [],
subDeptData: {
subDeptInfos: {}
},
subDeptUserData: {
userInfos: {},
},
stopShow: false,
deleteShow: false,
revocationShow: false,
fileNames: [],
minImageList: [],
imgTypes: ["png", "jpg", "jpeg"],
stopBtnShow: false,
comment: "",
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
options: options
})
this.findFlowNodes();
this.findApplyDataInfo();
this.findCommentByProcInsId();
},
//查询工作流节点
findFlowNodes() {
readDeployNotes(this.data.options.deployId).then(res => {
let list = [{
text: '开始'
}];
let index = this.data.active;
res.data.forEach((item,idx) => {
console.log("this.data.options.taskName",this.data.options.taskName)
console.log("item.name",item.name)
if(this.data.options.taskName==item.name){
index = idx+1;
}
list.push({
text: item.name.substr(0,5),
desc: ''
});
});
list.push({
text: '结束'
});
this.setData({
active: index,
stepList: list
})
});
},
//查询审批日志
findCommentByProcInsId() {
findCommentByProcInsId({
procInsId: this.data.options.procInsId
}).then(res => {
this.setData({
flowRecordList: res.data
})
let list = [];
res.data.forEach((item, idx) => {
if (idx == 1 && (item.commentType == "3" || item.commentType == "2")) {
this.setData({
rejectNode: true
})
}
if (item.deleteReason) {
item.deleteReason = this.getDeleteReason(item.deleteReason);
}
if (item.duration) {
item.duration = app.getDurationDate(item.duration);
}
list.push(item);
})
this.setData({
flowRecordList: list
})
});
},
//查询审批表单参数
findApplyDataInfo() {
findProSubDeptsUserInfoById(this.data.options.businessKey).then(res => {
if (res.data.eduFilePath) {
let files = res.data.eduFilePath.split('/');
res.data.eduFileName = files[files.length - 1];
}
if(res.data.userInfos){
res.data.userInfos = JSON.parse(res.data.userInfos);
}
this.setData({
subDeptUserData: res.data
})
//查询单位信息
this.getSubDeptInfo(res.data.subDeptId);
})
},
//查询审批表单参数
getSubDeptInfo(subDeptId) {
findProSubDeptsInfoById(subDeptId).then(res => {
res.data.subDeptInfos = JSON.parse(res.data.subDeptInfos);
this.setData({
subDeptData: res.data
})
})
},
//流程退回
onStop() {
if (!this.data.stopBtnShow) {
app.toast("请填写终止原因!")
this.setData({
stopBtnShow: true
})
return;
} else {
if (this.data.comment == "") {
app.toast("请填写终止原因!")
this.setData({
stopBtnShow: true
})
return;
}
}
let that = this
//弹出确认
wx.showModal({
title: '提示',
content: '是否终止当前流程申请?',
success: function (sm) {
if (sm.confirm) {
that.submitStopProcess();
}
}
})
},
/**
* 确认撤回
*/
submitStopProcess() {
stopProcess({
instanceId: this.data.options.procInsId,
comment: this.data.comment
}).then(res => {
if (res.code == 200) {
app.toast("终止流程申请成功!")
setTimeout(() => {
wx.redirectTo({
url: '../../index/index',
})
}, 500)
}
});
},
//流程删除
onDelete() {
let that = this
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认删除流程申请?',
success: function (sm) {
if (sm.confirm) {
that.submitDeleteInstance();
}
}
})
},
/**
* 流程删除
*/
submitDeleteInstance() {
deleteInstance(this.data.options.procInsId).then(res => {
if (res.code == 200) {
app.toast("删除流程申请成功!")
setTimeout(() => {
wx.redirectTo({
url: '../../index/index',
})
}, 500)
}
});
},
//流程撤回
onRevocation() {
let that = this
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认撤回当前任务流程?',
success: function (sm) {
if (sm.confirm) {
that.submitRevokeProcess();
}
}
});
},
/**
* 流程撤回
*/
submitRevokeProcess() {
revokeProcess({
procInsId: this.data.options.procInsId,
instanceId: this.data.options.procInsId,
taskId: this.data.options.taskId
}).then(res => {
if (res.code == 200) {
app.toast("撤回流程申请成功!")
setTimeout(() => {
wx.redirectTo({
url: '../../index/index',
})
}, 500)
}
});
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
},
/**
* 获取驳回节点
* @param {*} val
*/
getDeleteReason(val) {
val = val.replace("Change activity to ", "");
let flowRecordList = this.data.flowRecordList;
for (let i = 0; i < flowRecordList.length; i++) {
if (flowRecordList[i].taskDefKey == val) {
return "驳回至" + flowRecordList[i].taskName;
}
}
},
//终止原因
commentblur: function (options) {
this.data.comment = options.detail.value;
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.subDeptUserData.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
//选择退回节点
onSelectTargetKey(e) {
this.setData({
targetKey: e.detail.id,
backName: e.detail.name
})
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
if (wx.getStorageSync('nav-types') == "depts") {
wx.redirectTo({
url: '../subDepts/index',
})
} else if (wx.getStorageSync('nav-types') == "users") {
wx.redirectTo({
url: '../subDeptsUsers/index',
})
}
},
//展示图片
showImg:function(e){
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseImgUrl + url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,314 @@
<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>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">流程申请详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ stepList }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
<van-collapse value="{{activeName}}" bind:change="onChange">
<van-collapse-item title="审批日志" name="2">
<view class="inspect_list">
<view class="inspect_for" wx:for="{{flowRecordList}}" 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">{{(flowRecordList.length-index) < 10 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}
<text wx:if="{{item.taskName!='提交申请' && item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='委派'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='转办'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='退回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
</view>
</view>
</view>
<view class="inspect_list_info gk_open_con">
<view wx:if="{{item.assigneeName}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text>
</view>
<view wx:if="{{item.assigneeName}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text>
</view>
<view wx:if="{{item.candidate}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text>
</view>
<view wx:if="{{item.deleteReason}}">
<image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text>
</view>
<view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text>
</view>
<view wx:if="{{item.endTime}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text>
</view>
<view wx:if="{{item.duration}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text>
</view>
<view wx:if="{{item.message}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>处理意见:<text>{{item.message}}</text>
</view>
</view>
</view>
</view>
</view>
</van-collapse-item>
</van-collapse>
</view>
<view class="module_title module_title_padding">
<view>{{subDeptData.projectName}}</view>
</view>
<view class="inspect_info" wx:if="{{options.category=='1' || options.category=='2' || options.category=='3' || options.category=='4' || options.category=='5' || options.category=='6' || options.category=='8'}}">
<!-- <view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">项目单位</text></van-col>
<van-col span="16" class="color_orange">{{ subDeptData.projectName}}</van-col>
</van-row>
</view> -->
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{subDeptData.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{subDeptData.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">信用代码</text></van-col>
<van-col span="16">{{subDeptData.subDeptCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">营业执照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptData.businessLicensePath}}" src="{{imgBaseUrl+subDeptData.businessLicensePath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人姓名</text></van-col>
<van-col span="16">{{subDeptData.subDeptInfos.legalPerson}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人身份证</text></van-col>
<van-col span="16">{{subDeptData.subDeptInfos.legalPersonCard}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">法人证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptData.subDeptInfos.legalPersonCardImgPos}}" src="{{imgBaseUrl+subDeptData.subDeptInfos.legalPersonCardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptData.subDeptInfos.legalPersonCardImgInv}}" src="{{imgBaseUrl+subDeptData.subDeptInfos.legalPersonCardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">进入场地时间</text></van-col>
<van-col span="16">{{subDeptData.useDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">计划开工时间</text></van-col>
<van-col span="16">{{subDeptData.startWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">计划完工时间</text></van-col>
<van-col span="16">{{subDeptData.endWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">合同约定范围</text></van-col>
<van-col span="16">{{subDeptData.contractInfos}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">委托代理人</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">人员姓名</text>
</van-col>
<van-col span="16">{{subDeptUserData.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">代理人身份证</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{subDeptUserData.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8">
<text class="color_purple">工种岗位</text>
</van-col>
<van-col span="16">{{subDeptUserData.craftPostName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1' && options.category!='2'}}">
<van-row>
<van-col span="8">
<text class="color_purple">工种班组</text>
</van-col>
<van-col span="16">{{subDeptUserData.subDeptGroupName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">民族</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8">
<text wx:if="{{options.category=='1'}}" class="color_purple">代理人证件</text>
<text wx:if="{{options.category!='1'}}" class="color_purple">人员证件照</text>
</van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgPos}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgInv}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">花名册近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userPicture}}" src="{{imgBaseUrl+subDeptUserData.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='3' && options.category!='4' && options.category!='5' && options.category!='8'}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.subDeptPowerPath}}" src="{{imgBaseUrl+subDeptUserData.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{options.category=='3' || options.category=='4' || options.category=='5'}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{subDeptUserData.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击下载安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,101 @@
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}
.radio_custom_class{
padding: 10rpx 100rpx 10rpx 0;
}
.radio_label_class{
color: #ffffff !important;
}
.max_tab_name{
padding: 0 40rpx;
font-size:30rpx;
height: 460rpx;
overflow: auto;
margin-top: 20rpx;
text-align: center;
}
.van-popup.van-popup--bottom{
background: #232a44;
}
.van-popup {
background-color: var(--popup-background-color,#232a44) !important;
}
.font_color{
padding: 15rpx 0;
color: #157dd2;
}
.active{
font-size:30rpx;
font-weight: 600;
color: #14feff
}
.van-collapse.van-hairline--top-bottom:after{
border-width: 0px 0;
}
.van-cell.van-cell--borderless{
background-color: #2b345b;
color: #fff;
margin-top: 30rpx;
border-radius: 5rpx;
}
.van-cell.van-cell--borderless:active{
background-color: #2b345b;
}
.van-collapse-item__title.van-collapse-item__title--expanded:active{
background-color: #2b345b;
}
.van-collapse-item .van-cell:after{
border-bottom: 0;
}
.van-collapse-item.van-hairline--top:after{
border-top-width:0
}
.van-cell.van-cell--clickable{
background-color: #2b345b;
margin-top: 30rpx;
color: #fff;
border-radius: 15rpx;
}
.van-cell.van-cell--clickable:active{
background-color: #2b345b;
}
.van-collapse-item__wrapper .van-collapse-item__content{
background-color: #1e2336;
color:#8ca4ec ;
border-width: 0px 0;
}
.gk_open_con view{
padding: 10rpx 0;
width: 100%;
}
.gk_open_con image{
width: 30rpx;
height: 30rpx;
margin-right: 5rpx;
position: relative;
top: 5rpx;
}
.pass{
background-color: #388a38;
}
.transact{
background-color: #8e6424;
}
.text_active{
padding-left: 5rpx;
color: #8369f5;
}
.van-steps{
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container{
background-color: transparent !important;
}
.van-steps--horizontal{
padding: 10px 20px !important;
}

View File

@ -0,0 +1,277 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
quueryCount,
myAwaitFlowTaskList,
myFinishedFlowTaskList,
} from '../../../api/flowable'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
projectId: '',
projectName: '',
initData: {},
activeState: "dsh",
dshCount: 0,
yshCount: 0,
listData: [],
pageNum: 1,
pageSize: 10,
total: 0,
imgBaseUrl: config.baseImgUrl
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (getToken()) {
this.setData({
pageNum: 1,
pageSize: 10,
listData: [],
total: 0,
dshCount: 0,
yshCount: 0,
activeState: "dsh",
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
}
});
this.getListData();
this.getFlowableCount();
} else {
console.log("未查询到Token...{}...准备重新登录")
wx.redirectTo({
url: '../../../pages/login/login',
})
}
},
/**
* 查询列表数据
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&activeTags=depts&startProId=" + app.globalData.useProjectId;
if (this.data.activeState == 'dsh') {
myAwaitFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
} else {
myFinishedFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
}
},
/**
* 统计分包单位数据
*/
getFlowableCount() {
let params = "activeTags=depts&startProId=" + app.globalData.useProjectId;
quueryCount(params).then(res => {
if (res.code == 200) {
this.setData({
dshCount: res.data.await,
yshCount: res.data.finished
})
}
});
},
/**
* 统计审批数据
*/
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();
}
},
/**
* 切换页签数据
*/
switchTabJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = 'dsh';
} else {
nav = 'ysh';
}
if (nav != this.data.activeState) {
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData();
}
},
/**
* 点击栏目
* @param {*} e
*/
findDetail(e) {
let {
taskId,
taskName,
procInsId,
deployId,
category,
businessKey,
finishTime
} = e.currentTarget.dataset.set
wx.setStorageSync('nav-types', "depts");
if (finishTime) {
//详情页面
wx.redirectTo({
url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
} else {
//审批页面
wx.redirectTo({
url: `../approveTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
}
},
/**
* 办理时间计算
* @param {*} val
*/
getDurationDate(val) {
let day = 0;
let hours = 0;
let min = val;
if (min > 1440) {
day = parseInt(min / 1440);
min = min % 1440;
if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
} else if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
if (day > 0) {
if (day < 10) day = "0" + day;
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return day + "天" + hours + "小时" + min + "分钟";
}
if (hours > 0) {
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return hours + "小时" + min + "分钟";
}
if (min > 0) {
if (min < 10) min = "0" + min;
return min + "分钟";
}
if (min == 0) {
return "1分钟";
}
},
/**
* 返回页面
*/
returnToPage: function () {
wx.redirectTo({
url: '../../project_more/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,58 @@
<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>
<text class="header_fh">返回</text>
</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 class="{{activeState=='dsh'?'active':''}}" bindtap="switchTabJump" data-index="1"><text>待审核({{dshCount}}</text></view>
<view class="{{activeState=='ysh'?'active':''}}" bindtap="switchTabJump" data-index="2"><text>已审核({{yshCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="findDetail">
<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">
<text wx:if="{{!item.endTime}}" class="color_purple">申请时间 {{item.createTime}}</text>
<text wx:if="{{item.endTime}}" class="color_purple">办结时间 {{item.endTime}}</text>
</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image width="120rpx" height="120rpx" fit="cover" src="{{item.businessImg+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">单位类型:<text>{{item.businessMk2}}</text></view>
<view class="inspect_list_info_data_prop">单位名称:<text>{{item.businessMk1}}</text></view>
<view class="inspect_list_info_data_prop">信用代码:<text>{{item.businessMk3}}</text></view>
<view class="inspect_list_info_data_prop color_orange">处理耗时:{{item.durationStr}}</view>
</view>
</view>
</view>
</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>
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/project_flowable/subDepts/index.wxss */

View File

@ -0,0 +1,372 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
quueryCount,
batchComplete,
myAwaitFlowTaskList,
myFinishedFlowTaskList,
} from '../../../api/flowable'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
projectId: '',
projectName: '',
initData: {},
activeState: "dsh",
dshCount: 0,
yshCount: 0,
listData: [],
pageNum: 1,
pageSize: 10,
total: 0,
checkedAll:false,
showChecked:false,
imgBaseUrl: config.baseImgUrl
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (getToken()) {
this.setData({
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
listData: [],
total: 0,
dshCount: 0,
yshCount: 0,
activeState: "dsh",
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
}
});
let userInfo = getUserInfo();
if(userInfo && userInfo.projectUserInfo && userInfo.projectUserInfo.subDeptType=="1"){
this.setData({
showChecked:true
});
}
this.getListData();
this.getFlowableCount();
} else {
console.log("未查询到Token...{}...准备重新登录")
wx.redirectTo({
url: '../../login/login',
})
}
},
/**
* 查询列表数据
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&activeTags=users&startProId=" + app.globalData.useProjectId;
if (this.data.activeState == 'dsh') {
myAwaitFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
} else {
myFinishedFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
}
},
/**
* 统计分包单位数据
*/
getFlowableCount() {
let params = "activeTags=users&startProId=" + app.globalData.useProjectId;
quueryCount(params).then(res => {
if (res.code == 200) {
this.setData({
dshCount: res.data.await,
yshCount: res.data.finished
})
}
});
},
/**
* 统计审批数据
*/
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();
}
},
/**
* 切换页签数据
*/
switchTabJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = 'dsh';
} else {
nav = 'ysh';
}
if (nav != this.data.activeState) {
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData();
}
},
/**
* 点击栏目
* @param {*} e
*/
findDetail(e) {
let {
taskId,
taskName,
procInsId,
deployId,
category,
businessKey
} = e.currentTarget.dataset.set
wx.setStorageSync('nav-types', "users");
if (this.data.activeState=="ysh") {
//详情页面
wx.redirectTo({
url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
} else {
//审批页面
wx.redirectTo({
url: `../approveTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
}
},
/**
* 选中节点
* @param {*} e
*/
selectItem: function(event){
let procInsId = event.currentTarget.dataset.set;
console.log("procInsId==>",procInsId)
let _listData = this.data.listData;
_listData.forEach(item =>{
if(procInsId==item.procInsId){
item.selected=!item.selected;
}
})
this.setData({
listData: _listData
});
},
/**
* 全选
*/
onCheckedAll(){
let _checked = !this.data.checkedAll;
let _listData = this.data.listData;
_listData.forEach(item =>{
item.selected=_checked;
});
this.setData({
listData: _listData,
checkedAll: _checked
});
},
/**
* 批量
* 审核通过
*/
onBatchPass(){
let taskIds = [];
let _listData = this.data.listData;
_listData.forEach(item =>{
if(item.selected){
taskIds.push(item.taskId);
}
});
if(taskIds.length==0){
app.toast("请选择要审批的数据项!","none",1500);
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认批量审批通过?',
success: function (sm) {
if (sm.confirm) {
that.submitBatchPass();
}
}
})
},
/**
* 提交审批
*/
submitBatchPass(){
let taskIds = [];
let instanceIds = [];
let _listData = this.data.listData;
_listData.forEach(item =>{
if(item.selected){
taskIds.push(item.taskId);
instanceIds.push(item.procInsId);
}
});
let _data = {
'taskIds':taskIds,
'instanceIds':instanceIds
}
batchComplete(_data).then(res =>{
app.toast("批量审批通过成功!");
this.onLoad();
});
},
/**
* 办理时间计算
* @param {*} val
*/
getDurationDate(val) {
let day = 0;
let hours = 0;
let min = val;
if (min > 1440) {
day = parseInt(min / 1440);
min = min % 1440;
if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
} else if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
if (day > 0) {
if (day < 10) day = "0" + day;
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return day + "天" + hours + "小时" + min + "分钟";
}
if (hours > 0) {
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return hours + "小时" + min + "分钟";
}
if (min > 0) {
if (min < 10) min = "0" + min;
return min + "分钟";
}
if (min == 0) {
return "1分钟";
}
},
/**
* 返回页面
*/
returnToPage: function () {
wx.redirectTo({
url: '../../project_more/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,65 @@
<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>
<text class="header_fh">返回</text>
</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 class="{{activeState=='dsh'?'active':''}}" bindtap="switchTabJump" data-index="1"><text>待审核({{dshCount}}</text></view>
<view class="{{activeState=='ysh'?'active':''}}" bindtap="switchTabJump" data-index="2"><text>已审核({{yshCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="findDetail">
<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">
<text wx:if="{{!item.endTime}}" class="color_purple">申请时间 {{item.createTime}}</text>
<text wx:if="{{item.endTime}}" class="color_purple">办结时间 {{item.endTime}}</text>
</view>
<view wx:if="{{showChecked && activeState=='dsh'}}" class="myIcon" data-set="{{item.procInsId}}" catchtap="selectItem">
<image src="{{item.selected ? 'https://xiangguan.sxyanzhu.com/profile/static/images/choice.png' : '/images/unchoice.png'}}" />
</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image width="120rpx" height="120rpx" fit="cover" src="{{item.businessImg+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">工种类型:<text>{{item.businessMk2}}</text></view>
<view class="inspect_list_info_data_prop">单位名称:<text>{{item.businessMk1}}</text></view>
<view class="inspect_list_info_data_prop">信用代码:<text>{{item.businessMk3}}</text></view>
<view class="inspect_list_info_data_prop color_orange">处理耗时:{{item.durationStr}}</view>
</view>
</view>
</view>
</view>
</view>
<view wx:if="{{listData.length>0 && showChecked && activeState=='dsh'}}" class="problem_submit_to">
<view class="problem_submit_to_btn problem_submit_to_blue" bindtap="onCheckedAll">{{checkedAll?"全不选":"全选"}}</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onBatchPass">审批通过</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>
</scroll-view>

View File

@ -0,0 +1,10 @@
/* pages/project_flowable/subDeptsUsers/index.wxss */
.myIcon{
position: fixed;
right: 25px;
}
.myIcon image {
width: 22px;
height: 22px;
background-color: #eeeeee;
}

View File

@ -0,0 +1,615 @@
import config from '../../config'
import {
getToken,
getUserInfo
} from '../../utils/auth'
import {
findProjectInfo,
findProjectDepts
} from '../../api/project'
import {
findSubDeptsUsers,
findDaysAttendanceView,
findUsersAttendanceView,
findSubDeptsAttendanceView
} from '../../api/attendance'
import {
findMyTask
} from '../../api/flowable'
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
title: "项目详情",
activeNames: ["base"],
//项目信息
projectInfo: {},
projectDeptsList: [],
deptTypes: [{
"name": "建设单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jsdw.png"
}, {
"name": "监理单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jldw.png"
}, {
"name": "设计单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_sjdw.png"
}, {
"name": "检测单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jcjg.png"
}, {
"name": "勘察单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_ktdw.png"
}, {
"name": "总包单位",
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png"
}],
active: 0,
projectId: '',
projectName: '',
initData: {},
aqglDb: 0,
zlglDb: 0,
todoDb: 0,
nactive: 0,
labourData: [{
name: "管理人员",
total: 0,
unit: "人",
yesMonitor: 180
},
{
name: "劳务人员",
yesMonitor: 0,
total: 0,
unit: "人"
},
{
name: "特殊工种",
yesMonitor: 0,
total: 0,
unit: "人"
},
],
labourDataList: [],
labourDays: [{
name: "管理人员",
total: 0,
unit: "人",
yesMonitor: 180
},
{
name: "劳务人员",
yesMonitor: 0,
total: 0,
unit: "人"
},
{
name: "特殊工种",
yesMonitor: 0,
total: 0,
unit: "人"
},
],
labourDaysTotal: 0,
labourImg: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png",
labourName: "在岗人员",
labourTotal: 0,
labourTypeList: [{
name: "在岗人员",
total: 0,
img: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png"
}, {
name: "离岗人员",
total: 0,
img: "https://szgcwx.jhncidg.com/staticFiles/icon/rylg.png"
}],
animation: true,
animationData: {},
labourDatas: {
unit: '人',
legend: ['出勤人数', '当前在岗'],
color: ['#2e6ed0', '#fb9300'],
Xdata: ['01-01', '01-02', '01-03', '01-04', '01-05', '01-06', '01-07'],
Ydata: [
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]
]
},
switchChart: false,
attendanceListData: [],
subDeptUserInfo: {},
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (!getToken()) {
wx.redirectTo({
url: '../../pages/login/login',
})
}
wx.setStorageSync('nav-menu', "xmgk");
const proUserInfo = getUserInfo();
app.globalData.subDeptUserData = proUserInfo.projectUserInfo;
this.initAnimationData();
this.setData({
labourImg: this.data.labourTypeList[this.data.nactive].img,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
subDeptUserInfo: proUserInfo.projectUserInfo
});
//项目基本信息
this.getProjectInfo(app.globalData.useProjectId);
//用户项目信息
this.getProUserDatas();
//项目建设单位
this.getProjectDepts(app.globalData.useProjectId);
},
/**
* 统计劳务人员信息
* @param {*} proId
*/
getSubDeptsUsers(proId) {
findSubDeptsUsers(proId).then(res => {
if (res.code == 200) {
let zg = 0;
let lg = 0;
res.data.forEach(item => {
if (item.useStatus == '0') {
zg += item.total;
} else {
lg += item.total;
}
});
this.setData({
"labourTypeList[0].total": zg,
"labourTypeList[1].total": lg,
labourTotal: zg,
labourDataList: res.data || []
})
this.initSubDeptUsersCharts();
}
});
},
/**
* 初始化动画
*/
initAnimationData() {
var animation = wx.createAnimation({
duration: 1000,
timingFunction: 'linear',
})
this.animation = animation;
if (this.data.animation) {
animation.translateY(-8).step();
} else {
animation.translateY(8).step();
}
this.setData({
animation: this.data.animation ? false : true,
animationData: animation.export()
})
setTimeout(() => {
this.initAnimationData();
}, 1200)
},
/**
* 初始化统计图表
*/
initSubDeptUsersCharts() {
let labourDataList = this.data.labourDataList;
if (labourDataList.length > 0) {
let gl = 0;
let ts = 0;
let lw = 0;
labourDataList.forEach(item => {
if (this.data.nactive == 0) {
if (item.useStatus == '0') {
if (item.craftType == '2') {
ts += item.total;
} else if (item.craftType == '3') {
gl += item.total;
} else {
lw += item.total;
}
}
} else {
if (item.useStatus != '0') {
if (item.craftType == '2') {
ts += item.total;
} else if (item.craftType == '3') {
gl += item.total;
} else {
lw += item.total;
}
}
}
});
this.setData({
"labourData[0].total": gl,
"labourData[0].yesMonitor": gl,
"labourData[1].total": ts,
"labourData[1].yesMonitor": ts,
"labourData[2].total": lw,
"labourData[2].yesMonitor": lw,
labourTotal: this.data.labourTypeList[this.data.nactive].total
})
if (this.data.switchChart) {
let chats = this.selectComponent("#userChart");
chats.initChart();
}
}
},
/**
* 初始化
* 今日考勤
* @param {*} proId
*/
initSubDeptDaysCharts(proId) {
findDaysAttendanceView(proId).then(res => {
if (res.code == 200) {
let gl = 0;
let ts = 0;
let lw = 0;
res.data.forEach(item => {
if (item.craftType == '2') {
ts += item.total;
} else if (item.craftType == '3') {
gl += item.total;
} else {
lw += item.total;
}
});
this.setData({
"labourDays[0].total": gl,
"labourDays[0].yesMonitor": gl,
"labourDays[1].total": ts,
"labourDays[1].yesMonitor": ts,
"labourDays[2].total": lw,
"labourDays[2].yesMonitor": lw,
labourDaysTotal: gl + ts + lw
})
if (this.data.switchChart) {
let chats = this.selectComponent("#attsChart");
chats.initChart();
}
}
});
},
/**
* 统计
* 最近出勤信息
* @param {*} proId
*/
getSubDeptsAttendanceView(proId) {
findSubDeptsAttendanceView(proId).then(res => {
if (res.code == 200) {
let xd = [];
let yd1 = [];
let yd2 = [];
res.data.list.forEach(item => {
xd.push(item.attendanceTime);
yd1.push(item.total);
});
if (xd.length < 7) {
let n = 7 - xd.length;
for (let i = 0; i < n; i++) {
xd.push('-');
yd1.push(0);
}
}
for (let y = 0; y < 7; y++) {
yd2.push(res.data.user);
}
let yd = [];
yd.push(yd1);
yd.push(yd2);
this.setData({
"labourDatas.Xdata": xd,
"labourDatas.Ydata": yd
});
if (this.data.switchChart) {
let chats = this.selectComponent("#chartBar");
chats.initChart();
}
}
});
},
/**
* 查询用户考勤
* @param {*} proId
*/
getUsersAttendanceView(proId) {
findUsersAttendanceView(proId).then(res => {
if (res.code == 200) {
this.setData({
attendanceListData: res.data
});
}
})
},
/**
* 单位人员信息
* @param {*} proId
*/
getProUserDatas() {
//劳务人员信息
if ((app.globalData.subDeptUserData.subDeptType == '1' || app.globalData.subDeptUserData.subDeptType == '4' || app.globalData.subDeptUserData.subDeptType == '5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') {
//统计劳务人员信息
this.getSubDeptsUsers(app.globalData.useProjectId);
this.initSubDeptDaysCharts(app.globalData.useProjectId);
}
this.awaitTask();
//今日出勤信息
if (app.globalData.subDeptUserData.subDeptType == '1') {
this.getSubDeptsAttendanceView(app.globalData.useProjectId);
}
//人员出勤信息
if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') {
//统计劳务人员信息
this.getUsersAttendanceView(app.globalData.useProjectId);
}
},
/**
* 查询公众号消息授权
*/
reUserOpenMsgId() {
let userInfos = this.selectComponent("#userInfos");
userInfos.loadUserInfo();
},
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({
active: event.detail
});
},
/**
* 初始化曲线图表
*/
initLabourDatas() {
findGroupAllByDays({
projectId: app.globalData.projectId
}).then(res => {
if (res.code == 200) {
let xd = [];
let yd1 = [];
let yd2 = [];
res.data.list.forEach(item => {
xd.push(item.attendanceTime);
yd1.push(item.total);
});
if (xd.length < 7) {
let n = 7 - xd.length;
for (let i = 0; i < n; i++) {
xd.push('');
yd1.push(0);
}
}
for (let y = 0; y < 7; y++) {
yd2.push(res.data.user);
}
let yd = [];
yd.push(yd1);
yd.push(yd2);
this.setData({
"labourDatas.Xdata": xd,
"labourDatas.Ydata": yd
});
if (this.data.switchChart) {
let chats = this.selectComponent("#chartBar");
chats.initChart();
}
}
});
},
/**
* 查询项目详情
* @param {*} proId
*/
getProjectInfo: function (proId) {
findProjectInfo(proId).then(res => {
if (res.data.scheduledStartTime) {
res.data.scheduledStartTime = res.data.scheduledStartTime.split("T")[0];
} else {
res.data.scheduledStartTime = " - ";
}
if (res.data.actualOperatingTime) {
res.data.actualOperatingTime = res.data.actualOperatingTime.split("T")[0];
} else {
res.data.actualOperatingTime = " - ";
}
if (res.data.plannedCompletionTime) {
res.data.plannedCompletionTime = res.data.plannedCompletionTime.split("T")[0];
} else {
res.data.plannedCompletionTime = " - ";
}
res.data.projectDeptsList.forEach(item => {
let typeItem = this.data.deptTypes.filter((v) => v.name == item.deptType);
if(typeItem.length>0){
item.iconSrc = typeItem[0].iconSrc;
}
});
this.setData({
projectInfo: res.data,
projectDeptsList: res.data.projectDeptsList
})
});
},
/**
* 查询
* 项目建设单位
* @param {*} proId
*/
getProjectDepts: function (proId) {
findProjectDepts(proId).then(res => {
this.setData({
projectDeptsList: res.data
})
});
},
// 页签选中事件
selectedTab(e) {
this.setData({
nactive: e.target.dataset.set,
labourImg: this.data.labourTypeList[e.target.dataset.set].img,
})
this.initSubDeptUsersCharts();
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.setData({
switchChart: true
})
this.onLoad();
},
// 手风琴
onCollChange(event) {
this.setData({
activeNames: event.detail,
});
},
/**
* 拨打电话
* @param {*} event
*/
calling: function (event) {
let callPhone = event.currentTarget.dataset.phone;
wx.makePhoneCall({
phoneNumber: callPhone,
success: function () {
console.log("拨打电话成功!")
},
fail: function () {
console.log("拨打电话失败!")
}
})
},
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseImgUrl + url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 劳务管理查看详细
*/
goLWGL: function () {
if (this.data.nactive == 2) {
wx.redirectTo({
url: '../../pageage/project_attendance/project_attendanceData/list/index'
})
} else {
let type;
if (this.data.nactive == 0) {
type = 1;
} else {
type = 2;
}
wx.redirectTo({
url: '../../pageage/project_attendance/project_attendanceUser/list/index?type=' + type
})
}
},
/**
* 最近出勤
*/
goZJCQ: function () {
wx.redirectTo({
url: '../../pageage/project_attendance/project_attendanceData/list/index'
})
},
//跳转到安全管控
XMSP: function () {
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: '../project_safety/index'
})
},
//跳转到质量管理
ZLGL: function () {
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: '../project_quality/index'
})
},
//跳转到进度管理
JDGL: function () {
wx.setStorageSync('nav-menu', "xmgk");
wx.redirectTo({
url: '../project_schedule/list/index'
})
},
//跳转到项目管理
XMGL: function () {
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: '../project_more/index'
})
},
//跳转到项目列表
XMLB: function () {
wx.redirectTo({
url: '../project_list/index'
})
},
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
let proUserInfo = this.data.subDeptUserInfo;
this.setData({
todoDb: proUserInfo.subDeptType=="1"?(res.data.dwsh+res.data.rysh):res.data.todo,
aqglDb: proUserInfo.subDeptType=="1"?res.data.aqgl:0,
zlglDb: proUserInfo.subDeptType=="1"?res.data.zlgl:0
})
}
});
},
})

View File

@ -0,0 +1,13 @@
{
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col",
"van-tabbar": "@vant/weapp/tabbar",
"van-tabbar-item": "@vant/weapp/tabbar-item",
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"ec-canvas": "../../ec-canvas/ec-canvas",
"van-notice-bar": "@vant/weapp/notice-bar"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,287 @@
<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="XMLB">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="3">
<user-infos></user-infos>
</van-col>
<van-col span="10">
<view class="header_name">{{title}}</view>
</van-col>
</van-row>
</view>
</view>
<!-- 中间内容 -->
<view class="max_content">
<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>
</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>
</view>
<view>
<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>
</view>
<view wx:if="{{false}}">
<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>
</view>
<view>
<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>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<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>
</view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<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>
</view>
</view>
</van-collapse-item>
<van-collapse-item wx:if="{{subDeptUserInfo.subDeptType=='1'}}" title="建设及管理单位信息" name="dept">
<view class="construction_unit" wx:for="{{projectDeptsList}}" wx:key="unique">
<view class="construction_unit_image">
<image src="{{item.iconSrc}}"></image>
</view>
<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>
</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_min">
<view class="eharts_title module_title_flex">
劳务人员
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情
<van-icon name="arrow" />
</view> -->
</view>
<!-- tab栏切换 -->
<view class="information-review-tab" bindtap="selectedTab">
<view class="{{nactive===index?'active':''}}" data-set="{{index}}" wx:for="{{labourTypeList}}" wx:key="index">
{{item.name}}({{item.total}})
</view>
</view>
<view class="video_ai_survey">
<van-row>
<van-col span="8">
<view class="survey_content">
<view class="survey_content_img">
<image animation="{{animationData}}" src="{{labourImg}}" />
</view>
</view>
<view class="survey_content_number labour-survey_content_number">
<view class="survey_content_value">
<text>{{ labourTotal }}</text> 人
</view>
</view>
</van-col>
<van-col span="16">
<safety-bar-chart id="userChart" chart-id="userChart" data="{{labourData}}" height="350"></safety-bar-chart>
</van-col>
</van-row>
</view>
</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_min">
<view class="eharts_title module_title_flex">
今日出勤
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情
<van-icon name="arrow" />
</view> -->
</view>
<view class="video_ai_survey">
<van-row>
<van-col span="8">
<view class="survey_content">
<view class="survey_content_img">
<image animation="{{animationData}}" src="https://szgcwx.jhncidg.com/staticFiles/icon/dw.png" />
</view>
</view>
<view class="survey_content_number labour-survey_content_number">
<view class="survey_content_value">
<text>{{ labourDaysTotal }}</text> 人
</view>
</view>
</van-col>
<van-col span="16">
<safety-bar-chart id="attsChart" chart-id="attsChart" data="{{labourDays}}" height="350"></safety-bar-chart>
</van-col>
</van-row>
</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_min">
<view class="eharts_title module_title_flex">
我的二维码
</view>
<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>
</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>
</van-col>
</van-row>
</view>
</view>
</view>
<view class="echarts_max" wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<view class="echarts_min">
<view class="eharts_title module_title_flex">
最近出勤
<!-- <view class="module_see_info" bindtap="goZJCQ">查看详情
<van-icon name="arrow" />
</view> -->
</view>
<view class="video_ai_survey">
<bar-chart id="chartBar" chartId="chartBar" chartData="{{labourDatas}}"></bar-chart>
</view>
</view>
</view>
<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">
最近出勤
<!-- <view class="module_see_info" bindtap="goZJCQ">查看详情
<van-icon name="arrow" />
</view> -->
</view>
<view class="video_ai_survey">
<view class="inspect_max_scroll">
<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_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>
</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}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">人员姓名:<text>{{item.userName}}</text></view>
<view class="inspect_list_info_data_prop">入场时间:
<text wx:if="{{item.inTime}}">{{format.timeStr(item.inTime)}}</text>
<text wx:else class="color_red">未打卡</text>
</view>
<view class="inspect_list_info_data_prop">离场时间:
<text wx:if="{{item.outTime}}">{{format.timeStr(item.outTime)}}</text>
<text wx:else class="color_red">未打卡</text>
</view>
</view>
</view>
<view class="inspect_list_info_position">
<text class="color_purple">单位名称:{{item.subDeptName}}</text>
</view>
</view>
</view>
</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>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
</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-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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMSP">
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="ZLGL">
<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;" />
质量管理
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</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-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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>

View File

@ -0,0 +1,255 @@
/* pages/xiangmugaikuang/index.wxss */
.information-review-tab {
display: flex;
justify-content: space-around;
align-items: center;
height: 80rpx;
color: #92a1ca;
}
.information-review-tab .active {
color: #87e3fa;
padding-left: 40rpx;
background: url("https://szgcwx.jhncidg.com/staticFiles/icon/utilization.png") no-repeat left/35rpx;
}
/* 有赞原码修改 */
.van-collapse.van-hairline--top-bottom:after {
border-width: 0px 0;
}
.van-cell.van-cell--borderless {
background-color: #2b345b;
color: #fff;
margin-top: 30rpx;
border-radius: 5rpx;
}
.van-cell.van-cell--borderless:active {
background-color: #2b345b;
}
.van-collapse-item__title.van-collapse-item__title--expanded:active {
background-color: #2b345b;
}
.van-collapse-item .van-cell:after {
border-bottom: 0;
}
.van-collapse-item.van-hairline--top:after {
border-top-width: 0
}
.van-cell.van-cell--clickable {
background-color: #2b345b;
margin-top: 10rpx;
color: #fff;
border-radius: 15rpx;
}
.van-cell.van-cell--clickable:active {
background-color: #2b345b;
}
.van-collapse-item__wrapper .van-collapse-item__content {
background-color: #1e2336;
color: #8ca4ec;
border-width: 0px 0;
}
/* 页面样式 */
.gk_open {
padding: 0 30rpx;
}
.gk_open_con view {
padding: 10rpx 0;
}
.gk_open_con image {
width: 30rpx;
height: 30rpx;
margin-right: 5rpx;
position: relative;
top: 5rpx;
}
.echarts_max {
margin-top: 30rpx;
padding: 0 30rpx;
}
.echarts_min {
background: #1e2336;
font-size: 28rpx;
padding: 15rpx;
border-radius: 15rpx;
}
.eharts_title {
height: 40rpx;
line-height: 40rpx;
padding-left: 40rpx;
background: url("https://szgcwx.jhncidg.com/staticFiles/img/menu/CORE_52887EE6A33042408E11C2174974ABA1.png") no-repeat left/35rpx;
}
.eharts_head {
text-align: center;
padding: 30rpx 0;
}
.eharts_head text {
color: #0ad7ec;
font-size: 40rpx;
}
.eharts_con {
height: 320rpx;
width: auto;
}
.eharts_title_float {
float: right;
}
.eharts_title_float text {
padding: 0 5rpx;
}
.eharts_con_top {
margin-top: -320rpx;
}
.eharts_title_float_img {
width: 40rpx;
height: 40rpx;
float: right;
position: relative;
top: 2rpx;
}
.zdzb_bg {
height: 88rpx;
border-radius: 15rpx;
background: #2b345b;
margin: 30rpx;
font-size: 28rpx;
line-height: 88rpx;
padding-left: 30rpx;
}
.construction_unit {
padding: 10rpx 0;
display: flex;
}
.construction_unit_image {
padding-top: 15rpx;
}
.construction_unit_image image {
width: 80rpx;
height: 80rpx;
}
.construction_unit_list {
width: calc(100% - 100rpx);
padding-left: 20rpx;
}
.construction_unit_title {
padding: 6rpx 0;
color: #c5d9fc;
}
.construction_unit_name {
padding: 6rpx 0;
color: #54acf6;
}
.construction_unit_phone {
padding: 6rpx 0;
color: #ce9433;
}
.official {
margin-left: 30rpx;
margin-right: 30rpx;
}
.survey_content {
display: flex;
align-items: center;
justify-content: center;
margin-top: 15px;
}
.survey_content_img {
width: 90px;
height: 90px;
text-align: center;
line-height: 90px;
position: relative;
background: url("https://szgcwx.jhncidg.com/staticFiles/icon/survey_total_icon.png") no-repeat bottom/90px 60px;
}
.survey_content_img image {
text-align: center;
line-height: 90px;
width: 50px;
height: 50px;
}
.labour-survey_content_number {
color: #cbdaff;
font-size: 16px;
text-align: center;
padding-top: 25px;
padding-left: 0;
}
.survey_content_number {
padding-left: 15px;
color: #cbdaff;
font-size: 16px;
}
.labour-survey_content_number {
color: #cbdaff;
font-size: 16px;
text-align: center;
padding-top: 25px;
padding-left: 0;
}
.survey_content_value text {
font-size: 25px;
font-style: italic;
font-weight: bold;
color: #87e3fa;
padding-right: 5px;
}
.inspect_max_scroll {
height: 30vh;
max-height: 82vh;
}
.zz{
color: #fcbc02;
font-weight: 800;
}
.qrcode{
text-align: center;
}
.qrtext{
margin-top: 25rpx;
}
.qrcode image{
width: 100px;
height: 100px;
}
.bt30{
margin-bottom: 20px;
}

View File

@ -0,0 +1,74 @@
import {
getToken,
setUserInfo,
getUserInfo
} from '../../utils/auth'
import {
findMyProjectList,
findProSubDeptsUserInfo,
} from '../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
proCount:0,
projectInfoList:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (getToken()) {
this.getMyProjectList();
} else {
console.log("未查询到Token...{}...准备重新登录")
wx.redirectTo({
url: '../../pages/login/login',
})
}
},
/**
* 查询
* 用户项目信息
* 根据项目配置进入不同页面...
*/
getMyProjectList: function () {
findMyProjectList().then(res=>{
if(res.code==200){
res.rows.forEach(item =>{
item.videoNum = 0;
item.warningCount = 0;
item.monitoringCount = 0;
});
app.globalData.projectInfoList = res.rows;
this.setData({
proCount:res.total,
projectInfoList:res.rows
})
}
});
},
//项目详情
checkProject:function(even){
//赋值到公共参数
app.globalData.useProjectId = even.currentTarget.dataset['id'];
app.globalData.useProjectName = even.currentTarget.dataset['name'];
findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{
if(detail.code==200){
let userInfo = getUserInfo();
userInfo.projectUserInfo = detail.data;
setUserInfo(userInfo);
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
}
});
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,45 @@
<view class="header_title">
<view class="header_title_row">
<view class="header_name">工程项目列表</view>
</view>
</view>
<view class="max_content">
<view class="address list_title">
总工程数<text>{{proCount}}</text>
</view>
<view class="list_option_max">
<view class="list_option" wx:for="{{projectInfoList}}" wx:key="projectInfoList">
<view class="list_right" bindtap="checkProject" data-id="{{item.id}}" data-name="{{item.projectName}}">
<view class="list_left">{{item.comName}}</view>
<view class="list_con_bottom">
<view class="list_right_name">{{item.projectName}}</view>
<view class="list_right_address">{{item.projectAddress}}</view>
<view class="list_right_info">
<van-row>
<van-col span="8" wx:if="{{item.warningCount != '0'}}">
<text class="list_warning active">预警({{item.warningCount}})</text>
</van-col>
<van-col span="8" wx:if="{{item.warningCount == '0'}}">
<text class="list_warning">预警({{item.warningCount}})</text>
</van-col>
<van-col span="8" wx:if="{{item.videoNum != '0'}}">
<text class="list_video active">视频({{item.videoNum}})</text>
</van-col>
<van-col span="8" wx:if="{{item.videoNum == '0'}}">
<text class="list_video">视频({{item.videoNum}})</text>
</van-col>
<van-col span="8" wx:if="{{item.monitoringCount != '0'}}">
<text class="list_dust active">结构体({{item.monitoringCount}})</text>
</van-col>
<van-col span="8" wx:if="{{item.monitoringCount == '0'}}">
<text class="list_dust">结构体({{item.monitoringCount}})</text>
</van-col>
</van-row>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,324 @@
.list_max{
padding: 0 30rpx;
margin: 30rpx 0 10rpx;
}
.list_min{
border-radius:10rpx;
background: #2b345b;
height: 80rpx;
}
.list_min_1{
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
padding-left: 10rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.list_min_2{
height: 80rpx;
text-align: center;
line-height: 80rpx;
}
.list_bottom{
width:30rpx;
height:30rpx;
}
.list_title{
color:#8ca4ee;
font-size: 24rpx;
padding: 20rpx 30rpx;
}
.list_title text{
font-size: 26rpx;
color: #1aeff5;
}
.list_option_max{
padding:20rpx 30rpx;
}
.list_option{
margin-bottom: 40rpx;
background: #222840;
border-radius: 30rpx;
}
.list_left{
background: #273051;
border-radius: 30rpx 30rpx 0 0 ;
height: 80rpx;
font-size: 32rpx;
color: #14feff;
line-height: 80rpx;
padding-left: 30rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.list_right{
font-size: 24rpx;
}
.list_con_bottom{
padding: 30rpx;
}
.list_right_name{
font-size: 30rpx;
}
.list_right_address{
padding: 20rpx 0 20rpx 35rpx;
color:#8ca4ee;
background: url("https://szgcwx.jhncidg.com/staticFiles/img/menu/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/35rpx;
}
.list_right_info{
padding: 10rpx 0;
font-size: 22rpx;
}
.list_warning{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_632B884CD4084C4F8E556AB742809723.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.list_video{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_970838B4C6F54BC7B33BB9F198D50130.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.list_dust{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/62bfb39a8e5944f99a14c02922ffb80e.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.list_warning.active{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_ACFA3598B4C943EB836848A6977C4189.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.list_video.active{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_48D684509A314D55BD3B61EFFB77EF07.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.list_dust.active{
background: url("https://szgcwx.jhncidg.com/staticFiles/img/66036a52100146f5a36b0019849e8de0.png") no-repeat left/30rpx;
padding-left: 35rpx;
}
.sel_max{
width: 600rpx;
border-radius: 20rpx;
max-height: 800rpx;
padding: 30rpx;
background: #232a44;
border-radius: 20rpx;
overflow: auto;
}
.sel_min{
background: #273051;
height: 100rpx;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
line-height: 100rpx;
padding: 0 20rpx;
border-radius: 10rpx;
color: #14feff;
margin: 20rpx 0;
}
.sel_min:active{
background: #394577;
}
.van-popup.van-popup--center{
background: none;
}
.address{
margin: 0 30rpx;
color: #8ca4ee;
font-size: 28rpx;
padding: 20rpx 0 20rpx 50rpx;
background: url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_1F1F3A2778334D3EAC1226DDCEBD48D0.png") no-repeat left/40rpx;
}
.map_list_info{
background: #232a44;
padding: 0 30rpx;
}
.van-center-enter-to.van-center-enter-active{
border-radius: 20rpx;
background: #232a44;
}
.map_list_info_title{
padding: 30rpx;
text-align: center;
}
.map_list_info .van-picker{
background: none;
}
.map_list_info view{
background: none;
}
.map_list_info .van-picker-column{
color: #157dd2;
}
.map_list_info .van-picker-column__item--selected{
color: #00e3fe;
}
.map_list_info .van-hairline--top-bottom:after{
border-width: 0px 0;
}
/* -------------------------- */
.van-popup.van-popup--bottom{
background: #232a44;
}
.all_name{
font-size: 26rpx;
padding:30rpx 20rpx;
line-height: 50rpx;
color: #00e3fe;
}
.van-tabs__scroll{
background: none !important;
}
.van-hairline--top-bottom:after{
border: none !important;
}
.van-tab.van-tab--active{
color: #14feff !important;
}
.van-tab{
color: #157dd2 !important;
}
.max_tab_name{
padding: 0 40rpx;
font-size:30rpx;
height: 460rpx;
overflow: auto;
margin-top: 20rpx;
text-align: center;
}
.font_color{
padding: 15rpx 0;
color: #157dd2;
}
.active1{
color: #14feff
}
.active2{
color: #14feff
}
.active3{
color: #14feff ;
}
.van-tabs__line{
background-color:#14feff !important;
}
.tab_max_tltie{
padding:0 30rpx;
font-size: 30rpx;
}
.tab_max_tltie text{
padding: 30rpx ;
color: #999999;
}
.tab_max_tltie .active{
font-weight: bold;
color: #00e3fe;
}
.choice_max{
width: 500rpx;
background: #232a44;
padding:0 30rpx;
}
.choice_tltie{
text-align: center;
color: #00e3fe;
font-size: 28rpx;
padding: 20rpx 0;
}
.choice_input input{
border: 1px solid #00e3fe;
width: 100%;
height:60rpx;
border-radius: 50rpx;
font-size: 28rpx;
color: #00e3fe;
padding-left: 30rpx;
box-sizing: border-box;
}
.choice_content{
padding: 20rpx 0;
}
.choice_content_max{
max-height: 515rpx;
overflow: auto;
}
.choice_content_min{
padding: 10px 0;
border-bottom: 1px solid #39446f;
font-size: 24rpx;
color: #157dd2;
}
.choice_content_min:active{
color: #00e3fe;
}
.queren{
float: right;
position: relative;
right: 20rpx;
padding: 10rpx;
color: #157dd2;
font-size: 28rpx;
}
.choice_max{
width: 500rpx;
background: #232a44;
padding:0 30rpx;
}
.choice_tltie{
text-align: center;
color: #00e3fe;
font-size: 28rpx;
padding: 20rpx 0;
}
.choice_input input{
border: 1px solid #00e3fe;
width: 100%;
height:60rpx;
border-radius: 50rpx;
font-size: 28rpx;
color: #00e3fe;
padding-left: 30rpx;
box-sizing: border-box;
}
.choice_content{
padding: 20rpx 0;
}
.choice_content_max{
max-height: 515rpx;
overflow: auto;
}
.choice_content_min{
padding: 10px 0;
border-bottom: 1px solid #39446f;
font-size: 24rpx;
color: #157dd2;
}
.choice_content_min:active{
color: #00e3fe;
}
.queren{
float: right;
position: relative;
right: 20rpx;
padding: 10rpx;
color: #157dd2;
font-size: 28rpx;
}

View File

@ -0,0 +1,586 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
findProRoles,
findDictCache,
findCardOcrFront
} from '../../../api/publics'
import {
addUser,
getUserRoles
} from '../../../api/login'
import {
findProSubUsersInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
limit: 1,
maxDate: new Date(2088, 1, 1).getTime(),
form: {},
active: 0,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '人员入场'
}],
deptsList: [],
postsList: [],
allPostList:[],
proRoleList: [],
loadShow: false,
imgBase: config.baseImgUrl,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
const proUserInfo = getUserInfo();
this.setData({
"form.comId": proUserInfo.projectUserInfo.comId,
"form.deptId": app.globalData.useProjectId,
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
this.getDictCache();
this.getAllProDeptRoles();
},
/**
* 获取单位
*/
getAllProDeptRoles() {
findProRoles(app.globalData.useProjectId).then(res => {
let list = [];
res.data.forEach(item => {
list.push({
"roleId": item.roleId,
"roleName": item.roleName,
"roleKey": item.roleKey,
"state": false
});
});
this.setData({
proRoleList: list
});
});
},
/**
* 获取字典缓存数据
*/
getDictCache() {
// 初始化岗位
findDictCache("user_work_type").then(res => {
if (res.code == 200) {
let depts = [];
res.data.forEach(item => {
if(item.remark){
const exists = depts.some(ops => ops.id === item.remark);
if (!exists) {
depts.push({
'id': item.remark,
'text': item.remark,
'post': []
});
}
}
});
depts.forEach(des => {
res.data.forEach(item => {
if (des.id == item.remark) {
des.post.push({
'id': item.dictValue,
'text': item.dictLabel
});
}
});
})
this.setData({
deptsList: depts,
allPostList: res.data
});
}
})
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubUsersInfoById(id).then(userRes => {
if (userRes.code == 200 && userRes.data != null) {
userRes.data.deptId = userRes.data.projectId;
userRes.data.nickName = userRes.data.userName;
userRes.data.phonenumber = userRes.data.userPhone;
if (userRes.data.userInfos) {
let userInfosJSON = JSON.parse(userRes.data.userInfos);
userRes.data.nativePlace = userInfosJSON.nativePlace;
userRes.data.nation = userInfosJSON.nation;
userRes.data.address = userInfosJSON.address;
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
}
if (userRes.data.cardImgPos) {
userRes.data.cardImgPos = (this.data.imgBase + userRes.data.cardImgPos).split(',');
}
if (userRes.data.cardImgInv) {
userRes.data.cardImgInv = (this.data.imgBase + userRes.data.cardImgInv).split(',');
}
if (userRes.data.userPicture) {
userRes.data.avatar = (this.data.imgBase + userRes.data.userPicture).split(',');
}
this.setData({
active: 100,
form: userRes.data
});
this.initUserRole(userRes.data.userId);
}
});
},
/**
* 初始化用户角色
* @param {*} userId
*/
initUserRole(userId){
getUserRoles(userId).then(res => {
if(res.code==200){
let _roleIds = [];
let _roleNames = "";
res.data.roles.forEach(item =>{
_roleIds.push(item.roleId);
_roleNames += "" + item.roleName;
});
this.setData({
"form.deptId":res.data.deptId,
"form.roleIds": _roleIds,
"form.roleNames":_roleNames.substring(1)
})
}
})
},
//选择角色
onAddRoles(e) {
if (e.detail.length > 0) {
let _roleIds = "";
let _roleNames = "";
e.detail.forEach(item => {
_roleIds += "," + item.roleId;
_roleNames += "" + item.roleName;
});
this.setData({
"form.roleIds": _roleIds.substring(1).split(','),
"form.roleNames":_roleNames
})
console.log("dddddddd",this.data.form);
} else {
this.setData({
"form.roleIds": []
})
}
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
/**
* 委托代理提交参建单位信息
*/
submitSubUsers() {
let {
form
} = this.data;
//数据效验
if (!form.comId || !form.deptId || !form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
if (!form.cardImgPos || form.cardImgPos.length == 0) {
app.toast("请上传身份证正面照!");
return false;
}
if (!form.cardImgInv || form.cardImgInv.length == 0) {
app.toast("请上传身份证反面照!");
return false;
}
if (!form.avatar || form.avatar.length == 0) {
app.toast("请上传进场半身近照!");
return false;
}
if (!form.nickName) {
app.toast("请填写人员姓名!");
return false;
}
if (!form.cardCode) {
app.toast("请填写身份证号!");
return false;
} else {
const cardCodePattern = /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
if (!cardCodePattern.test(form.cardCode)) {
app.toast("身份证号码不正确!");
return false;
}
}
if (!form.phonenumber) {
app.toast("请填写联系电话!");
return false;
} else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.phonenumber)) {
app.toast("人员联系电话不正确!");
return false;
}
}
if(!form.id){
if (!form.password) {
app.toast("请输入登录密码!");
return false;
}else if(form.password.length<6){
app.toast("登录密码最少6位字符");
return false;
}
if (!form.depts) {
app.toast("请选择岗位部门!");
return false;
}
}
if (!form.workType) {
app.toast("请选择岗位级别!");
return false;
}
if (!form.roleIds || form.roleIds.length==0) {
app.toast("请选择用户角色!");
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认保存总包人员信息?',
success: function (sm) {
if (sm.confirm) {
that.submitSubUserForm();
}
}
})
},
/**
* 委托代理提交参建单位表单
*/
submitSubUserForm() {
let _form = {
...this.data.form
};
this.setData({
loadShow: true
})
let uploadFiles = [];
if (_form.cardImgPos && _form.cardImgPos.length > 0) {
uploadFiles.push({
type: 'cardImgPos',
path: _form.cardImgPos[0]
});
}
if (_form.cardImgInv && _form.cardImgInv.length > 0) {
uploadFiles.push({
type: 'cardImgInv',
path: _form.cardImgInv[0]
});
}
if (_form.avatar && _form.avatar.length > 0) {
uploadFiles.push({
type: 'userPicture',
path: _form.avatar[0]
});
}
let that = this;
let uploads = [];
uploadFiles.forEach(async (item, idx) => {
let obj;
if (item.path.indexOf(this.data.imgBase) > -1) {
obj = {
data: {
data: {
url: item.path.replace(this.data.imgBase, "")
}
}
}
} else {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
obj = await that.syncUploadImage(item.path);
}
if (item.type == "cardImgPos") {
_form.cardImgPos = obj.data.data.url;
}
if (item.type == "cardImgInv") {
_form.cardImgInv = obj.data.data.url;
}
if (item.type == "userPicture") {
_form.avatar = obj.data.data.url;
}
uploads.push(obj.data.data.url);
//验证图片上传完毕
if (uploads.length == uploadFiles.length) {
let userInfos = {};
userInfos.nation = _form.nation;
userInfos.nativePlace = _form.nativePlace;
userInfos.address = _form.address;
userInfos.cardImgPos = _form.cardImgPos;
userInfos.cardImgInv = _form.cardImgInv;
_form.userInfos = JSON.stringify(userInfos);
addUser(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
});
},
/**
* 个人身份证正面照
* @param {*} options
*/
fileUploadCardImgPos(options) {
let file = options.detail;
this.setData({
"form.cardImgPos": file
});
file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res => {
if (res.code == 200) {
if (res.data.nation.indexOf("族") < 0) {
res.data.nation = res.data.nation + "族";
}
this.setData({
"form.nickName": res.data.name,
"form.cardCode": res.data.cardId,
"form.nation": res.data.nation,
"form.nativePlace": res.data.native,
"form.address": res.data.address
})
if (!res.data.name || !res.data.cardId) {
this.setData({
"form.cardImgPos": []
});
app.toast("身份证正面照识别失败!请重新上传");
}
}
});
})
},
/**
* 个人身份证反面照
* @param {*} options
*/
fileUploadCardImgInv(options) {
let file = options.detail;
this.setData({
"form.cardImgInv": file
});
},
/**
* 个人半身近照
* @param {*} options
*/
fileUploadUserPicture(options) {
let file = options.detail;
this.setData({
"form.avatar": file
});
},
/**
* 输入个人姓名
* @param {*} e
*/
inputUserName(e) {
this.setData({
"form.nickName": e.detail.value
})
},
/**
* 输入个人身份证号
* @param {*} e
*/
inputUserCode(e) {
this.setData({
"form.cardCode": e.detail.value
})
},
/**
* 输入联系电话
* @param {*} e
*/
inputUserPhone(e) {
this.setData({
"form.phonenumber": e.detail.value
})
},
/**
* 登陆密码
* @param {*} e
*/
inputPassword(e) {
this.setData({
"form.password": e.detail.value
})
},
/**
* 选择部门
* @param {*} e
*/
onDepts(e) {
let _list = this.data.deptsList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.depts": e.detail.id,
"form.workType": null,
postsList: item.post
})
}
});
},
/**
* 选择岗位
* @param {*} e
*/
onPosts(e) {
this.setData({
"form.workType": e.detail.id
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,122 @@
<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">{{form.id?'修改':'新增'}}总包人员</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list">
<van-row>
<van-col span="8">
<view class="markers inspect_info_title">身份证正面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUploadCardImgPos" iconClass="in-zcard-click" limit="{{limit}}" fileUrlArray="{{form.cardImgPos}}"></file-uploader>
</view>
</van-col>
<van-col span="8">
<view class="markers inspect_info_title">身份证反面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUploadCardImgInv" iconClass="in-fcard-click" limit="{{limit}}" fileUrlArray="{{form.cardImgInv}}"></file-uploader>
</view>
</van-col>
<van-col span="8">
<view class="markers inspect_info_title">半身清晰照
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUploadUserPicture" limit="{{limit}}" fileUrlArray="{{form.avatar}}"></file-uploader>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">人员姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写姓名" placeholder-style="color:#6777aa;" bindinput="inputUserName" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nickName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写身份证号" placeholder-style="color:#6777aa;" bindinput="inputUserCode" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.cardCode}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">手机号码
<text wx:if="{{form.id}}" style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.id}}">
<input placeholder-style="color:#6777aa;" model:value="{{form.phonenumber}}" class="inspect_input_fill_out" disabled />
</view>
<view class="inspect_info_content" wx:if="{{!form.id}}">
<input placeholder="请填写手机号码" placeholder-style="color:#6777aa;" bindinput="inputUserPhone" model:value="{{form.phonenumber}}" class="inspect_input_fill_in" maxlength="11"/>
</view>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_delete">使用手机号码登录系统。</text>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">登陆密码</view>
<view class="inspect_info_content">
<input placeholder="请填写登陆密码" type="password" placeholder-style="color:#6777aa;" bindinput="inputPassword" class="inspect_input_fill_in" maxlength="30" model:value="{{form.password}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">岗位部门</view>
<view class="inspect_info_content">
<voucher-select columns="{{deptsList}}" placeholder="请选择岗位部门" bindchange="onDepts" ></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">岗位级别</view>
<view class="inspect_info_content">
<voucher-select columns="{{postsList}}" placeholder="请选择岗位部门" bindchange="onPosts" selectValue="{{form._userPost}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">部门岗位</view>
<view class="inspect_info_content">
<input wx:for="{{allPostList}}" wx:key="index" wx:if="{{item.dictValue==form.workType}}" placeholder-style="color:#6777aa;" model:value="{{item.remark+item.dictLabel}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">用户角色</view>
<view class="inspect_info_content">
<select-roles rectifierData="{{proRoleList}}" multiple="{{true}}" bindselected="onAddRoles" title="请选择用户角色" choose="{{form.roleNames}}"></select-roles>
</view>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">{{form.id?'修改':'新增'}}人员信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSubUsers">提交保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,11 @@
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,321 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
editSubUsersPhone,
editSubUsersUseStatus,
findProSubUsersInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 100,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '人员入场'
}],
form: {},
newUserPhone:"",
isChange: false,
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubUsersInfoById(id).then(userRes => {
if (userRes.code == 200 && userRes.data != null) {
if (userRes.data.userInfos) {
let userInfosJSON = JSON.parse(userRes.data.userInfos);
userRes.data.nativePlace = userInfosJSON.nativePlace;
userRes.data.nation = userInfosJSON.nation;
userRes.data.address = userInfosJSON.address;
userRes.data.emergencyContact = userInfosJSON.emergencyContact;
userRes.data.contactPhone = userInfosJSON.contactPhone;
userRes.data.bankName = userInfosJSON.bankName;
userRes.data.bankOffice = userInfosJSON.bankOffice;
userRes.data.bankCardNo = userInfosJSON.bankCardNo;
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
}
if (userRes.data.cardImgPos) {
userRes.data.cardImgPos = (this.data.imgBaseUrl + userRes.data.cardImgPos).split(',');
}
if (userRes.data.cardImgInv) {
userRes.data.cardImgInv = (this.data.imgBaseUrl + userRes.data.cardImgInv).split(',');
}
if (userRes.data.userPicture) {
userRes.data.userPicture = (this.data.imgBaseUrl + userRes.data.userPicture).split(',');
}
if (userRes.data.subDeptPowerPath) {
userRes.data.subDeptPowerPath = (this.data.imgBaseUrl + userRes.data.subDeptPowerPath).split(',');
}
this.setData({
active: 100,
form: userRes.data
});
}
});
},
/**
* 返回上页
*/
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 展示图片
* @param {*} e
*/
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.form.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
/**
* 单位入场
*/
submitSubDeptsIn(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认班组人员入场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(0);
}
}
})
},
/**
* 单位离场
*/
submitSubDeptsOut(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认班组人员离场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(1);
}
}
})
},
/**
* 表单提交
*/
submitSubDeptsUseStatus(status){
editSubUsersUseStatus(this.data.form.id,status).then(res =>{
if(res.code==200){
app.toast("操作成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
/**
* 输入联系电话
* @param {*} e
*/
inputUserPhone(e) {
this.setData({
newUserPhone: e.detail.value
})
},
/**
* 变更手机号
*/
changeUserPhone() {
this.setData({
isChange: !this.data.isChange
});
setTimeout(() => {
wx.pageScrollTo({
scrollTop: 99999, // 滚动到内容区域的高度,即最底部
duration: 100 // 滚动的动画持续时间
});
}, 500)
},
/**
*
*/
submitChangePhone(){
let {
form,
newUserPhone
} = this.data;
if(!newUserPhone){
app.toast("请输入新手机号码!")
return false;
}else{
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(newUserPhone)) {
app.toast("手机号码不正确!");
return false;
}
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认变更人员手机号?',
success: function (sm) {
if (sm.confirm) {
that.submitChangePhoneForm();
}
}
})
},
/**
* 确定
* 变更手机号
*/
submitChangePhoneForm(){
let _form = {
...this.data.form
};
let {
newUserPhone
} = this.data;
_form.userPhone = newUserPhone;
_form.cardImgPos = "";
_form.cardImgInv = "";
_form.userPicture = "";
_form.subDeptPowerPath = "";
editSubUsersPhone(_form).then(res =>{
if(res.code==200){
app.toast("变更成功!")
this.setData({
isChange: !this.data.isChange
})
this.onLoad({id: _form.id});
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,6 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,244 @@
<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>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">总包人员详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="module_title module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info">
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{form.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{form.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptGroupName}}">
<van-row>
<van-col span="8"><text class="color_purple">所属班组</text></van-col>
<van-col span="16">{{form.subDeptGroupName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.craftTypeName}}">
<van-row>
<van-col span="8"><text class="color_purple">工种类型</text></van-col>
<van-col span="16">{{form.craftTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.craftPostName}}">
<van-row>
<van-col span="8"><text class="color_purple">工种岗位</text></van-col>
<van-col span="16">
{{form.craftPostName}}
<text wx:if="{{form.userPost=='3'}}" style="font-size: small; color: #ff6d6d;">[班组长]</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.cardImgPos && form.cardImgInv}}">
<van-row>
<van-col span="8"><text class="color_purple">身份证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.cardImgPos}}" src="{{form.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{form.cardImgInv}}" src="{{form.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userPicture}}">
<van-row>
<van-col span="8"><text class="color_purple">半身近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.userPicture}}" src="{{form.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptPowerPath}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.subDeptPowerPath}}" src="{{form.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userName}}">
<van-row>
<van-col span="8">
<text class="color_purple">人员姓名</text>
</van-col>
<van-col span="16">{{form.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.cardCode}}">
<van-row>
<van-col span="8">
<text class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{form.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.nation}}">
<van-row>
<van-col span="8"><text class="color_purple">所属民族</text></van-col>
<van-col span="16">{{form.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.nativePlace}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯地址</text></van-col>
<van-col span="16">{{form.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.address}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{form.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16"><text class="color_blue txtb">{{form.userPhone}}</text></van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.emergencyContact}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{form.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.contactPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{form.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankName}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{form.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankOffice}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{form.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankCardNo}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{form.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.illnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{form.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{form.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{form.supIllnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{form.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{form.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{form.eduFilePath}}">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{form.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击下载安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.useStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">入场状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.useStatus=='0'}}" class="color_blue txtb">已入场</text>
<text wx:if="{{form.useStatus=='1'}}" class="color_delete txtb">已离场</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.approveStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">审批状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.approveStatus==0}}" class="code_label_2 code_label_yellow" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">待提交</text>
<text wx:if="{{form.approveStatus==10}}" class="code_label_2 code_label_blue" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核中</text>
<text wx:if="{{form.approveStatus==11}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核驳回</text>
<text wx:if="{{form.approveStatus==100}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核通过</text>
<text wx:if="{{form.approveStatus==101}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">系统免审</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.createBy}}">
<van-row>
<van-col span="8"><text class="color_purple">数据来源</text></van-col>
<van-col span="16">{{form.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.createTime}}">
<van-row>
<van-col span="8"><text class="color_purple">创建时间</text></van-col>
<van-col span="16">{{form.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{isChange}}">
<view class="module_title module_title_padding">
<view>变更手机号码</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="markers inspect_info_title">新手机号码</view>
<view class="inspect_info_content">
<input placeholder="请填写新手机号码" placeholder-style="color:#6777aa;" bindinput="inputUserPhone" model:value="{{newUserPhone}}" class="inspect_input_fill_in" maxlength="11"/>
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">返回取消</view>
<view wx:if="{{!isChange}}" class="problem_submit_to_btn problem_submit_to_view_eq" bindtap="changeUserPhone">变更电话</view>
<view wx:if="{{isChange}}" class="problem_submit_to_btn problem_submit_to_view_save" bindtap="submitChangePhone">提交保存</view>
<view wx:if="{{form.useStatus=='0'}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="submitSubDeptsOut">人员离场</view>
<view wx:if="{{form.useStatus=='1'}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="submitSubDeptsIn">人员入场</view>
</view>
</view>

View File

@ -0,0 +1,11 @@
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,228 @@
import {
getToken
} from '../../../utils/auth'
import {
subusersList,
subusersCount
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
addFlag: false,
initData: {},
pageNum: 1,
pageSize: 10000,
total: 0,
listData: [],
activeState: "0",
yrcCount: 0,
ylcCount: 0,
activeName: "0_0",
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.setData({
addFlag: true,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 10000,
listData: [],
total: 0
});
//获取数据列表
this.getListData();
this.getListCount();
},
/**
* 添加按钮
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 获取详情
* @param {*} e
*/
getInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},
// 手风琴
onChange(e) {
this.setData({
activeName: e.target.dataset.set
});
},
/**
* 查询数据列表
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=magUsers";
subusersList(params).then(res => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计数据列表
*/
getListCount() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=magUsers";
subusersCount(params).then(res => {
if (res.code == 200) {
let _yrc = 0,
_ylc = 0;
res.data.forEach(item => {
if (item.useStatus == "0") {
_yrc = item.total;
} else {
_ylc = item.total;
}
});
this.setData({
yrcCount: _yrc,
ylcCount: _ylc
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = '0';
} else {
nav = '1';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10000,
listData: [],
});
this.getListData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../../project_more/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("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,9 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-cell-group": "@vant/weapp/cell-group",
"van-cell": "@vant/weapp/cell"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,61 @@
<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 class="{{activeState=='0'?'active':''}}" bindtap="trainJump" data-index="1"><text>已入场({{yrcCount}}</text></view>
<view class="{{activeState=='1'?'active':''}}" bindtap="trainJump" data-index="2"><text>已离场({{ylcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" 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_text_2 color_orange">
{{item.subDeptName}}
</view>
</view>
</view>
<view class="inspect_list_info">
<van-collapse wx:for="{{item.groups}}" wx:for-item="groupItem" wx:for-index="groupIndex" wx:key="groupIndex" data-set="{{index+'_'+groupIndex}}" value="{{activeName}}" bind:change="onChange" accordion>
<van-collapse-item title="{{groupItem.subDeptGroupName+' ( '+groupItem.users.length+' )'}}" name="{{index+'_'+groupIndex}}" icon="qr">
<van-cell-group style="width: 100%;">
<van-cell wx:for="{{groupItem.users}}" wx:for-item="userItem" wx:for-index="userIndex" wx:key="userIndex" title="{{userItem.userName}}" cell-class="switch-cell" data-set="{{userItem.id}}" bindtap="getInfo" icon="vip-card-o">
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{userItem.id}}">
<van-icon name="edit" /><text class="edit_text">修改</text>
</view>
</van-cell>
</van-cell-group>
</van-collapse-item>
</van-collapse>
</view>
</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 wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,19 @@
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
color: #91ef4a;
font-weight: 600;
}
.module_see_info_edit .edit_text {
padding-left: 10rpx;
}
.van-cell{
color: #89a3ee !important;
background-color: #32374c !important;
}
.van-collapse-item__content{
padding: 0;
background-color: transparent !important;
}

View File

@ -0,0 +1,161 @@
import {
getToken,
getUserInfo
} from '../../utils/auth'
import {
findUserMenuList
} from '../../api/publics'
import {
findMyTask
} from '../../api/flowable'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 1,
projectId: '',
projectName: '',
subDeptUserInfo: {},
menuList: [],
initData: {},
aqglDb: 0,
zlglDb: 0,
todoDB: 0,
fbdwDB: 0,
fbrtDB: 0,
aqyhDB: 0,
zlyhDB: 0
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (!getToken()) {
wx.redirectTo({
url: '../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
active: proUserInfo.projectUserInfo.subDeptType == '1' ? 4 : 1,
subDeptUserInfo: proUserInfo.projectUserInfo,
});
//用户权限菜单
this.getUserMenuList(app.globalData.useProjectId);
this.awaitTask();
},
/**
* 查询功能菜单
* @param {*} proId
*/
getUserMenuList: function (proId) {
findUserMenuList(proId, 'gdgn').then(res => {
if (res.code == 200) {
this.setData({
menuList: res.data
})
}
});
},
goMenu: function (event) {
let _url = event.currentTarget.dataset.url;
if (!_url) {
app.toast("正在建设中...")
return false;
}
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: _url
})
//跳转到其它小程序
//wx.navigateToMiniProgram({
// appId: 'wx7c39a25db91228f7',
// path: 'pages/tabbar/order-new/index?type=0'
//})
},
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({
active: event.detail
});
},
//跳转到项目概况
XMGK: function () {
wx.setStorageSync('nav-menu', "xmgk");
wx.redirectTo({
url: '../project_info/index'
})
},
//跳转到安全管理
AQGL: function () {
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: '../project_safety/index'
})
},
//跳转到质量管理
ZLGL: function () {
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: '../project_quality/index'
})
},
//跳转到进度管理
JDGL: function () {
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: '../project_schedule/list/index'
})
},
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
let proUserInfo = this.data.subDeptUserInfo;
this.setData({
todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo,
fbdwDB: res.data.dwsh,
fbrtDB: res.data.rysh,
aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0,
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0,
aqyhDB: res.data.aqgl,
zlyhDB: res.data.zlgl,
})
}
});
},
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tabbar": "@vant/weapp/tabbar",
"van-tabbar-item": "@vant/weapp/tabbar-item"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,87 @@
<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="XMGK">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="3">
<user-infos></user-infos>
</van-col>
<van-col span="10">
<view class="header_name">项目管理</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="gd_max" style="margin-top: 20rpx;">
<van-row class="demo clearfix">
<van-col span="8" wx:for="{{menuList}}" wx:key="unique">
<view class="gd_min" data-id="{{item.menuIdenti}}" data-url="{{item.menuUrl}}" bindtap="goMenu">
<span class="tabNum_active" wx:if="{{item.menuIdenti=='FBDWSH' && fbdwDB>0}}">{{fbdwDB}}</span>
<span class="tabNum_active" wx:if="{{item.menuIdenti=='FBRYSH' && fbrtDB>0}}">{{fbrtDB}}</span>
<span class="tabNum_active" wx:if="{{item.menuIdenti=='AQYHPC' && aqyhDB>0}}">{{aqyhDB}}</span>
<span class="tabNum_active" wx:if="{{item.menuIdenti=='ZLYHPC' && zlyhDB>0}}">{{zlyhDB}}</span>
<image src="{{format.httpImg(item.menuImg)}}"></image>
<view>{{item.menuName}}</view>
</view>
</van-col>
</van-row>
</view>
</view>
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="AQGL">
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="ZLGL">
<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;" />
质量管理
<span class="tabNum" wx:if="{{zhglDB>0}}">{{zhglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理
</van-tabbar-item>
<van-tabbar-item>
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</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-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item>
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>

View File

@ -0,0 +1,23 @@
.more_max{
padding:10rpx 30rpx 30rpx;
}
.more_manage{
border-radius: 10rpx;
margin-top: 50rpx;
}
.gd_max{
padding:10rpx 50rpx 0;
}
.gd_min{
padding: 30rpx 0;
text-align: center;
}
.gd_min image{
width: 150rpx;
height: 150rpx;
}
.gd_min view{
padding: 10rpx;
color: #89a4eb;
}

View File

@ -0,0 +1,422 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
findDictCache
} from '../../../api/publics'
import {
findProjectDeptUsers
} from '../../../api/project'
import {
add,
findMyLastProblemmodify
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime()+(3600*48*1000),
type: "",
typeName: "",
problemTypeList: [],
problemSubTypeList: [],
imageInfoData: [],
form: {
projectId: "",
projectName: "",
infoType: "",
problemType: "1",
dangerType: "1",
workParts: "",
changeInfo: "",
nickedTime: "",
lordSent: "",
lordSentUser: "",
recheckSend: "",
recheckSendUser: "",
copySend: "",
copySendUser: ""
},
active: 1,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}],
lordSentList: [],
copySendList: [],
checkUserList: [],
loadShow: false,
showHis: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
"form.comId": proUserInfo.projectUserInfo.comId,
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName,
"form.infoType": options.type,
"form.recheckSend": proUserInfo.userId,
"form.recheckSendUser": proUserInfo.nickName
});
this.getDictCache();
this.getHisInfo(options.type);
this.getProjectUsers();
},
/**
* 获取字典缓存数据
*/
getDictCache() {
// 初始化检查类型
findDictCache("ssp_proble_type").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
});
this.setData({
problemTypeList: list
});
}
});
//初始化隐患类型
findDictCache("ssp_proble_sub_type").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
});
this.setData({
problemSubTypeList: list
});
}
});
},
/**
* 查询项目人员数据
* 获取项目所有人员在页面组装数据...
*/
getProjectUsers() {
findProjectDeptUsers(app.globalData.useProjectId).then(res => {
if (res.code == 200) {
this.setData({
lordSentList: res.data.lordSentList,
copySendList: res.data.copySendList,
checkUserList: res.data.checkUserList,
});
}
});
},
/**
* 这里查询当前登录人上次提交隐患
* 自动填充整改人复检人抄送人
* @param {*} type
*/
getHisInfo(type) {
findMyLastProblemmodify(app.globalData.useProjectId, type).then(res => {
if (res.code == 200 && res.data && res.data.length > 0) {
this.setData({
showHis: true,
"form.lordSent": res.data[0].lordSent,
"form.lordSentUser": res.data[0].lordSentUser,
"form.recheckSend": res.data[0].recheckSend,
"form.recheckSendUser": res.data[0].recheckSendUser,
"form.copySend": res.data[0].copySend,
"form.copySendUser": res.data[0].copySendUser
})
}
});
},
//隐患描述
onInputWorkParts(e) {
this.setData({
"form.workParts": e.detail.value
})
},
//整改要求
onInputChangeInfoValue(e) {
this.setData({
"form.changeInfo": e.detail.value
})
},
//验收时间
onInputTime(e) {
this.setData({
"form.nickedTime": e.detail
})
},
// 上传图片
onImagesArr(e) {
this.setData({
imageInfoData: e.detail
})
},
//添加整改人
onAddLordSent(e) {
if (e.detail.length > 0) {
this.setData({
"form.lordSent": e.detail[0].userId,
"form.lordSentUser": e.detail[0].userName
})
}
},
//添加抄送人
onAddCopySend(e) {
if (e.detail.length > 0) {
let _userIds = "";
let _userNames = "";
e.detail.forEach(it => {
_userIds += "," + it.userId;
_userNames += "," + it.userName;
});
this.setData({
"form.copySend": _userIds.substring(1),
"form.copySendUser": _userNames.substring(1)
})
} else {
this.setData({
"form.copySend": "",
"form.copySendUser": ""
})
}
},
//添加复检人
onAddRecheckSend(e) {
if (e.detail.length > 0) {
this.setData({
"form.recheckSend": e.detail[0].userId,
"form.recheckSendUser": e.detail[0].userName
})
}
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
/**
* 数据保存
*/
submitSave() {
let _form = {
...this.data.form
};
let {
imageInfoData
} = this.data
//数据效验
if (!_form.comId || !_form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
if (imageInfoData.length == 0) {
app.toast("请上传隐患现场图片!")
return false;
}
if (!_form.problemType) {
app.toast("请选择检查类型!")
return false;
}
if (!_form.dangerType) {
app.toast("请选择隐患类型!")
return false;
}
if (!_form.workParts) {
app.toast("请填写隐患描述!")
return false;
}
if (!_form.changeInfo) {
app.toast("请填写隐患整改要求!")
return false;
}
if (!_form.nickedTime) {
app.toast("请选择整改截至时间!")
return false;
}
if (!_form.lordSent || !_form.lordSentUser) {
app.toast("请选择整改人!")
return false;
}
if (!_form.recheckSend || !_form.recheckSendUser) {
app.toast("请选择复检人!")
return false;
}
if (!_form.copySend || !_form.copySendUser) {
app.toast("请选择抄送人!")
return false;
}
let fileUrls = [];
this.setData({
loadShow: true
});
let that = this;
imageInfoData.forEach(async (item) => {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(item);
fileUrls.push(obj.data.data.url);
//验证图片上传完毕
if (fileUrls.length == imageInfoData.length) {
_form.smarkUrl = fileUrls.toString();
add(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("新增数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`,
})
}, 200)
}
});
}
})
},
//选择检查类型
onSelectProblemType(e) {
this.setData({
"form.problemType": e.detail.id
})
},
//选择隐患类型
onSelectDangerType(e) {
this.setData({
"form.dangerType": e.detail.id
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,93 @@
<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">新增{{typeName}}隐患</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">隐患图片</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">检查类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType" selectValue="{{form.problemType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">隐患类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{problemSubTypeList}}" placeholder="请选择隐患类型" bindchange="onSelectDangerType" selectValue="{{form.dangerType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">隐患描述</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写质量隐患描述200字内" placeholder-style="color:#6777aa;" bindinput="onInputWorkParts" maxlength="200" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改要求</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写隐患整改要求200字内" placeholder-style="color:#6777aa;" bindinput="onInputChangeInfoValue" maxlength="200" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改截至时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" placeholder="请选择整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{lordSentList}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人" choose="{{form.lordSentUser}}">
</select-group-person>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">复检人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{checkUserList}}" multiple="{{fales}}" bindselected="onAddRecheckSend" index="2" title="请选择复检人" choose="{{form.recheckSendUser}}">
</select-group-person>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">抄送人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{copySendList}}" multiple="{{true}}" bindselected="onAddCopySend" index="3" title="请选择抄送人" choose="{{form.copySendUser}}">
</select-group-person>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">已自动填充上次隐患的整改人,复检人,抄送人。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">提交隐患</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,18 @@
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,266 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
findInfo,
findAuditInfos,
checkProblemmodify
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
infoData: {},
loadShow: false,
auditInfo1: {},
auditInfo3: {},
auditInfo4: {},
form: {},
imageInfoData: [],
imageList: [],
auditImageList: [],
active: 3,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.setData({
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
});
this.getInfo(options.id);
this.getAuditInfos(options.id);
},
/**
* 查详隐患详情
* @param {*} id
*/
getInfo(id) {
findInfo(id).then(res => {
if (res.code == 200) {
let urls = [];
if (res.data.smarkUrl) {
res.data.smarkUrl.split(',').forEach(item => {
urls.push(config.baseImgUrl + item);
});
}
this.setData({
infoData: res.data,
imageList: urls,
"form.mainId": res.data.id,
})
}
})
},
/**
* 查详隐患流程
* @param {*} id
*/
getAuditInfos(id) {
findAuditInfos(id).then(res => {
if (res.code == 200 && res.data.length > 0) {
res.data.forEach(item => {
if (item.processState == "0") {
let urls = [];
if (item.files.length > 0) {
item.files.forEach(_file => {
urls.push(config.baseImgUrl + _file.fileUrl);
});
}
this.setData({
auditInfo1: item,
auditImageList: urls
})
} else if (item.processState == "1") {
this.setData({
auditInfo4: item
})
} else if (item.processState == "2") {
this.setData({
auditInfo3: item
})
}
});
}
});
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
//保存
onSubmitSave(status) {
let _form = {
...this.data.form
};
_form.processState = status;
this.setData({
loadShow: true
});
checkProblemmodify(_form).then(res =>{
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("复检隐患成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
}, 200)
}
});
},
//审核驳回
onRejectSave() {
let that = this;
if (this.data.form.opinion) {
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认隐患复检驳回?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.onSubmitSave(2);
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
} else {
app.toast("请填写整改驳回意见!")
return false;
}
},
//审核通过
onPassSave() {
let that = this;
if (!this.data.form.opinion) {
this.setData({
"form.opinion": "审核通过!"
})
}
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认隐患复检通过?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.onSubmitSave(1);
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
},
//展示图片
showImg: function (e) {
let img = e.target.dataset.set;
wx.previewImage({
urls: img.split(','),
current: 0
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
// 审核意见
onInputOpinion(e) {
this.setData({
"form.opinion": e.detail.value
})
},
// list 上传图片
onImagesArr(e) {
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData: data
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-steps": "@vant/weapp/steps/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,145 @@
<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">{{typeName}}隐患复检</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title_2 module_title_padding">
<view>{{infoData.projectName}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{imageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">问题类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType!='4'}}">{{infoData.problemTypeName}}</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='4'}}">{{infoData.problemTypeName}}</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_orange">{{infoData.lordSentUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检人</text></van-col>
<van-col span="18" class="color_blue">{{infoData.recheckSendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18">{{infoData.copySendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState!='0'}}">
<view class="module_title module_title_padding">
<view>隐患整改</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改说明</text></van-col>
<van-col span="18">{{auditInfo1.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改后图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{auditImageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</view>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="true">
<view class="module_title module_title_padding">
<view>隐患复检意见</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写整改复检意见" placeholder-style="color:#6777aa;" bindinput="onInputOpinion" maxlength="200" />
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="onRejectSave">整改驳回</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onPassSave">整改通过</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,34 @@
.in-img-max:after{
display:block;
clear:both;
content:"";
visibility:hidden;
height:0
}
.in-img-max{
width: auto;
zoom:1
}
.in-img-div{
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image{
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,350 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
findDictCache
} from '../../../api/publics'
import {
findProjectDeptUsers
} from '../../../api/project'
import {
addDraft,
findMyLastProblemmodify
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
type: "",
typeName: "",
problemTypeList: [],
form: {
projectId: "",
projectName: "",
infoType: "",
problemType: "1",
lordSent: "",
lordSentUser: "",
},
active: 1,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}],
lordSentList: [],
loadShow: false,
showHis: false,
inspectInfoData: [{
image_upload: []
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
"form.comId": proUserInfo.projectUserInfo.comId,
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName,
"form.infoType": options.type
});
this.getDictCache();
this.getHisInfo(options.type);
this.getProjectUsers();
},
/**
* 获取字典缓存数据
*/
getDictCache() {
// 初始化检查类型
findDictCache("ssp_proble_type").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
});
this.setData({
problemTypeList: list
});
}
});
},
/**
* 查询项目人员数据
* 获取项目所有人员在页面组装数据...
*/
getProjectUsers() {
findProjectDeptUsers(app.globalData.useProjectId).then(res => {
if (res.code == 200) {
this.setData({
lordSentList: res.data.lordSentList
});
}
});
},
/**
* 这里查询当前登录人上次提交隐患
* 自动填充整改人复检人抄送人
* @param {*} type
*/
getHisInfo(type) {
findMyLastProblemmodify(app.globalData.useProjectId, type).then(res => {
if (res.code == 200 && res.data && res.data.length > 0) {
this.setData({
showHis: true,
"form.lordSent": res.data[0].lordSent,
"form.lordSentUser": res.data[0].lordSentUser
})
}
});
},
// 上传图片
onImagesArr(e) {
var index = e.currentTarget.dataset.index
var data = this.data.inspectInfoData
data[index].image_upload = e.detail
this.setData({
inspectInfoData: data
})
},
//添加整改人
onAddLordSent(e) {
if (e.detail.length > 0) {
this.setData({
"form.lordSent": e.detail[0].userId,
"form.lordSentUser": e.detail[0].userName
})
}
},
// 取消页面
cancelSaveView() {
this.returnToPage()
},
// 保存
submitSave() {
let _form = {
...this.data.form
};
let {
inspectInfoData
} = this.data
//数据效验
if (!_form.comId || !_form.projectId) {
app.toast("数据异常,请刷新页面重试!");
return false;
}
if (!_form.problemType) {
app.toast("请选择检查类型!");
return false;
}
if (!_form.lordSent || !_form.lordSentUser) {
app.toast("请选择整改人!");
return false;
}
if (inspectInfoData.length > 0) {
for (let i = 0; i < inspectInfoData.length; i++) {
if (inspectInfoData[i].image_upload.length == 0) {
app.toast("请上传问题“" + (i + 1) + "”的隐患图片或删除问题项!");
return false;
}
}
}
this.setData({
loadShow: true
})
let fileUrls = [];
let that = this;
inspectInfoData.forEach(async (item) => {
let beforeCheckUrl = [];
item.image_upload.forEach(async (itFile) => {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(itFile);
beforeCheckUrl.push(obj.data.data.url);
if (beforeCheckUrl.length >= item.image_upload.length) {
fileUrls.push(beforeCheckUrl);
}
//验证图片上传完毕
if (fileUrls.length >= inspectInfoData.length) {
_form.smarkUrls = fileUrls;
addDraft(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("新增数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`,
})
}, 200);
}
});
}
});
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
/**
* 选择问题类型
* @param {*} e
*/
onSelectProblemType(e) {
this.setData({
"form.problemType": e.detail.id,
})
},
returnToPage: function () {
if (wx.getStorageSync('nav-menu') == "list") {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
} else {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
}
},
//新增问题
onNewIssues() {
var data = this.data.inspectInfoData
if (data.length == 5) {
app.toast("一次最多只能提交5个问题!");
return false;
}
data.push({
image_upload: []
})
this.setData({
inspectInfoData: data
})
},
//删除
onNewIssuesDelete(e) {
var index = e.currentTarget.dataset.index
var data = this.data.inspectInfoData
data.splice(index, 1)
this.setData({
inspectInfoData: data
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,113 @@
<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">新增{{typeName}}隐患草稿</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info ">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">检查类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType" selectValue="{{form.problemType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改人员</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{lordSentList}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人员" choose="{{form.lordSentUser}}">
</select-group-person>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">已自动填充上次选择的隐患整改人员。</text>
</view>
<view class="inspect_info_list" wx:for="{{inspectInfoData}}" wx:key="index">
<view class="module_title module_title_flex">
<view>问题 {{index + 1}}</view>
<view class="module_see_info_delete" wx:if="{{index != 0}}" bindtap="onNewIssuesDelete" data-index="{{index}}"><van-icon name="delete" /> 删除</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">隐患图片</view>
<view class="problem_list_info_con" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr" data-index="{{index}}" fileUrlArray="{{item.image_upload}}"></file-uploader>
</view>
</view>
</view>
<view class="inspect_new_issues_max">
<view class="inspect_new_issues" bindtap="onNewIssues"><van-icon name="add-o" style="position: relative;top:5rpx"/> 新增问题</view>
</view>
<view class="safety_prop module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">草稿添加的数据在电脑端提交后生效!</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">保存草稿</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/../images/loding2.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,19 @@
.van-popup {
background: none !important;
}
.van-image__img {
border-radius: 10rpx !important;
}
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,232 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
remove,
findInfo,
findAuditInfos
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
infoData: {},
auditInfo1: {},
auditInfo3: {},
auditInfo4: {},
showDel: false,
imageList: [],
auditImageList: [],
proUserInfo: {},
active: 100,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
proUserInfo,
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
});
this.getInfo(options.id);
this.getAuditInfos(options.id);
},
/**
* 查详隐患详情
* @param {*} id
*/
getInfo(id) {
findInfo(id).then(res => {
if (res.code == 200) {
let state = this.data.active;
if (res.data.checkState == "0") {
state = 2;
} else if (res.data.checkState == "1") {
state = 3;
} else if (res.data.checkState == "3") {
state = 2;
}
this.setData({
active: state
})
let urls = [];
if (res.data.smarkUrl) {
res.data.smarkUrl.split(',').forEach(item => {
urls.push(config.baseImgUrl + item);
});
}
this.setData({
infoData: res.data,
imageList: urls
})
//判断当前能否删除
if (res.data.checkState != 4 && res.data.createUser == this.data.proUserInfo.userId) {
this.setData({
showDel: true
})
}
}
})
},
/**
* 查详隐患流程
* @param {*} id
*/
getAuditInfos(id) {
findAuditInfos(id).then(res => {
if (res.code == 200 && res.data.length > 0) {
res.data.forEach(item => {
if (item.processState == "0") {
let urls = [];
if (item.files.length > 0) {
item.files.forEach(_file => {
urls.push(config.baseImgUrl + _file.fileUrl);
});
}
this.setData({
auditInfo1: item,
auditImageList: urls
})
} else if (item.processState == "1") {
this.setData({
auditInfo4: item
})
} else if (item.processState == "2") {
this.setData({
auditInfo3: item
})
}
});
}
});
},
/**
* 点击删除
*/
onDelete() {
let that = this
wx.showModal({
title: '提示',
content: '是否确定删除当前隐患数据?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.submitDelete();
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
},
/**
* 提交删除
*/
submitDelete() {
let {
infoData
} = this.data
remove(infoData.id).then(res => {
if (res.code == 200) {
app.toast("删除数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`,
})
}, 200);
}
});
},
//展示图片
showImg: function (e) {
let img = e.target.dataset.set;
wx.previewImage({
urls: img.split(','),
current: 0
})
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: `../list/index?type=${this.data.type}`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,167 @@
<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">{{typeName}}隐患详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" rejectNode="{{ active<100 && infoData.checkState=='3' ? active+1:0 }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title_2 module_title_padding">
<view>{{infoData.projectName}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{imageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">问题类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType!='4'}}">{{infoData.problemTypeName}}</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='4'}}">{{infoData.problemTypeName}}</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_orange">
{{infoData.lordSentUser}}
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检人</text></van-col>
<van-col span="18" class="color_blue">{{infoData.recheckSendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18"> {{infoData.copySendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState!='0'}}">
<view class="module_title module_title_padding">
<view>隐患整改</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改说明</text></van-col>
<van-col span="18">{{auditInfo1.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改后图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{auditImageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</view>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState=='3' || infoData.checkState=='4'}}">
<view class="module_title module_title_padding">
<view>问题复检</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检结果</text></van-col>
<van-col span="18">
<text wx:if="{{infoData.checkState=='3'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">复检驳回</text>
<text wx:if="{{infoData.checkState=='4'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">复检通过</text>
</van-col>
</van-row>
</view>
<view wx:if="{{infoData.checkState=='3'}}" class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检意见</text></van-col>
<van-col span="18">{{auditInfo3.opinion}}</van-col>
</van-row>
</view>
<view wx:if="{{infoData.checkState=='4'}}" class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检意见</text></van-col>
<van-col span="18">{{auditInfo4.opinion}}</van-col>
</van-row>
</view>
<view wx:if="{{infoData.checkState=='3'}}" class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检时间</text></van-col>
<van-col span="18">{{auditInfo3.createTime}}</van-col>
</van-row>
</view>
<view wx:if="{{infoData.checkState=='4'}}" class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检时间</text></van-col>
<van-col span="18">{{auditInfo4.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="problem_submit_to" wx:if="{{showDel}}">
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</view>
</view>
</view>

View File

@ -0,0 +1,37 @@
.in-img-max:after {
display: block;
clear: both;
content: "";
visibility: hidden;
height: 0
}
.in-img-max {
width: auto;
zoom: 1
}
.in-img-div {
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image {
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,257 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
list,
listCount
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
type: "",
typeName: "",
addFlag: false,
addDraftFlag: false,
projectId: "",
projectName: "",
initData: {},
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
activeState: "dzg",
dzgCount: 0,
dfjCount: 0,
yzgCount: 0,
ywcCount: 0,
imgBaseUrl: config.baseImgUrl,
projectUserInfo: {}
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad({
type: this.data.type
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
const _activeState = proUserInfo.projectUserInfo.subDeptType == "1" ? "dfj" : "dzg";
this.setData({
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
addFlag: proUserInfo.projectUserInfo.subDeptType == "1",
addDraftFlag: proUserInfo.projectUserInfo.subDeptType == "1",
activeState: _activeState,
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
});
this.getListData(proUserInfo.projectUserInfo, _activeState, options.type);
},
/**
* 添加隐患信息
*/
skipAdd() {
wx.redirectTo({
url: `../add/index?type=${this.data.type}`,
})
},
/**
* 添加隐患草稿
*/
skipAddDarft() {
wx.redirectTo({
url: `../draft/index?type=${this.data.type}`,
})
},
getInfo(e) {
let {
id,
checkState,
lordSent,
recheckSend
} = e.currentTarget.dataset.set
if ((checkState == 0 || checkState == 3) && lordSent == this.data.projectUserInfo.userId) {
//整改页面(状态时待整改&&整改人是当前登录人)
wx.redirectTo({
url: `../modify/index?type=${this.data.type}&id=${id}`,
})
} else if (checkState == 1 && recheckSend == this.data.projectUserInfo.userId) {
//复检页面 (状态时待复检&&复检人是当前登录人)
wx.redirectTo({
url: `../check/index?type=${this.data.type}&id=${id}`,
})
} else {
wx.redirectTo({
url: `../info/index?type=${this.data.type}&id=${id}`,
})
}
},
/**
* 查询项目质量隐患排查数据
*/
getListData(userInfo, activeState, type) {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&comId=" + userInfo.comId + "&projectId=" + app.globalData.useProjectId + "&infoType=" + type + "&activeTags=" + activeState;
list(params).then(res => {
if (res.code == 200) {
res.rows.forEach(item => {
item.marksPicture = item.smarkUrl.split(',')[0];
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
// 统计列表
listCount(params).then(res => {
if (res.code == 200) {
this.setData({
dzgCount: res.data.dzg,
dfjCount: res.data.dfj,
yzgCount: res.data.yzg,
ywcCount: res.data.ywc,
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = 'dzg';
}
if (index == 2) {
nav = 'yzg';
} else if (index == 3) {
nav = 'dfj';
} else if (index == 4) {
nav = 'dzg';
} else if (index == 5) {
nav = 'ywc';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData(this.data.projectUserInfo, nav, this.data.type);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
if (wx.getStorageSync('nav-menu') == "xmgl") {
wx.redirectTo({
url: '../../project_more/index',
})
} else {
if (this.data.type == 1) {
wx.redirectTo({
url: '../../project_quality/index',
})
} else {
wx.redirectTo({
url: '../../project_safety/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.projectUserInfo, this.data.activeState, this.data.type);
} else {
console.log("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index" ,
"van-popup": "@vant/weapp/popup/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,81 @@
<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">{{typeName}}隐患排查</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 wx:if="{{projectUserInfo.subDeptType!='1'}}" class="modify_video_nav" style="margin-top: 5rpx;">
<view class="{{activeState=='dzg'?'active':''}}" bindtap="trainJump" data-index="1"><text>待整改({{dzgCount}}</text></view>
<view class="{{activeState=='yzg'?'active':''}}" bindtap="trainJump" data-index="2"><text>已整改({{yzgCount}}</text></view>
</view>
<view wx:if="{{projectUserInfo.subDeptType=='1'}}" class="modify_video_nav" style="margin-top: 5rpx;">
<view class="{{activeState=='dfj'?'active':''}}" bindtap="trainJump" data-index="3"><text>待复检({{dfjCount}}</text></view>
<view class="{{activeState=='dzg'?'active':''}}" bindtap="trainJump" data-index="4"><text>待整改({{dzgCount}}</text></view>
<view class="{{activeState=='ywc'?'active':''}}" bindtap="trainJump" data-index="5"><text>已完成({{ywcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" 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_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_text_2">
{{item.createTime}}
</view>
<text class="timeline_for_state_1" wx:if="{{item.problemType!='4'}}">{{item.problemTypeName}}</text>
<text class="timeline_for_state_2" wx:if="{{item.problemType=='4'}}">{{item.problemTypeName}}</text>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<view wx:if="{{item.checkState==0}}" class="code_label code_label_yellow">待整改</view>
<view wx:if="{{item.checkState==1}}" class="code_label code_label_blueviolet">待复检</view>
<view wx:if="{{item.checkState==3}}" class="code_label code_label_red">已驳回</view>
<view wx:if="{{item.checkState==4}}" class="code_label code_label_green">已完成</view>
<van-image width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.marksPicture+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop">隐患类型:<text>{{item.dangerTypeName}}</text></view>
<view class="inspect_list_info_data_prop">隐患描述:<text>{{item.workParts}}</text></view>
<view class="inspect_list_info_data_prop color_orange">整改人员:<text>{{item.lordSentUser}}</text></view>
<view class="inspect_list_info_data_prop color_blue">复检人员:<text>{{item.recheckSendUser}}</text></view>
</view>
</view>
<!-- <view class="inspect_list_info_position">
整改要求:<text class="color_purple">{{item.changeInfo}}</text>
</view> -->
</view>
</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 wx:if="{{addDraftFlag}}" class="inspect_add_to_darft" bindtap="skipAddDarft">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>草稿</view>
</view>
</view>
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/project_problemmodify/list/index.wxss */

View File

@ -0,0 +1,288 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
findInfo,
findAuditInfos,
modifyProblemmodify
} from '../../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
infoData: {},
loadShow: false,
auditInfo1: {},
auditInfo3: {},
auditInfo4: {},
form: {},
imageInfoData: [],
imageList: [],
auditImageList: [],
active: 2,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.setData({
type: options.type,
typeName: options.type == 1 ? "质量" : "安全",
});
this.getInfo(options.id);
this.getAuditInfos(options.id);
},
/**
* 查详隐患详情
* @param {*} id
*/
getInfo(id) {
findInfo(id).then(res => {
if (res.code == 200) {
let state = this.data.active;
if (res.data.checkState == "0") {
state = 2;
} else if (res.data.checkState == "1") {
state = 3;
} else if (res.data.checkState == "3") {
state = 2;
}
this.setData({
active: state
})
let urls = [];
if (res.data.smarkUrl) {
res.data.smarkUrl.split(',').forEach(item => {
urls.push(config.baseImgUrl + item);
});
}
this.setData({
infoData: res.data,
imageList: urls,
"form.mainId": res.data.id,
})
}
})
},
/**
* 查详隐患流程
* @param {*} id
*/
getAuditInfos(id) {
findAuditInfos(id).then(res => {
if (res.code == 200 && res.data.length > 0) {
res.data.forEach(item => {
if (item.processState == "0") {
let urls = [];
if (item.files.length > 0) {
item.files.forEach(_file => {
urls.push(config.baseImgUrl + _file.fileUrl);
});
}
this.setData({
auditInfo1: item,
auditImageList: urls
})
} else if (item.processState == "1") {
this.setData({
auditInfo4: item
})
} else if (item.processState == "2") {
this.setData({
auditInfo3: item
})
}
});
}
});
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
//保存
onSubmitSave() {
let _form = {
...this.data.form
};
let {
imageInfoData
} = this.data
//数据效验
if (!_form.mainId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
if (!_form.opinion) {
app.toast("请填写整改说明!")
return false;
}
if (imageInfoData.length == 0) {
app.toast("请上传整改后图片!")
return false;
}
this.setData({
loadShow: true
})
let that = this
let fileUrls = [];
imageInfoData.forEach(async (item) => {
let obj = await that.syncUploadImage(item);
fileUrls.push(obj.data.data.url);
//验证图片上传完毕
if (fileUrls.length == imageInfoData.length) {
_form.processState = "0";
_form.images = fileUrls.toString();
modifyProblemmodify(_form).then(res => {
if (res.code == 200) {
app.toast("整改提交成功,请关注审核结果!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`,
})
}, 200)
}
});
}
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
//展示图片
showImg: function (e) {
let img = e.target.dataset.set;
wx.previewImage({
urls: img.split(','),
current: 0
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
// 整改说明
onInputOpinion(e) {
this.setData({
"form.opinion": e.detail.value
})
},
// 上传图片
onImagesArr(e) {
this.setData({
imageInfoData: e.detail
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,148 @@
<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">{{typeName}}隐患整改</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" rejectNode="{{ active<100 && infoData.checkState=='3' ? active+1:0 }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title_2 module_title_padding">
<view>{{infoData.projectName}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{imageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType!='4'}}">{{infoData.problemTypeName}}</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='4'}}">{{infoData.problemTypeName}}</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_orange">{{infoData.lordSentUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_blue">复检人</text></van-col>
<van-col span="18">{{infoData.recheckSendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18">{{infoData.copySendUser}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState==3}}">
<view class="module_title module_title_padding">
<view>隐患整改驳回</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回意见</text></van-col>
<van-col span="18">{{auditInfo3.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回时间</text></van-col>
<van-col span="18" class="color_orange">{{auditInfo3.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview">
<view class="module_title module_title_padding">
<view>隐患整改提交</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改说明</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写整改说明" placeholder-style="color:#6777aa;" bindinput="onInputOpinion" maxlength="200" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">整改后图片</view>
<view class="problem_list_info_con" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSubmitSave">保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,34 @@
.in-img-max:after{
display:block;
clear:both;
content:"";
visibility:hidden;
height:0
}
.in-img-max{
width: auto;
zoom:1
}
.in-img-div{
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image{
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,198 @@
import {
getToken,
getUserInfo
} from '../../utils/auth'
import {
findUserMenuList
} from '../../api/publics'
import {
findMyTask
} from '../../api/flowable'
import {
findGroupCountView
} from '../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 2,
projectId: '',
projectName: '',
subDeptUserInfo: {},
menuList: [],
initData: {},
aqglDb: 0,
zlyhDB: 0,
zlglDb: 0,
todoDB: 0,
checkList: [{
id: 1,
name: "日常巡检问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 2,
name: "周检隐患问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 3,
name: "月检隐患问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 4,
name: "专项检查问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}],
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (!getToken()) {
wx.redirectTo({
url: '../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
subDeptUserInfo: proUserInfo.projectUserInfo,
});
//用户权限菜单
this.getUserMenuList(app.globalData.useProjectId);
this.awaitTask();
this.getGroupCountView(app.globalData.useProjectId, 1);
},
/**
* 查询功能菜单
* @param {*} proId
*/
getUserMenuList: function (proId) {
findUserMenuList(proId, 'zlgl').then(res => {
if (res.code == 200) {
this.setData({
menuList: res.data
})
}
});
},
/**
* 项目分组查询统计
* @param {*} proId
* @param {*} type
*/
getGroupCountView(proId, type) {
findGroupCountView(proId, type).then(res => {
let _checkList = this.data.checkList;
//隐患统计数据
res.data.forEach((item, idx) => {
let _index = parseInt(item.problemType - 1);
_checkList[_index].rate = (item.comTotal / item.total * 100).toFixed(2);
_checkList[_index].total = item.comTotal;
_checkList[_index].number = item.total;
});
this.setData({
checkList: _checkList
})
});
},
goMenu: function (event) {
let _url = event.currentTarget.dataset.url;
if (!_url) {
app.toast("正在建设中...")
return false;
}
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: _url
})
},
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({
active: event.detail
});
},
//跳转到项目概况
XMGK: function () {
wx.setStorageSync('nav-menu', "xmgk");
wx.redirectTo({
url: '../project_info/index'
})
},
//跳转到安全管理
AQGL: function () {
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: '../project_safety/index'
})
},
//跳转到进度管理
JDGL: function () {
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: '../project_schedule/list/index'
})
},
//跳转到项目管理
XMGL: function () {
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: '../project_more/index'
})
},
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
let proUserInfo = this.data.subDeptUserInfo;
this.setData({
aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0,
zlyhDB: res.data.zlyl,
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0,
todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo
})
}
});
},
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tabbar": "@vant/weapp/tabbar",
"van-tabbar-item": "@vant/weapp/tabbar-item"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,113 @@
<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="XMGK">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="3">
<user-infos></user-infos>
</van-col>
<van-col span="10">
<view class="header_name">质量管理</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="gd_max" style="margin-top: 20rpx;">
<van-row class="demo clearfix">
<van-col span="8" wx:for="{{menuList}}" wx:key="unique">
<view class="gd_min" data-id="{{item.menuIdenti}}" data-url="{{item.menuUrl}}" bindtap="goMenu">
<span class="tabNum_active" wx:if="{{item.menuIdenti=='ZLYHPC' && zlyhDB>0}}">{{zlyhDB}}</span>
<image src="{{format.httpImg(item.menuImg)}}"></image>
<view>{{item.menuName}}</view>
</view>
</van-col>
</van-row>
</view>
</view>
<view class="module_max">
<view class="module_min">
<view class="module_title module_title_flex">
<view>质量隐患统计</view>
<view class="module_see_info" bindtap="goAQYH">查看详情
<van-icon name="arrow" />
</view>
</view>
<view class="safety_inspect">
<van-row>
<van-col span="12" wx:for="{{checkList}}" wx:key="index">
<view class="safety_inspect_title">{{item.name}}</view>
<safety-number number="{{item.number}}"></safety-number>
<view class="safety_prop ">
<view style="padding-right: 30rpx;">整改率</view>
<view class="safety_prop_val"><text>{{item.rate}}</text> %</view>
</view>
<view class="safety_issue">
<view class="safety_issue_number">
<view style="padding-right: 30rpx;">已整改问题数</view>
<view>{{item.total}}</view>
</view>
</view>
</van-col>
</van-row>
</view>
</view>
</view>
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="AQGL">
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item>
<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;" />
质量管理
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</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-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>

View File

@ -0,0 +1,27 @@
.more_max {
padding: 10rpx 30rpx 30rpx;
}
.more_manage {
border-radius: 10rpx;
margin-top: 50rpx;
}
.gd_max {
padding: 10rpx 50rpx 0;
}
.gd_min {
padding: 30rpx 0;
text-align: center;
}
.gd_min image {
width: 150rpx;
height: 150rpx;
}
.gd_min view {
padding: 10rpx;
color: #89a4eb;
}

View File

@ -0,0 +1,197 @@
import {
getToken,
getUserInfo
} from '../../utils/auth'
import {
findUserMenuList
} from '../../api/publics'
import {
findMyTask
} from '../../api/flowable'
import {
findGroupCountView
} from '../../api/problemmodify'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 1,
projectId: '',
projectName: '',
subDeptUserInfo: {},
menuList: [],
initData: {},
aqyhDB: 0,
aqglDB: 0,
zlglDB: 0,
todoDB: 0,
checkList: [{
id: 1,
name: "日常巡检问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 2,
name: "周检隐患问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 3,
name: "月检隐患问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}, {
id: 4,
name: "专项检查问题",
rate: 0, //整改率
total: 0, //问题总数
number: 0, //检查次数
}],
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (!getToken()) {
wx.redirectTo({
url: '../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
subDeptUserInfo: proUserInfo.projectUserInfo,
});
//用户权限菜单
this.getUserMenuList(app.globalData.useProjectId);
this.awaitTask();
this.getGroupCountView(app.globalData.useProjectId, 0);
},
/**
* 查询功能菜单
* @param {*} proId
*/
getUserMenuList: function (proId) {
findUserMenuList(proId, 'aqgl').then(res => {
if (res.code == 200) {
this.setData({
menuList: res.data
})
}
});
},
/**
* 项目分组查询统计
* @param {*} proId
* @param {*} type
*/
getGroupCountView(proId, type) {
findGroupCountView(proId, type).then(res => {
let _checkList = this.data.checkList;
//隐患统计数据
res.data.forEach((item, idx) => {
let _index = parseInt(item.problemType - 1);
_checkList[_index].rate = (item.comTotal / item.total * 100).toFixed(2);
_checkList[_index].total = item.comTotal;
_checkList[_index].number = item.total;
});
this.setData({
checkList: _checkList
})
});
},
goMenu: function (event) {
let _url = event.currentTarget.dataset.url;
if (!_url) {
app.toast("正在建设中...")
return false;
}
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: _url
})
},
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({
active: event.detail
});
},
//跳转到项目概况
XMGK: function () {
wx.setStorageSync('nav-menu', "xmgk");
wx.redirectTo({
url: '../project_info/index'
})
},
//跳转到质量管理
ZLGL: function () {
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: '../project_quality/index'
})
},
//跳转到进度管理
JDGL: function () {
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: '../project_schedule/list/index'
})
},
//跳转到项目管理
XMGL: function () {
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: '../project_more/index'
})
},
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
let proUserInfo = this.data.subDeptUserInfo;
this.setData({
aqyhDB: res.data.aqyh,
aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0,
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0,
todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo
})
}
});
},
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tabbar": "@vant/weapp/tabbar",
"van-tabbar-item": "@vant/weapp/tabbar-item"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,113 @@
<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="XMGK">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="3">
<user-infos></user-infos>
</van-col>
<van-col span="10">
<view class="header_name">安全管理</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="gd_max" style="margin-top: 20rpx;">
<van-row class="demo clearfix">
<van-col span="8" wx:for="{{menuList}}" wx:key="unique">
<view class="gd_min" data-id="{{item.menuIdenti}}" data-url="{{item.menuUrl}}" bindtap="goMenu">
<span class="tabNum_active" wx:if="{{item.menuIdenti=='AQYHPC' && aqyhDB>0}}">{{aqyhDB}}</span>
<image src="{{format.httpImg(item.menuImg)}}"></image>
<view>{{item.menuName}}</view>
</view>
</van-col>
</van-row>
</view>
</view>
<view class="module_max">
<view class="module_min">
<view class="module_title module_title_flex">
<view>安全隐患统计</view>
<view class="module_see_info" bindtap="goAQYH">查看详情
<van-icon name="arrow" />
</view>
</view>
<view class="safety_inspect">
<van-row>
<van-col span="12" wx:for="{{checkList}}" wx:key="index">
<view class="safety_inspect_title">{{item.name}}</view>
<safety-number number="{{item.number}}"></safety-number>
<view class="safety_prop ">
<view style="padding-right: 30rpx;">整改率</view>
<view class="safety_prop_val"><text>{{item.rate}}</text> %</view>
</view>
<view class="safety_issue">
<view class="safety_issue_number">
<view style="padding-right: 30rpx;">已整改问题数</view>
<view>{{item.total}}</view>
</view>
</view>
</van-col>
</van-row>
</view>
</view>
</view>
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item>
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="ZLGL">
<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;" />
质量管理
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</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-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>

View File

@ -0,0 +1,27 @@
.more_max {
padding: 10rpx 30rpx 30rpx;
}
.more_manage {
border-radius: 10rpx;
margin-top: 50rpx;
}
.gd_max {
padding: 10rpx 50rpx 0;
}
.gd_min {
padding: 30rpx 0;
text-align: center;
}
.gd_min image {
width: 150rpx;
height: 150rpx;
}
.gd_min view {
padding: 10rpx;
color: #89a4eb;
}

View File

@ -0,0 +1,327 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
findPlanDatas,
findRecursionPlan,
findPreviousSchedule,
submitPlanSchedule
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate: new Date().getTime() + (3600 * 24 * 30 * 1000),
form: {
schedulePercent: 1
},
loadShow: false,
imageInfoData: [],
picker: false,
planOptions: [],
previousSchedule: null, //上次填报数据
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
this.initPlanDatas();
},
/**
* 打开选择窗
*/
openPicker() {
this.setData({
picker: true
})
},
closePicker() {
this.setData({
picker: false
})
},
/**
* 构建树结构
* @param {*} all
* @param {*} id
*/
buildTree(all, id) {
let tmps = all.filter((d) => d.parentId == id);
if (tmps.length > 0) {
tmps.forEach((it) => {
it.children = this.buildTree(all, it.taskId);
});
}
return tmps;
},
/**
* 初始化计划
*/
initPlanDatas() {
findPlanDatas(app.globalData.useProjectId).then((res) => {
let treeDatas = this.buildTree(res.data, 1);
this.setData({
planOptions: treeDatas
})
});
},
/**
* 组件选中时会触发
*/
handleClick: function (e) {
let checkIds = e.detail.idList;
if (checkIds.length > 0) {
let planValue = checkIds[checkIds.length - 1];
this.setData({
picker: false
})
findRecursionPlan(planValue.planId).then(res => {
if (res.data) {
this.setData({
"form.comId": res.data.comid,
"form.planId": planValue.planId,
"form.taskId": res.data.taskId,
"form.taskUniqueId": res.data.taskUniqueId,
"form.taskName": res.data.taskName,
"form.bimId": res.data.bimId,
});
} else {
this.setData({
"form.comId": null,
"form.taskId": null,
"form.taskUniqueId": null,
"form.taskName": null,
"form.bimId": null,
});
}
});
findPreviousSchedule(planValue.planId).then((res) => {
if (res.data) {
this.setData({
previousSchedule: res.data,
"form.schedulePercent": res.data.schedulePercent
});
} else {
this.setData({
previousSchedule: null,
"form.schedulePercent": 1
});
}
});
}
},
onChangeMinus(e) {
this.setData({
"form.schedulePercent": this.data.form.schedulePercent - 1
});
},
onChangePlus(e) {
this.setData({
"form.schedulePercent": this.data.form.schedulePercent + 1
});
},
onChangeBlur(e) {
this.setData({
"form.schedulePercent": e.detail.value
});
},
//完成时间
onInputTime(e) {
this.setData({
"form.finishDate": e.detail
})
},
//进度描述
onInputDescription(e) {
this.setData({
"form.description": e.detail.value
})
},
// 上传图片
onImagesArr(e) {
this.setData({
imageInfoData: e.detail
})
},
/**
* 数据保存
*/
submitSave() {
let _form = {
...this.data.form
};
let {
imageInfoData
} = this.data
//数据效验
if (!_form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
if (!_form.planId) {
app.toast("请选择工程计划!")
return false;
}
if (!_form.schedulePercent) {
app.toast("请填写计划完成进度!")
return false;
} else {
if (_form.schedulePercent == 100 && !_form.finishDate) {
app.toast("请选择完成时间!")
return false;
}
}
if (!_form.description) {
app.toast("请填写进度描述!")
return false;
}
if (imageInfoData.length == 0) {
app.toast("请上传施工现场作业图!")
return false;
}
let fileUrls = [];
this.setData({
loadShow: true
});
let that = this;
imageInfoData.forEach(async (item) => {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(item);
fileUrls.push(obj.data.data.url);
//验证图片上传完毕
if (fileUrls.length == imageInfoData.length) {
_form.images = fileUrls.toString();
submitPlanSchedule(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("新增进度成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
})
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: `../list/index`,
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index",
"van-stepper": "@vant/weapp/stepper/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,79 @@
<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>
<view class="max_content">
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="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}}" bind:select="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">完成进度
<text wx:if="{{previousSchedule && previousSchedule.schedulePercent}}" style="font-size: small; color: #ff711e;font-weight: 600;">[ 上次完成进度 {{previousSchedule.schedulePercent}} % ]</text>
</view>
<view class="inspect_info_content">
<van-stepper v-model="{{form.schedulePercent}}" :value="{{form.schedulePercent}}" min="{{previousSchedule && previousSchedule.schedulePercent ? previousSchedule.schedulePercent : 1}}" max="100" integer bind:blur="onChangeBlur" bind:minus="onChangeMinus" bind:plus="onChangePlus" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.schedulePercent==100}}">
<view class="markers inspect_info_title">完成时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" placeholder="请选择完成时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">进度描述</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写施工进度描述800字内" placeholder-style="color:#6777aa;" bindinput="onInputDescription" maxlength="800" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">施工图片</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</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>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,86 @@
.rectifier_max {
width: 100%;
background: #232a44;
border-radius: 15rpx;
position: relative;
height: 100%;
}
.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;
}
.rectifier_list {
padding: 20rpx 40rpx;
}
.rectifier_list_height {
height: 990rpx;
overflow: auto;
}
.rectifier_list_for {
display: flex;
align-items: center;
padding: 16rpx 15rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rectifier_btn {
display: flex;
align-items: center;
background: #27304f;
border-radius: 0 0 15rpx 15rpx;
}
.rectifier_btn view {
width: 50%;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #6874a4;
}
.rectifier_btn view:last-child {
border-left: 1px solid #6874a4;
color: #ffffff;
}
.van-stepper__minus {
width: 90rpx !important;
height: 90rpx !important;
background-color: #513ea7 !important;
color: #cdcdcd !important;
}
.van-stepper__input {
width: calc(100% - 196rpx) !important;
height: 90rpx !important;
background: #212737 !important;
border-radius: 10rpx !important;
padding: 0 30rpx !important;
color: #ffffff !important;
}
.van-stepper__plus {
width: 90rpx !important;
height: 90rpx !important;
background-color: #513ea7 !important;
color: #cdcdcd !important;
}

View File

@ -0,0 +1,116 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
planScheduleInfo
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
infoData: {},
imageList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.getInfo(options.id);
},
/**
* 查详进度详情
* @param {*} id
*/
getInfo(id) {
planScheduleInfo(id).then(res => {
if (res.code == 200) {
let urls = [];
if (res.data.images) {
res.data.images.split(',').forEach(item => {
urls.push(config.baseImgUrl + item);
});
}
this.setData({
infoData: res.data,
imageList: urls
})
}
})
},
//展示图片
showImg: function (e) {
let img = e.target.dataset.set;
wx.previewImage({
urls: img.split(','),
current: 0
})
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: `../list/index`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,85 @@
<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>
<view class="max_content">
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title_2 module_title_padding">
<view>{{infoData.projectName}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">计划名称</text></van-col>
<van-col span="18" class="color_blue">
{{infoData.taskName}}
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">任务编号</text></van-col>
<van-col span="18">{{infoData.taskUniqueId}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.bimId}}">
<van-row>
<van-col span="6"><text class="color_purple">BIM编号</text></van-col>
<van-col span="18">{{infoData.bimId}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">完成进度</text></van-col>
<van-col span="18" class="safety_issue_number color_orange txtb">{{infoData.schedulePercent}} % </van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.finishDate}}">
<van-row>
<van-col span="6"><text class="color_purple">完成时间</text></van-col>
<van-col span="18">{{infoData.finishDate}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">进度描述</text></van-col>
<van-col span="18">{{infoData.description}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">进度图片</text></van-col>
<van-col span="18" class="in-img-max">
<view class="in-img-div" wx:for="{{imageList}}" wx:key="index">
<image bindtap='showImg' data-set="{{item}}" src="{{item+'.min.jpg'}}"></image>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">填报用户</text></van-col>
<van-col span="18" class="color_blue">{{infoData.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">填报时间</text></van-col>
<van-col span="18" class="color_blue">{{infoData.createDate}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,25 @@
.in-img-max:after {
display: block;
clear: both;
content: "";
visibility: hidden;
height: 0
}
.in-img-max {
width: auto;
zoom: 1
}
.in-img-div {
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image {
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}

View File

@ -0,0 +1,192 @@
import config from '../../../config'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
findMyTask
} from '../../../api/flowable'
import {
planScheduleList
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 3,
projectId: '',
projectName: '',
subDeptUserInfo: {},
initData: {},
aqglDb: 0,
zlyhDB: 0,
zlglDb: 0,
todoDB: 0,
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
imgBaseUrl:config.baseImgUrl
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
const proUserInfo = getUserInfo();
this.setData({
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
subDeptUserInfo: proUserInfo.projectUserInfo,
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
});
this.awaitTask();
this.getListData();
},
/**
* 添加进度计划
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 查看进度详情
* @param {*} e
*/
getInfo(e) {
let {
id
} = e.currentTarget.dataset.set
wx.redirectTo({
url: `../info/index?id=${id}`,
})
},
/**
* 数据加载
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId;
planScheduleList(params).then(res => {
if (res.code == 200) {
res.rows.forEach(item => {
let _tsk = item.taskName.split(' / ');
item.mainPlan = _tsk[_tsk.length];
item.planName = item.taskName.replace(item.mainPlan + " / ");
if (item.images) {
item.mainImage = item.images.split(',')[0];
} else {
item.mainImage = "default";
}
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 滚动加载
*/
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("已经到底了,没有数据可加载!!!");
}
},
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({
active: event.detail
});
},
//跳转到项目概况
XMGK: function () {
wx.setStorageSync('nav-menu', "xmgk");
wx.redirectTo({
url: '../../project_info/index'
})
},
//跳转到安全管理
AQGL: function () {
wx.setStorageSync('nav-menu', "aqgl");
wx.redirectTo({
url: '../../project_safety/index'
})
},
//跳转到质量管理
ZLGL: function () {
wx.setStorageSync('nav-menu', "zlgl");
wx.redirectTo({
url: '../../project_quality/index'
})
},
//跳转到项目管理
XMGL: function () {
wx.setStorageSync('nav-menu', "xmgl");
wx.redirectTo({
url: '../../project_more/index'
})
},
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
let proUserInfo = this.data.subDeptUserInfo;
this.setData({
aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0,
zlyhDB: res.data.zlyl,
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0,
todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo
})
}
});
},
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tabbar": "@vant/weapp/tabbar",
"van-tabbar-item": "@vant/weapp/tabbar-item"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,98 @@
<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="XMGK">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="3">
<user-infos></user-infos>
</van-col>
<van-col span="10">
<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="inspect_max_scroll">
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" 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_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_text">
填报时间:{{item.createDate}}
</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.mainImage+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop">计划名称:<text class="color_blue">{{item.taskName}}</text></view>
<view class="inspect_list_info_data_prop safety_issue_number">完成进度:<text class="color_orange txtb">{{item.schedulePercent}} %</text></view>
</view>
</view>
<view class="inspect_list_info_position">
进度描述:<text class="color_purple">{{item.description}}</text>
</view>
</view>
</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_add_to_copy" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item bindtap="XMGK">
<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;" />
项目概况
</van-tabbar-item>
<van-tabbar-item>
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="ZLGL">
<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;" />
质量管理
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
</van-tabbar-item>
<van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item>
</van-tabbar>

View File

@ -0,0 +1,20 @@
element.style {
}
.inspect_add_to_copy {
position: fixed;
right: 30rpx;
bottom: 250rpx;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: #273252;
text-align: center;
font-size: 26rpx;
color: #b0ccf5;
}
.inspect_add_to_copy image {
width: 40rpx;
height: 40rpx;
}

View File

@ -0,0 +1,843 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
findDictCache,
findCardOcrFront
} from '../../../api/publics'
import {
registerSubDeptsGL,
findProSubDeptsInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
limit: 1,
maxDate: new Date(2088, 1, 1).getTime(),
form: {
subDeptType: "3",
subDeptName: "",
subDeptCode: "",
businessLicensePath: "",
subDeptInfos: {
legalPersonCardImgPos: "",
legalPersonCardImgInv: "",
legalPerson: "",
legalPersonCard: ""
},
contractInfos: "",
useDates: "",
startWorkDates: "",
endWorkDates: "",
leaderCardImgPos: "",
leaderCardImgInv: "",
leaderUserPicture: "",
subDeptLeaderPowerPath: "",
subDeptLeaderName: "",
subDeptLeaderCode: "",
subDeptLeaderPhone: "",
nation: "",
nativePlace: "",
address: "",
emergencyContact: "",
contactPhone: "",
leaderDegreeGrade: ""
},
eduCationalType: [],
subDeptTypeList: [],
active: 0,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '单位入场'
}],
loadShow: false,
imgBase: config.baseImgUrl,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
this.getDictCache();
},
/**
* 获取字典缓存数据
*/
getDictCache() {
// 初始化单位类型
findDictCache("sub_dept_type").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
if (item.dictValue != "1") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
});
this.setData({
subDeptTypeList: list
});
}
});
// 初始化学历类型
findDictCache("educational_type").then(res => {
if (res.code == 200) {
let eduCationalType = [];
res.data.forEach(item => {
eduCationalType.push({
"id": item.dictValue,
"text": item.dictLabel
});
})
this.setData({
eduCationalType
});
}
})
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubDeptsInfoById(id).then(deptRes => {
if (deptRes.code == 200 && deptRes.data) {
if (deptRes.data.proProjectInfoSubdeptsUsers) {
deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep;
if (deptRes.data.proProjectInfoSubdeptsUsers.userPicture) {
deptRes.data.leaderUserPicture = (this.data.imgBase + deptRes.data.proProjectInfoSubdeptsUsers.userPicture).split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath) {
deptRes.data.subDeptLeaderPowerPath = (this.data.imgBase + deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath).split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.userInfos) {
let userInfosJSON = JSON.parse(deptRes.data.proProjectInfoSubdeptsUsers.userInfos);
if (userInfosJSON.cardImgPos) {
deptRes.data.leaderCardImgPos = (this.data.imgBase + userInfosJSON.cardImgPos).split(',');
}
if (userInfosJSON.cardImgInv) {
deptRes.data.leaderCardImgInv = (this.data.imgBase + userInfosJSON.cardImgInv).split(',');
}
deptRes.data.proProjectInfoSubdeptsUsers.userInfos = userInfosJSON;
deptRes.data.nativePlace = userInfosJSON.nativePlace;
deptRes.data.nation = userInfosJSON.nation;
deptRes.data.address = userInfosJSON.address;
deptRes.data.emergencyContact = userInfosJSON.emergencyContact;
deptRes.data.contactPhone = userInfosJSON.contactPhone;
}
}
if (deptRes.data.businessLicensePath) {
deptRes.data.businessLicensePath = (this.data.imgBase + deptRes.data.businessLicensePath).split(',');
}
if (deptRes.data.subDeptInfos) {
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
deptRes.data.subDeptInfos = subDeptInfosJSON;
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
deptRes.data.subDeptInfos.legalPersonCardImgPos = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgPos).split(',');
}
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
deptRes.data.subDeptInfos.legalPersonCardImgInv = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgInv).split(',');
}
}
this.setData({
active: 100,
form: deptRes.data
});
}
});
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
/**
* 委托代理提交参建单位信息
*/
submitSubDeptValues() {
let {
form
} = this.data;
let subDeptInfos = form.subDeptInfos;
if (!subDeptInfos) {
subDeptInfos = {};
}
//数据效验
if (!form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
//数据效验
if (!form.subDeptType) {
app.toast("请选择单位类型!");
return false;
}
if (!form.subDeptName) {
app.toast("请填写单位名称!");
return false;
}
if (!form.subDeptCode) {
app.toast("请填写单位社会信用代码!");
return false;
}
if (!form.useDates) {
app.toast("请选择进入场地时间!");
return false;
}
if (form.subDeptType == "4" || form.subDeptType == "5") {
if (!form.businessLicensePath || form.businessLicensePath.length == 0) {
app.toast("请上传营业执照副本!");
return false;
}
if (!subDeptInfos.legalPersonCardImgPos || subDeptInfos.legalPersonCardImgPos.length == 0) {
app.toast("请上传法人身份证正面照!");
return false;
}
if (!subDeptInfos.legalPersonCardImgInv || subDeptInfos.legalPersonCardImgInv.length == 0) {
app.toast("请上传法人身份证反面照!");
return false;
}
if (!subDeptInfos.legalPerson) {
app.toast("请填写法人姓名!");
return false;
}
if (!subDeptInfos.legalPersonCard) {
app.toast("请填写法人身份证号!");
return false;
}
if (!form.contractInfos) {
app.toast("请填写合同约定的承包范围!");
return false;
}
if (!form.startWorkDates) {
app.toast("请选择计划开工时间!");
return false;
}
if (!form.endWorkDates) {
app.toast("请选择计划完工时间!");
return false;
}
if (!form.leaderCardImgPos || form.leaderCardImgPos.length == 0) {
app.toast("请上传委托人身份证正面照!");
return false;
}
if (!form.leaderCardImgInv || form.leaderCardImgInv.length == 0) {
app.toast("请上传委托人身份证反面照!");
return false;
}
if (!form.leaderUserPicture || form.leaderUserPicture.length == 0) {
app.toast("请上传委托人半身近照!");
return false;
}
if (!form.subDeptLeaderPowerPath || form.subDeptLeaderPowerPath.length == 0) {
app.toast("请上传委托人单位委托书!");
return false;
}
if (!form.subDeptLeaderName) {
app.toast("请填写委托人姓名!");
return false;
}
if (!form.subDeptLeaderCode) {
app.toast("请填写委托人身份证号!");
return false;
} else {
const cardCodePattern = /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
if (!cardCodePattern.test(form.subDeptLeaderCode)) {
app.toast("身份证号码不正确!");
return false;
}
}
if (!form.subDeptLeaderPhone) {
app.toast("请填写委托人联系电话!");
return false;
}else{
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.subDeptLeaderPhone)) {
app.toast("委托人联系电话不正确!");
return false;
}
}
if (!form.nativePlace) {
app.toast("请填写籍贯!");
return false;
}
if (!form.nation) {
app.toast("请填写民族!");
return false;
}
if (!form.address) {
app.toast("请填写地址!");
return false;
}
if (!form.emergencyContact) {
app.toast("请填写紧急联系人!");
return false;
}
if (!form.contactPhone) {
app.toast("请填写紧急联系人电话!");
return false;
} else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.contactPhone)) {
app.toast("紧急联系人电话不正确!");
return false;
}
}
if (!form.leaderDegreeGrade) {
app.toast("请选择委托人学历信息!");
return false;
}
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认保存参建单位信息?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptForm();
}
}
})
},
/**
* 委托代理提交参建单位表单
*/
submitSubDeptForm() {
let _form = {
...this.data.form
};
let subDeptInfos = {
..._form.subDeptInfos
};
this.setData({
loadShow: true
})
let uploadFiles = [];
if (_form.businessLicensePath && _form.businessLicensePath.length > 0) {
uploadFiles.push({
type: 'businessLicensePath',
path: _form.businessLicensePath[0]
});
}
if (subDeptInfos.legalPersonCardImgPos && subDeptInfos.legalPersonCardImgPos.length > 0) {
uploadFiles.push({
type: 'legalPersonCardImgPos',
path: subDeptInfos.legalPersonCardImgPos[0]
});
}
if (subDeptInfos.legalPersonCardImgInv && subDeptInfos.legalPersonCardImgInv.length > 0) {
uploadFiles.push({
type: 'legalPersonCardImgInv',
path: subDeptInfos.legalPersonCardImgInv[0]
});
}
if (_form.leaderCardImgPos && _form.leaderCardImgPos.length > 0) {
uploadFiles.push({
type: 'leaderCardImgPos',
path: _form.leaderCardImgPos[0]
});
}
if (_form.leaderCardImgInv && _form.leaderCardImgInv.length > 0) {
uploadFiles.push({
type: 'leaderCardImgInv',
path: _form.leaderCardImgInv[0]
});
}
if (_form.leaderUserPicture && _form.leaderUserPicture.length > 0) {
uploadFiles.push({
type: 'leaderUserPicture',
path: _form.leaderUserPicture[0]
});
}
if (_form.subDeptLeaderPowerPath && _form.subDeptLeaderPowerPath.length > 0) {
uploadFiles.push({
type: 'subDeptLeaderPowerPath',
path: _form.subDeptLeaderPowerPath[0]
});
}
let that = this;
let uploads = [];
if (uploadFiles.length > 0) {
uploadFiles.forEach(async (item) => {
let obj;
if (item.path.indexOf(this.data.imgBase) > -1) {
obj = {
data: {
data: {
url: item.path.replace(this.data.imgBase, "")
}
}
}
} else {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
obj = await that.syncUploadImage(item.path);
}
if (item.type == "businessLicensePath") {
_form.businessLicensePath = obj.data.data.url;
}
if (item.type == "legalPersonCardImgPos") {
subDeptInfos.legalPersonCardImgPos = obj.data.data.url;
}
if (item.type == "legalPersonCardImgInv") {
subDeptInfos.legalPersonCardImgInv = obj.data.data.url;
}
if (item.type == "leaderCardImgPos") {
_form.leaderCardImgPos = obj.data.data.url;
}
if (item.type == "leaderCardImgInv") {
_form.leaderCardImgInv = obj.data.data.url;
}
if (item.type == "leaderUserPicture") {
_form.leaderUserPicture = obj.data.data.url;
}
if (item.type == "subDeptLeaderPowerPath") {
_form.subDeptLeaderPowerPath = obj.data.data.url;
}
uploads.push(obj.data.data.url);
//验证图片上传完毕
if (uploads.length == uploadFiles.length) {
_form.subDeptInfos = JSON.stringify(subDeptInfos);
let leaderUserInfos = {};
leaderUserInfos.nation = _form.nation;
leaderUserInfos.nativePlace = _form.nativePlace;
leaderUserInfos.address = _form.address;
leaderUserInfos.emergencyContact = _form.emergencyContact;
leaderUserInfos.contactPhone = _form.contactPhone;
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
if (_form.proProjectInfoSubdeptsUsers && _form.proProjectInfoSubdeptsUsers.userInfos) {
_form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(_form.proProjectInfoSubdeptsUsers.userInfos);
}
registerSubDeptsGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
});
} else {
_form.subDeptInfos = JSON.stringify(subDeptInfos);
let leaderUserInfos = {};
leaderUserInfos.nation = _form.nation;
leaderUserInfos.nativePlace = _form.nativePlace;
leaderUserInfos.address = _form.address;
leaderUserInfos.emergencyContact = _form.emergencyContact;
leaderUserInfos.contactPhone = _form.contactPhone;
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
registerSubDeptsGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("新增数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
},
//选择单位类型
onSubDeptType(e) {
this.setData({
"form.subDeptType": e.detail.id
})
},
//填写单位名称
onSubDeptName(e) {
this.setData({
"form.subDeptName": e.detail.value
})
},
//填写信用代码
onSubDeptCode(e) {
this.setData({
"form.subDeptCode": e.detail.value
})
},
/**
* 营业执照副本
* @param {*} options
*/
fileUpload0(options) {
let file = options.detail;
this.setData({
"form.businessLicensePath": file
});
},
/**
* 法人身份证正面
* @param {*} options
*/
fileUpload1(options) {
let file = options.detail;
this.setData({
"form.subDeptInfos.legalPersonCardImgPos": file
});
file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res => {
if (res.code == 200) {
this.setData({
"form.subDeptInfos.legalPerson": res.data.name,
"form.subDeptInfos.legalPersonCard": res.data.cardId
})
if (!res.data.name || !res.data.cardId) {
this.setData({
"form.subDeptInfos.legalPersonCardImgPos": []
});
app.toast("身份证正面照识别失败!请重新上传");
}
}
});
})
},
/**
* 法人身份证反面
* @param {*} options
*/
fileUpload2(options) {
let file = options.detail;
this.setData({
"form.subDeptInfos.legalPersonCardImgInv": file
});
},
/** 单位法人姓名 */
inputInfoslegalPerson(e) {
this.setData({
"form.subDeptInfos.legalPerson": e.detail.value
})
},
/** 单位法人身份证号 */
inputInfoslegalPersonCard(e) {
this.setData({
"form.subDeptInfos.legalPersonCard": e.detail.value
})
},
/** 合同约定的承包范围 */
inputContractInfos(e) {
this.setData({
"form.contractInfos": e.detail.value
})
},
/** 进入场地时间 */
onInputTime0(e) {
this.setData({
"form.useDates": e.detail
})
},
/** 计划开工时间 */
onInputTime1(e) {
this.setData({
"form.startWorkDates": e.detail
})
},
/** 计划完工时间 */
onInputTime2(e) {
this.setData({
"form.endWorkDates": e.detail
})
},
/**
* 委托人身份证反面
* @param {*} options
*/
fileUpload3(options) {
let file = options.detail;
this.setData({
"form.leaderCardImgPos": file
});
file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res => {
if (res.code == 200) {
this.setData({
"form.subDeptLeaderName": res.data.name,
"form.subDeptLeaderCode": res.data.cardId,
"form.nation": res.data.nation,
"form.nativePlace": res.data.native,
"form.address": res.data.address
})
if (!res.data.name || !res.data.cardId) {
this.setData({
"form.leaderCardImgPos": []
});
app.toast("身份证正面照识别失败!请重新上传");
}
}
});
})
},
/**
* 委托人身份证反面
* @param {*} options
*/
fileUpload4(options) {
let file = options.detail;
this.setData({
"form.leaderCardImgInv": file
});
},
/**
* 委托人半身照
* @param {*} options
*/
fileUpload5(options) {
let file = options.detail;
this.setData({
"form.leaderUserPicture": file
});
},
/**
* 委托人委托书
* @param {*} options
*/
fileUpload6(options) {
let file = options.detail;
this.setData({
"form.subDeptLeaderPowerPath": file
});
},
/**
* 输入负责人姓名
* @param {*} e
*/
inputLeaderName(e) {
this.setData({
"form.subDeptLeaderName": e.detail.value
})
},
/**
* 输入负责人身份证号
* @param {*} e
*/
inputLeaderCode(e) {
this.setData({
"form.subDeptLeaderCode": e.detail.value
})
},
/**
* 输入负责人联系电话
* @param {*} e
*/
subDeptLeaderPhone(e) {
this.setData({
"form.subDeptLeaderPhone": e.detail.value
})
},
/**
* 个人籍贯
* @param {*} e
*/
inputOriginNative(e) {
this.setData({
"form.nativePlace": e.detail.value
})
},
/**
* 个人民族
* @param {*} e
*/
inputOriginNation(e) {
this.setData({
"form.nation": e.detail.value
})
},
/**
* 个人籍贯地址
* @param {*} e
*/
inputOriginAddress(e) {
this.setData({
"form.address": e.detail.value
})
},
/**
* 紧急联系人
* @param {*} e
*/
inputUrgentUser(e) {
this.setData({
"form.emergencyContact": e.detail.value
})
},
/**
* 紧急联系人电话
* @param {*} e
*/
inputUrgentUserPhone(e) {
this.setData({
"form.contactPhone": e.detail.value
})
},
/**
* 文化程度
* @param {*} e
*/
onLeaderDegreeGrade(e) {
this.setData({
"form.leaderDegreeGrade": e.detail.id
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(file) {
let _baseUrl = config.baseUrl;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
const data = JSON.parse(res.data)
resolve({
data: data
})
},
fail: (err) => {
//上传失败修改pedding为reject
console.log("访问接口失败", err);
wx.showToast({
title: "网络出错,上传失败",
icon: 'none',
duration: 1000
});
reject(err)
}
});
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,234 @@
<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">{{form.id?'修改':'新增'}}参建单位</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">单位类型
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位类型" placeholder-style="color:#6777aa;" model:value="{{form.subDeptTypeName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">单位类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{subDeptTypeList}}" placeholder="请选择单位企业类型" bindchange="onSubDeptType" selectValue="{{form.subDeptType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">单位名称</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写单位名称" model:value="{{form.subDeptName}}" placeholder-style="color:#6777aa;" maxlength="64" bindblur="onSubDeptName" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">社会信用代码</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写社会信用代码" model:value="{{form.subDeptCode}}" placeholder-style="color:#6777aa;" maxlength="64" bindblur="onSubDeptCode" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">营业执照副本
<text style="font-size: small; color: #ff711e;">[有效期内的清晰扫描照片]</text>
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload0" limit="{{limit}}" fileUrlArray="{{form.businessLicensePath}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<van-row>
<van-col span="12">
<view class="markers inspect_info_title">法人身份证正面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload1" iconClass="in-zcard-click" limit="{{limit}}" fileUrlArray="{{form.subDeptInfos.legalPersonCardImgPos}}"></file-uploader>
</view>
</van-col>
<van-col span="12">
<view class="markers inspect_info_title">法人身份证反面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload2" iconClass="in-fcard-click" limit="{{limit}}" fileUrlArray="{{form.subDeptInfos.legalPersonCardImgInv}}"></file-uploader>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">法定代表人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPerson}}" disabled bindinput="inputInfoslegalPerson" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">法定代表人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPersonCard}}" disabled bindinput="inputInfoslegalPersonCard" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">合同约定的承包范围</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写合同约定的承包范围" model:value="{{form.contractInfos}}" placeholder-style="color:#6777aa;" bindblur="inputContractInfos" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">进入场地时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="请选择进入场地时间" time="{{form.useDates}}" bindchange="onInputTime0"></voucher-date>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">计划开工时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="请选择计划开工时间" time="{{form.startWorkDates}}" bindchange="onInputTime1"></voucher-date>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">计划完工时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="请选择计划完工时间" time="{{form.endWorkDates}}" bindchange="onInputTime2"></voucher-date>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<van-row>
<van-col span="12">
<view class="markers inspect_info_title">代理人证件正面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload3" iconClass="in-zcard-click" limit="{{limit}}" fileUrlArray="{{form.leaderCardImgPos}}"></file-uploader>
</view>
</van-col>
<van-col span="12">
<view class="markers inspect_info_title">代理人证件反面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload4" iconClass="in-fcard-click" limit="{{limit}}" fileUrlArray="{{form.leaderCardImgInv}}"></file-uploader>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">代理人半身照
<text style="font-size: small; color: #ff711e;">[进场扫脸,请上传清晰照片]</text>
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload5" limit="{{limit}}" fileUrlArray="{{form.leaderUserPicture}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">代理人委托书
<text style="font-size: small; color: #ff711e;">[需加盖劳务单位的公章委托书照片]</text>
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUpload6" limit="{{limit}}" fileUrlArray="{{form.subDeptLeaderPowerPath}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">委托代理人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderName}}" disabled bindinput="inputLeaderName" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">委托代理人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderCode}}" disabled bindinput="inputLeaderCode" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id && (form.subDeptType=='4' || form.subDeptType=='5')}}">
<view class="markers inspect_info_title">委托代理人联系电话
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderPhone}}" class="inspect_input_fill_out" disabled/>
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id && (form.subDeptType=='4' || form.subDeptType=='5')}}">
<view class="markers inspect_info_title">委托代理人联系电话</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" bindinput="subDeptLeaderPhone" model:value="{{form.subDeptLeaderPhone}}" class="inspect_input_fill_in" maxlength="11" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">紧急联系人</view>
<view class="inspect_info_content">
<input placeholder="请填写紧急联系人" placeholder-style="color:#6777aa;" bindinput="inputUrgentUser" class="inspect_input_fill_in" model:value="{{form.emergencyContact}}" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">紧急联系人电话</view>
<view class="inspect_info_content">
<input placeholder="请填写紧急联系人电话" placeholder-style="color:#6777aa;" bindinput="inputUrgentUserPhone" class="inspect_input_fill_in" model:value="{{form.contactPhone}}" maxlength="11" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">代理人文化程度</view>
<view class="inspect_info_content">
<voucher-select columns="{{eduCationalType}}" placeholder="请选择代理人文化程度" bindchange="onLeaderDegreeGrade" selectValue="{{form.leaderDegreeGrade}}"></voucher-select>
</view>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">{{form.id?'修改':'新增'}}单位信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSubDeptValues">提交保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,11 @@
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,261 @@
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
editSubDeptsUseStatus,
findProSubDeptsInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 100,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '单位入场'
}],
form: {
subDeptInfos: {}
},
subDeptUserData: {
userInfos: {},
},
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubDeptsInfoById(id).then(deptRes => {
if (deptRes.code == 200 && deptRes.data) {
if (deptRes.data.proProjectInfoSubdeptsUsers) {
deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep;
if (deptRes.data.proProjectInfoSubdeptsUsers.userPicture) {
deptRes.data.leaderUserPicture = deptRes.data.proProjectInfoSubdeptsUsers.userPicture.split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath) {
deptRes.data.subDeptLeaderPowerPath = deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath.split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.userInfos) {
let userInfosJSON = JSON.parse(deptRes.data.proProjectInfoSubdeptsUsers.userInfos);
if (userInfosJSON.cardImgPos) {
deptRes.data.leaderCardImgPos = userInfosJSON.cardImgPos.split(',');
}
if (userInfosJSON.cardImgInv) {
deptRes.data.leaderCardImgInv = userInfosJSON.cardImgInv.split(',');
}
deptRes.data.proProjectInfoSubdeptsUsers.userInfos = userInfosJSON;
deptRes.data.nativePlace = userInfosJSON.nativePlace;
deptRes.data.nation = userInfosJSON.nation;
deptRes.data.address = userInfosJSON.address;
deptRes.data.emergencyContact = userInfosJSON.emergencyContact;
deptRes.data.contactPhone = userInfosJSON.contactPhone;
}
}
if (deptRes.data.businessLicensePath) {
deptRes.data.businessLicensePath = deptRes.data.businessLicensePath.split(',');
}
if (deptRes.data.subDeptInfos) {
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
deptRes.data.subDeptInfos = subDeptInfosJSON;
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
deptRes.data.subDeptInfos.legalPersonCardImgPos = deptRes.data.subDeptInfos.legalPersonCardImgPos.split(',');
}
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
deptRes.data.subDeptInfos.legalPersonCardImgInv = deptRes.data.subDeptInfos.legalPersonCardImgInv.split(',');
}
}
let _subDeptUserData = {
userInfos: {}
};
if (deptRes.data.proProjectInfoSubdeptsUsers) {
_subDeptUserData = deptRes.data.proProjectInfoSubdeptsUsers;
}
this.setData({
active: 100,
form: deptRes.data,
subDeptUserData: _subDeptUserData
});
}
});
},
/**
* 返回上页
*/
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 展示图片
* @param {*} e
*/
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseImgUrl + url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.subDeptUserData.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
/**
* 单位入场
*/
submitSubDeptsIn(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认参建单位入场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(0);
}
}
})
},
/**
* 单位离场
*/
submitSubDeptsOut(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认参建单位离场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(1);
}
}
})
},
/**
* 表单提交
*/
submitSubDeptsUseStatus(status){
editSubDeptsUseStatus(this.data.form.id,status).then(res =>{
if(res.code==200){
app.toast("操作成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,6 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,277 @@
<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>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">参建单位详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="module_title module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info">
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{form.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{form.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptCode}}">
<van-row>
<van-col span="8"><text class="color_purple">信用代码</text></van-col>
<van-col span="16">{{form.subDeptCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.businessLicensePath}}">
<van-row>
<van-col span="8"><text class="color_purple">营业执照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.businessLicensePath}}" src="{{imgBaseUrl+form.businessLicensePath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPerson}}">
<van-row>
<van-col span="8"><text class="color_purple">法人姓名</text></van-col>
<van-col span="16">{{form.subDeptInfos.legalPerson}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPersonCard}}">
<van-row>
<van-col span="8"><text class="color_purple">法人身份证</text></van-col>
<van-col span="16">{{form.subDeptInfos.legalPersonCard}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPersonCardImgPos && form.subDeptInfos.legalPersonCardImgInv}}">
<van-row>
<van-col span="8"><text class="color_purple">法人证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.subDeptInfos.legalPersonCardImgPos}}" src="{{imgBaseUrl+form.subDeptInfos.legalPersonCardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{form.subDeptInfos.legalPersonCardImgInv}}" src="{{imgBaseUrl+form.subDeptInfos.legalPersonCardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.useDates}}">
<van-row>
<van-col span="8"><text class="color_purple">进入场地时间</text></van-col>
<van-col span="16">{{form.useDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.startWorkDates}}">
<van-row>
<van-col span="8"><text class="color_purple">计划开工时间</text></van-col>
<van-col span="16">{{form.startWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.endWorkDates}}">
<van-row>
<van-col span="8"><text class="color_purple">计划完工时间</text></van-col>
<van-col span="16">{{form.endWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.contractInfos}}">
<van-row>
<van-col span="8"><text class="color_purple">合同约定范围</text></van-col>
<van-col span="16">{{form.contractInfos}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.cardImgPos && subDeptUserData.userInfos.cardImgInv}}">
<van-row>
<van-col span="8">
<text class="color_purple">代理人证件</text>
</van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgPos}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgInv}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userPicture}}">
<van-row>
<van-col span="8"><text class="color_purple">半身近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userPicture}}" src="{{imgBaseUrl+subDeptUserData.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userName}}">
<van-row>
<van-col span="8">
<text class="color_purple">委托代理人</text>
</van-col>
<van-col span="16">{{subDeptUserData.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.cardCode}}">
<van-row>
<van-col span="8">
<text class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{subDeptUserData.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.nation}}">
<van-row>
<van-col span="8"><text class="color_purple">民族</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.nativePlace}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.address}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.subDeptPowerPath}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.subDeptPowerPath}}" src="{{imgBaseUrl+subDeptUserData.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.emergencyContact}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.contactPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankName}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankOffice}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankCardNo}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.illnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.supIllnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.eduFilePath}}">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{subDeptUserData.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击下载安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.useStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">入场状态</text></van-col>
<van-col span="16">
<text wx:if="{{subDeptUserData.useStatus=='0'}}" class="color_blue txtb">已入场</text>
<text wx:if="{{subDeptUserData.useStatus=='1'}}" class="color_delete txtb">已离场</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.approveStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">审批状态</text></van-col>
<van-col span="16">
<text wx:if="{{subDeptUserData.approveStatus==0}}" class="code_label_2 code_label_yellow" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">待提交</text>
<text wx:if="{{subDeptUserData.approveStatus==10}}" class="code_label_2 code_label_blue" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核中</text>
<text wx:if="{{subDeptUserData.approveStatus==11}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核驳回</text>
<text wx:if="{{subDeptUserData.approveStatus==100}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核通过</text>
<text wx:if="{{subDeptUserData.approveStatus==101}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">系统免审</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.createBy}}">
<van-row>
<van-col span="8"><text class="color_purple">数据来源</text></van-col>
<van-col span="16">{{subDeptUserData.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.createTime}}">
<van-row>
<van-col span="8"><text class="color_purple">创建时间</text></van-col>
<van-col span="16">{{subDeptUserData.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">返回取消</view>
<view wx:if="{{form.useStatus=='0'}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="submitSubDeptsOut">单位离场</view>
<view wx:if="{{form.useStatus=='1'}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="submitSubDeptsIn">单位入场</view>
</view>
</view>

View File

@ -0,0 +1,11 @@
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -0,0 +1,220 @@
import {
getToken
} from '../../../utils/auth'
import {
subdeptsList,
subdeptsCount
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
addFlag: false,
initData: {},
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
activeState: "0",
yrcCount: 0,
ylcCount: 0
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
this.setData({
addFlag: true,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 10,
listData: [],
total: 0
});
//获取数据列表
this.getListData();
this.getListCount();
},
/**
* 添加按钮
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 获取详情
* @param {*} e
*/
getInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e){
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},
/**
* 查询数据列表
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished";
subdeptsList(params).then(res => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计数据列表
*/
getListCount() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished";
subdeptsCount(params).then(res => {
if (res.code == 200) {
let _yrc = 0,
_ylc = 0;
res.data.forEach(item => {
if (item.useStatus == "0") {
_yrc = item.total;
} else {
_ylc = item.total;
}
});
this.setData({
yrcCount: _yrc,
ylcCount: _ylc
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = '0';
} else {
nav = '1';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../../project_more/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("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,58 @@
<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 class="{{activeState=='0'?'active':''}}" bindtap="trainJump" data-index="1"><text>已入场({{yrcCount}}</text></view>
<view class="{{activeState=='1'?'active':''}}" bindtap="trainJump" data-index="2"><text>已离场({{ylcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item.id}}" bindtap="getInfo">
<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_text_2 color_orange">
{{item.subDeptTypeName}}
</view>
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{item.id}}"><van-icon name="edit" /><text class="edit_text">修改</text></view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">单位名称:<text>{{item.subDeptName}}</text></view>
<view class="inspect_list_info_data_prop">信用代码:<text>{{item.subDeptCode}}</text></view>
<view class="inspect_list_info_data_prop ">入场时间:<text>{{item.useDates}}</text></view>
</view>
</view>
</view>
</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 wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,11 @@
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
padding-left: 10rpx;
color: #91ef4a;
display: flex;
align-items: center;
font-weight: 600;
}
.module_see_info_edit .edit_text{
padding-left: 10rpx;
}

View File

@ -0,0 +1,285 @@
import {
getToken
} from '../../../utils/auth'
import {
findDictCache
} from '../../../api/publics'
import {
subdeptsList,
findSubdeptsGroupById,
registerSubDeptsGroupGL
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 0,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '班组入场'
}],
form: {
subDeptId: "",
subDeptType: "",
subDeptName: "",
subDeptCode: "",
groupName: "",
craftType: "1",
craftPost: ""
},
subDeptList: [],
craftPostList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../pages/login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
this.getDictCache(options.id);
this.getAllSubDepts(options.id);
} else {
this.getDictCache(null);
this.getAllSubDepts(null);
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
},
/**
* 获取单位
*/
getAllSubDepts(optId) {
let params = "pageNum=1&pageSize=1000&useStatus=0&activeTags=finished&projectId=" + app.globalData.useProjectId;
subdeptsList(params).then(res => {
let list = [];
res.rows.forEach(item => {
list.push({
"id": item.id,
"text": item.subDeptName,
"type": item.subDeptType,
"code": item.subDeptCode,
});
});
this.setData({
subDeptList: list
});
if (!optId) {
this.setData({
"form.subDeptId": list.length > 0 ? list[0].id : null,
"form.subDeptType": list.length > 0 ? list[0].type : null,
"form.subDeptName": list.length > 0 ? list[0].text : null,
"form.subDeptCode": list.length > 0 ? list[0].code : null
});
}
});
},
/**
* 获取字典缓存数据
*/
getDictCache(optId) {
/**
* 初始化工种类型
* (普通工种)
*/
findDictCache("pro_craft_post").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
if (item.cssClass == "1") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
});
this.setData({
craftPostList: list
});
if (!optId) {
this.setData({
"form.craftPost": list[0].id
});
}
}
});
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findSubdeptsGroupById(id).then(res => {
if (res.code == 200) {
this.setData({
active: 100,
form: res.data
});
}
});
},
/**
* 提交班组信息
*/
submitValues() {
let {
form
} = this.data;
//数据效验
if (!form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
//数据效验
if (!form.craftPost) {
app.toast("请选择工种类型!");
return false;
}
if (!form.groupName) {
app.toast("请填写班组名称!");
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认保存单位班组信息?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptForm();
}
}
})
},
/**
* 提交单位班组信息
*/
submitSubDeptForm() {
let _form = {
...this.data.form
};
this.setData({
loadShow: true
})
registerSubDeptsGroupGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
//选择单位
onSubDept(e) {
let _list = this.data.subDeptList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.subDeptId": item.id,
"form.subDeptType": item.type,
"form.subDeptName": item.text,
"form.subDeptCode": item.code
})
}
});
},
/**
* 选择工种类型
* @param {*} e
*/
onCraftPost(e) {
this.setData({
"form.craftPost": e.detail.id
})
},
//填写班组名称
onGroupName(e) {
this.setData({
"form.groupName": e.detail.value
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,82 @@
<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">{{form.id?'修改':'新增'}}单位班组</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">参建单位
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写参建单位" placeholder-style="color:#6777aa;" model:value="{{form.subDeptName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">参建单位</view>
<view class="inspect_info_content">
<voucher-select columns="{{subDeptList}}" placeholder="请选择参建单位" bindchange="onSubDept" selectValue="{{form.subDeptId}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">工种类型
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode=='DEFAULT'}}">
<input placeholder-style="color:#6777aa;" model:value="管理人员" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode=='SPECIAL'}}">
<input placeholder-style="color:#6777aa;" model:value="特殊工种" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode!='DEFAULT' && form.groupCode!='SPECIAL'}}">
<input placeholder-style="color:#6777aa;" model:value="{{form.craftPostName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">工种类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{craftPostList}}" placeholder="请选择工种类型" bindchange="onCraftPost" selectValue="{{form.craftPost}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">班组名称</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写班组名称" model:value="{{form.groupName}}" placeholder-style="color:#6777aa;" maxlength="64" bindblur="onGroupName" />
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{form.groupCode=='DEFAULT' || form.groupCode=='SPECIAL'}}">
<text class="color_delete">系统生成默认班组不可修改。</text>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{!form.id}}">
<text class="color_blue">只能新增普通劳务班组、管理班组默认已创建。</text>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">{{form.id?'修改':'新增'}}班组信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view wx:if="{{form.groupCode!='DEFAULT' && form.groupCode!='SPECIAL'}}" class="problem_submit_to_btn problem_submit_to_save" bindtap="submitValues">提交保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,11 @@
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

Some files were not shown because too many files have changed in this diff Show More