Commit 2b3f20c1 authored by xinzhedeai's avatar xinzhedeai

天虹小程序 init lcl-v1 可用版

parent 6a1334d6
Pipeline #507 failed with stages
......@@ -276,6 +276,7 @@ Page({
delete formData.imgrecturl
delete formData.hdFilePath
delete formData.rectFilePath
delete formData.entryDate
if (!formData.hdInspectDate) {
delete formData.hdInspectDate
}
......@@ -350,6 +351,7 @@ Page({
delete formData.imgrecturl
delete formData.hdFilePath
delete formData.rectFilePath
delete formData.entryDate
if (!formData.hdInspectDate) {
delete formData.hdInspectDate
}
......
......@@ -70,27 +70,36 @@ Page({
recDeadLine:'',
// 整改评价
recEvaluation:'',
//录入日期
entryDate:'xcx',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.companyId = app.globalData.currentEnter.companyId
console.log(this.data,this.data.comment,11111111111111)
this.data.companyId = app.globalData.currentEnter.companyId;
console.log(this.formatDate())
const hdInspect = this.formatDate()
this.setData({
hdInspectDate:hdInspect
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
wx.setNavigationBarTitle({
title: '新增隐患',
})
......@@ -152,6 +161,28 @@ Page({
*/
onShareAppMessage: function () {
},
formatDate() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
formatDate1() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
//安全类别
chooseSecType(e){
......@@ -270,7 +301,7 @@ Page({
this.setData({
hdName: this.data.hdName,
basis: this.data.secCheckDiscover[event.detail.value].basis,
suggestion: this.data.secCheckDiscover[event.detail.value].suggestion
// suggestion: this.data.secCheckDiscover[event.detail.value].suggestion
})
},
/**
......@@ -397,7 +428,12 @@ Page({
},
// 提交隐患
submitDanger() {
console.log(this.data.comment,this.data.imgrecturl,'this.data.comment')
const entryDate = this.formatDate1()
this.setData({
entryDate:entryDate
})
console.log(this.data,'this.data')
if (this.data.comment===""||this.data.comment===undefined||this.data.comment===null||this.data.comment.trim().length === 0||/^\r*$/.test(this.data.comment)) {
wx.showToast({
title: '未填写隐患描述',
......@@ -443,7 +479,7 @@ Page({
delete formData.comment
}
if (formData.hdInspectDate) {
formData.hdInspectDate += ' 00:00:00'
formData.hdInspectDate
} else {
delete formData.hdInspectDate
}
......@@ -454,7 +490,7 @@ Page({
delete formData.hdRectificationDate
}
console.log(formData,'formData')
wx.uploadFile({
filePath: this.data.hdFilePath,
name: 'hdPic',
......@@ -516,7 +552,7 @@ Page({
delete formData.hdFilePath
delete formData.rectFilePath
if (formData.hdInspectDate) {
formData.hdInspectDate += ' 00:00:00'
formData.hdInspectDate
} else {
delete formData.hdInspectDate
}
......@@ -539,7 +575,6 @@ Page({
},
data: this.formatFormData(formData),
success: (res) => {
console.log(res, '上传成功了吗afhdhsfhhdsfhadsf')
if (res.statusCode === 201) {
wx.showToast({
title: '上传成功',
......
......@@ -3,11 +3,15 @@
<view class="danger-form-wrapper">
<view class="danger-check-date">
<text>检查日期:</text>
<picker class="danger-pick-date" mode="date" value="{{hdInspectDate}}" bindchange="selectCheckDate">
<!-- <picker class="danger-pick-date" mode="date" value="{{hdInspectDate}}" bindchange="selectCheckDate">
<view class="current-picker">
当前选择: {{hdInspectDate}}
</view>
</picker>
</picker> -->
<view class="current-picker">
{{hdInspectDate}}
</view>
</view>
<view class="danger-expert">
......
......@@ -65,13 +65,9 @@
box-shadow: 1rpx 2rpx 2rpx 2rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.company-name {
font-size: 36rpx;
line-height: 29rpx;
height: 50rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
font-size: 36rpx;
justify-content: start;
}
.company-per {
margin-top: 15rpx;
......
......@@ -17,7 +17,7 @@
<view class="info-card-icon law-icon"></view>
</view>
<view class="info-card info-right advice-wrapper" bindtap="linkToAdvice">
<view class="info-card-title">通知公告</view>
<view class="info-card-title">重要工作部署</view>
<view class="info-card-icon advice-icon"></view>
</view>
</view>
......
......@@ -44,7 +44,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.18.0",
"appid": "wxe009b5c8f819efb8",
"appid": "wx1f2b920d2d2232e0",
"projectname": "%E5%A4%A9%E5%BC%98%E8%B4%A8%E9%87%8F%E6%A3%80%E6%B5%8B",
"condition": {
"search": {
......
......@@ -7,7 +7,7 @@
"list": [
{
"name": "pages/person/person",
"pathName": "pages/person/person",
"pathName": "pages/dangerregister/dangerregister",
"query": "",
"launchMode": "default",
"scene": null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment