|
@@ -104,9 +104,9 @@
|
|
|
:expand-row-keys="expands">
|
|
|
<el-table-column label="选择" type="selection"/>
|
|
|
<el-table-column type="expand" width="20">
|
|
|
- <template #default="{row}">
|
|
|
+ <template #default="{row,$index}">
|
|
|
<el-table :data="row.bacteriaResults[0].antibioticResults"
|
|
|
- ref="drugSensitivityRef"
|
|
|
+ :ref="(el) => setRefMap(el, $index)"
|
|
|
@row-click="drugTable"
|
|
|
v-if="row.bacteriaResults.length > 0">
|
|
|
<el-table-column label="选择" type="selection"/>
|
|
@@ -163,6 +163,11 @@ const inspectionHeader = ref({
|
|
|
})
|
|
|
const dateRange = ref([])
|
|
|
|
|
|
+const refMap = {}
|
|
|
+const setRefMap = (el, item) => {
|
|
|
+ refMap[`drug${item}`] = el
|
|
|
+}
|
|
|
+
|
|
|
const query = async () => {
|
|
|
let {startTime, endTime} = getDateRangeFormatDate(dateRange.value)
|
|
|
const param = {
|
|
@@ -212,26 +217,20 @@ const drugTable = (row) => {
|
|
|
let copyStr = ''
|
|
|
const appendCopy = () => {
|
|
|
let temp = tableRef.value.getSelectionRows()
|
|
|
- let drugSensitivity = []
|
|
|
-
|
|
|
- try {
|
|
|
- drugSensitivity = drugSensitivityRef.value.getSelectionRows()
|
|
|
- } catch (e) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (temp.length === 0 && drugSensitivity.length === 0) {
|
|
|
- xcMessage.error('请先选选择数据')
|
|
|
- }
|
|
|
let data = currentReportForm.aply_CTNT + ":"
|
|
|
|
|
|
temp.forEach(item => {
|
|
|
data += `${item.itm_NAME}${result(item)}${item.itm_UNIT}${getItemStr(item.itm_ALERT, item.itm_STR_VALUE, item.itm_VALUE)},`
|
|
|
})
|
|
|
|
|
|
- drugSensitivity.forEach(item => {
|
|
|
- data += `${item.anti_NAME_CN}${item.anti_ABB}${item.anti_MIC}${item.anti_VALUE},`
|
|
|
- })
|
|
|
+ for (let key in refMap) {
|
|
|
+ let item = refMap[key]
|
|
|
+ let tempList = item.getSelectionRows()
|
|
|
+ tempList.forEach(item => {
|
|
|
+ data += `${item.anti_NAME_CN}${item.anti_ABB}${item.anti_MIC}${item.anti_VALUE},`
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
copyStr += ' ' + data
|
|
|
xcMessage.success('追加成功。')
|
|
|
}
|