diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js index 7580cd8..db180bd 100644 --- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js +++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js @@ -1,5 +1,6 @@ // subpages/InspectionReport/pages/InspectionReport/InspectionReport.js const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') +import addRecord from "../../../../utils/api" Page({ /** @@ -28,6 +29,8 @@ Page({ key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' }) this.reverseLocation() + this.ToaddRecord() + }, /** @@ -98,6 +101,7 @@ Page({ } }) }, + // reverseLocation() { const _this = this this.data.qqMapWX.reverseGeocoder({ @@ -114,5 +118,12 @@ Page({ console.debug(err) } }) - }, + }, + + ToaddRecord(){ + addRecord().then(res=>{ + console.log(res) + }) + } + }) \ No newline at end of file diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.json b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.json index 047ca3b..c93f381 100644 --- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.json +++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.json @@ -1,6 +1,8 @@ { "navigationBarTitleText": "安检巡查", "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" } } \ No newline at end of file diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js index 2ef2d0f..0f4ba8e 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js @@ -1,95 +1,144 @@ // subpages/safetyinspection/pages/safetyinspection/safetyinspection.js +import { + showRecord +} from "../../../../utils/api" 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 }); - }, - }); - }, }) \ No newline at end of file diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.json b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.json index bcaed8f..8236caf 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.json +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.json @@ -2,11 +2,9 @@ "navigationBarTitleText": "安全巡检", "backgroundTextStyle":"dark", "usingComponents": { - "load-more": "../../../../components/loadMore/loadMore", - "no-data": "../../../../components/noData/nodata", "van-checkbox": "@vant/weapp/checkbox/index", - "van-checkbox-group": "@vant/weapp/checkbox-group/index", - "van-field": "@vant/weapp/field/index", - "van-uploader": "@vant/weapp/uploader/index" + "van-checkbox-group": "@vant/weapp/checkbox-group/index", + "van-uploader": "@vant/weapp/uploader/index", + "van-popup": "@vant/weapp/popup/index" } } \ No newline at end of file diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml index c412d43..3f35ea3 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml @@ -1,42 +1,40 @@ - - + + * 检查人员 - 张玉斌 + {{ selectedOptions }} -