Browse Source

巡查上报

lisu_V4.3.1
是小王呀\24601 1 year ago
parent
commit
5d44f69398
  1. 13
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 4
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.json
  3. 231
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  4. 8
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.json
  5. 81
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  6. 47
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss
  7. 17
      subpages/securityCheck/pages/securityCheck.js
  8. 10
      subpages/securityCheck/pages/securityCheck.wxml
  9. 13
      utils/api.js

13
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -1,5 +1,6 @@
// subpages/InspectionReport/pages/InspectionReport/InspectionReport.js // subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
import addRecord from "../../../../utils/api"
Page({ Page({
/** /**
@ -28,6 +29,8 @@ Page({
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
}) })
this.reverseLocation() this.reverseLocation()
this.ToaddRecord()
}, },
/** /**
@ -98,6 +101,7 @@ Page({
} }
}) })
}, },
//
reverseLocation() { reverseLocation() {
const _this = this const _this = this
this.data.qqMapWX.reverseGeocoder({ this.data.qqMapWX.reverseGeocoder({
@ -114,5 +118,12 @@ Page({
console.debug(err) console.debug(err)
} }
}) })
}, },
ToaddRecord(){
addRecord().then(res=>{
console.log(res)
})
}
}) })

4
subpages/InspectionReport/pages/InspectionReport/InspectionReport.json

@ -1,6 +1,8 @@
{ {
"navigationBarTitleText": "安检巡查", "navigationBarTitleText": "安检巡查",
"usingComponents": { "usingComponents": {
"van-uploader": "@vant/weapp/uploader/index" "van-uploader": "@vant/weapp/uploader/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index"
} }
} }

231
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -1,95 +1,144 @@
// subpages/safetyinspection/pages/safetyinspection/safetyinspection.js // subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
import {
showRecord
} from "../../../../utils/api"
Page({ Page({
/**
* 页面的初始数据
*/
data: {
result: ['a', 'b', 'c'],
arrlist:[],
fileList: [],
companyId: '',
showPopup: false, // 控制弹出层显示/隐藏的状态
selectedOptions: [], // 选中的复选框项
Prosecutors:['小王','李四','张三'], //检查人员
arr:[
{value:1,name:'小王'},
{value:2,name:'李四'},
{value:3,name:'张三'}
],
arr:[
{value:1,name:'小王'},
{value:2,name:'李四'},
{value:3,name:'张三'}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options.resiId)
this.setData({
companyId: options.resiId
})
this.showRecordData()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
onChange(event) {
console.log(event)
this.setData({
selectedOptions: event.detail
});
// event.detail 为当前输入的值
console.log(this.data.selectedOptions);
},
afterRead(event) {
const {
file
} = event.detail;
console.log(file)
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
filePath: file.url,
name: 'file',
formData: {
user: 'test'
},
success(res) {
// 上传完成需要更新 fileList
const {
fileList = []
} = this.data;
fileList.push({
...file,
url: res.data
});
this.setData({
fileList
});
},
});
},
showRecordData() {
let parm = {
companyId: this.data.companyId
}
console.log(parm)
showRecord(parm).then(res => {
console.log(res)
})
},
showPopup() {
this.setData({ showPopup: true }); // 点击按钮显示弹出层
},
onClose() {
this.setData({ showPopup: false }); // 关闭弹出层
},
onChange1(event) {
console.log(event)
const { value } = event.detail;
console.log(event.detail)
this.setData({
arr: value
});
},
confirmSelection() {
// 点击确定按钮后触发,处理选中的复选框项
console.log("选中的项:", this.data.selectedOptions);
this.setData({ showPopup: false }); // 关闭弹出层
},
/**
* 页面的初始数据
*/
data: {
result: ['a', 'b'],
value: '',
fileList: [
],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
onChex(event) {
this.setData({
result: event.detail,
});
},
onChange(event) {
// event.detail 为当前输入的值
console.log(event.detail);
},
afterRead(event) {
const { file } = event.detail;
console.log(file)
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
filePath: file.url,
name: 'file',
formData: { user: 'test' },
success(res) {
// 上传完成需要更新 fileList
const { fileList = [] } = this.data;
fileList.push({ ...file, url: res.data });
this.setData({ fileList });
},
});
},
}) })

8
subpages/safetyinspection/pages/safetyinspection/safetyinspection.json

