123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758 |
- <template>
- <div style="min-height:100%" ref="viewBox">
- <crumbs :title="title" :param="$route.params" linkTo="ZskDiagBase"></crumbs>
- <div class="contents">
- <el-form
- :inline="true"
- ref="form"
- :label-position="labelPosition"
- class="add-new-form"
- label-width="100px"
- :model="form"
- :rules="rules"
- >
- <div class="content">
- <el-form-item label="疾病名称:" class="item" prop="conceptId" :rules="rules.conceptId">
- <el-select
- clearable
- remote
- filterable
- :remote-method="searchDiag"
- v-model.trim="form.conceptId"
- >
- <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 label="诊断依据描述:" prop="description" class="item">
- <el-input
- class="inps"
- maxlength="200"
- placeholder="请输入诊断依据描述"
- v-model.trim="form.description"
- ></el-input>
- </el-form-item>
- </div>
- <div class="content content-2">
- <div class="content-2-header">
- <p class="title1">
- <span class="star">*</span>诊断依据内容
- </p>
- <p class="title2">注:1、选择诊断依据类型后才能展示基础依据类型。2、医学内容可输入升高、降低、阴性、阳性等~</p>
- </div>
- <el-table
- size="mini"
- :span-method="dataSpanMethod"
- :data="form.klDiagnoseTypeVO"
- border
- ref="tableList"
- style="min-height: 200px"
- height="calc(100vh - 450px)"
- :header-cell-style="{background:'#E3EAF4'}"
- >
- <el-table-column label="依据" width="100" fixed>
- <template slot="header" slot-scope="scope">
- <span class="name">依据</span>
- </template>
- <template slot-scope="scope">
- <el-form-item>
- <img
- src="../../images/icon-copy.png"
- height="18"
- width="18"
- class="icon"
- @click="copyDiag(scope.row.depart_id)"
- />
- <img
- src="../../images/icon-add.png"
- height="18"
- width="18"
- class="icon"
- @click="addDiag(scope.row.depart_id)"
- />
- <img
- src="../../images/icon-delete.png"
- height="18"
- width="18"
- class="icon"
- @click="delDiag(scope.row.depart_id,scope.$index)"
- v-show="dest.length>1"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="诊断依据类型" width="130">
- <template slot="header" slot-scope="scope">
- <span class="star">*</span>
- <span class="name">诊断依据类型</span>
- </template>
- <template slot-scope="scope">
- <el-form-item
- class="is-request"
- :prop="'klDiagnoseTypeVO.'+scope.$index+'.conditionType'"
- :rules="rules.conditionType"
- >
- <el-select
- ref="aa"
- v-model="form.klDiagnoseTypeVO[scope.$index].conditionType"
- @change="(val)=>basTypeChange(val,scope.$index)"
- >
- <el-option
- v-for="item in baseTypes"
- :key="item.ruleType"
- :label="item.name"
- :value="item.ruleType"
- ></el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="组" width="130">
- <template slot="header" slot-scope="scope">
- <span class="star">*</span>
- <span class="name">组</span>
- </template>
- <template slot-scope="scope">
- <el-form-item>
- <img
- src="../../images/icon-add.png"
- height="18"
- width="18"
- class="icon"
- @click="addGroup(scope.$index)"
- />
- <img
- src="../../images/icon-delete.png"
- height="18"
- width="18"
- class="icon"
- @click="delGroup(scope.row.depart_id,scope.$index)"
- v-show="isMax(scope.row.depart_id)"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="符合条件数量" width="150">
- <template slot="header" slot-scope="scope">
- <span class="star">*</span>
- <span class="name">符合条件数量</span>
- </template>
- <template slot-scope="scope">
- <el-form-item
- :prop="'klDiagnoseTypeVO.'+scope.$index+'.groupVO.'+0+'.fitNo'"
- :rules="rules.fitNo"
- >
- <el-select v-model="scope.row.groupVO[0].fitNo">
- <el-option
- v-for="item in numArr[scope.$index].num[0]"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column v-for="(v,i) in columns" :width="v.width" :key="i">
- <template slot="header" slot-scope="scope">
- <span class="star" v-if="v.istar">*</span>
- <span class="name">{{v.title}}</span>
- </template>
- <template slot-scope="scope">
- <div v-for="(item,index) in scope.row.groupVO" :key="index">
- <div v-for="(items,i) in item.klDiagnoseDetail" :key="i">
- <div v-if="v.title == '基础依据'">
- <el-form-item>
- <img
- src="../../images/icon-add.png"
- height="18"
- width="18"
- class="icon"
- @click="addRule(scope.row,scope.$index,index)"
- />
- <img
- src="../../images/icon-delete.png"
- height="18"
- width="18"
- class="icon"
- @click="delRule(scope.row,scope.$index,index,i)"
- v-show="item.klDiagnoseDetail.length>1"
- />
- </el-form-item>
- </div>
- <div class="box-2" v-if="v.title == '基础依据名称'">
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.basDescription'"
- :rules="rules.basDescription"
- >
- <el-input
- class="inp-name"
- placeholder="请输入基础依据名称"
- maxlength="100"
- v-model.trim="items.basDescription"
- ></el-input>
- </el-form-item>
- </div>
- <div class="box-2" v-if="v.title == '基础依据类型'">
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.basType'"
- :rules="rules.basType"
- >
- <el-select
- v-model="items.basType"
- @change="(val)=>baseTermTypeChange(val,scope.$index,index,i)"
- >
- <el-option
- v-for="item in baseTermTypeList"
- :key="item.id"
- :label="item.name"
- :value="item.type"
- ></el-option>
- </el-select>
- </el-form-item>
- </div>
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.basLibType'"
- v-if="!items.basNameType && v.title == '基础依据术语类型'"
- :rules="rules.basLibType"
- >
- <el-select
- v-model="items.basLibType"
- @change="(val)=>basLibTypeChange(val,scope.$index,index,i)"
- >
- <el-option
- v-for="item in items.basLibTypeList"
- :key="item.id"
- :label="item.name"
- :value="Number(item.code)"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="items.basNameType && v.title == '基础依据术语类型'">
- <el-input disabled v-model="items.basTypeName"></el-input>
- </el-form-item>
- <div
- v-if="v.title == '医学标准术语'"
- class="box-2"
- :class="items.basType===3 || items.basType===4? 'tmall' : 'taobao'"
- >
- <el-form-item
- v-if="items.basType==1 || items.basType==2 || items.basType==''"
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.basConceptId'"
- :rules="rules.subConceptId"
- >
- <el-select
- class="searchselect"
- v-model.trim="items.basConceptId"
- multiple
- filterable
- remote
- reserve-keyword
- placeholder="请输入关键词"
- :remote-method="(val)=>searchConcept(val,scope.$index,index,i)"
- @change="(val)=>conceptChange(val,scope.$index,index,i)"
- >
- <el-option
- v-for="item in items.conceptList"
- :key="item.conceptId"
- :label="item.conceptName"
- :value="item.conceptId"
- ></el-option>
- </el-select>
- <!-- <el-select
- clearable
- remote
- filterable
- :remote-method="(val)=>searchConcept(val,scope.$index,index,i)"
- v-model.trim="items.basConceptId"
- @change="(val)=>conceptChange(val,scope.$index,index,i)"
- >
- <el-option
- v-for="item in items.conceptList"
- :key="item.conceptId"
- :label="item.conceptName"
- :value="item.conceptId"
- ></el-option>
- </el-select>-->
- </el-form-item>
- </div>
- <div class="last-box" v-if="v.title == '依据具体内容'">
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.dataType'"
- v-if="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType"
- :rules="rules.dataType"
- >
- <el-select
- class="box-1"
- :class="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType? 'taobao' : 'tmall'"
- v-model="items.dataType"
- @change="(val)=>dataTypeChange(val,scope.$index,index,i)"
- placeholder="请选择"
- size="small"
- >
- <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
- v-if="(!items.onlyNumType&&items.dataType==='1')||items.onlyNumType"
- label="最大值:"
- label-width="60px"
- >
- <div class="last-box-1">
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.maxOperator'"
- :rules="[
- {
- validator: (rule, value, callback) => {
- maxOperator(items, rule, value, callback);
- },
- trigger: ['change']
- }
- ]"
- >
- <el-select
- v-model="items.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-form-item
- class="num"
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.maxVal'"
- :rules="[
- {
- validator: (rule, value, callback) => {
- maxVal(items, rule, value, callback);
- },
- trigger: ['blur']
- }
- ]"
- >
- <el-input v-model="items.maxVal" placeholder="填写数值"></el-input>
- </el-form-item>
- <el-form-item prop="minUnit">
- <el-input v-model.trim="items.maxUnit" placeholder="填写单位"></el-input>
- </el-form-item>
- </div>
- </el-form-item>
- <el-form-item
- v-if="(!items.onlyNumType&&items.dataType==='1')||items.onlyNumType"
- label="最小值:"
- label-width="60px"
- >
- <div class="last-box-1 last-box-s">
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.minOperator'"
- :rules="[
- {
- validator: (rule, value, callback) => {
- minOperator(items, rule, value, callback);
- },
- trigger: ['change']
- }
- ]"
- >
- <el-select
- v-model="items.minOperator"
- placeholder="请选择"
- size="small"
- clearable
- >
- <el-option
- v-for="item in operMinList"
- :key="item.key"
- :label="item.name"
- :value="item.key"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- class="minnum"
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.minVal'"
- :rules="[
- {
- validator: (rule, value, callback) => {
- minVal(items, rule, value, callback);
- },
- trigger: ['blur']
- }
- ]"
- >
- <el-input v-model="items.minVal" placeholder="填写数值"></el-input>
- </el-form-item>
- <el-form-item prop="minUnit">
- <el-input v-model.trim="items.minUnit" placeholder="填写单位"></el-input>
- </el-form-item>
- </div>
- </el-form-item>
- <div>
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.eqValue'"
- v-if="items.basType===4 || items.basType===3"
- maxlength="200"
- label="正则表达式:"
- class="discDesc"
- :rules="[
- {
- required: true,
- message: '请输入正则表达式',
- trigger: 'blur'
- },
- ]"
- >
- <el-input class="inp" placeholder="请输入正则表达式" v-model.trim="items.eqValue"></el-input>
- </el-form-item>
- </div>
- <div>
- <el-form-item
- :prop="'klDiagnoseTypeVO.' +
- scope.$index +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.'+i+'.eqValue'"
- maxlength="200"
- v-if="(!items.onlyNumType&&!items.basNameType&&(items.basType===2 || items.basType===1)&&items.dataType==='2')||items.onlyTxtType"
- label="医学内容:"
- class="discDesc"
- :rules="[
- {
- required: true,
- message: '请输入医学内容',
- trigger: 'blur'
- }
-
- ]"
- >
- <el-input v-model.trim="items.eqValue" class="inp" placeholder="请输入医学内容"></el-input>
- </el-form-item>
- </div>
- </div>
- </div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-form>
- <div class="Butn">
- <el-button class="disclButn" size="small" type="primary" @click="confirm">确定</el-button>
- </div>
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import util from '../../api/utils.js';
- import api from '@api/zskDiagBase.js';
- import { tableRules } from './rules';
- export default {
- name: 'AddZskDiagBase',
- data() {
- return {
- columns: [
- { title: '基础依据', width: 90, istar: true },
- { title: '基础依据名称', width: 160, istar: true },
- { title: '基础依据类型', width: 130, istar: true },
- { title: '基础依据术语类型', width: 160, istar: true },
- { title: '医学标准术语', width: 180, istar: true },
- { title: '依据具体内容', width: 850 }
- ],
- dicts: {},
- baseTypes: [], //诊断数据类型
- baseTermTypeList: [], //基础依据类型
- basLibTypeList: [], //基础术语依据类型
- numTypes: '', //只有数值类型的类型id
- labelPosition: 'left',
- isCopy: false,
- title: '诊断依据维护-添加诊断依据',
- conceptName: '',
- conceptList: [],
- form: {
- description: '',
- conceptId: '',
- klDiagnoseTypeVO: [
- {
- conditionType: '',
- depart_id: 0,
- groupVO: [
- {
- baseGroup: '',
- conditionGroup: '',
- fitNo: '',
- klDiagnoseDetail: [
- {
- dataType: '',
- basNameType: false,
- onlyNumType: false,
- onlyTxtType: false,
- basTypeName: '',
- basConceptId: [],
- basDescription: '',
- basLename: '',
- basLibName: '',
- basLibType: null,
- basType: '',
- eqOperator: '',
- eqUnit: '',
- eqValue: '',
- maxOperator: '',
- maxUnit: '',
- maxVal: '',
- minOperator: '',
- minUnit: '',
- minVal: ''
- }
- ]
- }
- ]
- }
- ]
- },
- id: null,
- rules: tableRules,
- dataTypes: [
- { id: '1', name: '数值类型' },
- { id: '2', name: '文本类型' }
- ],
- operMaxList: [
- { name: '<=', key: '<=' },
- { name: '<', key: '<' }
- ],
- operMinList: [
- { name: '>', key: '>' },
- { name: '>=', key: '>=' }
- ],
- basType: '',
- dataType: '',
- spanArr: [],
- list: [], //提交数据数组,
- i: 1,
- onshow: true
- };
- },
- created() {
- const param = this.$route.params;
- this.baseTypes = JSON.parse(localStorage.getItem('zskDiagList') || '[]');
- this.dicts = JSON.parse(localStorage.getItem('zskDiagDicts') || '{}');
- let info = param.data;
- if (info) {
- this.id = info.id;
- this.isCopy = param.copy;
- this.title =
- '诊断依据维护-' + (this.isCopy ? '复制' : '修改') + '诊断依据';
- this.conceptList = [
- { conceptId: info.conceptId, conceptName: info.conceptName }
- ];
- for (let i = 0; i < info.klDiagnoseTypeVO.length; i++) {
- info.klDiagnoseTypeVO[i].depart_id = i;
- }
- this.form = Object.assign({}, this.form, this.formatData(info));
- if (this.isCopy) {
- this.conceptList = [];
- delete this.form.conceptName;
- delete this.form.conceptId;
- delete this.form.description;
- delete this.form.id;
- }
- var index2 = this.baseTypes.findIndex(
- item => item.ruleType === this.form.klDiagnoseTypeVO[0].conditionType
- );
- this.baseTermTypeList = this.baseTypes[index2].subMenuList;
- let arr = [];
- for (let i = 0; i < this.form.klDiagnoseTypeVO.length; i++) {
- for (let j = 0; j < this.form.klDiagnoseTypeVO[i].groupVO.length; j++) {
- for (
- let k = 0;
- k <
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
- k++
- ) {
- var index2 = this.baseTermTypeList.findIndex(
- item =>
- item.type ===
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .basType
- );
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basLibTypeList = this.baseTermTypeList[index2].subMenuList;
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].conceptList = this.formatData2(this.form.klDiagnoseTypeVO[i].groupVO[
- j
- ].klDiagnoseDetail[k].libNameList)
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].libNameList.forEach(item => {
- arr.push(item.basConceptId);
- });
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basConceptId = arr;
- if (
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .maxOperator ||
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .minOperator
- ) {
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].dataType = '1';
- } else if (
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .eqValue
- ) {
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].dataType = '2';
- }
- if (
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .basType == 3 ||
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .basType == 4
- ) {
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basTypeName = this.form.klDiagnoseTypeVO[i].groupVO[
- j
- ].klDiagnoseDetail[k].basLibTypeList[0].name;
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basNameType = true;
- } else {
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basTypeName = '';
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].basNameType = false;
- }
- const onlyNum = this.dicts['onlyNum'] || '&';
- const onlyTxt = this.dicts['onlyTxt'] || '&';
- const codes = onlyNum + ',';
- const code = onlyTxt + ',';
- let type = this.form.klDiagnoseTypeVO[i].groupVO[j]
- .klDiagnoseDetail[k].basLibType;
- let a = this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .basLibType;
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].onlyNumType = type && codes.indexOf(a + ',') > -1;
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
- k
- ].onlyTxtType = type && code.indexOf(a + ',') > -1;
- }
- }
- }
- this.i = this.form.klDiagnoseTypeVO.slice(-1)[0].depart_id + 1;
- }
- },
- computed: {
- numArr() {
- let arr = [];
- let num = [];
- for (let i = 0; i < this.form.klDiagnoseTypeVO.length; i++) {
- arr.push({ num: [] });
- for (let j = 0; j < this.form.klDiagnoseTypeVO[i].groupVO.length; j++) {
- arr[i].num.push([]);
- for (
- let k = 0;
- k <
- this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
- k++
- ) {
- arr[i].num[j].push({ id: k + 1, name: k + 1 });
- }
- }
- }
- return arr;
- },
- dest() {
- const formData = JSON.parse(JSON.stringify(this.form));
- let map = {},
- dest = [];
- for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
- let ai = formData.klDiagnoseTypeVO[i];
- if (!map[ai.depart_id]) {
- dest.push({
- depart_id: ai.depart_id,
- conditionType: ai.conditionType,
- groupVO: ai.groupVO
- });
- map[ai.depart_id] = ai;
- } else {
- for (let j = 0; j < dest.length; j++) {
- var dj = dest[j];
- if (dj.depart_id == ai.depart_id) {
- dj.groupVO = dj.groupVO.concat(ai.groupVO);
- break;
- }
- }
- }
- }
- return dest;
- }
- },
- // mounted() {
- // this.onscroll();
- // },
- methods: {
- // onscroll() {
- // this.$nextTick(function() {
- // // 监听当前组件的滚动事件
- // this.box = this.$refs.tableList.bodyWrapper;
- // this.box.addEventListener(
- // 'scroll',
- // () => {
- // // select组件层级太高,滚动隐藏
- // if (this.$refs.tableList.bodyWrapper.scrollLeft > 0) {
- // console.log(this.$refs.aa.handleClose)
- // // this.$refs.aa.handleClose()
- // // this.$refs.aa.blur()
- // // const SELECTWRAP_BODY = document.body; // body
- // // const SELECTWRAP_DOWNALL = document.querySelectorAll(
- // // '.el-select-dropdown'
- // // ); // select下拉框
- // // SELECTWRAP_BODY.click();
- // // SELECTWRAP_DOWNALL.forEach(item => {
- // // item.blur();
- // // });
- // }
- // },
- // false
- // );
- // });
- // },
- // 最大值 选择rule
- maxOperator(items, rule, value, callback) {
- const { maxVal, minOperator, minVal } = items;
- const val = value + minOperator + minVal + maxVal;
- if (!val || (!value && maxVal !== '')) {
- callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
- } else {
- callback();
- }
- },
- // 最大值 数值rule
- maxVal(items, rule, value, callback) {
- const { maxOperator, minOperator, minVal } = items;
- const val = value + maxOperator + minOperator + minVal;
- const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
- if (!val || (value == '' && maxOperator)) {
- callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
- } else if (value !== '' && !isNum) {
- callback(new Error('只能输入数字'));
- } else {
- callback();
- }
- },
- // 最小值 选择rule
- minOperator(items, rule, value, callback) {
- const { maxVal, maxOperator, minVal } = items;
- const val = value + maxVal + maxOperator + minVal;
- if (!val || (!value && minVal !== '')) {
- callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
- } else {
- callback();
- }
- },
- // 最小值 数值rule
- minVal(items, rule, value, callback) {
- const { maxVal, minOperator, maxOperator } = items;
- const val = value + maxVal + minOperator + maxOperator;
- const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
- if (!val || (value == '' && minOperator)) {
- callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
- } else if (value !== '' && !isNum) {
- callback(new Error('只能输入数字'));
- } else {
- callback();
- }
- },
- isMax(id) {
- const typeNum = this.form.klDiagnoseTypeVO.filter(
- item => item.depart_id === id
- ).length;
- return typeNum > 1;
- },
- getData(data) {
- let arr = data;
- let str = [];
- let newArr = [];
- arr.filter((value, index, array) => {
- if (value.groupVO.length > 1 && value.groupVO.length != 0) {
- for (let j = 0; j < value.groupVO.length; j++) {
- var db = {
- conditionType: value.conditionType,
- depart_id: value.depart_id,
- groupVO: [value.groupVO[j]]
- };
- str.push(db);
- }
- value.groupVO = [];
- arr.splice(index, 1);
- arr.splice(index, 0, ...str);
- newArr = str;
- } else {
- newArr = arr;
- }
- });
- // console.log(newArr)
- // this.$set(this, 'form.klDiagnoseTypeVO', newArr);
- this.getSpanArr(newArr);
- },
- getSpanArr(data) {
- this.spanArr = [];
- for (var i = 0; i < data.length; i++) {
- if (i === 0) {
- this.spanArr.push(1);
- this.pos = 0;
- } else {
- if (data[i].depart_id === data[i - 1].depart_id) {
- this.spanArr[this.pos] += 1;
- this.spanArr.push(0);
- } else {
- this.spanArr.push(1);
- this.pos = i;
- }
- }
- }
- },
- dataSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0 || columnIndex === 1) {
- //合并行的行为只在第一列进行
- const _row = this.spanArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- getInitData() {
- this.i++;
- return {
- conditionType: '',
- depart_id: this.i,
- groupVO: [
- {
- baseGroup: '',
- conditionGroup: '',
- fitNo: '',
- klDiagnoseDetail: [
- {
- dataType: '',
- basNameType: false,
- onlyNumType: false,
- onlyTxtType: false,
- basTypeName: '',
- basConceptId: [],
- basDescription: '',
- basLename: '',
- basLibName: '',
- basLibType: null,
- basType: '',
- eqOperator: '',
- eqUnit: '',
- eqValue: '',
- maxOperator: '',
- maxUnit: '',
- maxVal: '',
- minOperator: '',
- minUnit: '',
- minVal: ''
- }
- ]
- }
- ]
- };
- },
- //新增依据
- addDiag(id) {
- let temp = this.getInitData();
- var i = -1;
- this.form.klDiagnoseTypeVO.forEach((item, inx) => {
- if (item.depart_id == id) {
- i = inx;
- }
- });
- this.$nextTick(() => {
- this.$refs.tableList.bodyWrapper.scrollLeft = 0;
- });
- this.form.klDiagnoseTypeVO.splice(i + 1, 0, temp);
- },
- //复制依据
- copyDiag(id) {
- this.i++;
- const formData = JSON.parse(JSON.stringify(this.form));
- let i = -1;
- let arr = [];
- formData.klDiagnoseTypeVO.forEach((item, inx) => {
- if (item.depart_id == id) {
- arr.push(item);
- i = inx;
- }
- });
- arr.forEach((item, index) => {
- item.depart_id = this.i;
- this.form.klDiagnoseTypeVO.splice(i + index + 1, 0, item);
- });
- // console.log(this.form.klDiagnoseTypeVO);
- // let map = {},
- // dest = [];
- // for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
- // let ai = formData.klDiagnoseTypeVO[i];
- // if (!map[ai.depart_id]) {
- // dest.push({
- // depart_id: ai.depart_id,
- // conditionType: ai.conditionType,
- // groupVO: ai.groupVO
- // });
- // map[ai.depart_id] = ai;
- // } else {
- // for (let j = 0; j < dest.length; j++) {
- // var dj = dest[j];
- // if (dj.depart_id == ai.depart_id) {
- // dj.groupVO = dj.groupVO.concat(ai.groupVO);
- // break;
- // }
- // }
- // }
- // }
- // var index = dest.findIndex(item => {
- // return item.depart_id == id;
- // });
- // JSON.parse(JSON.stringify(dest[index])).depart_id=this.i
- // dest.splice(index + 1, 0, JSON.parse(JSON.stringify(dest[index])));
- // dest.forEach((item, i) => {
- // item.depart_id = i;
- // });
- // this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(dest));
- },
- //删除依据
- delDiag(id, inx) {
- this.form.klDiagnoseTypeVO = this.form.klDiagnoseTypeVO.filter(
- item => item.depart_id !== id
- );
- this.form.klDiagnoseTypeVO.forEach((item, index) => {
- if (item.depart_id > id) {
- item.depart_id = item.depart_id - 1;
- }
- });
- },
- //新增组
- addGroup(i) {
- const temp = {
- baseGroup: '',
- conditionGroup: '',
- fitNo: '',
- klDiagnoseDetail: [
- {
- dataType: '',
- basNameType: false,
- onlyNumType: false,
- onlyTxtType: false,
- basTypeName: '',
- basConceptId: [],
- basDescription: '',
- basLename: '',
- basLibName: '',
- basLibType: null,
- basType: '',
- eqOperator: '',
- eqUnit: '',
- eqValue: '',
- maxOperator: '',
- maxUnit: '',
- maxVal: '',
- minOperator: '',
- minUnit: '',
- minVal: ''
- }
- ]
- };
- this.form.klDiagnoseTypeVO[i].groupVO.splice(i + 1, 0, temp);
- },
- delGroup(id, i) {
- this.form.klDiagnoseTypeVO.splice(i, 1);
- },
- //新增基础依据
- addRule(row, index, i) {
- let temp = {
- dataType: '',
- basNameType: false,
- basTypeName: '',
- basConceptId: [],
- basDescription: '',
- basLename: '',
- basLibName: '',
- basLibType: null,
- basType: '',
- eqOperator: '',
- eqUnit: '',
- eqValue: '',
- maxOperator: '',
- maxUnit: '',
- maxVal: '',
- minOperator: '',
- minUnit: '',
- minVal: '',
- dataType: ''
- };
- this.form.klDiagnoseTypeVO[index].groupVO[i].klDiagnoseDetail.push(temp);
- },
- delRule(row, inx, index, i) {
- if (
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail
- .length == 1
- ) {
- return;
- } else {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail.splice(
- i,
- 1
- );
- }
- },
- //诊断依据类型修改
- basTypeChange(val, inx) {
- if (!val) {
- this.baseTermTypeList = [];
- return;
- }
- var index2 = this.baseTypes.findIndex(item => item.ruleType === val);
- this.baseTermTypeList = this.baseTypes[index2].subMenuList;
- },
- //基础依据类型修改
- baseTermTypeChange(val, inx, index, i) {
- if (!val) {
- return;
- }
- this.basType = val;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basType = val;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basLibType = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].dataType = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].conceptList = [];
- this.clearConcept(val, inx, index, i); //清空医学标准术语
- this.clearNumText(val, inx, index, i); //清空数值、医学内容
- var index2 = this.baseTermTypeList.findIndex(item => item.type === val);
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basLibTypeList = this.baseTermTypeList[index2].subMenuList;
- this.form.klDiagnoseTypeVO[inx].groupVO[
- index
- ].baseTermTypeList = this.baseTermTypeList;
- if (val == 3 || val == 4) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basTypeName = this.form.klDiagnoseTypeVO[inx].groupVO[
- index
- ].klDiagnoseDetail[i].basLibTypeList[0].name;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basNameType = true;
- this.$refs['form'].clearValidate([
- 'klDiagnoseTypeVO.' +
- inx +
- '.groupVO.' +
- index +
- '.klDiagnoseDetail.' +
- i +
- '.basLibType'
- ]);
- } else {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basTypeName = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basNameType = false;
- }
- },
- //基础依据术语类型修改
- basLibTypeChange(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basLibType = val;
- // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- // i
- // ].dataType = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basConceptId = [];
- if ((this.numTypes + ',').indexOf(val + ',') > -1) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].dataType = '1';
- } else {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].dataType = '';
- }
- const onlyNum = this.dicts['onlyNum'] || '&';
- const onlyTxt = this.dicts['onlyTxt'] || '&';
- const codes = onlyNum + ',';
- const code = onlyTxt + ',';
- let type = this.form.klDiagnoseTypeVO[inx].groupVO[index]
- .klDiagnoseDetail[i].basLibType;
- let a = this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
- .basLibType;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].onlyNumType = type && codes.indexOf(a + ',') > -1;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].onlyTxtType = type && code.indexOf(a + ',') > -1;
- this.clearConcept(val, inx, index, i);
- this.clearNumText2(val, inx, index, i);
- },
- //医学标准术语
- conceptChange(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basConceptId = val;
- console.log(val);
- // if (val) {
- // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- // i
- // ].basLibName = this.form.klDiagnoseTypeVO[inx].groupVO[
- // index
- // ].klDiagnoseDetail[i].conceptList.find(
- // it => it.conceptId === val
- // ).conceptName;
- // } else {
- // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- // i
- // ].basLibName = '';
- // }
- },
- searchConcept(val, inx, index, i) {
- const formData = JSON.parse(JSON.stringify(this.form));
- const param = {
- excludedConceptIds: [
- formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
- .basType
- ],
- libType:
- formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
- .basLibType,
- name: val
- };
- api
- .searchConcept(param)
- .then(res => {
- if (res.data.code == '0') {
- const data = res.data.data;
- this.$nextTick(() => {
- // dom元素更新后执行,因此这里能正确打印更改之后的值
- formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].conceptList = data; // 改变了的值
- });
- this.form = formData;
- }
- })
- .catch(error => {
- console.log(error);
- });
- },
- dataTypeChange(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].dataType = val;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].eqOperator = val === '2' ? '=' : '';
- },
- clearConcept(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basConceptId = [];
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].basLibName = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].conceptList = [];
- },
- clearNumText2(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxOperator = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxVal = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxUnit = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minOperator = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minVal = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minUnit = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].eqValue = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].eqOperator = '';
- },
- clearNumText(val, inx, index, i) {
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxOperator = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxVal = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].maxUnit = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minOperator = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minVal = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].minUnit = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].eqValue = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].eqOperator = '';
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].onlyNumType = false;
- this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
- i
- ].onlyTxtType = false;
- },
- formatData(data) {
- //转换字段名
- let str = JSON.stringify(data)
- .replace(/byIdDTO/g, 'groupVO')
- .replace(/klDiagnoseByIdDTO/g, 'klDiagnoseDetail');
- //console.log(JSON.parse(str))
- return JSON.parse(str);
- },
- formatData2(data) {
- //转换字段名
- let str = JSON.stringify(data)
- .replace(/basLibName/g, 'conceptName')
- .replace(/basConceptId/g, 'conceptId');
- //console.log(JSON.parse(str))
- return JSON.parse(str);
- },
- searchDiag(val) {
- const param = {
- diseaseName: val
- };
- api
- .searchDiag(param)
- .then(res => {
- if (res.data.code == '0') {
- const data = res.data.data;
- this.conceptList = data;
- }
- })
- .catch(error => {
- console.log(error);
- });
- },
- setInitGroupData() {
- let temp = this.getInitData();
- this.form.klDiagnoseTypeVO = [temp];
- },
- setRules() {
- let that = this;
- let list = this.form.klDiagnoseTypeVO;
- if (list && list.length > 0) {
- list.forEach((item, i) => {
- let list1 = list[i].groupVO;
- list1.forEach((it, x) => {
- let list2 = list1[x].klDiagnoseDetail;
- list2.forEach((t, j) => {
- let grandeObj = this.form.klDiagnoseTypeVO[i].groupVO[x]
- .klDiagnoseDetail[j];
- if (grandeObj) {
- const keyTxt =
- 'klDiagnoseTypeVO.' +
- i +
- '.groupVO.' +
- x +
- '.klDiagnoseDetail.' +
- j;
- that.rules[keyTxt + '.dataType'] = [
- {
- required: true,
- message: '请选择类型',
- trigger: ['change']
- }
- ];
- that.rules[keyTxt + '.maxOperator'] = [
- {
- validator: (rule, value, callback) => {
- const { maxVal, minOperator, minVal } = grandeObj;
- const val = value + minOperator + minVal + maxVal;
- if (!val || (!value && maxVal !== '')) {
- callback(
- new Error(
- '最大值和最小值至少完整填写一个,单位不必填'
- )
- );
- } else {
- callback();
- }
- },
- trigger: 'change'
- }
- ];
- that.rules[keyTxt + '.minOperator'] = [
- {
- validator: (rule, value, callback) => {
- const { maxVal, maxOperator, minVal } = grandeObj;
- const val = value + maxOperator + minVal + maxVal;
- if (!val || (!value && minVal !== '')) {
- callback(
- new Error(
- '最大值和最小值至少完整填写一个,单位不必填'
- )
- );
- } else {
- callback();
- }
- },
- trigger: 'change'
- }
- ];
- that.rules[keyTxt + '.maxVal'] = [
- {
- validator: (rule, value, callback) => {
- const { maxOperator, minOperator, minVal } = grandeObj;
- const val = value + maxOperator + minVal + minOperator;
- const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
- if (!val || (value === '' && maxOperator)) {
- callback(
- new Error(
- '最大值和最小值至少完整填写一个,单位不必填'
- )
- );
- } else if (value !== '' && !isNum) {
- callback(new Error('只能输入数字'));
- } else {
- callback();
- }
- },
- trigger: 'blur'
- }
- ];
- that.rules[keyTxt + '.minVal'] = [
- {
- validator: (rule, value, callback) => {
- const { maxVal, minOperator, maxOperator } = grandeObj;
- const val = value + maxOperator + maxVal + minOperator;
- const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
- if (!val || (value === '' && minOperator)) {
- callback(
- new Error(
- '最大值和最小值至少完整填写一个,单位不必填'
- )
- );
- } else if (value !== '' && !isNum) {
- callback(new Error('只能输入数字'));
- } else {
- callback();
- }
- },
- trigger: 'blur'
- }
- ];
- }
- });
- });
- });
- }
- },
- saveDiagBase(params) {
- api.saveDiagBase(params).then(res => {
- if (res.data.code == 0) {
- this.$message({
- message: '操作成功',
- type: 'success'
- });
- this.$router.push({
- name: 'ZskDiagBase',
- params: this.$route.params
- });
- } else {
- this.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- });
- },
- validateForms(callBack) {
- this.$refs['form'].validate(valid => {
- if (valid) {
- callBack();
- } else {
- return false;
- }
- });
- },
- confirm() {
- const formData = JSON.parse(JSON.stringify(this.form));
- const _this = this;
- for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
- for (let j = 0; j < formData.klDiagnoseTypeVO[i].groupVO.length; j++) {
- delete formData.klDiagnoseTypeVO[i].groupVO[j].baseTermTypeList;
- for (
- let k = 0;
- k < formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
- k++
- ) {
- delete formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .basLibTypeList;
- delete formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
- .conceptList;
- }
- }
- }
- let map = {},
- dest = [];
- for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
- let ai = formData.klDiagnoseTypeVO[i];
- if (!map[ai.depart_id]) {
- dest.push({
- depart_id: ai.depart_id,
- conditionType: ai.conditionType,
- groupVO: ai.groupVO
- });
- map[ai.depart_id] = ai;
- } else {
- for (let j = 0; j < dest.length; j++) {
- var dj = dest[j];
- if (dj.depart_id == ai.depart_id) {
- dj.groupVO = dj.groupVO.concat(ai.groupVO);
- break;
- }
- }
- }
- }
- formData.klDiagnoseTypeVO = dest;
- this.validateForms(function() {
- let params = formData;
- _this.saveDiagBase(params);
- });
- }
- },
- watch: {
- form: {
- handler: function(newQuestion, oldQuestion) {
- this.getData(this.form.klDiagnoseTypeVO);
- },
- deep: true,
- immediate: true
- }
- }
- };
- </script>
- <style lang="less" scoped>
- @import '../../less/admin.less';
- /deep/ .searchselect{
- .el-input{
- height: 100%!important;
- }
- }
- .contents {
- height: 100%;
- .content {
- background: #fff;
- padding: 20px 20px;
- color: #545455;
- min-width: 980px;
- position: relative;
- .tip-text {
- color: #f56c6c;
- margin-left: 10px;
- }
- .conceptItem {
- padding: 0 10px;
- cursor: pointer;
- height: 32px;
- line-height: 32px;
- &:hover {
- background: #ebedf1;
- }
- }
- .el-table--scrollable-y .el-table__body-wrapper {
- height: calc(100vh - 370px);
- }
- /deep/ .el-input {
- height: 30px;
- line-height: 30px;
- .el-input__inner {
- height: 30px;
- line-height: 30px;
- font-size: 12px;
- }
- }
- .inps {
- width: 500px !important;
- font-size: 14px;
- /deep/ .el-input__inner {
- width: 500px !important;
- font-size: 14px;
- }
- }
- .item {
- /deep/.el-form-item__label {
- font-size: 14px;
- }
- /deep/.el-input__inner {
- font-size: 14px;
- }
- }
- }
- .content-2 {
- margin-top: 10px;
- padding: 20px 20px;
- height: calc(100vh - 370px);
- .cell {
- overflow: initial;
- }
- .content-2-header {
- padding: 20px 0;
- .title1 {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- }
- .title2 {
- font-size: 12px;
- font-weight: 400;
- color: #ff545b;
- line-height: 17px;
- }
- }
- .el-form-item {
- margin-bottom: 10px;
- margin-right: 0;
- }
- .discDesc {
- margin-bottom: 20px;
- /deep/ .el-form-item__error {
- top: 38px;
- left: 100px !important;
- white-space: nowrap;
- }
- }
- .el-popper[x-placement^='bottom'] {
- width: 100px !important;
- }
- .disclButn {
- position: absolute;
- right: calc(50% - 60px);
- bottom: 10px;
- }
- .el-table .cell.el-tooltip {
- position: relative;
- }
- .box-2 {
- position: relative;
- .tips {
- left: 3px;
- }
- }
- .box-3 {
- position: relative;
- }
- .tips {
- width: 12px;
- height: 12px;
- position: absolute;
- left: 15px;
- top: 15px;
- }
- .title {
- position: absolute;
- z-index: -1;
- }
- .last-box {
- display: flex;
- height: 50px;
- margin-bottom: 10px;
- position: relative;
- /deep/ .el-input,
- .el-input__inner {
- width: 85px;
- font-size: 12px;
- margin-right: 15px;
- }
- /deep/ .el-form-item__content {
- position: inherit !important;
- }
- .last-box-1 {
- display: flex;
- /deep/ .el-form-item__error {
- top: 38px;
- left: 10px;
- white-space: nowrap;
- width: 360px;
- }
- }
- .last-box-s {
- position: absolute;
- /deep/ .el-form-item__error {
- top: 38px;
- left: 0px;
- white-space: nowrap;
- width: 260px;
- }
- }
- /deep/ .el-form-item__error {
- top: 38px;
- left: 10px;
- white-space: nowrap;
- }
- /deep/ .inp {
- width: 600px !important;
- .el-input__inner {
- width: 600px !important;
- }
- }
- .el-form-item {
- margin: 0;
- overflow: hidden;
- display: flex;
- }
- }
- .tmall {
- visibility: hidden;
- height: 60px;
- }
- .medical {
- margin-right: 26px;
- }
- .group {
- border-bottom: 1px solid red;
- padding: 30px 0;
- .group-row {
- padding: 10px 0;
- border-bottom: 1px solid red;
- }
- }
- .group:last-child {
- border-bottom: none;
- }
- .icon {
- padding: 0 3px;
- cursor: pointer;
- }
- .star {
- color: #ff545b;
- }
- }
- .Butn {
- display: flex;
- justify-content: center;
- background: #fff;
- .el-button {
- margin: 15px 0;
- }
- }
- .name {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- }
- }
- </style>
|