Browse Source

接口数据返回

lisu_V4.3.1
是小王呀\24601 1 year ago
parent
commit
75bd3e8d9d
  1. 2
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  2. 110
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  3. 65
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  4. 46
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

2
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -10,7 +10,7 @@
<view class="field-text">所属组织</view> <view class="field-text">所属组织</view>
</view> </view>
<view class="value-dl" bind:tap="showPicker"> <view class="value-dl" bind:tap="showPicker">
<view class="di-name">{{agencyName?agencyName:'请选择'}}</view> <view class="di-name">{{agencyName?agencyName:'请选择-'}}</view>
<image class="di-but" src="../../../../../images/right.png" mode="aspectFit" /> <image class="di-but" src="../../../../../images/right.png" mode="aspectFit" />
</view> </view>
</view> </view>

110
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -1,12 +1,21 @@
// subpages/safetyinspection/pages/safetyinspection/safetyinspection.js // subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
import { import {
showRecord showRecord,addRecord,inspectionStaff
} from "../../../../utils/api" } from "../../../../utils/api"
const config = require('../../../../utils/config')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
orgid:'',
orgType:'',
pageNo:'1',
pageSize:'20',
showList:[],
imageUrls:[],
remarks:'',//备注
getData:'',
gridName:'', gridName:'',
array: ['选项1', '选项2', '选项3', '选项4'], // 选择器的数据源 array: ['选项1', '选项2', '选项3', '选项4'], // 选择器的数据源
result: ['a', 'b', 'c'], result: ['a', 'b', 'c'],
@ -28,6 +37,10 @@ Page({
arr1:[ arr1:[
{value:"1",name:'1.车间一些软件设备出现生锈断裂情况严重'}, {value:"1",name:'1.车间一些软件设备出现生锈断裂情况严重'},
{value:"2",name:'2.还有部分货运车辆已过年检。'}, {value:"2",name:'2.还有部分货运车辆已过年检。'},
],
arr2:[
{id:"1", data:"2024-05-06 10:20",name:'检察人员',jielun:"不合格",yinhuan:"1.车间一些软件设备出现生锈断裂情况严重",fuchashijian:'2024-01-05',fujian:"1223",beizhu:"qq","dingwei":"山东路"},
{id:"2",data:"2024-05-06 10:20",name:'检察人员',jielun:"不合格",yinhuan:"2.车间一些软件设备出现生锈断裂情况严重",fuchashijian:'2024-01-05',fujian:"1223",beizhu:"qq","dingwei":"山东路"},
] ]
}, },
@ -40,6 +53,7 @@ Page({
companyId: options.resiId companyId: options.resiId
}) })
this.showRecordData() this.showRecordData()
this.addRecordData()
}, },
/** /**
@ -124,6 +138,20 @@ Page({
console.log(parm) console.log(parm)
showRecord(parm).then(res => { showRecord(parm).then(res => {
console.log(res) console.log(res)
this.setData({
showList:res.data
})
console.log(this.data.showList)
})
},
addRecordData(){
addRecord(parm).then(res => {
console.log("")
this.setData({
showList:res.data
})
console.log(this.data.showList)
}) })
}, },
showPopup() { showPopup() {
@ -183,13 +211,91 @@ Page({
pickerChange: function(e) { pickerChange: function(e) {
// 更新当前选中的索引 // 更新当前选中的索引
console.log(e.detail.value), console.log(e.detail.value),
console.log(this.data.array[e.detail.value])
this.setData({ this.setData({
gridName: this.data.array[e.detail.value] gridName: this.data.array[e.detail.value]
}); });
console.log(this.data.gridName) console.log(this.data.gridName)
// 在这里可以根据选择的值进行相应的逻辑处理 // 在这里可以根据选择的值进行相应的逻辑处理
},
pickerChange1: function(e) {
// 更新当前选中的索引
console.log(e.detail.value),
this.setData({
getData: e.detail.value
});
console.log(this.data.getData)
// 在这里可以根据选择的值进行相应的逻辑处理
},
bindRemarkInput(e){
this.setData({
remarks: e.detail.value
});
console.log(this.data.remarks)
},
chooseImage() {
const that = this;
wx.chooseMedia({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success(res) {
console.log(res)
const tempFilePaths = res;
console.log(tempFilePaths);
const imageUrls = [...that.data.imageUrls]
if (that.data.imageUrls) {
that.setData({
imageUrls: that.data.imageUrls.concat(tempFilePaths)
})
wx.uploadFile({
url: `${config.BASEURL()}oss/file/uploadvariedfile`,
filePath: res.tempFiles[0].tempFilePath,
name: 'file',
header: {
'Content-type': 'application/json;charset=UTF-8',
'Authorization': wx.getStorageSync('token')
},
success(fileRes) {
if (!JSON.parse(fileRes.data).data) {
that.showToast('图片上传失败,请重试~')
// 删除
const index = that.data.imageUrls.findIndex(item => item.imageId === that.data.imageId)
if (index > -1) {
that.data.imageUrls.splice(index, 1)
that.setData({
imageUrls: that.data.imageUrls
})
}
} else {
imageUrls[imageUrls.length - 1].uploaded = true
imageUrls[imageUrls.length - 1].ossUrl = JSON.parse(fileRes.data).data
that.setData({
imageUrls
})
}
},
fail(fileRes) {
that.setData({
imageUrls: []
})
that.showToast('图片上传失败,请重试~')
}
})
}else{
} }
// 将选定的图片显示在页面上
// this.setData({
// imageUrl: tempFilePaths[0]
// });
}
})
},
}) })

65
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -20,7 +20,7 @@
</view> </view>
<view class="checkbox1"> <view class="checkbox1">
<van-checkbox-group value="{{ result }}" bind:change="onChange"> <van-checkbox-group value="{{ result }}" bind:change="onChange">
<van-checkbox name="{{item.value}}" wx:for="{{arr1}}">{{item.name}}</van-checkbox> <van-checkbox custom-class="group1" name="{{item.value}}" wx:for="{{arr1}}" >{{item.name}}</van-checkbox>
</van-checkbox-group> </van-checkbox-group>
</view> </view>
<view class="input1"> <view class="input1">
@ -50,9 +50,9 @@
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<text class="prosecutors_pre">拟复查时间</text> <text class="prosecutors_pre">拟复查时间</text>
<view> <view>
<picker mode="date" class="prosecutors_name" bindchange="pickerChange" value="{{data}}" range="{{array}}"> <picker mode="date" class="prosecutors_name" bindchange="pickerChange1" value="{{data}}">
<view class="{{gridName?'':'gray'}}"> <view class="{{getData?'':'gray'}}">
{{gridName?gridName:'请选择'}} {{getData?getData:'请选择'}}
</view> </view>
</picker> </picker>
</view> </view>
@ -66,50 +66,56 @@
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" /> <van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" />
<text class="text1">备注</text> <text class="text1">备注</text>
<view class="textarea1"> <view class="textarea1">
<textarea class="" placeholder-style="color: #C1C1C1;" value="{{form.remark}}" bindblur="bindRemarkInput" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="请输入" /> <textarea placeholder-style="color: #C1C1C1;" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="请输入" />
</view> </view>
</view> </view>
</view> </view>
<view class="from"> <view class="from">
<view><text class="text2">巡检记录</text></view> <view>
<text class="text2">巡检记录</text>
</view>
<view style="margin-top: 32rpx;padding: 0 35rpx;"> <view style="margin-top: 32rpx;padding: 0 35rpx;">
<view class="logsBox"> <view class="logsBox" wx:for="{{showList}}" wx:for-index="index">
<view class="item-dian {{index!=0?'item-dian1':''}}"> <view class="item-dian {{index!=0?'item-dian1':''}}">
<view class="neidian"></view> <view class="neidian"></view>
</view> </view>
<view class="logs-top"> <view class="logs-top">
<view class="logs-top-title">时间</view> <view class="logs-top-title">{{item.checkTime}}</view>
</view> </view>
<view class="logs-content"> <view class="logs-content">
<view class="logs-content-left"> <view class="logs-content-left">
<view> <view>
<text class="logs-content-title">检察人员:</text> <text class="logs-content-title">检察人员:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">{{item.checkPersons}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">检查结论:</text> <text class="logs-content-title">检查结论:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">{{item.checkResultFlag}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">隐患明细:</text> <text class="logs-content-title">隐患明细:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt" wx:for="{{item.hiddenDangeList}}" >{{item.hazardDesc}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">整改要求:</text> <text class="logs-content-title">整改要求:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt" wx:for="{{item.hiddenDangeList}}">{{item.hazardStatus}}</text>
</view>
<view>
<text class="logs-content-title">拟复查时间:</text>
<text class="logs-content-txt">{{item.reviewTime}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">附件:</text> <text class="logs-content-title" >附件:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt" wx:for="{{item.attachmentUrls}}" >{{item.fileName}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">备注:</text> <text class="logs-content-title">备注:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">{{item.remark}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">整改要求:</text> <text class="logs-content-title">巡查定位:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">--</text>
</view> </view>
</view> </view>
@ -120,15 +126,20 @@
</view> </view>
<!--<van-popup show="{{ showPopup }}" bind:close="onClose"position="top" <view class="footer">
class="var" > <view class="btn">
<van-checkbox-group bind:change="onChange1"> <text class="btn_text">提交</text>
<van-checkbox name="checkbox1">选项1</van-checkbox> </view>
<van-checkbox name="checkbox2">选项2</van-checkbox> </view>
<van-checkbox name="checkbox3">选项3</van-checkbox> <view class="image-box">
</van-checkbox-group> <view class="field-text">上传图片</view>
<button bindtap="confirmSelection">确定</button> <view wx:for="{{imageUrls}}">
</van-popup>--> <image wx:if="{{imageUrls}}" src="{{item.tempFilePath}}" mode="aspectFit" style="width: 200rpx; height: 300px;"></image>
</view>
<image src="../../../../images/addphoto.png" bindtap="chooseImage" />
</view>
<van-popup show="{{ showPopup }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose"> <van-popup show="{{ showPopup }}" closeable close-icon="close" position="bottom" custom-style="height: 50%" bind:close="onClose">
<view class="popup-content"> <view class="popup-content">
<van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1"> <van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1">
@ -136,4 +147,4 @@
</van-checkbox-group> </van-checkbox-group>
<button bindtap="confirmSelection">确定</button> <button bindtap="confirmSelection">确定</button>
</view> </view>
</van-popup> </van-popup>

46
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

@ -1,7 +1,6 @@
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;
} }
@ -183,7 +182,7 @@ page {
} }
.logs-content-left { .logs-content-left {
width: 48%; width: 100%;
} }
.logs-content-right { .logs-content-right {
@ -283,4 +282,47 @@ page {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
}
.btn{
display: flex;
margin: 20rpx;
background-color: #3974F6;
width: 630rpx;
height: 86rpx;
border-radius: 43rpx;
justify-content: center;
align-items: center;
margin-bottom: 30px;
}
.btn_text{
width: 80rpx;
height: 31rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
line-height: 60rpx;
margin-bottom: 20rpx;
}
.footer{
width: 700rpx;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
}
.image-box {
width: 100%;
height: auto;
border-radius: 16rpx;
background: #fff;
margin-top: 20rpx;
box-sizing: border-box;
padding: 34rpx 24rpx;
position: relative;
}
.group1{
margin-top: 20rpx;
} }
Loading…
Cancel
Save