@ -2,11 +2,9 @@
"navigationBarTitleText": "安全巡检", "navigationBarTitleText": "安全巡检",
"backgroundTextStyle":"dark", "backgroundTextStyle":"dark",
"usingComponents": { "usingComponents": {
"load-more": "../../../../components/loadMore/loadMore",
"no-data": "../../../../components/noData/nodata",
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index", "van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-field": "@vant/weapp/field/index", "van-uploader": "@vant/weapp/uploader/index",
"van-uploader": "@vant/weapp/uploader/index" "van-popup": "@vant/weapp/popup/index"
} }
} }

81
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -1,42 +1,40 @@
<!--subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml--> <!--subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml-->
<view class="from"> <view class="from">
<view class="prosecutors"> <view class="prosecutors" bind:tap="showPopup">
<view> <view >
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检查人员</text> <text class="prosecutors_pre">检查人员</text>
<text class="prosecutors_name">张玉斌</text> <text class="prosecutors_name">{{ selectedOptions }}</text>
</view> </view>
<view> <view>
<image src="../../../../images/right.png" class="prosecutors_img"></image> <image src="../../../../images/right.png" class="prosecutors_img"></image>
</view> </view>
</view> </view>
<view class="hidden">
<view class="hidden_top"> <view class="pitfall">
<view class="prosecutors"> <view class="prosecutors">
<view> <view>
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<text class="prosecutors_pre">已整改隐患</text> <text class="prosecutors_pre">已整改隐患</text>
</view> </view>
<view> <view>
<image src="../../../../images/right.png" class="prosecutors_img"></image> <image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
<view class="prosecutors_but">
<van-checkbox-group value="{{ result }}" bind:change="onCheckBox" class="prosecutors_chex">
<van-checkbox class="checkbox" name="a">1.车间一些软件设备出现生锈断裂情况严重。 </van-checkbox>
<van-checkbox name="b">2.还有部分货运车辆已过年检。</van-checkbox>
</van-checkbox-group>
<van-cell-group>
<van-field value="{{ value }}" placeholder="请输入新的隐患信息" border="{{ false }}" bind:change="onChange" class="prosecutors_group" />
</van-cell-group>
</view>
<view class="prosecutors_add">
<image src="../../../../images/add.png" style="width: 30rpx; height: 30rpx;"></image>
<text class="text3">在添加一条</text>
</view>
</view> </view>
</view> </view>
<view class="checkbox1">
<van-checkbox-group value="{{ result }}" bind:change="onChange">
<van-checkbox name="a">1.车间一些软件设备出现生锈断裂情况严重</van-checkbox>
<van-checkbox name="b">2.还有部分货运车辆已过年检。</van-checkbox>
</van-checkbox-group>
</view>
<view class="input1">
<input bindinput="changeNewPassword" type="password" placeholder=" 请输入"/>
</view>
<view class="add">
<image src="../../../../images/add.png" class="add_img"></image>
<text>再添加一条</text>
</view>
</view>
<view class="prosecutors"> <view class="prosecutors">
<view> <view>
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
@ -117,4 +115,29 @@
</view> </view>
<!--<van-popup show="{{ showPopup }}" bind:close="onClose"position="top"
class="var" >
<van-checkbox-group bind:change="onChange1">
<van-checkbox name="checkbox1">选项1</van-checkbox>
<van-checkbox name="checkbox2">选项2</van-checkbox>
<van-checkbox name="checkbox3">选项3</van-checkbox>
</van-checkbox-group>
<button bindtap="confirmSelection">确定</button>
</van-popup>-->
<van-popup
show="{{ showPopup }}"
closeable
close-icon="close"
position="bottom"
custom-style="height: 50%"
bind:close="onClose"
>
<view class="popup-content">
<van-checkbox-group value="{{selectedOptions}}" bind:change="onChange">
<van-checkbox name="{{item.name}}" bind:click="onClick" wx:for="{{arr}}">{{item.name}}</van-checkbox>
</van-checkbox-group>
<button bindtap="confirmSelection">确定</button>
</view>
</van-popup>

47
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

