修改车辆 添加全选

This commit is contained in:
X_Rian 2024-06-06 16:22:39 +08:00
parent 848c7d15ab
commit 081aa07f63
10 changed files with 88 additions and 42 deletions

View File

@ -325,7 +325,7 @@
width: 100%;
margin: 20rpx 0;
box-shadow: 0 8rpx 26rpx 0 rgba(212, 220, 236, 0.67);
padding: 20rpx 20rpx 20rpx 28rpx;
padding: 20rpx 20rpx 20rpx 20rpx;
box-sizing: border-box;
border-radius: 16rpx;
}
@ -340,7 +340,7 @@
.item_wrap {
width: 100%;
flex-wrap: wrap;
justify-content: space-between;
/* justify-content: space-between; */
}
.item_wrap .item {
@ -353,6 +353,7 @@
line-height: 84rpx;
position: relative;
margin-top: 14rpx;
margin-left: 8rpx;
}
.item_wrap .item .state1 {

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,7 +66,8 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
@ -74,6 +75,7 @@
},
onLoad(options) {
this.detailId = options.detailId
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,c
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -5,7 +5,7 @@
安全措施
</view>
</headers>
<view class="safe-mesure-container">
<view class="safe-mesure-container" :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
<view class="safe-mesure-header">
<view class="header-left">安全措施</view>
<view class="header-right">是否涉及</view>
@ -66,14 +66,16 @@
detailId: '',
detailData: '',
safeMeasure:[],
otherSafeMeasure: []
otherSafeMeasure: [],
statusBarHeight: 0,
};
},
created() {
this.getWork()
},
onLoad(options) {
this.detailId = options.detailId
this.detailId = options.detailId,
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
methods:{
getWork(){
@ -112,7 +114,7 @@
}
.safe-mesure-container{
padding: 0 30rpx;
padding-top: 138rpx;
// padding-top: 138rpx;
padding-bottom: 100rpx;
// background-color: darkred;
.safe-mesure-header{

View File

@ -4,13 +4,13 @@
<view class="headerName">
人员列表
</view>
<!-- <template #right>
<template #right>
<checkbox-group @change="selectAll">
<label>
<checkbox :value="1" />全选
<checkbox value="1" :checked="isChecked" :disabled="isDisable" />全选
</label>
</checkbox-group>
</template> -->
</template>
</headers>
<!-- <scroll-view scroll-y="true" class="pageContent"> -->
<view class="personContent">
@ -60,7 +60,9 @@
pageNo: 1,
pageSize: 100,
objData: "",
selectCheckVal: []
selectCheckVal: [],
isChecked: false,
isDisable: false,
};
},
onLoad(options) {
@ -80,9 +82,16 @@
},
methods: {
//
// selectAll(){
// },
selectAll(e) {
this.isChecked = e.detail.value.length > 0 ? true : false;
this.personList = this.personList.map(item => {
return {
...item,
isChecked: !item.isDisable ? this.isChecked : item.isChecked,
};
});
this.selectCheckVal = this.personList.filter(item => item.isChecked).map(item => item.checkVal);
},
addSaveBtn() {
let dealData = [];
this.personList.map(item => {
@ -110,8 +119,15 @@
})
},
checkboxChange(e) {
console.log(e)
this.selectCheckVal = e.detail.value
console.log(e, "11111")
this.selectCheckVal = e.detail.value;
this.personList = this.personList.map(item => {
return {
...item,
isChecked: !this.selectCheckVal.includes(item.checkVal) ? false : true,
};
});
this.isChecked = e.detail.value.length == this.personList.length ? true : false;
},
loadData() {
var that = this
@ -144,6 +160,7 @@
item.isDisable = false;
item.isChecked = false;
})
that.isChecked = false;
if (uni.getStorageSync("personInfo")) {
let storeArr = JSON.parse(uni.getStorageSync("personInfo"))
that.personList.map((item, index) => {
@ -154,6 +171,10 @@
item.isChecked = true;
}
})
that.isDisable = that.personList.filter(item => item.isChecked == true).length == that
.personList.length ? true : false;
that.isChecked = that.personList.filter(item => item.isChecked == true).length == that
.personList.length ? true : false;
}
}
})
@ -168,6 +189,14 @@
</script>
<style lang="scss" scoped>
/deep/ .rightIcon {
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-50%);
z-index: 9;
}
.personContent {
padding: 15px;
padding-bottom: 80rpx;