Browse Source

检察人员返回

lisu_V4.3.1
是小王呀\24601 2 years ago
parent
commit
365146ee99
  1. 77
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  2. 3
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.json
  3. 80
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  4. 11
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

77
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -7,22 +7,27 @@ Page({
* 页面的初始数据
*/
data: {
gridName:'',
array: ['选项1', '选项2', '选项3', '选项4'], // 选择器的数据源
result: ['a', 'b', 'c'],
arrlist:[],
fileList: [],
companyId: '',
showPopup: false, // 控制弹出层显示/隐藏的状态
selectedOptions: [], // 选中的复选框项
Prosecutors:['小王','李四','张三'], //检查人员
selectedNames:[],//显示检察人员
// 用于存放复选框选择的结果
result: [],
// 用于存放输入框的值
newPassword: '',
arr:[
{value:1,name:'小王'},
{value:2,name:'李四'},
{value:3,name:'张三'}
{value:"1",name:'小王'},
{value:"2",name:'李四'},
{value:"3",name:'张三'}
],
arr:[
{value:1,name:'小王'},
{value:2,name:'李四'},
{value:3,name:'张三'}
arr1:[
{value:"1",name:'1.车间一些软件设备出现生锈断裂情况严重'},
{value:"2",name:'2.还有部分货运车辆已过年检。'},
]
},
@ -79,7 +84,7 @@ Page({
onChange(event) {
console.log(event)
this.setData({
selectedOptions: event.detail
result: event.detail
});
// event.detail 为当前输入的值
console.log(this.data.selectedOptions);
@ -129,16 +134,62 @@ Page({
},
onChange1(event) {
console.log(event)
const { value } = event.detail;
console.log(event.detail)
this.setData({
arr: value
selectedOptions: event.detail
});
console.log(this.data.selectedOptions)
},
confirmSelection() {
// 点击确定按钮后触发,处理选中的复选框项
console.log("选中的项:", this.data.selectedOptions);
this.setData({ showPopup: false }); // 关闭弹出层
console.log(this.data.arr)
console.log(this.data.arr.filter(item => this.data.selectedOptions.includes(item.value)).map(item => item.name));
console.log(this.data.arr.filter(item => this.data.selectedOptions.includes(item.value)));
const selectedName = this.data.arr.filter(item => this.data.selectedOptions.includes(item.value)).map(item => item.name);
console.log("选中的名称:", selectedName);
this.setData({
showPopup: false,
selectedNames:selectedName
}); // 关闭弹出层
console.log(this.data.selectedNames)
},
changeNewPassword(e){
console.log("执行了")
this.setData({
newPassword: e.detail.value
});
console.log(this.data.newPassword)
},
addAnother() {
// // 获取输入框的值
// const newPassword = this.data.newPassword;
// // 将值添加到arr数组中
// const arr = this.data.arr.concat(newPassword);
// // 更新数据
// this.setData({
// arr: arr,
// // 清空输入框的值
// newPassword: ''
// });
let newValue = this.data.arr1.length + 1; // 根据数组长度确定新值
let newArr = this.data.arr1.concat({ value: newValue.toString(), name: this.data.newPassword });
this.setData({
arr1: newArr,
newPassword: '', // 清空输入框的值
});
console.log('添加后的数组:', this.data.arr1);
},
pickerChange: function(e) {
// 更新当前选中的索引
console.log(e.detail.value),
console.log(this.data.array[e.detail.value])
this.setData({
gridName: this.data.array[e.detail.value]
});
console.log(this.data.gridName)
// 在这里可以根据选择的值进行相应的逻辑处理
}
})

3
subpages/safetyinspection/pages/safetyinspection/safetyinspection.json

@ -5,6 +5,7 @@
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-popup": "@vant/weapp/popup/index"
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index"
}
}

80
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -1,10 +1,10 @@
<!--subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml-->
<view class="from">
<view class="prosecutors" bind:tap="showPopup">
<view >
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检查人员</text>
<text class="prosecutors_name">{{ selectedOptions }}</text>
<text class="prosecutors_name">{{ selectedNames }}</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
@ -12,36 +12,36 @@
</view>
<view class="pitfall">
<view class="prosecutors">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">已整改隐患</text>
<view class="prosecutors">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">已整改隐患</text>
</view>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
<view class="checkbox1">
<van-checkbox-group value="{{ result }}" bind:change="onChange">
<van-checkbox name="{{item.value}}" wx:for="{{arr1}}">{{item.name}}</van-checkbox>
</van-checkbox-group>
</view>
<view class="input1">
<input bindinput="changeNewPassword" type="text" placeholder=" 请输入" />
</view>
<view class="add" bind:tap="addAnother">
<image src="../../../../images/add.png" class="add_img"></image>
<text>再添加一条</text>
</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>
<view class="conclusion">
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检查结论</text>
<text class="prosecutors_name">请选择</text>
<picker class="prosecutors_name" bindchange="pickerChange" value="{{index}}" range="{{array}}">
<view class="{{gridName?'':'gray'}}">
{{gridName?gridName:'请选择'}}
</view>
</picker>
</view>
<view>
<view class="conclusion_right">
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
@ -49,8 +49,12 @@
<view class="prosecutors_data">
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">拟复查时间</text>
<view class="input">
<input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" />
<view>
<picker mode="date" class="prosecutors_name" bindchange="pickerChange" value="{{data}}" range="{{array}}">
<view class="{{gridName?'':'gray'}}">
{{gridName?gridName:'请选择'}}
</view>
</picker>
</view>
</view>
<view>
@ -125,19 +129,11 @@
</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"
>
<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>
<van-checkbox-group value="{{selectedOptions}}" bind:change="onChange1">
<van-checkbox name="{{item.value}}" data-value="{{item.value}}" wx:for="{{arr}}">{{item.name}}</van-checkbox>
</van-checkbox-group>
<button bindtap="confirmSelection">确定</button>
</view>
</van-popup>

11
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

@ -23,6 +23,10 @@ page {
height: 50rpx;
border-bottom: 1px solid #EAEAEA;
}
.conclusion{
display: flex;
flex-direction: row;
}
.prosecutors_req{
color: red;
margin: 5rpx
@ -40,7 +44,7 @@ page {
margin-left: 6rpx;
}
.prosecutors_name{
width: 200px;
width: 150px;
height: 30rpx;
overflow-wrap: break-word;
color: rgba(51,51,51,1);
@ -274,4 +278,9 @@ page {
.add_img{
width: 40rpx;
height: 40rpx;
}
.conclusion_right{
display: flex;
flex-direction: row;
}
Loading…
Cancel
Save