左侧点击切换

main
岩仔88 2 weeks ago
parent 671b118f04
commit b6c8d4df1b

@ -5,7 +5,7 @@
<div class="k_title">医嘱列表 </div>
<div v-for="(MainInfo_item,index1) in MainInfo" :key="index1">
<div v-for="(item,index) in MainInfo_item.itemInfo" :key="index">
<div :class="(item.selected==true)?'entrust_selected k_entrust':' k_entrust' ">
<div :class="(item.selected==true)?'entrust_selected k_entrust':' k_entrust' " @click="EntrustItemClick(item, index, index1)">
<div style="display: flex;">
<div class="l_title">医嘱项 </div>
<div class="l_value">{{item.entrust.entrust}}</div>
@ -299,7 +299,10 @@
//
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
// EnableGroupItemid
if (!EnableGroupItem.value.some(item2 => item2.id === v2.item.id)) {
EnableGroupItem.value.push(v2.item)
}
})
})
SelectedEntrustFunc()
@ -368,11 +371,75 @@
}
})
}
//
const EntrustItemClick = (item, index, index1) => {
//
item.selected = !item.selected
// EnableGroupItem使key
updateEnableGroupItem()
//
updateYuYueInfoAndRequest()
}
// EnableGroupItem
const updateEnableGroupItem = () => {
EnableGroupItem.value = []
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
if (v2.selected) {
EnableGroupItem.value.push(v2.item)
}
})
})
}
//
const updateYuYueInfoAndRequest = () => {
startYuYueInfo.value.entrustItems = ''
startYuYueInfo.value.entrustids = []
startYuYueInfo.value.mainListids = []
let hasSelected = false
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
if (v2.selected) {
hasSelected = true
startYuYueInfo.value.entrustItems += v2.item.item_name + ' , '
startYuYueInfo.value.entrustids.push(v2.entrust.entrust_id)
startYuYueInfo.value.mainListids.push(v2.entrust.id)
}
})
})
//
if (!hasSelected) {
//
tableData1.value = { plan_list: [] }
tableData2.value = { plan_list: [] }
//
startYuYueInfo.value.planInfo = {
id: 0,
date: '',
timeRange: '',
department_resources_name: ''
}
} else {
//
NearestEnablePlanDateFunc()
}
}
//
const SelectedEntrustFunc = () => {
startYuYueInfo.value.entrustItems = ''
startYuYueInfo.value.entrustids = []
startYuYueInfo.value.mainListids = []
let hasSelected = false
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
let isok = false;
@ -381,8 +448,11 @@
isok = true;
}
})
//
MainInfo.value[i].itemInfo[i2].selected = isok
if (isok) {
MainInfo.value[i].itemInfo[i2].selected = true
hasSelected = true
startYuYueInfo.value.entrustItems += v2.item.item_name + ' , '
startYuYueInfo.value.entrustids.push(v2.entrust.entrust_id)
startYuYueInfo.value.mainListids.push(v2.entrust.id)
@ -390,7 +460,22 @@
})
})
//
if (!hasSelected) {
//
tableData1.value = { plan_list: [] }
tableData2.value = { plan_list: [] }
//
startYuYueInfo.value.planInfo = {
id: 0,
date: '',
timeRange: '',
department_resources_name: ''
}
} else {
NearestEnablePlanDateFunc()
}
}
//

Loading…
Cancel
Save