提交代码

main
姜玉琦 2023-09-01 02:28:39 +08:00
parent 8d0666cab2
commit ec75545ed1
42 changed files with 2818 additions and 25 deletions

View File

@ -96,7 +96,14 @@
"project_special/info/index",
"project_measure/list/index",
"project_measure/add/index",
"project_measure/info/index"
"project_measure/info/index",
"project_materialSeal/list/index",
"project_materialSeal/add/index",
"project_materialSeal/info/index",
"project_checkDetection/list/index",
"project_checkDetection/add/index",
"project_checkDetection/info/index",
"project_checkDetection/check/index"
],
"independent": false
}

View File

@ -1499,6 +1499,14 @@ swiper-item video{
margin-bottom: 15rpx;
margin-left: -3rpx;
}
.code_label_2{
font-size: 0.6rem;
width: 120rpx;
margin: auto;
text-align: center;
padding: 0.1rem;
border-radius: 0.5rem 0 0.5rem 0;
}
.code_label_green{
background: green;
color: #FFFFFF;

View File

@ -0,0 +1,355 @@
// pageage/safetyManagement/addSafetyInspect/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
currentDate:new Date().getTime(),
deptId:"",
projectId:"",
projectName:"",
loginName:"",
rectifierData:[],
loadShow:false,
checkTypeList:[],
checkType:"1",
materialName:"",
usePosition:"",
sampleNum:"",
qualifiedFlag:"Y",
witnessUser:"",
witnessUserName:"",
checkTime:"",
laboratoryName:"",
qualifiedFlagList:[{id:'Y',text:"是"},{id:'N',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.getAllProjectUserData();
this.getTypeList();
}
})
},
//查询项目人员数据
getAllProjectUserData(){
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
})
}
}
})
},
getTypeList(){
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectDetection/queryType',
method:"get",
data:{},
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({
checkTypeList:list
})
}
}
})
},
//材料名称
onInputMaterialNameValue(e){
let materialName = e.detail.value
this.setData({
materialName
})
},
//使用部位
onInputUsePositionValue(e){
let usePosition = e.detail.value
this.setData({
usePosition
})
},
//取样数量
onInputSampleNumValue(e){
let sampleNum = e.detail.value
this.setData({
sampleNum
})
},
//送检实验室名称
onInputLaboratoryNameValue(e){
let laboratoryName = e.detail.value
this.setData({
laboratoryName
})
},
//验收时间
onInputTime(e){
let checkTime = e.detail
this.setData({
checkTime
})
},
//添加抄送人
onAddSend(e){
if(e.detail.length>0){
let phoneNumbers="";
let userNames="";
e.detail.forEach(it =>{
phoneNumbers+=","+it.phoneNumber;
userNames+=","+it.userName;
});
this.setData({
witnessUserName:userNames.substring(1),
witnessUser:phoneNumbers.substring(1)
})
}else{
this.setData({
witnessUser:"",
witnessUserName:""
})
}
},
//取消页面
cancelSaveView(){
this.returnToPage()
},
//保存
onSubmitSave(){
this.setData({
loadShow:true
})
let that = this
let {projectId,deptId,checkType,
materialName,
usePosition,
sampleNum,
qualifiedFlag,
witnessUser,
witnessUserName,
checkTime,
laboratoryName,loginName} = that.data;
//数据效验
if(projectId==""||loginName==""||deptId==""){
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
})
return;
}
if(checkType==""){
app.toast("请选择送检类型!")
that.setData({
loadShow:false
})
return;
}
if(materialName==""){
app.toast("请填写材料名称!")
that.setData({
loadShow:false
})
return;
}
if(sampleNum==""){
app.toast("请填写取样数量!")
that.setData({
loadShow:false
})
return;
}
if(usePosition==""){
app.toast("请填写使用部位!")
that.setData({
loadShow:false
})
return;
}
if(qualifiedFlag==""){
app.toast("请选择是否提供合格证!")
that.setData({
loadShow:false
})
return;
}
if(qualifiedFlag==""){
app.toast("请选择是否提供合格证!")
that.setData({
loadShow:false
})
return;
}
if(witnessUser==""||witnessUserName==""){
app.toast("请选择见证人!")
that.setData({
loadShow:false
})
return;
}
if(checkTime==""){
app.toast("请选择送检时间!")
that.setData({
loadShow:false
})
return;
}
if(laboratoryName==""){
app.toast("请填写送检实验室名称!")
that.setData({
loadShow:false
})
return;
}
let params = {
projectId,
deptId,
checkType,
materialName,
usePosition,
sampleNum,
qualifiedFlag,
witnessUser,
witnessUserName,
checkTime:checkTime+":00",
laboratoryName,
createBy:loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/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)
}
}
})
},
//选择检测类型
onSelectCheckType(e){
this.setData({
checkType:e.detail.id
})
},
//选择是否提供合格证
onSelectQualifiedFlag(e){
this.setData({
qualified:e.detail.id
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

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

View File

@ -0,0 +1,129 @@
<!--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">
<voucher-select columns="{{checkTypeList}}" placeholder="请选择送检类型" bindchange="onSelectCheckType" ></voucher-select>
</view>
</view>
<view class="inspect_info_list" >
<view class="inspect_info_title">材料名称</view>
<view class="inspect_info_content">
<input placeholder="请填写材料名称" bindblur="onInputMaterialNameValue" placeholder-style="color:#6777aa;" maxlength="100" class="inspect_input_fill_in" />
</view>
</view>
<view class="inspect_info_list" >
<view class="inspect_info_title">取样数量</view>
<view class="inspect_info_content">
<input placeholder="请填写取样数量" bindblur="onInputSampleNumValue" placeholder-style="color:#6777aa;" maxlength="100" class="inspect_input_fill_in" />
</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="onInputUsePositionValue" maxlength="200"/>
</view>
</view>
<view class="inspect_info_list" >
<view class="inspect_info_title">是否提供合格证</view>
<view class="inspect_info_content">
<voucher-select columns="{{qualifiedFlagList}}" placeholder="请选择是否提供合格证" bindchange="onSelectQualifiedFlag" ></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">
<select-group-person rectifierData="{{rectifierData}}" multiple="{{true}}" bindselected="onAddSend" index="{{0}}" title="请选择见证人">
</select-group-person>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title">送检时间</view>
<view class="inspect_info_content">
<voucher-datetime counts="5" currentDate="{{currentDate}}" 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">
<input placeholder="请填写实验室名称" bindblur="onInputLaboratoryNameValue" placeholder-style="color:#6777aa;" maxlength="100" class="inspect_input_fill_in" />
</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="/images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,7 @@
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}

View File

@ -0,0 +1,323 @@
// pageage/project_checking/info/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:"",
infoData:{},
loadShow:false,
loginName:"",
showDel:false,
detectionImageList:[],
minDetectionFileImages:[],
detectionFiles:[],
list:[{id:1,text:"合格"},{id:2,text:"不合格"}],
detectionResult:"1",
detectionFileData:[],
fileType:["pdf","png","jpg","jpeg"],
request:app.globalData.reqUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {id} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
id,
loginName:res.data.loginName
})
this.getInfo();
}
})
},
//取消页面
cancelSaveView(){
this.returnToPage()
},
/**
* 获取安全检查详情信息
*
*/
getInfo(){
let {id} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectDetection/info',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200){
let imageUrls = [];
let minImageUrls = [];
let fileUrls = [];
//判断附件
if(res.data.detectionFile){
res.data.detectionFile.split(',').forEach(element => {
let _file = element.split('.');
_file = _file[_file.length-1].toLocaleUpperCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if(_file=="PNG"||_file=="JPG"||_file=="JPEG"){
imageUrls.push(that.data.request+element);
minImageUrls.push(that.data.request+element+'.min.jpg');
}else{
fileUrls.push(element);
}
});
}
that.setData({
infoData:res.data,
detectionImageList:imageUrls,
minDetectionFileImages:minImageUrls,
detectionFiles:fileUrls,
loadShow:false
})
//判断当前能否删除
if(res.data.createBy==that.data.loginName){
that.setData({
showDel:true
})
}
}
}
})
},
//保存
onSubmitSave(){
this.setData({
loadShow:true
})
let that = this
let {id,detectionResult,detectionFileData,loginName} = that.data;
//数据效验
if(id==""||loginName==""){
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
})
return;
}
if(detectionResult==""){
app.toast("请选择检测结果!")
that.setData({
loadShow:false
})
return;
}
if(detectionFileData.length==0){
app.toast("请上传检测报告!")
that.setData({
loadShow:false
})
return;
}
let _fileType = detectionFileData[0].path.split('.');
_fileType = _fileType[_fileType.length-1].toLowerCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if(this.data.fileType.indexOf(_fileType)==-1){
app.toast("检测报告不支持 [ "+_fileType+" ] 格式!")
that.setData({
loadShow:false
});
return;
}
detectionFileData.forEach(async (item)=>{
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
let uploadName = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl,item.path,uploadName);
let params = {
id,
checkState:"2",
detectionResult,
detectionFile:obj.data.fileName,
updateBy:loginName
}
wx.request({
url: app.globalData.reqUrl + "/wechat/projectDetection/edit",
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)
}
});
})
},
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
wx.request({
url: app.globalData.reqUrl+'/wechat/projectDetection/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]
})
},
//选择检测类型
onSelect(e){
this.setData({
detectionResult:e.detail.id
})
},
fileUpload(options){
let file=options.detail;
this.setData({
detectionFileData: file
});
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

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

View File

@ -0,0 +1,126 @@
<!--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_blue">送检类型</text></van-col>
<van-col span="18" class="color_blue">{{infoData.checkTypeName}}</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.materialName}}</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.sampleNum}}</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.usePosition}}</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.qualifiedFlag=='Y'}}" class="color_green">已提供</text>
<text wx:else>未提供</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.witnessUserName}}</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.checkTime}}</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.laboratoryName}}</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="inspect_overview" wx:if="{{infoData.detectionResult==nulll}}">
<view class="safety_inspect_title module_title_flex module_title_padding">
<view>登记取样复试结果</view>
</view>
<view class="inspect_info">
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">检测结果</view>
<view class="inspect_info_content">
<voucher-select columns="{{list}}" placeholder="请选择检测结果" bindchange="onSelect" ></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">检测报告
<text style="font-size: small;">[可上传PDF和图片格式]</text>
</view>
<view class="inspect_info_content">
<file-uploader-all bindfiles="fileUpload" limit="{{1}}"></file-uploader-all>
</view>
</view>
</view>
</view>
<view class="problem_submit_to" wx:if="{{showDel}}">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</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="/images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -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;
}

View File

@ -0,0 +1,190 @@
// pageage/project_checking/info/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:"",
infoData:{},
loadShow:false,
loginName:"",
showDel:false,
detectionImageList:[],
minDetectionFileImages:[],
detectionFiles:[],
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/projectDetection/info',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200){
let imageUrls = [];
let minImageUrls = [];
let fileUrls = [];
//判断附件
if(res.data.detectionFile){
res.data.detectionFile.split(',').forEach(element => {
let _file = element.split('.');
_file = _file[_file.length-1].toLocaleUpperCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if(_file=="PNG"||_file=="JPG"||_file=="JPEG"){
imageUrls.push(that.data.request+element);
minImageUrls.push(that.data.request+element+'.min.jpg');
}else{
fileUrls.push(element);
}
});
}
that.setData({
infoData:res.data,
detectionImageList:imageUrls,
minDetectionFileImages:minImageUrls,
detectionFiles:fileUrls,
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
wx.request({
url: app.globalData.reqUrl+'/wechat/projectDetection/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]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
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,139 @@
<!--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_blue">送检类型</text></van-col>
<van-col span="18" class="color_blue">{{infoData.checkTypeName}}</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.materialName}}</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.sampleNum}}</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.usePosition}}</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.qualifiedFlag=='Y'}}" class="color_green">已提供</text>
<text wx:else>未提供</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.witnessUserName}}</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.checkTime}}</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.laboratoryName}}</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="inspect_overview" wx:if="{{infoData.detectionResult!=nulll}}">
<view class="safety_inspect_title module_title_flex 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">{{infoData.updateBy}}</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.updateTime}}</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.detectionResult==1}}" class="color_green" style="font-weight: 700;">合格</text>
<text wx:if="{{infoData.detectionResult==2}}" style="color: red;font-weight: 700;">不合格</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">
<view class="in-img-div" wx:if="{{minDetectionFileImages.length>0}}" wx:for="{{minDetectionFileImages}}" wx:key="index">
<image bindtap='showDetectionFileImg' data-index="{{index}}" src='{{item}}'></image>
</view>
<view class="in-img-div" wx:if="{{detectionFiles.length>0}}">
<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>
</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,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;
}

