123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <template>
- <div class="groups-cont">
- <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
- <div class="sub-condition-form">
- <span v-if="!isLast" class="del-btn" @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
- <el-form-item label="基础依据名称:" :prop="ruleLine+ind+'.basDescription'">
- <el-input v-model.trim = "groupData.basDescription"></el-input>
- </el-form-item>
- <el-form-item label="基础依据类型:" :prop="ruleLine+ind+'.basType'">
- <el-select v-model="groupData.basType"
- id="basTypeRef"
- placeholder="请选择"
- size="small"
- @change="basTypeChange">
- <el-option
- v-for="item in baseTypes"
- :key="item.id"
- :label="item.name"
- :value="item.type">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="!showRegx" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
- <el-select v-model="groupData.basLibType"
- placeholder="请选择"
- size="small"
- :disabled="showRegx">
- <el-option
- v-for="item in baseTermTypeList"
- :key="item.id"
- :label="item.name"
- :value="item.code">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="showRegx" label="基础依据术语类型:" class="is-required">
- <el-input disabled v-model="basTypeName"></el-input>
- </el-form-item>
- <el-form-item v-if="!showRegx" class="addDepartFormItem" label="医学标准术语:" :prop="ruleLine+ind+'.basConceptId'">
- <el-select clearable remote filterable :remote-method="searchConcept" v-model.trim="groupData.basConceptId">
- <el-option
- v-for="item in conceptList"
- :key="item.conceptId"
- :label="item.conceptName"
- :value="item.conceptId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="groupData.basType===2&&!onlyNum" label="选择类型:" :prop="ruleLine+ind+'.dataType'">
- <el-select v-model="groupData.dataType"
- placeholder="请选择"
- size="small" @change="dataTypeChange">
- <el-option
- v-for="item in dataTypes"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="min-margin" v-if="groupData.dataType==='1'||onlyNum" label="最大值:">
- <div class="select-item clearfix">
- <el-col :span="3">
- <el-form-item :prop="ruleLine+ind+'.maxOperator'">
- <el-select v-model="groupData.maxOperator"
- placeholder="请选择"
- size="small" clearable>
- <el-option
- v-for="item in operMaxList"
- :key="item.key"
- :label="item.name"
- :value="item.key">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item :prop="ruleLine+ind+'.maxVal'">
- <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值"/>
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item prop="maxUnit">
- <el-input type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位"/>
- </el-form-item>
- </el-col>
- </div>
- </el-form-item>
- <el-form-item class="min-margin" v-if="groupData.dataType==='1'||onlyNum" label="最小值:">
- <div class="select-item clearfix">
- <el-col :span="3">
- <el-form-item :prop="ruleLine+ind+'.minOperator'">
- <el-select v-model="groupData.minOperator"
- placeholder="请选择"
- size="small" clearable>
- <el-option
- v-for="item in operMinList"
- :key="item.name"
- :label="item.name"
- :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item :prop="ruleLine+ind+'.minVal'">
- <el-input type="text" v-model="groupData.minVal" placeholder="填写数值"/>
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item prop="minUnit">
- <el-input type="text" v-model.trim="groupData.minUnit" placeholder="填写单位"/>
- </el-form-item>
- </el-col>
- </div>
- </el-form-item>
- <el-form-item v-if="groupData.dataType==='2'" label="医学内容:" :prop="ruleLine+ind+'.eqValue'" class="discDesc is-required">
- <el-input type="textarea" rows="3" placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
- </el-form-item>
- <el-form-item v-if="showRegx" label="正则表达式:" :prop="ruleLine+ind+'.eqValue'" class="discDesc is-required">
- <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
- </el-form-item>
- </div>
- <!--</el-form>-->
- <div class="inner-oper" v-if="ind===len-1">
- <span>新增基础依据:</span>
- <span class="add-btn" @click="addRule"><img src="../../images/add.png" alt="新增基础依据"></span>
- </div>
- </div>
- </template>
- <script>
- import api from '@api/zskDiagBase.js';
- export default {
- name:'DiagBaseItem',
- props:['groupData','ind','isLast','baseTypes','parInx','inx','len'],
- data(){
- return {
- baseTermTypeList:[],
- typeList:[],
- numTypes:'', //只有数值类型的类型id
- //basTypeName:'',
- operMaxList:[
- {name:'<=',key:'<='},
- {name:'<',key:'<'},
- ],
- operMinList:[{name:'>',key:'>'},
- {name:'>=',key:'>='},
- ],
- dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
- conceptList:[],
- }
- },
- watch: {
- 'groupData': {
- handler: function (val) {
- this.$emit("changeVal", val, this.ind);
- },
- deep: true
- },
- },
- created(){
- if(this.groupData.maxOperator||this.groupData.minOperator){
- this.groupData.dataType='1';
- }else if(this.groupData.eqValue){
- this.groupData.dataType='2';
- }
- },
- mounted(){
- this.conceptList=[{conceptName:this.groupData.basLibName,conceptId:this.groupData.basConceptId}];
- if(this.groupData.basLibType){
- this.baseTermTypeList=[{name:this.groupData.basLename,code:this.groupData.basLibType}];
- }
- },
- computed:{
- basTypeName:function(){
- return (this.baseTypes.find((it)=>it.type===this.groupData.basType)||{}).name;
- },
- onlyNum:function(){
- const codes=localStorage.getItem("zskDiagDicts")+',';
- const type=this.groupData.basLibType;
- return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
- },
- ruleLine:function(){
- return 'klDiagnoseTypeVO.'+this.parInx+'.groupVO.'+this.inx+'.klDiagnoseDetail.';
- },
- showRegx:function(){
- return this.groupData.basType===3||this.groupData.basType===4;
- },
- textName:function(){
- return this.showRegx?'正则表达式':'医学内容';
- },
- },
- methods:{
- dataTypeChange(val){
- this.groupData.eqOperator=(val==='2'?'=':'');
- this.clearNumText();
- delete this.groupData.dataType; //触发更新
- this.$set(this.groupData,'dataType',val);
- },
- basTypeChange(val){ //基础规则类型修改
- if(!val){
- this.baseTermTypeList =[];
- return;
- }
- this.groupData.basLibType='';
- this.clearConcept(); //清空医学标准术语
- this.clearNumText(); //清空数值、医学内容
- const obj = this.baseTypes.find((it)=>it.type===val);
- this.baseTermTypeList = obj.subMenuList;
- },
- subCodeChange(val){ //基础规则术语类型修改
- this.groupData.basLibType=val;
- if((this.numTypes+',').indexOf(val+',')>-1){
- this.groupData.dataType='1';
- }else{
- this.groupData.dataType='';
- }
- this.clearConcept();
- this.clearNumText();
- },
- clearConcept(){
- this.groupData.basConceptId='';
- this.conceptList=[];
- },
- clearNumText(){
- this.groupData.maxOperator='';
- this.groupData.maxVal='';
- this.groupData.maxUnit='';
- this.groupData.minOperator='';
- this.groupData.minVal='';
- this.groupData.minUnit='';
- this.groupData.eqValue='';
- this.groupData.eqOperator='';
- },
- searchConcept(val){
- const param = {
- excludedConceptIds:[this.groupData.basType],
- libType:this.groupData.basLibType,
- name:val,
- };
- api.searchConcept(param).then((res) => {
- if (res.data.code == '0') {
- const data = res.data.data;
- this.conceptList = data;
- }
- }).catch((error) => {
- console.log(error);
- });
- },
- addRule(){
- this.$emit("addRule");
- this.$emit('setRules');
- },
- delRule(){
- this.$emit("delRule",this.ind);
- },
- warning(msg,type){
- this.$message({
- showClose: true,
- message:msg,
- type:type||'warning'
- })
- },
- showConfirmDialog(msg,resolve){
- this.$alert(msg, '提示', {
- confirmButtonText: '确定',
- type: 'warning'
- }).then(() => {
- resolve();
- }).catch(() => {});
- },
- }
- }
- </script>
- <style lang="less">
- .groups-cont{
- background: #fff;
- border-bottom:2px solid #F5F5F5;
- .conceptItem{
- padding: 0 10px;
- cursor: pointer;
- height: 32px;
- line-height: 32px;
- &:hover{
- background: #ebedf1;
- }
- }
- .inner-oper{
- padding: 15px 0 15px 21px;
- .add-btn {
- cursor: pointer;
- img {
- vertical-align: middle;
- }
- }
- }
- .sub-condition-form{
- padding: 20px;
- position: relative;
- border-bottom:1px solid #F5F5F5;
- .del-btn{
- color: #FF5B5B;
- cursor: pointer;
- position: absolute;
- right: 20px;
- top:20px;
- z-index: 1;
- &.disable{
- color: #B8B8B8;
- }
- }
- }
- .el-input__icon{
- line-height: 32px;
- }
- .select-item{
- &>div{
- float: left;
- margin-right: 10px;
- }
- .el-input{
- width: auto;
- }
- input{
- width: 95px;
- line-height: 32px;
- height: 32px;
- }
- }
- .el-input,.el-input__inner{
- width: 190px;
- line-height: 32px;
- height: 32px;
- }
- .el-button--danger.is-plain{
- background: none;
- }
- .itemList {
- position: absolute;
- // display: none;
- background: #fff;
- width: 188px;
- max-height: 160px;
- border: 1px solid #DCDFE6;
- left: 0;
- top: 37px;
- z-index: 2;
- overflow-y: auto;
- }
- .el-form-item{
- margin-bottom: 22px;
- &.min-margin{
- margin-bottom: 0;
- }
- }
- .el-form-item__error{
- top: auto;
- white-space: nowrap;
- background: #fff;
- }
- .el-input-number{
- width: 95px;
- }
- .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
- width: 25px;
- height: 15px;
- line-height: 16px;
- }
- .el-col-3 {
- width: 94px;
- }
- }
- </style>
|