提交优化
parent
bed3085a9b
commit
8d0666cab2
|
@ -1,71 +0,0 @@
|
|||
//app.js
|
||||
|
||||
//全局分享
|
||||
!function(){
|
||||
var PageTmp = Page;
|
||||
Page =function (pageConfig) {
|
||||
// 设置全局默认分享
|
||||
pageConfig = Object.assign({
|
||||
//右上角分享功能
|
||||
onShareAppMessage () {
|
||||
return {
|
||||
title: '智能工地+',//分享标题
|
||||
path: '/pages/login/login',//分享用户点开后页面
|
||||
success (res) {
|
||||
console.log('分享成功!')
|
||||
}
|
||||
}
|
||||
}
|
||||
},pageConfig);
|
||||
PageTmp(pageConfig);
|
||||
};
|
||||
}();
|
||||
|
||||
App({
|
||||
globalData: {
|
||||
paramDeptId:'',
|
||||
//请求地址参数
|
||||
//reqUrl:"http://192.168.31.126:9981",
|
||||
//reqUrl:'https://zngdtest.makalu.cc/',
|
||||
reqUrl:'https://zngd.makalu.cc',
|
||||
//地图相关参数
|
||||
scale:'',
|
||||
initialLon:'',
|
||||
initialLat:'',
|
||||
markers:[],
|
||||
//页面跳转参数
|
||||
type:'',
|
||||
value1:'省',
|
||||
value2:'市/区',
|
||||
value3:'公司',
|
||||
projectInfoList:{},
|
||||
projectId:'',
|
||||
projectName:'',
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
if (!wx.cloud) {
|
||||
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
|
||||
} else {
|
||||
wx.cloud.init({
|
||||
// env 参数说明:
|
||||
// env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
|
||||
// 此处请填入环境 ID, 环境 ID 可打开云控制台查看
|
||||
// 如不填则使用默认环境(第一个创建的环境)
|
||||
// env: 'my-env-id',
|
||||
traceUser: true,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//页面弹窗
|
||||
toast: function (msg) {
|
||||
wx.showToast({
|
||||
title: msg,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
}
|
||||
|
||||
})
|
|
@ -90,7 +90,13 @@
|
|||
"project_schedule/info/index",
|
||||
"project_train/list/index",
|
||||
"project_train/add/index",
|
||||
"project_train/info/index"
|
||||
"project_train/info/index",
|
||||
"project_special/list/index",
|
||||
"project_special/add/index",
|
||||
"project_special/info/index",
|
||||
"project_measure/list/index",
|
||||
"project_measure/add/index",
|
||||
"project_measure/info/index"
|
||||
],
|
||||
"independent": false
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ Page({
|
|||
rectifierData:[],
|
||||
rectifierData2:[],
|
||||
imageInfoData:[],
|
||||
checkingResult:"",
|
||||
checkingResult:"1",
|
||||
//验收时间
|
||||
checkTime:'',
|
||||
loadShow:false,
|
||||
|
@ -136,7 +136,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -243,7 +243,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("添加成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -290,7 +290,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -0,0 +1,446 @@
|
|||
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
maxDate:new Date(2088,1,1).getTime(),
|
||||
deptId:"",
|
||||
projectId:"",
|
||||
projectName:"",
|
||||
loginName:"",
|
||||
rectifierData:[],
|
||||
rectifierData2:[],
|
||||
imageInfoData:[],
|
||||
loadShow:false,
|
||||
measureType:"1",
|
||||
measureTypeList:[],
|
||||
measureInfo:"1",
|
||||
measureInfoTypeList:[],
|
||||
measurePosition:"",
|
||||
measurePointPosition:"",
|
||||
qualityUser:"",
|
||||
qualityUserName:"",
|
||||
superviseUser:"",
|
||||
superviseUserName:"",
|
||||
//验收时间
|
||||
measureTime:'',
|
||||
measureResult:"1",
|
||||
resultList:[{id:1,text:"合格"},{id:2,text:"不合格"}]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let {projectId,projectName} = options
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
projectId,
|
||||
projectName,
|
||||
deptId:res.data.deptId,
|
||||
loginName:res.data.loginName
|
||||
})
|
||||
this.getProjectUserData();
|
||||
this.getMeasureTypeList();
|
||||
this.getMeasureInfoTypeList();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//查询项目人员数据
|
||||
getProjectUserData(){
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectuserinfo/list',
|
||||
method:"get",
|
||||
data:{
|
||||
projectId:that.data.projectId
|
||||
},
|
||||
header:{
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
that.setData({
|
||||
rectifierData:res.data,
|
||||
rectifierData2:res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getMeasureTypeList(){
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
|
||||
method:"get",
|
||||
data:{
|
||||
type:'project_measure_type'
|
||||
},
|
||||
header:{
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
let list=[];
|
||||
res.data.forEach(it =>{
|
||||
list.push({"id":it.dictValue,"text":it.dictLabel});
|
||||
})
|
||||
that.setData({
|
||||
measureTypeList:list
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getMeasureInfoTypeList(){
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
|
||||
method:"get",
|
||||
data:{
|
||||
type:'project_measure_info_type'
|
||||
},
|
||||
header:{
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
let list=[];
|
||||
res.data.forEach(it =>{
|
||||
list.push({"id":it.dictValue,"text":it.dictLabel});
|
||||
})
|
||||
that.setData({
|
||||
measureInfoTypeList:list
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//测量部位
|
||||
onInputMeasurePosition(e){
|
||||
let measurePosition = e.detail.value
|
||||
this.setData({
|
||||
measurePosition
|
||||
})
|
||||
},
|
||||
|
||||
//测量点位
|
||||
onInputMeasurePointPosition(e){
|
||||
let measurePointPosition = e.detail.value
|
||||
this.setData({
|
||||
measurePointPosition
|
||||
})
|
||||
},
|
||||
|
||||
//验收时间
|
||||
onInputTime(e){
|
||||
let measureTime = e.detail
|
||||
this.setData({
|
||||
measureTime
|
||||
})
|
||||
},
|
||||
|
||||
// list 上传图片
|
||||
onImagesArr(e){
|
||||
var data = this.data.imageInfoData
|
||||
data = e.detail
|
||||
this.setData({
|
||||
imageInfoData:data
|
||||
})
|
||||
},
|
||||
|
||||
//添加质量专员
|
||||
onAddQualityUser(e){
|
||||
if(e.detail.length>0){
|
||||
this.setData({
|
||||
qualityUser:e.detail[0].phoneNumber,
|
||||
qualityUserName:e.detail[0].userName
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//添加监理专员
|
||||
onAddSuperviseUser(e){
|
||||
if(e.detail.length>0){
|
||||
this.setData({
|
||||
superviseUser:e.detail[0].phoneNumber,
|
||||
superviseUserName:e.detail[0].userName
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//切换测量结果
|
||||
onSelectType(e){
|
||||
this.setData({
|
||||
measureResult:e.detail.id
|
||||
})
|
||||
},
|
||||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
onSave(){
|
||||
this.setData({
|
||||
loadShow:true
|
||||
})
|
||||
let that = this
|
||||
let {projectId,loginName, deptId,measureType,
|
||||
measureInfo,
|
||||
measurePosition,
|
||||
measurePointPosition,
|
||||
qualityUser,
|
||||
qualityUserName,
|
||||
superviseUser,
|
||||
superviseUserName,
|
||||
measureTime,
|
||||
measureResult,imageInfoData} = that.data;
|
||||
//数据效验
|
||||
if(projectId==""||loginName==""||deptId==""){
|
||||
app.toast("数据异常,请刷新页面重试!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(imageInfoData.length==0){
|
||||
app.toast("请上传测量现场图片!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measureType==""){
|
||||
app.toast("请选择测量类型!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measureInfo==""){
|
||||
app.toast("请选择测量内容!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measurePosition==""){
|
||||
app.toast("请填写测量部位!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measurePointPosition==""){
|
||||
app.toast("请填写测量点位!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(qualityUser==""||qualityUserName==""){
|
||||
app.toast("请选择质量专员!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(superviseUser==""||superviseUserName==""){
|
||||
app.toast("请选择监理专员!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measureTime==""){
|
||||
app.toast("请选择测量时间!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(measureResult==""){
|
||||
app.toast("请选择测量结果!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(superviseUser==qualityUser){
|
||||
app.toast("质量专员和监理专员不能是同一人!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
let fileUrls = [];
|
||||
imageInfoData.forEach(async (item)=>{
|
||||
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
|
||||
let name = "file"
|
||||
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||
let obj = await that.syncUploadImage(uploadUrl,item,name);
|
||||
fileUrls.push(obj.data.fileName);
|
||||
//验证图片上传完毕
|
||||
if(fileUrls.length == imageInfoData.length){
|
||||
let params = {
|
||||
projectId,
|
||||
deptId,
|
||||
imageUrls:fileUrls.toString(),
|
||||
measureType,
|
||||
measureInfo,
|
||||
measurePosition,
|
||||
measurePointPosition,
|
||||
qualityUser,
|
||||
qualityUserName,
|
||||
superviseUser,
|
||||
superviseUserName,
|
||||
measureTime:measureTime+":00",
|
||||
measureResult,
|
||||
createBy:loginName
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectMeasure/add',
|
||||
method:"POST",
|
||||
data:params,
|
||||
header: {
|
||||
"Username": loginName,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
success(res){
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
app.toast("添加成功!")
|
||||
setTimeout(()=>{
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 这里考虑上传图片异步问题,封装为同步
|
||||
*/
|
||||
syncUploadImage(url,uploadFile,name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url, // 上传的服务器接口地址
|
||||
filePath: uploadFile,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||
},
|
||||
name, //上传的所需字段,后端提供
|
||||
formData: { user: 'test' },
|
||||
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)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
//选择测量类型
|
||||
onSelectMeasureType(e){
|
||||
this.setData({
|
||||
measureType:e.detail.id
|
||||
})
|
||||
},
|
||||
|
||||
//选择测量内容
|
||||
onSelectMeasureInfo(e){
|
||||
this.setData({
|
||||
measureInfo:e.detail.id
|
||||
})
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||
<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 module_title_flex">
|
||||
<view>{{projectName}}</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量图片</view>
|
||||
<view class="problem_list_info_con">
|
||||
<file-uploader bindimages="onImagesArr"></file-uploader>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量类型</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{measureTypeList}}" placeholder="请选择测量类型" bindchange="onSelectMeasureType"></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量内容</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{measureInfoTypeList}}" placeholder="请选择测量内容" bindchange="onSelectMeasureInfo"></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list" >
|
||||
<view class="inspect_info_title">测量部位</view>
|
||||
<view class="inspect_info_content">
|
||||
<textarea class="add_textarea" placeholder="请填写测量部位"
|
||||
placeholder-style="color:#6777aa;" bindblur="onInputMeasurePosition" maxlength="200"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list" >
|
||||
<view class="inspect_info_title">测量点位</view>
|
||||
<view class="inspect_info_content">
|
||||
<textarea class="add_textarea" placeholder="请填写测量点位"
|
||||
placeholder-style="color:#6777aa;" bindblur="onInputMeasurePointPosition" maxlength="200"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">质量专员</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{rectifierData}}" multiple="{{fales}}" bindselected="onAddQualityUser" index="{{0}}" title="请选择质量专员" >
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">监理专员</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{rectifierData2}}" multiple="{{fales}}" bindselected="onAddSuperviseUser" index="{{1}}" title="请选择监理专员" >
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量时间</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-datetime counts="5" placeholder="请选择测量时间" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-datetime>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title">测量结果</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{resultList}}" placeholder="请选择测量结果" bindchange="onSelectType" ></voucher-select>
|
||||
</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="onSave">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-overlay show="{{loadShow}}">
|
||||
<view class="gif">
|
||||
<image src="../../../images/loding2.gif"></image>
|
||||
<view>数据加载中!请稍后...</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||
.van-popup{
|
||||
background: none !important;
|
||||
}
|
||||
.van-image__img{
|
||||
border-radius: 10rpx !important;
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
// pageage/project_checking/info/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
id:"",
|
||||
infoData:{},
|
||||
loadShow:false,
|
||||
loginName:"",
|
||||
showDel:false,
|
||||
imageList:[],
|
||||
minImageList:[],
|
||||
request:app.globalData.reqUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let {id} = options
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
id,
|
||||
loginName:res.data.loginName
|
||||
})
|
||||
this.getInfo();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 获取安全检查详情信息
|
||||
*
|
||||
*/
|
||||
getInfo(){
|
||||
let {id} = this.data
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectMeasure/info',
|
||||
method:"get",
|
||||
data:{
|
||||
id:id
|
||||
},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
let urls = [];
|
||||
let minUrls = [];
|
||||
if(res.data.imageUrls){
|
||||
res.data.imageUrls.split(',').forEach(element => {
|
||||
urls.push(that.data.request+element);
|
||||
minUrls.push(that.data.request+element+'.min.jpg');
|
||||
});
|
||||
}
|
||||
that.setData({
|
||||
infoData:res.data,
|
||||
imageList:urls,
|
||||
minImageList:minUrls,
|
||||
loadShow:false
|
||||
})
|
||||
//判断当前能否删除
|
||||
if(res.data.createBy==that.data.loginName){
|
||||
that.setData({
|
||||
showDel:true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(){
|
||||
//弹出确认
|
||||
let that = this
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '是否确定删除此条数据?',
|
||||
success: function (sm) {
|
||||
if (sm.confirm) {
|
||||
// 用户点击了确定 可以调用了
|
||||
that.deleteData();
|
||||
} else if (sm.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteData(){
|
||||
let {id} = this.data
|
||||
let that = this;
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectMeasure/remove',
|
||||
header: {
|
||||
"Username": that.data.loginName,
|
||||
},
|
||||
data:{
|
||||
id:id
|
||||
},
|
||||
method:"get",
|
||||
success(res){
|
||||
app.toast("删除成功!")
|
||||
wx.redirectTo({
|
||||
url: `../list/index`,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//展示图片
|
||||
showImg:function(e){
|
||||
var that=this;
|
||||
wx.previewImage({
|
||||
urls: that.data.imageList,
|
||||
current: that.data.imageList[e.currentTarget.dataset.index]
|
||||
})
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle":"custom"
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
<!--pageage/safetyManagement/problemRectification/index.wxml-->
|
||||
<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 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="{{minImageList}}" wx:key="index">
|
||||
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></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" class="color_blue">{{infoData.measureTypeName}}</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.measureInfoName}}</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.measurePosition}}</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.measurePointPosition}}</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.measureTime}}</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.qualityUserName}}</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.superviseUserName}}</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">
|
||||
<text wx:if="{{infoData.measureResult == 1}}" class="color_green">合格</text>
|
||||
<text wx:if="{{infoData.measureResult == 2}}" class="color_orange">不合格</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.deptName}}</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.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">{{infoData.createTime}}</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</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>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/* pageage/project_checking/info/index.wxss */
|
||||
.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;
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
// pageage/safetyManagement/securityCheckGR/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
deptId:"",
|
||||
loginName:"",
|
||||
projectId:"",
|
||||
minRoleId:"",
|
||||
projectData:{},
|
||||
initData: {},
|
||||
show:false,
|
||||
listData:[],
|
||||
request:app.globalData.reqUrl
|
||||
},
|
||||
|
||||
skipAdd(){
|
||||
wx.redirectTo({
|
||||
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
|
||||
})
|
||||
},
|
||||
|
||||
getInfo(e){
|
||||
let {id} = e.currentTarget.dataset.set
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
deptId:res.data.deptId,
|
||||
loginName:res.data.loginName,
|
||||
userName:res.data.userName,
|
||||
projectId:app.globalData.projectId,
|
||||
minRoleId:res.data.minRoleId,
|
||||
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
|
||||
})
|
||||
this.getListData(app.globalData.projectId,res.data.deptId,res.data.minRoleId);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询项目举牌验收数据
|
||||
*/
|
||||
getListData(projectId,deptId,minRoleId) {
|
||||
var that = this;
|
||||
//判断角色,
|
||||
if(minRoleId==2||minRoleId==3||minRoleId==4){
|
||||
deptId=0;
|
||||
}
|
||||
let param = {
|
||||
"projectId": projectId,
|
||||
"deptId":deptId
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectMeasure/list',
|
||||
data:param,
|
||||
method: "get",
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
listData:res.data.data
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/gengduogongneng/gengduogongneng',
|
||||
})
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e){
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.projectId = projectId;
|
||||
app.globalData.projectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index" ,
|
||||
"van-popup": "@vant/weapp/popup/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
<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">
|
||||
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
|
||||
<view class="inspect_max">
|
||||
<view class="inspect_list">
|
||||
<view class="inspect_for" 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 < 9 ?'0'+(index+1):(index+1)}}</view>
|
||||
<view class="module_title module_title_flex inspect_list_title_text">测量时间:{{item.measureTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_list_info">
|
||||
<view class="inspect_list_info_details">
|
||||
<view class="inspect_list_info_img">
|
||||
<view wx:if="{{item.measureResult==2}}" class="code_label code_label_red">不合格</view>
|
||||
<view wx:if="{{item.measureResult==1}}" class="code_label code_label_green">合格</view>
|
||||
<van-image width="120rpx" height="120rpx" fit="cover" src="{{request+item.mainImage+'.min.jpg'}}"/>
|
||||
</view>
|
||||
<view class="inspect_list_info_data">
|
||||
<view class="inspect_list_info_data_prop">测量类型:<text>{{item.measureTypeName}}</text></view>
|
||||
<view class="inspect_list_info_data_prop">测量内容:<text>{{item.measureInfoName}}</text></view>
|
||||
<view class="inspect_list_info_data_prop">测量点位:<text class="color_blue">{{item.measurePointPosition}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_list_info_position">测量部位:<text class="color_purple">{{item.measurePosition}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="../../../images/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* pageage/project_checking_list/project_checking_list.wxss */
|
|
@ -184,7 +184,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -311,7 +311,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("添加成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -365,7 +365,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title">整改截至时间</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-date counts="5" placeholder="请选整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
<voucher-date counts="5" placeholder="请选择整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
|
|
|
@ -108,7 +108,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -156,7 +156,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("操作成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -230,7 +230,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -139,7 +139,7 @@ Page({
|
|||
method:"get",
|
||||
success(res){
|
||||
app.toast("删除成功!")
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: `../list/index`,
|
||||
})
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -104,7 +104,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -169,7 +169,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("提交成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -225,7 +225,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -318,7 +318,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("添加成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -372,7 +372,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title">整改截至时间</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-date counts="5" placeholder="请选整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
<voucher-date counts="5" placeholder="请选择整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
|
|
|
@ -108,7 +108,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -156,7 +156,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("操作成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -230,7 +230,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -137,7 +137,7 @@ Page({
|
|||
method:"get",
|
||||
success(res){
|
||||
app.toast("删除成功!")
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: `../list/index`,
|
||||
})
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -104,7 +104,7 @@ Page({
|
|||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
wx.navigateBack()
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
|
@ -169,7 +169,7 @@ Page({
|
|||
if(res.code == 200){
|
||||
app.toast("提交成功!")
|
||||
setTimeout(()=>{
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
|
@ -225,7 +225,7 @@ Page({
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
|
|
@ -0,0 +1,333 @@
|
|||
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
maxDate:new Date(2088,1,1).getTime(),
|
||||
deptId:"",
|
||||
projectId:"",
|
||||
projectName:"",
|
||||
loginName:"",
|
||||
name:"",
|
||||
sex:"1",
|
||||
phoneNumber:"",
|
||||
specialType:"1",
|
||||
credentialNumber:"",
|
||||
credentialExpirationTime:"",
|
||||
sexList:[{id:"1",text:"男"},{id:"2",text:"女"},{id:"3",text:"未知"}],
|
||||
specialTypeList:[],
|
||||
credentialFileData:[],
|
||||
limit:1,
|
||||
fileType:["pdf","png","jpg","jpeg"]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let {projectId,projectName} = options
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
projectId,
|
||||
projectName,
|
||||
deptId:res.data.deptId,
|
||||
loginName:res.data.loginName
|
||||
})
|
||||
this.getDictData();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//获取字典数据
|
||||
getDictData(){
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectSpecial/querySpecialType',
|
||||
method:"get",
|
||||
data:{},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
let temData=[];
|
||||
res.data.forEach(item =>{
|
||||
temData.push({id:item.dictValue,text:item.dictLabel});
|
||||
});
|
||||
that.setData({
|
||||
specialTypeList:temData
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//取消页面
|
||||
cancelSaveView(){
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index'
|
||||
})
|
||||
},
|
||||
|
||||
//保存
|
||||
onSave(){
|
||||
this.setData({
|
||||
loadShow:true
|
||||
})
|
||||
let that = this
|
||||
let {projectId,projectName,deptId,loginName,name,sex,phoneNumber,specialType,credentialNumber,credentialExpirationTime,credentialFileData} = that.data;
|
||||
//数据效验
|
||||
if(projectId==""||loginName==""||deptId==""){
|
||||
app.toast("数据异常,请刷新页面重试!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(name==""){
|
||||
app.toast("请填写人员姓名!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(sex==""){
|
||||
app.toast("请选择人员性别!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(phoneNumber==""){
|
||||
app.toast("请填写联系方式!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(phoneNumber.length!=11){
|
||||
app.toast("人员联系方式格式错误!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(specialType==""){
|
||||
app.toast("请选择人员类型!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(credentialNumber==""){
|
||||
app.toast("请填写证书编号!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(credentialExpirationTime==""){
|
||||
app.toast("请选择证书过期时间!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(credentialFileData.length==0){
|
||||
app.toast("请上传证书附件!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
});
|
||||
return;
|
||||
}
|
||||
let _fileType = credentialFileData[0].path.split('.');
|
||||
_fileType = _fileType[_fileType.length-1].toLowerCase();
|
||||
//判断附件类型,如果是图片直接展示,非图片则显示附件
|
||||
if(this.data.fileType.indexOf(_fileType)==-1){
|
||||
app.toast("证书附件不支持 [ "+_fileType+" ] 格式!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
});
|
||||
return;
|
||||
}
|
||||
credentialFileData.forEach(async (item)=>{
|
||||
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
|
||||
let uploadName = "file"
|
||||
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||
let obj = await that.syncUploadImage(uploadUrl,credentialFileData[0].path,uploadName);
|
||||
let params = {
|
||||
projectId,
|
||||
projectName,
|
||||
deptId,
|
||||
specialType,
|
||||
name,sex,phoneNumber,credentialNumber,credentialExpirationTime,
|
||||
credentialFile:obj.data.fileName,
|
||||
isCredential:"Y",
|
||||
isDel:0,
|
||||
createBy:loginName
|
||||
}
|
||||
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + "/wechat/projectSpecial/add",
|
||||
method:"POST",
|
||||
data:params,
|
||||
header: {
|
||||
"Username": loginName,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
success(res){
|
||||
that.setData({
|
||||
loadShow:false
|
||||
})
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
app.toast("添加成功!")
|
||||
setTimeout(()=>{
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},200)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 这里考虑上传图片异步问题,封装为同步
|
||||
*/
|
||||
syncUploadImage(url,uploadFile,name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url, // 上传的服务器接口地址
|
||||
filePath: uploadFile,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||
},
|
||||
name, //上传的所需字段,后端提供
|
||||
formData: { user: 'test' },
|
||||
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)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
nameAction: function (options) {
|
||||
this.data.name = options.detail.value;
|
||||
},
|
||||
|
||||
phoneAction: function (options) {
|
||||
let value = options.detail.value;
|
||||
value = value.replace(/[^0-9]/g, ''); // 正则表达式替换非数字为空
|
||||
this.setData({
|
||||
phoneNumber: value
|
||||
});
|
||||
},
|
||||
credentialNumberAction: function (options) {
|
||||
this.data.credentialNumber = options.detail.value
|
||||
},
|
||||
|
||||
fileUpload(a,b,c){
|
||||
let file=a.detail;
|
||||
this.setData({
|
||||
credentialFileData: file
|
||||
});
|
||||
},
|
||||
|
||||
//演练训练时间
|
||||
onInputTime(e){
|
||||
let credentialExpirationTime = e.detail
|
||||
this.setData({
|
||||
credentialExpirationTime
|
||||
})
|
||||
},
|
||||
|
||||
//切换性别
|
||||
onSelectSex(e){
|
||||
this.setData({
|
||||
sex:e.detail.id
|
||||
})
|
||||
},
|
||||
//切换人员类型
|
||||
onSelectSpecialType(e){
|
||||
this.setData({
|
||||
specialType:e.detail.id
|
||||
})
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||
<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 module_title_flex">
|
||||
<view>{{projectName}}</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">人员姓名</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请填写人员姓名" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" bindblur="nameAction" maxlength="30"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">人员性别</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{sexList}}" placeholder="请选择人员性别" bindchange="onSelectSex" ></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">联系方式</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请填写联系方式" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" bindblur="phoneAction" maxlength="11" value="{{phoneNumber}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">人员类型</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{specialTypeList}}" placeholder="请选择人员类型" bindchange="onSelectSpecialType" ></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">证书编号</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请填写证书编号" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" bindblur="credentialNumberAction" maxlength="50"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">过期时间</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-date counts="5" placeholder="请选择证书过期时间" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list" style="width: 100%;">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">证书附件</view>
|
||||
<view class="problem_list_info_con">
|
||||
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}"></file-uploader-all>
|
||||
</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="onSave">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-overlay show="{{loadShow}}">
|
||||
<view class="gif">
|
||||
<image src="../../../images/loding2.gif"></image>
|
||||
<view>数据加载中!请稍后...</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/* 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
|
||||
}
|
|
@ -0,0 +1,202 @@
|
|||
// pageage/project_checking/info/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
id:"",
|
||||
infoData:{},
|
||||
imageList:[],
|
||||
minImageList:[],
|
||||
loadShow:false,
|
||||
loginName:"",
|
||||
showDel:false,
|
||||
request:app.globalData.reqUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let {id} = options
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
id,
|
||||
loginName:res.data.loginName
|
||||
})
|
||||
this.getInfo();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 获取安全检查详情信息
|
||||
*
|
||||
*/
|
||||
getInfo(){
|
||||
let {id} = this.data
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/projectSpecial/info',
|
||||
method:"get",
|
||||
data:{
|
||||
id:id
|
||||
},
|
||||
success(res){
|
||||
res = res.data
|
||||
if(res.code == 200){
|
||||
let urls = [];
|
||||
let minUrls = [];
|
||||
if(res.data.credentialFile){
|
||||
res.data.credentialFile.split(',').forEach(element => {
|
||||
urls.push(that.data.request+element);
|
||||
minUrls.push(that.data.request+element+'.min.jpg');
|
||||
});
|
||||
}
|
||||
that.setData({
|
||||
infoData:res.data,
|
||||
imageList:urls,
|
||||
minImageList:minUrls,
|
||||
loadShow:false
|
||||
})
|
||||
//判断当前能否删除
|
||||
if(res.data.createBy==that.data.loginName){
|
||||
that.setData({
|
||||
showDel:true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(){
|
||||
//弹出确认
|
||||
let that = this
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '是否确定删除此条数据?',
|
||||
success: function (sm) {
|
||||
if (sm.confirm) {
|
||||
// 用户点击了确定 可以调用了
|
||||
that.deleteData();
|
||||
} else if (sm.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteData(){
|
||||
let {id} = this.data
|
||||
let that = this;
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+"/wechat/projectSpecial/remove",
|
||||
header: {
|
||||
"Username": this.data.loginName,
|
||||
},
|
||||
data:{
|
||||
id:id
|
||||
},
|
||||
method:"get",
|
||||
success(res){
|
||||
app.toast("删除成功!")
|
||||
wx.redirectTo({
|
||||
url: `../list/index`,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//展示图片
|
||||
showImg:function(e){
|
||||
var that=this;
|
||||
wx.previewImage({
|
||||
urls: that.data.imageList,
|
||||
current: that.data.imageList[e.currentTarget.dataset.index]
|
||||
})
|
||||
},
|
||||
|
||||
downFile:function(e){
|
||||
let idx = e.currentTarget.dataset['index'];
|
||||
let that = this;
|
||||
wx.downloadFile({
|
||||
// 示例 url,并非真实存在
|
||||
url: that.data.request+that.imageList[idx],
|
||||
success: function (res) {
|
||||
const filePath = res.tempFilePath
|
||||
wx.openDocument({
|
||||
filePath: filePath,
|
||||
success: function (res) {
|
||||
console.log('打开文档成功')
|
||||
},
|
||||
fail:function(res) {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
//app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "形象进度详情"
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
<!--pageage/safetyManagement/problemRectification/index.wxml-->
|
||||
<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 module_title_padding">
|
||||
<view>{{infoData.projectName}}</view>
|
||||
</view>
|
||||
<view class="inspect_overview_list_max">
|
||||
<view class="inspect_overview_list" wx:if="{{infoData.credentialType != 'PDF'}}">
|
||||
<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="{{minImageList}}" wx:key="index">
|
||||
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
|
||||
</view>
|
||||
</view>
|
||||
</van-row>
|
||||
</view>
|
||||
<view class="inspect_overview_list" wx:if="{{infoData.credentialType == 'PDF'}}">
|
||||
<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">
|
||||
<image src='https://cf.makalu.cc/profile/wechat/icon/pdf.png'></image>
|
||||
<text class="files" style="color:#89a3ed;margin-left:50rpx;" bindtap='downFile' data-index="{{0}}" >下载附件</text>
|
||||
</view>
|
||||
</view>
|
||||
</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" class="color_blue">{{infoData.name}}</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">
|
||||
<text wx:if="{{infoData.sex=='1'}}">男</text>
|
||||
<text wx:if="{{infoData.sex=='2'}}">女</text>
|
||||
<text wx:if="{{infoData.sex=='3'}}">未知</text>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
<view class="inspect_overview_list">
|
||||
<van-row>
|
||||
<van-col span="6"><text class="color_orange">人员类型</text></van-col>
|
||||
<van-col span="18" class="color_orange">{{infoData.specialTypeName}}</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 class="safety_issue_number" span="18" style="padding:0;">{{infoData.credentialNumber}}</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.phoneNumber}}</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.credentialExpirationTime}}</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.deptName}}
|
||||
</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.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">{{infoData.createTime}}</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</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>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/* pageage/project_checking/info/index.wxss */
|
||||
.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;
|
||||
}
|
|
@ -0,0 +1,151 @@
|
|||
// pageage/safetyManagement/securityCheckGR/index.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
deptId:"",
|
||||
loginName:"",
|
||||
userName:"",
|
||||
projectId:"",
|
||||
projectData:{},
|
||||
projectNameArgs:"",
|
||||
initData: {},
|
||||
show:false,
|
||||
listData:[],
|
||||
request:app.globalData.reqUrl
|
||||
},
|
||||
|
||||
onClose(){
|
||||
this.setData({ show: false });
|
||||
},
|
||||
showPopup() {
|
||||
this.setData({ show: true });
|
||||
},
|
||||
|
||||
skipAdd(){
|
||||
wx.redirectTo({
|
||||
url: `../add/index?projectId=${this.data.initData.id}&projectName=${this.data.initData.text}`,
|
||||
})
|
||||
},
|
||||
|
||||
getInfo(e){
|
||||
let {id} = e.currentTarget.dataset.set
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success:res=>{
|
||||
this.setData({
|
||||
deptId:res.data.deptId,
|
||||
loginName:res.data.loginName,
|
||||
userName:res.data.userName,
|
||||
projectId:app.globalData.projectId,
|
||||
projectNameArgs:app.globalData.projectName,
|
||||
minRoleId:res.data.minRoleId,
|
||||
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
|
||||
})
|
||||
this.getListData(app.globalData.projectId,res.data.deptId,res.data.minRoleId);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询项目特种人员数据
|
||||
*/
|
||||
getListData(projectId,deptId,minRoleId) {
|
||||
var that = this;
|
||||
//判断角色,
|
||||
if(minRoleId==2||minRoleId==3||minRoleId==4){
|
||||
deptId=0;
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectSpecial/list',
|
||||
data: {
|
||||
"deptId":deptId,
|
||||
"projectId": projectId
|
||||
},
|
||||
method: "get",
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
listData:res.data.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/gengduogongneng/gengduogongneng',
|
||||
})
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e){
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.projectId = projectId;
|
||||
app.globalData.projectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"van-overlay": "@vant/weapp/overlay/index" ,
|
||||
"van-popup": "@vant/weapp/popup/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
|
@ -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>
|
||||
<view class="max_content">
|
||||
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
|
||||
<view class="inspect_max">
|
||||
<view class="inspect_list">
|
||||
<view class="inspect_for" 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 < 9 ?'0'+(index+1):(index+1)}}</view>
|
||||
<view class="module_title module_title_flex inspect_list_title_text"> {{' '+item.credentialNumber}}</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.credentialType != 'PDF'}}" width="120rpx" height="120rpx" fit="cover" src="{{request+item.mainImage+'.min.jpg'}}"/>
|
||||
<van-image wx:if="{{item.credentialType == 'PDF'}}" width="120rpx" height="120rpx" fit="cover" src="https://cf.makalu.cc/profile/wechat/icon/pdf.png"/>
|
||||
</view>
|
||||
<view class="inspect_list_info_data">
|
||||
<view class="inspect_list_info_data_prop color_blue">人员姓名:{{item.name}}</view>
|
||||
<view class="inspect_list_info_data_prop color_orange">人员类型:{{item.specialTypeName}}</view>
|
||||
<view class="inspect_list_info_data_prop">证书过期时间:{{item.credentialExpirationTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="../../../images/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view></view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* pageage/project_checking_list/project_checking_list.wxss */
|
|
@ -26,6 +26,7 @@ Page({
|
|||
projectDeptList:[],
|
||||
navs:[],
|
||||
deptNames:"",
|
||||
fileType:["doc","docx","xls","xlsx","ppt","pptx","txt","pdf","png","jpg","jpeg","mp4"]
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -112,7 +113,6 @@ Page({
|
|||
})
|
||||
let that = this
|
||||
let {projectId,projectName,loginName,imageInfoData,trainType,trainTitle,trainParticipants,beginDate,trainContent,trainFileData,minTitle,deptId} = that.data;
|
||||
debugger
|
||||
//数据效验
|
||||
if(projectId==""||loginName==""){
|
||||
app.toast("数据异常,请刷新页面重试!")
|
||||
|
@ -163,6 +163,16 @@ Page({
|
|||
});
|
||||
return;
|
||||
}
|
||||
let _fileType = trainFileData[0].path.split('.');
|
||||
_fileType = _fileType[_fileType.length-1].toLowerCase();
|
||||
//判断附件类型,如果是图片直接展示,非图片则显示附件
|
||||
if(this.data.fileType.indexOf(_fileType)==-1){
|
||||
app.toast("当前 [ "+_fileType+" ] 文件不支持上传!")
|
||||
that.setData({
|
||||
loadShow:false
|
||||
});
|
||||
return;
|
||||
}
|
||||
let fileUrls = [];
|
||||
imageInfoData.forEach(async (item)=>{
|
||||
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
|
||||
|
@ -178,7 +188,6 @@ Page({
|
|||
this.data.navs.forEach((it)=>{
|
||||
depts.push({deptId:that.data.projectDeptList[it].unitId});
|
||||
});
|
||||
debugger
|
||||
let params = {
|
||||
projectId,
|
||||
projectName,
|
||||
|
|
|
@ -67,6 +67,11 @@
|
|||
</view>
|
||||
<van-popup position="bottom" show="{{ showDept }}" bind:close="onCloseDept">
|
||||
<view class="max_tab_name">
|
||||
<view class="option_list_title">
|
||||
<view class="option_list_title_btn" bindtap="onCloseDept">取消</view>
|
||||
<view>请选择协作团队</view>
|
||||
<view class="option_list_title_btn" bindtap="onCloseDept">确认</view>
|
||||
</view>
|
||||
<view wx:for="{{projectDeptList}}" wx:key="index" data-index="{{index}}" bindtap="changeDept" data-name="{{item.deptName}}" data-id="{{item.deptId}}" class="font_color {{ item.state=='1' ? 'active' :' '}}">{{item.deptName}}</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
|
|
|
@ -34,3 +34,13 @@
|
|||
font-weight: 600;
|
||||
color: #14feff
|
||||
}
|
||||
.option_list_title{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.option_list_title_btn{
|
||||
color: #1989fa;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<view class="option_list_title_btn" bindtap="onClose">取消</view>
|
||||
<view>{{placeholder}}</view>
|
||||
<view class="option_list_title_btn" bindtap="onConfirm">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-picker columns="{{ columns }}" bind:change="onSelectChange" custom-class="time_select_style" default-index="{{index}}"
|
||||
column-class="time_list_style" active-class="time_active_style" toolbar-class="toolbar_style" visible-item-count="5" />
|
||||
</van-popup>
|
||||
|
|
|
@ -55,10 +55,11 @@ Page({
|
|||
},
|
||||
success:(res)=>{
|
||||
res = res.data;
|
||||
this.onClickHide();
|
||||
this.onClickHide();
|
||||
this.setData({
|
||||
openId:res.data.openid,
|
||||
})
|
||||
wx.setStorageSync('openId', res.data.openid)
|
||||
//验证登录用户
|
||||
this.selectUserInfoByOpenId(res.data.openid);
|
||||
}
|
||||
|
@ -80,7 +81,6 @@ Page({
|
|||
}
|
||||
this.onClickShow();
|
||||
var that = this;
|
||||
wx.setStorageSync('openId', openId)
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl+'/wechat/openIdLogin',
|
||||
data:{
|
||||
|
@ -119,13 +119,15 @@ Page({
|
|||
url: '../map/map',
|
||||
})
|
||||
}
|
||||
}else{
|
||||
that.onClickHide();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//登录
|
||||
userLogin:function(){
|
||||
userLogin:function(openid){
|
||||
var that = this;
|
||||
var username = that.data.username;
|
||||
var password = that.data.password;
|
||||
|
@ -137,9 +139,13 @@ Page({
|
|||
app.toast("密码不能为空");
|
||||
return;
|
||||
}
|
||||
if(!that.data.openId){
|
||||
app.toast("获取微信小程序授权失败,请重启应用或微信再试!如果还是授权失败,请删除应用后再试...");
|
||||
return;
|
||||
let openId = that.data.openId
|
||||
if(openId==""){
|
||||
openId = wx.getStorageSync("openId");
|
||||
if(openId==""){
|
||||
app.toast("获取微信授权失败,请卸载后重新进入应用!!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//启动蒙版
|
||||
that.onClickShow();
|
||||
|
@ -149,7 +155,7 @@ Page({
|
|||
data:{
|
||||
"username":username,
|
||||
"password":password,
|
||||
"openId":that.data.openId,
|
||||
"openId":openId,
|
||||
},
|
||||
method:"POST",
|
||||
success(res){
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
<!--pages/login/login.wxml-->
|
||||
|
||||
<view class="login_logo" style="text-align: center;padding-top: 30rpx;">
|
||||
<image src="https://cf.makalu.cc/profile/wechat/logo.png" style="width:550rpx;height:190rpx;"></image>
|
||||
</view>
|
||||
|
||||
<view class="login_title">
|
||||
<text>北跨泾河-产发工程数字管理平台</text>
|
||||
</view>
|
||||
|
||||
<view class="login_bg">
|
||||
<view class="login_dl">登录</view>
|
||||
<view class="login_ex">产发工程数字管理平台,请使用手机号登录</view>
|
||||
<view class="login_input">
|
||||
<input placeholder="输入账户号码" placeholder-style="color:#5e6ea2" bindblur="name"/>
|
||||
</view>
|
||||
<view class="login_input">
|
||||
<input placeholder="输入账户密码" placeholder-style="color:#5e6ea2" password="true" bindblur="psw"/>
|
||||
<input placeholder="输入账户密码" placeholder-style="color:#5e6ea2" password="true" bindinput="psw"/>
|
||||
</view>
|
||||
|
||||
|
||||
|
|
|
@ -3,21 +3,20 @@ page{
|
|||
background: #191d28 url("http://fileimg.makalu.cc/CORE_40247DD946964A15AA0D4000E1031E19.png") no-repeat bottom/100%;
|
||||
}
|
||||
.login_title{
|
||||
height: 200rpx;
|
||||
padding:0 50rpx;
|
||||
line-height: 200rpx;
|
||||
height: 180rpx;
|
||||
line-height: 180rpx;
|
||||
color: #728ce3;
|
||||
font-size: 45rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.login_title text{
|
||||
border-bottom: 3px solid #728ce3;
|
||||
}
|
||||
.login_bg{
|
||||
|
||||
border-radius: 20rpx;
|
||||
margin: 0 40rpx;
|
||||
padding: 80rpx 40rpx;
|
||||
padding: 25rpx 40rpx;
|
||||
}
|
||||
.login_dl{
|
||||
color: #ffffff;
|
||||
|
@ -28,6 +27,7 @@ page{
|
|||
padding:20rpx 0;
|
||||
font-size: 28rpx;
|
||||
color: #8ca4ee;
|
||||
text-align: center;
|
||||
}
|
||||
.login_input{
|
||||
margin-top: 50rpx;
|
||||
|
|
Loading…
Reference in New Issue