View File

@ -0,0 +1,201 @@
// pageage/safetyManagement/securityCheckGR/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
projectId:"",
minRoleId:"",
projectData:{},
initData: {},
show:false,
listData:[],
activeState:"sjz",
sjzCount:0,
ywcCount:0,
request:app.globalData.reqUrl
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
getInfo(e){
let {id,checkState} = e.currentTarget.dataset.set
if(checkState=="1"){
wx.redirectTo({
url: `../check/index?id=${id}`,
})
}else{
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,
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,
"activeName":that.data.activeState
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/list',
data:param,
method: "get",
success: function (res) {
that.setData({
listData:res.data.data
})
}
});
this.queryCount(projectId,deptId);
},
//查询统计
queryCount(projectId,deptId){
//查询统计数量
let param = {
"projectId": projectId,
"deptId":deptId,
"activeName":this.data.activeState
}
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/queryCount',
data: param,
method: "get",
success: function (res) {
let check1=0;
let check2=0;
if(res.data.data.check1){
check1+=res.data.data.check1;
}
if(res.data.data.check2){
check2+=res.data.data.check2;
}
that.setData({
sjzCount:check1,
ywcCount:check2
});
}
});
},
/**
* 标签切换
*/
typeJump(e){
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
nav = 'sjz';
}else if(index == 2){
nav = 'ywc';
}
this.setData({
activeState:nav
});
this.getListData(this.data.projectId,this.data.deptId,this.data.minRoleId);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index" ,
"van-popup": "@vant/weapp/popup/index"
},
"navigationStyle":"custom",
"navigationBarTitleText": "质量隐患排查"
}

View File

@ -0,0 +1,63 @@
<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="modify_video_nav" style="margin-top: 5rpx;">
<view class="{{activeState=='sjz'?'active':''}}" bindtap="typeJump" data-index="1"><text>送检中({{sjzCount}}</text></view>
<view class="{{activeState=='ywc'?'active':''}}" bindtap="typeJump" data-index="2"><text>已完成({{ywcCount}}</text></view>
</view>
<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.checkTime}}</view>
<view wx:if="{{item.detectionResult==null}}" class="code_label_2 code_label_blueviolet">送检中</view>
<view wx:if="{{item.detectionResult==1}}" class="code_label_2 code_label_green">合格</view>
<view wx:if="{{item.detectionResult==2}}" class="code_label_2 code_label_red">不合格</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.checkTypeName}}</text></view>
<view class="inspect_list_info_data_prop safety_issue_number color_orange">材料名称:<text>{{item.materialName}}</text></view>
<view class="inspect_list_info_data_prop">使用部位:<text>{{item.usePosition}}</text></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>
<view class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>

View File

@ -0,0 +1 @@
/* pageage/project_checking_list/project_checking_list.wxss */

View File

@ -0,0 +1,332 @@
// pageage/safetyManagement/addSafetyInspect/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
currentDate:new Date().getTime(),
deptId:"",
projectId:"",
projectName:"",
loginName:"",
imageInfoData:[],
materialName:"",
usePosition:"",
contractBrand:"",
useBrand:"",
sealDate:"",
signFileData:[],
alterationFileData:[],
limit:1,
showBgd:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {projectId,projectName} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
projectId,
projectName,
deptId:res.data.deptId,
loginName:res.data.loginName
})
}
})
},
// list 上传图片
onImagesArr(e){
var data = this.data.imageInfoData;
data = e.detail
this.setData({
imageInfoData:data
})
},
onImagesArrSignFiles(e){
var data = this.data.signFileData;
data = e.detail
this.setData({
signFileData:data
})
},
onImagesArrAlterationFiles(e){
var data = this.data.alterationFileData;
data = e.detail
this.setData({
alterationFileData:data
})
},
//取消页面
cancelSaveView(){
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index'
})
},
//保存
onSave(){
this.setData({
loadShow:true
})
let that = this
let {projectId,projectName,deptId,loginName,imageInfoData,materialName,
usePosition,contractBrand,useBrand,sealDate,signFileData,alterationFileData} = that.data;
debugger
//数据效验
if(projectId==""||loginName==""||deptId==""){
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
})
return;
}
if(imageInfoData.length==0){
app.toast("请上传封样现场图片!")
that.setData({
loadShow:false
})
return;
}
if(materialName==""){
app.toast("请填写封样名称!")
that.setData({
loadShow:false
})
return;
}
if(usePosition==""){
app.toast("请填写使用部位!")
that.setData({
loadShow:false
})
return;
}
if(contractBrand==""){
app.toast("请填写合同指定品牌!")
that.setData({
loadShow:false
})
return;
}
if(useBrand==""){
app.toast("请填写拟用品牌!")
that.setData({
loadShow:false
})
return;
}
if(sealDate==""){
app.toast("请选择封样时间!")
that.setData({
loadShow:false
})
return;
}
if(signFileData.length==0){
app.toast("请上传会签单照片!")
that.setData({
loadShow:false
});
return;
}
if(contractBrand.indexOf(useBrand)==-1 && alterationFileData.length==0){
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 signFile = await that.syncUploadImage(uploadUrl,signFileData[0],name);
//上传变更单
let alterationFilePath = "";
if(alterationFileData.length>0){
obj = await that.syncUploadImage(uploadUrl,alterationFileData[0],name);
alterationFilePath = obj.data.fileName
}
let params = {
projectId,
projectName,
deptId,
imageUrls:fileUrls.toString(),
materialName,
usePosition,
contractBrand,
useBrand,
sealDate:sealDate+":00",
signFiles:signFile.data.fileName,
alterationFiles:alterationFilePath,
createBy:loginName
}
wx.request({
url: app.globalData.reqUrl + "/wechat/projectMaterialSeal/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)
}
});
})
},
materialNameAction: function (options) {
this.data.materialName = options.detail.value;
},
usePositionAction: function (options) {
this.data.usePosition = options.detail.value
},
contractBrandAction: function (options) {
this.data.contractBrand = options.detail.value
this.showBgdLabel()
},
useBrandAction: function (options) {
this.data.useBrand = options.detail.value
this.showBgdLabel()
},
showBgdLabel(){
if(this.data.contractBrand!="" && this.data.useBrand!="" && this.data.contractBrand.indexOf(this.data.useBrand)==-1){
this.setData({
showBgd:true
})
}else{
this.setData({
showBgd:false
})
}
},
//演练训练时间
onInputTime(e){
let sealDate = e.detail
this.setData({
sealDate
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,12 @@
{
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col",
"van-popup": "@vant/weapp/popup",
"van-picker": "@vant/weapp/picker/index",
"van-area": "@vant/weapp/area/index",
"mkl-multi-select": "/components/@mkl/multi-select/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,130 @@
<!--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" data-index="{{0}}"></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">
<input placeholder="请填写封样名称" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" bindblur="materialNameAction" 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">
<textarea class="add_textarea" placeholder="请填写使用部位"
placeholder-style="color:#6777aa;" maxlength="800" bindblur="usePositionAction"/>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">合同指定品牌</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写合同指定品牌"
placeholder-style="color:#6777aa;" maxlength="800" bindblur="contractBrandAction"/>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">拟用品牌</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写拟用品牌"
placeholder-style="color:#6777aa;" maxlength="800" bindblur="useBrandAction"/>
</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}}" currentDate="{{currentDate}}" bindchange="onInputTime"></voucher-datetime>
</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="onImagesArrSignFiles" data-index="{{1}}" limit="{{limit}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list" wx:if="{{showBgd}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">变更单图片</view>
<view class="problem_list_info_con">
<file-uploader bindimages="onImagesArrAlterationFiles" data-index="{{2}}" limit="{{limit}}"></file-uploader>
<text class="safety_inspect_title module_title_flex">合同指定品牌和拟用品牌不一致时需要上传</text>
</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>

View File

@ -0,0 +1,46 @@
/* 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
}
.option_list_title{
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
}
.option_list_title_btn{
color: #1989fa;
font-size: 30rpx;
}

View File

@ -0,0 +1,288 @@
// pageage/project_checking/info/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:"",
infoData:{},
imageList:[],
minImageList:[],
loadShow:false,
loginName:"",
showDel:false,
signFileNames:[],
minSignFileImages:[],
signFileImages:[],
alterationFileNames:[],
minAlterationFileImages:[],
alterationFileImages:[],
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/projectMaterialSeal/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');
});
}
let fileNames = [];
let minFileImages = [];
let fileImages = [];
//判断附件
if(res.data.signFiles){
res.data.signFiles.split(',').forEach(element => {
let _file = element.split('.');
_file = _file[_file.length-1].toLocaleUpperCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if(_file=="PNG"||_file=="JPG"||_file=="JPEG"){
fileImages.push(that.data.request+element);
minFileImages.push(that.data.request+element+'.min.jpg');
}else{
fileNames.push(element);
}
});
}
let fileNames2 = [];
let minFileImages2 = [];
let fileImages2 = [];
//判断附件
if(res.data.alterationFiles){
res.data.alterationFiles.split(',').forEach(element => {
let _file = element.split('.');
_file = _file[_file.length-1].toLocaleUpperCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if(_file=="PNG"||_file=="JPG"||_file=="JPEG"){
fileImages2.push(that.data.request+element);
minFileImages2.push(that.data.request+element+'.min.jpg');
}else{
fileNames2.push(element);
}
});
}
that.setData({
signFileNames:fileNames,
minSignFileImages:minFileImages,
signFileImages:fileImages,
alterationFileNames:fileNames2,
minAlterationFileImages:minFileImages2,
alterationFileImages:fileImages2,
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/projectMaterialSeal/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]
})
},
//展示图片
showSignFileImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.sifnFileImages,
current: that.data.sifnFileImages[e.currentTarget.dataset.index]
})
},
//展示图片
showAlterationFileImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.alterationFileImages,
current: that.data.alterationFileImages[e.currentTarget.dataset.index]
})
},
downFile:function(e){
let idx = e.currentTarget.dataset['index'];
let that = this;
wx.downloadFile({
// 示例 url并非真实存在
url: that.data.request+that.data.signFileNames[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("暂不支持下载!如需下载请前往后台管理系统!!")
},
downFile2:function(e){
let idx = e.currentTarget.dataset['index'];
let that = this;
wx.downloadFile({
// 示例 url并非真实存在
url: that.data.request+that.alterationFileNames[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() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index"
},
"navigationStyle":"custom",
"navigationBarTitleText": "形象进度详情"
}

View File

@ -0,0 +1,117 @@
<!--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_blue">封样名称</text></van-col>
<van-col span="18" class="color_blue">{{infoData.materialName}}</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.usePosition}}</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.contractBrand}}</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.useBrand}}</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.sealDate}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.signFiles!=null && infoData.signFiles!=''}}">
<van-row>
<van-col span="6"><text class="color_purple" style="letter-spacing: 15rpx;">会签单</text></van-col>
<van-col span="18">
<view class="in-img-div" wx:if="{{minSignFileImages.length>0}}" wx:for="{{minSignFileImages}}" wx:key="index">
<image bindtap='showSignFileImg' data-index="{{index}}" src='{{item}}'></image>
</view>
<view class="in-img-div" wx:if="{{signFileNames.length>0}}">
<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>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.alterationFiles!=null && infoData.alterationFiles!=''}}">
<van-row>
<van-col span="6"><text class="color_purple" style="letter-spacing: 15rpx;">变更单</text></van-col>
<van-col span="18">
<view class="in-img-div" wx:if="{{minAlterationFileImages.length>0}}" wx:for="{{minAlterationFileImages}}" wx:key="index">
<image bindtap='showAlterationFileImg' data-index="{{index}}" src='{{item}}'></image>
</view>
<view class="in-img-div" wx:if="{{alterationFileNames.length>0}}">
<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>
</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>

View File

@ -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;
}

View File

@ -0,0 +1,139 @@
// pageage/safetyManagement/securityCheckGR/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
projectId:"",
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,
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;
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMaterialSeal/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() {
}
})

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,60 @@
<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.sealDate}}</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="{{request+item.mainImage+'.min.jpg'}}"/>
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">封样名称:<text class="color_blue">{{item.materialName}}</text></view>
<view class="inspect_list_info_data_prop color_orange">使用部位:<text class="color_orange">{{item.usePosition}}</text></view>
<view class="inspect_list_info_data_prop color_purple">拟用品牌:<text>{{item.useBrand}}</text></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>

View File

@ -0,0 +1 @@
/* pageage/project_checking_list/project_checking_list.wxss */

View File

@ -7,6 +7,7 @@ Page({
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
currentDate:new Date().getTime(),
deptId:"",
projectId:"",
projectName:"",

View File

@ -66,7 +66,7 @@
<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>
<voucher-datetime counts="5" placeholder="请选择测量时间" maxDate="{{maxDate}}" currentDate="{{currentDate}}" bindchange="onInputTime"></voucher-datetime>
</view>
</view>
<view class="inspect_info_list">

View File

@ -176,8 +176,8 @@ Page({
onAddRecheckSend(e){
if(e.detail.length>0){
this.setData({
recheckSend:e.detail[0].phoneNumber,
recheckSendUser:e.detail[0].userName
recheckSend:e.detail[0].userName,
recheckSendUser:e.detail[0].phoneNumber
})
}
},

View File

@ -176,8 +176,8 @@ Page({
onAddRecheckSend(e){
if(e.detail.length>0){
this.setData({
recheckSend:e.detail[0].phoneNumber,
recheckSendUser:e.detail[0].userName
recheckSend:e.detail[0].userName,
recheckSendUser:e.detail[0].phoneNumber
})
}
},

View File

@ -247,8 +247,8 @@ Page({
this.data.credentialNumber = options.detail.value
},
fileUpload(a,b,c){
let file=a.detail;
fileUpload(options){
let file=options.detail;
this.setData({
credentialFileData: file
});

View File

@ -53,7 +53,9 @@
</view>
</view>
<view class="inspect_info_list" style="width: 100%;">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">证书附件</view>
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">证书附件
<text style="font-size: small;">[可上传PDF和图片格式]</text>
</view>
<view class="problem_list_info_con">
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}"></file-uploader-all>
</view>

View File

@ -48,7 +48,9 @@
</view>
</view>
<view class="inspect_info_list" style="width: 100%;">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">相关文件</view>
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">相关文件
<text style="font-size: small;">[可上传PDF/图片/WORD/PPT/XLS格式]</text>
</view>
<view class="problem_list_info_con">
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}"></file-uploader-all>
</view>

View File

@ -6,9 +6,8 @@
</view>
<!-- </van-sticky> -->
<view class="deep_point_position" style="padding:40rpx 0 0">
<view class="{{statePosit == 1?'active':''}}" bindtap="onStatePosit" data-state="1">待送检(<text>{{prepareDataList.length}}</text>)</view>
<view class="{{statePosit == 2?'active':''}}" bindtap="onStatePosit" data-state="2">检验中(<text>{{underwayDataList.length}}</text>)</view>
<view class="{{statePosit == 3?'active':''}}" bindtap="onStatePosit" data-state="3">已完成(<text>{{finishDataList.length}}</text>)</view>
<view class="{{statePosit == 1?'active':''}}" bindtap="onStatePosit" data-state="1">送检中(<text>{{prepareDataList.length}}</text>)</view>
<view class="{{statePosit == 2?'active':''}}" bindtap="onStatePosit" data-state="2">已完成(<text>{{finishDataList.length}}</text>)</view>
</view>
<view class="inspect_max">
<view class="module_title module_title_flex">

View File

@ -3,7 +3,7 @@
<!-- 上传图片 -->
<view class="file">
<view class="files" wx:for="{{uploaderList}}" wx:key="index">
<text data-index="{{index}}">{{item.name}}</text>
<text data-index="{{index}}" style="word-wrap: break-word;">{{item.name}}</text>
<view class="in-delete" bindtap='clearImg' data-index="{{index}}">×</view>
</view>

View File

@ -1,7 +1,7 @@
<!--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 class="login_logo">
<image src="https://cf.makalu.cc/profile/wechat/logo2.png"></image>
</view>
<view class="login_title">

View File

@ -50,6 +50,16 @@ page{
.login_btn:active{
margin:82rpx 55rpx 0;
}
.login_logo{
width: 100%;
height:150rpx;
text-align: center;
padding-top: 100rpx;
}
.login_logo image{
width: 77%;
height: 130rpx;
}

View File

@ -631,25 +631,25 @@ Page({
//跳转到安全管控
XMSP:function(){
app.toast("敬请期待!");
wx.redirectTo({
url:'../newAddPage/safetyManagement/index'
})
// wx.redirectTo({
// url:'../newAddPage/safetyManagement/index'
// })
},
//跳转到质量管理
ZLGL2:function(){
app.toast("敬请期待!");
wx.redirectTo({
url:'../Quality-Assurance/index'
})
// wx.redirectTo({
// url:'../Quality-Assurance/index'
// })
},
//跳转到进度管理
JDGL2:function(){
app.toast("敬请期待!");
wx.redirectTo({
// wx.redirectTo({
// //url: '../deepExcavation/index'
url:'../../pageage/Progress-management/index'
})
// url:'../../pageage/Progress-management/index'
// })
},
//跳转到更多功能