This commit is contained in:
2025-08-12 13:11:53 +08:00
parent 4a79dabd83
commit f523a450e7

View File

@@ -92,7 +92,8 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.vid}">
<!-- <tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.vid}"> -->
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
<td>{{e.vehicle_code}}</td>
<td>{{e.site_code}}</td>
@@ -103,7 +104,7 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" @tap="toDel()">删除选中行</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !checkedArr.length}" @tap="toDel()">删除选中行</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !index || !dataList.length}" @tap="_zwConfirmIn">全部提交</button>
</view>
</view>
@@ -128,6 +129,7 @@
val1: '',
val2: '',
dataList: [],
checkedArr: [],
pkId: '',
currentData: {},
flag: false,
@@ -139,7 +141,7 @@
this.id = options.id
},
created () {
// this._getFormDataList()
this._getFormDataList()
},
methods: {
handleChange (e) {
@@ -176,7 +178,7 @@
}
},
toDel () {
this.dataList = this.dataList.filter(el => el.checked === true)
this.dataList = this.dataList.filter(el => el.checked === false)
},
async _getFormDataList () {
try {
@@ -193,12 +195,17 @@
selectChange (e) {
this.index = e
},
// toChek (e) {
// this.pkId = this.pkId === e.vid ? '' : e.vid
// this.pkObj = this.pkId === e.vid ? e : {}
// },
toCheck (e) {
e.checked = !e.checked
let arr = this.dataList.filter(el => el.checked === true)
this.checkedArr = this.dataList.filter(el => el.checked === true)
},
clearUp () {
this.pkId = ''
this.dataList = []
this.checkedArr = []
},
async _zwConfirmIn () {
this.disabled = true
@@ -228,3 +235,12 @@
}
}
</script>
<style lang="stylus" scoped>
.checked
background #ffffff
.slide_new table tr.checked td {
// background-color: transparent;
// color: #fff;
}
</style>