|
|
@ -7,6 +7,12 @@ |
|
|
:listApi="listApi" |
|
|
:listApi="listApi" |
|
|
:selectedCode="selectedCode" |
|
|
:selectedCode="selectedCode" |
|
|
@radioSelect="handleSelect"/> |
|
|
@radioSelect="handleSelect"/> |
|
|
|
|
|
|
|
|
|
|
|
<div class="other-reagent"> |
|
|
|
|
|
<el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox> |
|
|
|
|
|
<el-input class="other-reagent-input" v-model="otherReagent"></el-input> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<template slot="footer" class="dialog-footer"> |
|
|
<template slot="footer" class="dialog-footer"> |
|
|
<el-button @click="onCancel">{{$t('form.cancel')}}</el-button> |
|
|
<el-button @click="onCancel">{{$t('form.cancel')}}</el-button> |
|
|
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button> |
|
|
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button> |
|
|
@ -86,10 +92,19 @@ export default { |
|
|
currentRow: {}, |
|
|
currentRow: {}, |
|
|
studyFormId:'',//有个studyFormId需要从外面动态传过来 |
|
|
studyFormId:'',//有个studyFormId需要从外面动态传过来 |
|
|
uuid:'',//为了标识eventBus的事件id, |
|
|
uuid:'',//为了标识eventBus的事件id, |
|
|
|
|
|
|
|
|
|
|
|
otherChecked: false, |
|
|
|
|
|
otherReagent: "",//其他试剂 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
isDisabled() { |
|
|
isDisabled() { |
|
|
|
|
|
if (this.otherChecked && this.otherReagent) {//如果选中了其他,那么就不校验是否选择了试剂 |
|
|
|
|
|
return false; |
|
|
|
|
|
}else if(this.checkType === "checkbox"){ |
|
|
|
|
|
console.log(this.currentRow,"this.currentRow") |
|
|
|
|
|
return !this.currentRow || this.currentRow.length === 0; |
|
|
|
|
|
} |
|
|
return !this.selectedId; |
|
|
return !this.selectedId; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -106,6 +121,9 @@ export default { |
|
|
} |
|
|
} |
|
|
}, 10); |
|
|
}, 10); |
|
|
this.studyFormId = studyFormId |
|
|
this.studyFormId = studyFormId |
|
|
|
|
|
|
|
|
|
|
|
this.otherChecked = false; |
|
|
|
|
|
this.otherReagent = ""; |
|
|
}, |
|
|
}, |
|
|
onCancel() { |
|
|
onCancel() { |
|
|
this.visible = false |
|
|
this.visible = false |
|
|
@ -113,21 +131,30 @@ export default { |
|
|
}, |
|
|
}, |
|
|
onSubmit() { |
|
|
onSubmit() { |
|
|
let row = this.currentRow; |
|
|
let row = this.currentRow; |
|
|
this.$emit('submit', this.selectedId,row); |
|
|
|
|
|
const selectInfo = { |
|
|
|
|
|
|
|
|
const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId; |
|
|
|
|
|
|
|
|
|
|
|
this.$emit('submit', selectedValue,row); |
|
|
|
|
|
const selectInfo = this.otherChecked ?{}: { |
|
|
mc: row.mc, |
|
|
mc: row.mc, |
|
|
bh: row.bh, |
|
|
bh: row.bh, |
|
|
xh: row.xh, |
|
|
xh: row.xh, |
|
|
jzrq: row.jzrq, |
|
|
jzrq: row.jzrq, |
|
|
} |
|
|
} |
|
|
// 触发eventBus事件 |
|
|
// 触发eventBus事件 |
|
|
EventBus.$emit("onInstrumentSubmit",{selectInfo,uuid:this.uuid,selectedId:this.selectedId,row,type:"yq"}); |
|
|
|
|
|
|
|
|
EventBus.$emit("onInstrumentSubmit",{selectInfo,uuid:this.uuid,selectedId:selectedValue,row,type:"yq"}); |
|
|
this.visible = false; |
|
|
this.visible = false; |
|
|
}, |
|
|
}, |
|
|
handleSelect(code,row) { |
|
|
handleSelect(code,row) { |
|
|
this.selectedId = code; |
|
|
this.selectedId = code; |
|
|
this.currentRow = row; |
|
|
this.currentRow = row; |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleOtherChange(val) { |
|
|
|
|
|
this.otherChecked = val; |
|
|
|
|
|
if (val) {//如果选中了其他,那么就清空选中的id |
|
|
|
|
|
this.selectedId = ""; |
|
|
|
|
|
this.currentRow = null; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -138,4 +165,14 @@ export default { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
padding: 20px 0; |
|
|
padding: 20px 0; |
|
|
} |
|
|
} |
|
|
|
|
|
.other-reagent { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
padding: 20px 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.other-reagent-input { |
|
|
|
|
|
width: 200px; |
|
|
|
|
|
margin-left: 5px; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |