Browse Source

feat: [仪器选择] 增加其他输入

luojie
memorylkf 1 week ago
parent
commit
727b16f040
1 changed files with 40 additions and 3 deletions
  1. +40
    -3
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue

+ 40
- 3
src/views/business/comps/template/dialog/SelectInstrumentDialog.vue View File

@ -7,6 +7,12 @@
:listApi="listApi"
:selectedCode="selectedCode"
@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">
<el-button @click="onCancel">{{$t('form.cancel')}}</el-button>
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button>
@ -86,10 +92,19 @@ export default {
currentRow: {},
studyFormId:'',//studyFormId
uuid:'',//eventBusid,
otherChecked: false,
otherReagent: "",//
}
},
computed: {
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;
}
},
@ -106,6 +121,9 @@ export default {
}
}, 10);
this.studyFormId = studyFormId
this.otherChecked = false;
this.otherReagent = "";
},
onCancel() {
this.visible = false
@ -113,21 +131,30 @@ export default {
},
onSubmit() {
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,
bh: row.bh,
xh: row.xh,
jzrq: row.jzrq,
}
// 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;
},
handleSelect(code,row) {
this.selectedId = code;
this.currentRow = row;
},
handleOtherChange(val) {
this.otherChecked = val;
if (val) {//id
this.selectedId = "";
this.currentRow = null;
}
},
}
}
</script>
@ -138,4 +165,14 @@ export default {
align-items: center;
padding: 20px 0;
}
.other-reagent {
display: flex;
align-items: center;
padding: 20px 0;
}
.other-reagent-input {
width: 200px;
margin-left: 5px;
}
</style>

Loading…
Cancel
Save