超过数量置灰

main
岩仔88 2 weeks ago
parent b6c8d4df1b
commit 82742bb0ec

@ -116,7 +116,14 @@
</el-table-column>
<el-table-column prop="address" width="90" label="已用/总数">
<template #default="scope">
<span @click="UsedCountClick(scope.row)" style="font-weight: 700;color:cornflowerblue;cursor: pointer;">{{scope.row.used_count}}/{{scope.row.count}}</span>
<span @click="UsedCountClick(scope.row)"
:style="{
'font-weight': 700,
'color': scope.row.isAvailable ? 'cornflowerblue' : '#c0c4cc',
'cursor': 'pointer'
}">
{{scope.row.used_count}}/{{scope.row.count}}
</span>
</template>
</el-table-column>
</el-table>
@ -144,7 +151,13 @@
</el-table-column>
<el-table-column prop="address" width="90" label="已用/总数">
<template #default="scope">
<span
:style="{
'font-weight': 700,
'color': scope.row.isAvailable ? 'cornflowerblue' : '#c0c4cc'
}">
{{scope.row.used_count}}/{{scope.row.count}}
</span>
</template>
</el-table-column>
</el-table>
@ -341,6 +354,17 @@
//
const GetEnablePlanFunc = (date, entrustids) => {
loading.value = true
//
let totalUseSeats = 0
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
if (v2.selected && v2.item.use_seats) {
totalUseSeats += v2.item.use_seats
}
})
})
GetEnablePlan({
regnum: MainInfo.value[MainInfoKey.value].mainInfo.reg_num,
entrustid: entrustids,
@ -350,6 +374,14 @@
}).then(res => {
loading.value = false
if (res.status) {
//
res.data.plan_list.forEach((plan, index) => {
//
const availableCount = plan.count - plan.used_count
//
plan.isAvailable = availableCount >= totalUseSeats
})
if (res.data.appointment_date == table_date1.value) {
tableData1.value = res.data
tableData1.value.plan_list.forEach((v, i) => {

Loading…
Cancel
Save