Commit 2b3f20c1 authored by xinzhedeai's avatar xinzhedeai

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

parent 6a1334d6
Pipeline #507 failed with stages
...@@ -276,6 +276,7 @@ Page({ ...@@ -276,6 +276,7 @@ Page({
delete formData.imgrecturl delete formData.imgrecturl
delete formData.hdFilePath delete formData.hdFilePath
delete formData.rectFilePath delete formData.rectFilePath
delete formData.entryDate
if (!formData.hdInspectDate) { if (!formData.hdInspectDate) {
delete formData.hdInspectDate delete formData.hdInspectDate
} }
...@@ -350,6 +351,7 @@ Page({ ...@@ -350,6 +351,7 @@ Page({
delete formData.imgrecturl delete formData.imgrecturl
delete formData.hdFilePath delete formData.hdFilePath
delete formData.rectFilePath delete formData.rectFilePath
delete formData.entryDate
if (!formData.hdInspectDate) { if (!formData.hdInspectDate) {
delete formData.hdInspectDate delete formData.hdInspectDate
} }
......
...@@ -70,27 +70,36 @@ Page({ ...@@ -70,27 +70,36 @@ Page({
recDeadLine:'', recDeadLine:'',
// 整改评价 // 整改评价
recEvaluation:'', recEvaluation:'',
//录入日期
entryDate:'xcx',
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.data.companyId = app.globalData.currentEnter.companyId this.data.companyId = app.globalData.currentEnter.companyId;
console.log(this.data,this.data.comment,11111111111111) console.log(this.formatDate())
const hdInspect = this.formatDate()
this.setData({
hdInspectDate:hdInspect
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '新增隐患', title: '新增隐患',
}) })
...@@ -152,6 +161,28 @@ Page({ ...@@ -152,6 +161,28 @@ Page({
*/ */
onShareAppMessage: function () { 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){ chooseSecType(e){
...@@ -270,7 +301,7 @@ Page({ ...@@ -270,7 +301,7 @@ Page({
this.setData({ this.setData({
hdName: this.data.hdName, hdName: this.data.hdName,
basis: this.data.secCheckDiscover[event.detail.value].basis, 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({ ...@@ -397,7 +428,12 @@ Page({
}, },
// 提交隐患 // 提交隐患
submitDanger() { 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)) { 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({ wx.showToast({
title: '未填写隐患描述', title: '未填写隐患描述',
...@@ -443,7 +479,7 @@ Page({ ...@@ -443,7 +479,7 @@ Page({
delete formData.comment delete formData.comment
} }
if (formData.hdInspectDate) { if (formData.hdInspectDate) {
formData.hdInspectDate += ' 00:00:00' formData.hdInspectDate
} else { } else {
delete formData.hdInspectDate delete formData.hdInspectDate
} }
...@@ -454,7 +490,7 @@ Page({ ...@@ -454,7 +490,7 @@ Page({
delete formData.hdRectificationDate delete formData.hdRectificationDate
} }
console.log(formData,'formData')
wx.uploadFile({ wx.uploadFile({
filePath: this.data.hdFilePath, filePath: this.data.hdFilePath,
name: 'hdPic', name: 'hdPic',
...@@ -516,7 +552,7 @@ Page({ ...@@ -516,7 +552,7 @@ Page({
delete formData.hdFilePath delete formData.hdFilePath
delete formData.rectFilePath delete formData.rectFilePath
if (formData.hdInspectDate) { if (formData.hdInspectDate) {
formData.hdInspectDate += ' 00:00:00' formData.hdInspectDate
} else { } else {
delete formData.hdInspectDate delete formData.hdInspectDate
} }
...@@ -539,7 +575,6 @@ Page({ ...@@ -539,7 +575,6 @@ Page({
}, },
data: this.formatFormData(formData), data: this.formatFormData(formData),
success: (res) => { success: (res) => {
console.log(res, '上传成功了吗afhdhsfhhdsfhadsf')
if (res.statusCode === 201) { if (res.statusCode === 201) {
wx.showToast({ wx.showToast({
title: '上传成功', title: '上传成功',
......
...@@ -3,11 +3,15 @@ ...@@ -3,11 +3,15 @@
<view class="danger-form-wrapper"> <view class="danger-form-wrapper">
<view class="danger-check-date"> <view class="danger-check-date">
<text>检查日期:</text> <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"> <view class="current-picker">
当前选择: {{hdInspectDate}} 当前选择: {{hdInspectDate}}
</view> </view>
</picker> </picker> -->
<view class="current-picker">
{{hdInspectDate}}
</view>
</view> </view>
<view class="danger-expert"> <view class="danger-expert">
......
...@@ -65,13 +65,9 @@ ...@@ -65,13 +65,9 @@
box-shadow: 1rpx 2rpx 2rpx 2rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee; box-shadow: 1rpx 2rpx 2rpx 2rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
} }
.company-name { .company-name {
font-size: 36rpx; display: flex;
line-height: 29rpx; font-size: 36rpx;
height: 50rpx; justify-content: start;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.company-per { .company-per {
margin-top: 15rpx; margin-top: 15rpx;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="info-card-icon law-icon"></view> <view class="info-card-icon law-icon"></view>
</view> </view>
<view class="info-card info-right advice-wrapper" bindtap="linkToAdvice"> <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 class="info-card-icon advice-icon"></view>
</view> </view>
</view> </view>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.18.0", "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", "projectname": "%E5%A4%A9%E5%BC%98%E8%B4%A8%E9%87%8F%E6%A3%80%E6%B5%8B",
"condition": { "condition": {
"search": { "search": {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"list": [ "list": [
{ {
"name": "pages/person/person", "name": "pages/person/person",
"pathName": "pages/person/person", "pathName": "pages/dangerregister/dangerregister",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "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