@ -1,6 +1,7 @@
page { page {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
height: 1450rpx;
overflow-y: auto; overflow-y: auto;
background-color: #f7f7f7; background-color: #f7f7f7;
} }
@ -39,7 +40,7 @@ page {
margin-left: 6rpx; margin-left: 6rpx;
} }
.prosecutors_name{ .prosecutors_name{
width: 93rpx; width: 200px;
height: 30rpx; height: 30rpx;
overflow-wrap: break-word; overflow-wrap: break-word;
color: rgba(51,51,51,1); color: rgba(51,51,51,1);
@ -228,9 +229,49 @@ page {
} }
.hidden_top{ .hidden_top{
display: flex; display: flex;
flex-direction:row; flex-direction:column;
align-items: center; align-items: center;
margin: 20rpx;
justify-content: space-between; justify-content: space-between;
height: 50rpx; height: 50rpx;
}
.text8{
display: flex;
flex-direction: row;
}
.text9{
display: flex;
}
.pitfall{
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.pitfall_header{
display: flex;
flex-direction: row;
}
.checkbox1{
display: flex;
flex-direction:column;
margin-left: 50rpx;
margin-bottom: 20rpx;
}
.input1{
width: 650rpx;
height: 90rpx;
background-color: #F7F7F7;
border-radius: 10rpx;
margin-left: 50rpx;
}
.add{
display: flex;
flex-direction: row;
box-sizing: border-box;
justify-content: center;
align-items: center;
margin: 20rpx;
}
.add_img{
width: 40rpx;
height: 40rpx;
} }

17
subpages/securityCheck/pages/securityCheck.js

@ -24,7 +24,7 @@ Page({
pageNo: this.data.pageNo, pageNo: this.data.pageNo,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
}).then(({data}) => { }).then(({data}) => {
console.log(data)
this.setData({ this.setData({
marsi: data.list, marsi: data.list,
total: data.total total: data.total
@ -98,20 +98,29 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
},
toAddEnterprise(){
wx.navigateTo({
url: '../../../subpages/InspectionReport/pages/InspectionReport/InspectionReport',
})
},
toDetails(e){
console.log(e)
wx.navigateTo({
url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}`,
})
} }
}) })

10
subpages/securityCheck/pages/securityCheck.wxml

@ -11,7 +11,7 @@
<view class=""> <view class="">
<view class="section_5"> <view class="section_5">
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;"> <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;">
<view class="list_1" wx:for="{{flag0Array}}"> <view class="list_1" wx:for="{{flag0Array}}" bind:tap="toDetails" data-resiId="{{item.id}}">
<view class="section_1-0" id="scrollToHere"> <view class="section_1-0" id="scrollToHere">
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view> <view class="title_mall">检查时间: {{item.orderDate}}</view>
@ -30,8 +30,8 @@
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;"> <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;">
<view class="list_1" wx:for="{{flag1Array}}"> <view class="list_1" wx:for="{{flag1Array}}" bind:tap="toDetails">
<view class="section_1-0" id="scrollToHere"> <view class="section_1-0" id="scrollToHere" >
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view> <view class="title_mall">检查时间: {{item.orderDate}}</view>
<view class="title_mall">检查人员: {{item.checkPersons}}</view> <view class="title_mall">检查人员: {{item.checkPersons}}</view>
@ -41,8 +41,8 @@
</view> </view>
</view> </view>
<movable-area class="movable-area"> <movable-area class="movable-area">
<movable-view class="movable-view" direction="all" x="250" y="300"> <movable-view class="movable-view" direction="all" x="250" y="300" bind:tap="toAddEnterprise">
<image src="../../images/xuncha.png" class="image-wrapper"></image> <image src="../../../images/xuncha.png" class="image-wrapper"></image>
</movable-view> </movable-view>
</movable-area> </movable-area>
</scroll-view> </scroll-view>

13
utils/api.js

@ -78,7 +78,9 @@ module.exports = {
nonIntResiList, nonIntResiList,
securityCheckk, securityCheckk,
overView, overView,
getFamilyRelationshipListByHouseId getFamilyRelationshipListByHouseId,
addRecord,
showRecord
} }
// 获取公钥 // 获取公钥
@ -409,6 +411,13 @@ function securityCheckk(parm){
function overView(parm){ function overView(parm){
return fly.get(`actual/base/communityHouse/resiAndHouseCollect/overview`,parm) return fly.get(`actual/base/communityHouse/resiAndHouseCollect/overview`,parm)
} }
//巡查记录--新增
function addRecord(parm){
return fly.post(`actual/base/companyInfo/addRecord`,parm)
}
//巡查巨鹿--展示
function showRecord(parm){
return fly.post(`actual/base/companyInfo/showRecord`,parm)
}

Loading…
Cancel
Save