12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136 |
- <template>
- <div>
- <crumbs :title="minTitle" :param="$route.params" linkTo="BasicTermsMaintenance"></crumbs>
- <div class="contents">
- <div class="content">
- <h3>添加术语:</h3>
- <p class="titl">医学标准术语:</p>
- <table class="deptbox" v-if="id == ''">
- <tr>
- <td class="ind">序号</td>
- <td>
- 医学标准术语
- <span class="necess">*</span>
- </td>
- <td>拼音</td>
- <td>
- 术语类型
- <span class="necess">*</span>
- </td>
- <td class="desc">说明</td>
- </tr>
- <tr>
- <td class="ind">1</td>
- <td :title="data.name&&data.name.length>9?data.name:''">
- <!-- 修改时标准词不能修改,修改了会当做新增处理 4-17 -->
- <p v-if="id">{{data.name}}</p>
- <!-- 4-18 需求变更 -->
- <input
- v-else
- type="text"
- v-model.trim="data.name"
- placeholder="请输入术语"
- maxlength="50"
- @blur="handleBlur(1)"
- />
- <SimilarListDrag
- :searchType="searchType"
- :similarList="similarList"
- isShow="true"
- @closeTable="closeTable"
- ></SimilarListDrag>
- </td>
- <td>
- <input
- type="text"
- v-model.trim="data.spell"
- placeholder="请输入拼音"
- maxlength="50"
- @input="handlePinyin($event,1)"
- />
- </td>
- <td>
- <!-- <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small" @change="selectType">
- <el-option
- v-for="item in typeList"
- :key="item.id"
- :label="item.name"
- :value="item.name">
- </el-option>
- </el-select>-->
- <template v-if="!id">
- <el-select
- v-model="data.type"
- filterable
- clearable
- placeholder="请选择"
- @clear="clearDataCi"
- size="small"
- @change="selectType"
- >
- <el-option-group v-for="group in options" :key="group.label">
- <el-option
- v-for="item in group.options"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-option-group>
- </el-select>
- </template>
- <span v-else>{{data.type}}</span>
- </td>
- <td class="desc">
- <input v-model.trim="data.remark" placeholder="请输入术语说明" maxlength="120" />
- </td>
- </tr>
- </table>
- <div class="deptboxChange" v-else>
- <table class="deptbox deptboxTable">
- <tr>
- <td class="ind">序号</td>
- <td class="desc">医学标准术语</td>
- <td>拼音</td>
- <td>术语类型</td>
- <td class="desc">说明</td>
- <td class="descs">术语性质</td>
- <td v-if="id">操作</td>
- </tr>
- <tr v-for="(item,index) in allwords" :key="index">
- <td class="ind">{{index+1}}</td>
- <td :title="item.name&&item.name.length>9?item.name:''">
- <!-- 使用原生input,输入限制 -->
- <!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
- <input
- type="text"
- v-model.trim="item.name"
- :title="item.name"
- placeholder="请输入术语"
- maxlength="50"
- @blur="handleBlur(2,index,99)"
- />
- <SimilarListDrag
- :searchType="searchType"
- :similarList="similarList"
- :isShow="index ===searchIndex"
- @closeTable="closeTable"
- ></SimilarListDrag>
- </td>
- <!-- <td v-if="!item.isEdit">
- {{item.spell}}
- </td>
- <td v-else>-->
- <td>
- <input
- type="text"
- v-model.trim="item.spell"
- placeholder="请输入拼音"
- maxlength="50"
- @input="handlePinyin($event,2,index)"
- class="spell"
- />
- </td>
- <td>
- <template v-if="index==0&©">
- <el-select
- v-model="data.type"
- filterable
- placeholder="请选择"
- size="small"
- @clear="clearDataCi"
- @change="selectType"
- >
- <el-option-group v-for="group in options" :key="group.label">
- <el-option
- v-for="item in group.options"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-option-group>
- </el-select>
- </template>
- <span v-else>{{data.type}}</span>
- </td>
- <td class="desc">
- <input v-model.trim="item.remark" placeholder="请输入术语说明" maxlength="120" />
- </td>
- <td class="desc">{{item.isConcept == 1?"医学标准术语":"同义词"}}</td>
- <td v-if="id">
- <span class="displayColor" v-if="item.isConcept == 1">删除</span>
- <span @click="deleLine(index,55,item)" class="delete" v-else>删除</span>
- </td>
- </tr>
- <tr @click="addSpan(55)">
- <td colspan="7" class="addSpan">+</td>
- </tr>
- </table>
- <div class="actionDo">
- <!-- <div class="btnWrap"> -->
- <!-- <el-button type="primary" size="mini" v-if="show" @click="comfirn(14)">确认修改</el-button> -->
- <!-- <el-button plain size="mini" v-if="show" @click="toggleShow(1)">放弃修改</el-button>
- <el-button plain size="mini" @click="toggleShow(2)" v-if="!show">修改标准词</el-button>-->
- <!-- </div> -->
- <div class="radioWrap" v-if="show">
- <el-radio-group v-model="radioVal" size="mini">
- <el-radio
- v-for="(item,index) in allwords"
- :label="index"
- :key="index"
- :disabled="index == 0"
- >选为标准词</el-radio>
- </el-radio-group>
- </div>
- </div>
- </div>
- <p class="titl" v-if="id == ''">同义词:</p>
- <table class="deptbox" v-if="id == ''">
- <tr>
- <td class="ind">序号</td>
- <td >医学标准术语</td>
- <td>拼音</td>
- <td>术语类型</td>
- <td class="desc">说明</td>
- <td v-if="id">操作</td>
- </tr>
- <tr v-for="(item,index) in synonymous" :key="index">
- <td class="ind">{{index+1}}</td>
- <td :title="item.name&&item.name.length>9?item.name:''">
- <!-- 使用原生input,输入限制 -->
- <!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
- <input
- type="text"
- v-model.trim="item.name"
- placeholder="请输入术语"
- maxlength="50"
- @blur="handleBlur(2,index)"
- />
- <SimilarListDrag
- :searchType="searchType"
- :similarList="similarList"
- :isShow="index ===searchIndex"
- @closeTable="closeTable"
- ></SimilarListDrag>
- </td>
- <td>
- <input
- type="text"
- v-model.trim="item.spell"
- placeholder="请输入拼音"
- maxlength="50"
- @input="handlePinyin($event,3,index)"
- />
- </td>
- <td>{{data.type}}</td>
- <td class="desc">
- <input v-model.trim="item.remark" placeholder="请输入术语说明" maxlength="120" />
- </td>
- <td v-if="id">
- <span @click="deleLine(index,1,item)" class="delete">删除</span>
- </td>
- </tr>
- <tr @click="addSpan">
- <td :colspan="colspan" class="addSpan">+</td>
- </tr>
- </table>
- <div class="moreInfo" v-if="showMore == 1">
- <p>更多信息:</p>
- <el-form label-width="150px">
- <el-form-item label="性别:">
- <el-select v-model="sexType">
- <el-option v-for="(it,i) in sex" :key="i" :label="it.name" :value="it.name"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="年龄:" class="ages is-required">
- <el-input v-model.number="minAge" type="number" @input="inputAge"></el-input>
- <span class="ageLine">~</span>
- <el-input v-model.number="maxAge" type="number" @input="inputAge"></el-input>
- </el-form-item>
- <el-form-item
- v-if="data.type=='实验室检查子项目'" label="最大值与最小值:" class="ages">
- <el-input v-model.number="minValue" type="number" @input="inputAge"></el-input>
- <span class="ageLine">~</span>
- <el-input v-model.number="maxValue" type="number" @input="inputAge"></el-input>
- </el-form-item>
- <el-form-item v-if="data.type=='实验室检查子项目'" label="范围:" class="range">
- <el-select v-model="rangeSelect">
- <el-option v-for="(it,i) in range" :key="i" :label="it.name" :value="it.name"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="data.type=='疾病'"
- label="ICD10编码:"
- prop="description"
- class="marT description"
- >
- <span class="necess">*</span>
- <el-input v-model.trim="icdCode" maxlength="7" placeholder="请输入编码"></el-input>
- </el-form-item>
- <el-form-item label="科室:" v-if="dioType" class="marT">
- <el-select v-model="dept">
- <!-- <el-option v-for="(it,i) in deptList" :label="it.name" :value="it.name"></el-option> -->
- <el-option-group v-for="group in deptListArr" :key="group.label">
- <el-option
- v-for="item in group.deptList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-option-group>
- </el-select>
- </el-form-item>
- <el-form-item label="归属类型:" v-if="dioType" class="marT">
- <el-select v-model="dioType">
- <el-option v-for="(it,i) in dioTypeList" :key="i" :label="it.name" :value="it.val"></el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item
- v-if="data.type=='症状'"
- label="填写单患者界面展示通俗内容:"
- prop="description"
- class="marT description"
- >
- <span class="necess">*</span>
- <el-input v-model.trim="description" maxlength="7" placeholder="请输入填写单患者界面展示通俗内容"></el-input>
- </el-form-item> -->
- <!-- <el-form-item v-if="data.type=='症状'" label="医学教育说明:" prop="explains" class="marT">
- <el-input
- type="textarea"
- v-model.trim="explains"
- maxlength="100"
- style="width: 500px;"
- :rows="4"
- ></el-input>
- </el-form-item> -->
- </el-form>
- </div>
- <div class="btn">
- <el-button type="primary" :disabled="saveDisable" @click="comfirn">确 定</el-button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import api from '@api/knowledgeTree.js';
- import pinyin from '../../js/Convert_Pinyin.js';
- import utils from '@api/utils.js';
- import SimilarListDrag from './SimilarListDrag';
- export default {
- name: 'AddMedicalName',
- data() {
- return {
- minTitle: '基础术语维护-添加',
- data: {
- name: '',
- type: '',
- code: '',
- remark: '',
- isConcept: 1,
- spell: ''
- },
- radioVal: '',
- typeList: [],
- id: '',
- synonymous: [], //同义词
- singleword: [],
- allwords: [], //标准词和同义词
- colspan: 5,
- colspans: 6,
- currentPage: 1,
- pageSize: 10,
- show: false,
- tmpSynonymous: [],
- sexType: '通用',
- rangeSelect: '内',
- maxAge: 200,
- minAge: 0,
- maxValue: null,
- minValue: null,
- icdCode:'',
- showMore: '',
- sex: [
- {
- name: '通用',
- value: 3
- },
- {
- name: '男',
- value: 1
- },
- {
- name: '女',
- value: 2
- }
- ],
- range: [
- {
- name: '内',
- value: 1
- },
- {
- name: '外',
- value: 2
- }
- ],
- unfit: false, //点确认时是否弹提示,
- saveDisable: false, //保存按钮禁止点击
- options: [],
- copy: null,
- dioTypeList: [], //更多信息-类型
- dioType: '', //默认展示一类
- deptList: [], //更多信息-科室
- deptListArr: [], //科室信息分组
- dept: '', //默认展示全科
- similarList: [], //相似词列表
- searchIndex: -1, //展示哪个的同义词
- searchType: '',
- description: '',
- explains: ''
- };
- },
- created() {
- this.getTypeList();
- const id = this.$route.params.id;
- const copy = this.$route.params.copy || '';
- this.copy = copy;
- if (id) {
- this.minTitle = copy ? '基础术语维护-复制' : '基础术语维护-修改';
- this.id = id;
- this.colspan = 5;
- this.getDetail(id);
- }
- },
- watch: {
- radioVal(newVal, preVal) {
- if (newVal && newVal != preVal) {
- this.changeState(newVal);
- }
- }
- },
- methods: {
- clearDataCi(){
- this.data.code = ''
- },
- dragAdd(ev) {
- utils.dragBox('dragModalWrap', 'dragModalTitle', 'add');
- },
- dragDel() {
- utils.dragBox('dragModalWrap', 'dragModalTitle', 'del');
- },
- closeTable() {
- this.searchType = '';
- this.similarList = [];
- },
- // 诊断类型下--更多信息-类型
- getDioType(flag) {
- api.getknowledgeList().then(res => {
- const data = res.data;
- if (data.code == 0) {
- this.dioTypeList = data.data[2];
- // 修改时无需赋值
- if (!flag) {
- this.dioType = this.dioTypeList[0].val;
- }
- }
- });
- },
- // 诊断类型下--更多信息-科室
- getDdeptList(conptId) {
- api.getDeptList({ type: 1 }).then(res => {
- const data = res.data;
- if (data.code == 0) {
- this.deptList = data.data;
- if (!conptId) {
- this.dept = '全科'; //默认展示全科
- } else {
- // 科室id转成name显示
- this.deptList.map((v, i) => {
- if (v.conceptId == conptId) {
- this.dept = v.name;
- }
- });
- }
- const total = this.deptList.length;
- const average = parseInt(total / 3);
- const mod = total % 3; //余数
- const firstGroup = this.deptList.slice(0, average);
- let secGroup = [];
- let thirdGroup = [];
- let tempArr = [];
- if (mod == 2) {
- secGroup = this.deptList.slice(average, average * 2 + 1);
- thirdGroup = this.deptList.slice(average * 2 + 1, total);
- } else {
- secGroup = this.deptList.slice(average, average * 2);
- thirdGroup = this.deptList.slice(average * 2, total);
- }
- tempArr.push(
- { label: 1, deptList: firstGroup },
- { label: 2, deptList: secGroup },
- { label: 3, deptList: thirdGroup }
- );
- this.deptListArr = tempArr;
- }
- });
- },
- changeState(val) {
- let tmpAllwords = JSON.parse(JSON.stringify(this.synonymous));
- for (let i = 0; i < tmpAllwords.length; i++) {
- if (i + 1 == val) {
- tmpAllwords[i].isConcept = 1;
- tmpAllwords[i].type = this.data.type;
- } else {
- tmpAllwords[i].isConcept = 0;
- }
- }
- this.tmpSynonymous = tmpAllwords;
- this.synonymous = tmpAllwords;
- },
- toggleShow(num) {
- let tmpShow = this.show;
- this.show = !tmpShow;
- if (num == 1) {
- this.changeState(-1);
- this.radioVal = '';
- }
- },
- reViewData(data) {
- let tmpObj = [{
- isConcept: data.isConcept,
- name: data.libName,
- remark: data.remark,
- spell: data.spell,
- type: data.typeName,
- conceptId: data.conceptId,
- libId: data.libId,
- isHasCommon: data.isHasCommon,
- synonymName: data.synonymName,
- status: data.status,
- typeId: data.libType
- }]
- for(let i = 0;i < data.klConceptSub.length;i++){
- let tmp = data.klConceptSub[i]
- tmp.name = tmp.synonymName
- tmp.type = tmp.typeName
- tmp.typeId = tmp.libType
- }
- data.libName = tmpObj
- data.otherNames = data.klConceptSub
- return data
- },
- getDetail(ids) {
- if (ids) {
- api.getBaseConceptAll({ conceptId: ids }).then(res => {
- const result = res.data;
- let redata = this.reViewData(result.data)
- if (result.code == 0) {
- this.data = redata.libName[0];
- this.singleword = redata.libName;
- this.synonymous = redata.otherNames;
- this.allwords = redata.libName.concat(redata.otherNames);
- this.showMore = redata.isHasCommon; //是否支持通用扩展
- this.maxAge = redata.maxAge;
- this.minAge = redata.minAge;
- this.maxValue = redata.maxVal;
- this.minValue = redata.minVal;
- this.rangeSelect = redata.scopeType == '1'?'外':'内'
- this.icdCode = redata.icdCode;
- this.description = redata.description;
- this.explains = redata.explains;
- const type = redata.type;
- if (type == '诊断') {
- this.dioType = redata.classify || 'Ⅰ'; //类型,默认展示Ⅰ类
- const deptConptId = redata.deptId;
- this.getDioType(true);
- this.getDdeptList(deptConptId);
- }
- // this.sexType = result.data.sexType;
- let sexType = redata.sexType;
- this.sex.map((v, i) => {
- if (v.value == sexType) {
- this.sexType = v.name;
- }
- });
- } else {
- this.$message({
- message: result.msg,
- type: 'warning'
- });
- }
- });
- }
- },
- getTypeList() {
- api.baseTypeGetPage({ name: '',size: 1000 })
- .then(res => {
- const data = res.data;
- if (data.code == 0) {
- let types = data.data.records
- this.typeList = types;
- // this.typeList = data.data;
- // 类型改成平铺
- if (types.length > 0) {
- const total = types.length;
- const average = parseInt(total / 3);
- const mod = total % 3; //余数
- const firstGroup = types.slice(0, average);
- let secGroup = [];
- let thirdGroup = [];
- if (mod == 2) {
- secGroup = types.slice(average, average * 2 + 1);
- thirdGroup = types.slice(average * 2 + 1, total);
- } else {
- secGroup = types.slice(average, average * 2);
- thirdGroup = types.slice(average * 2, total);
- }
- this.options.push(
- { label: 1, options: firstGroup },
- { label: 2, options: secGroup },
- { label: 3, options: thirdGroup }
- );
- }
- } else {
- this.$message({
- message: data.msg,
- type: 'warning'
- });
- }
- })
- .catch(error => {
- console.log(error);
- });
- },
- // handleInput(index,name){
- /* handleInput(type,index){
- // 可输入内容:字母、数字、汉字、特殊字符:% —— 其余不可输入;
- // if(!name){//标准词输入
- if(type==1){//标准词输入
- this.data.name = this.data.name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
- }else{
- this.synonymous[index].name = this.synonymous[index].name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
- }
- },*/
- handleBlur(type, index, flg) {
- // 不能为纯数字、纯字符、纯数字加字符 4-18
- // const pattern = /[^~@#$%^&*_\-+=,,.。::"“??”;;、!!0-9]/g;
- // 需求更改:不能为纯数字,其余均可输入 5-20
- const pattern = /[^0-9]/g;
- if (type == 1) {
- //标准词输入
- if (this.data.name && !pattern.test(this.data.name)) {
- this.$message({
- // message:'无法输入纯数字或者纯字符,请输入正确数据!',
- message: '无法输入纯数字,请输入正确数据!',
- type: 'warning'
- });
- // this.data.name = '';
- this.unfit = true;
- } else {
- let data = this.data;
- data.spell = pinyin.getCamelChars(data.name);
- this.unfit = false;
- this.searchType = 'standard';
- this.getSimilarList(this.data.name);
- }
- } else if (type == 2) {
- // 修改时术语名称、拼音和类型均不能修改
- if (flg == 99) {
- // if(this.synonymous[index-1].name && !pattern.test(this.synonymous[index-1].name)){
- if (
- this.allwords[index].name &&
- !pattern.test(this.allwords[index].name)
- ) {
- this.$message({
- message: '无法输入纯数字,请输入正确数据!',
- type: 'warning'
- });
- // this.synonymous[index-1].name = '';
- this.unfit = true;
- } else {
- // let current = this.synonymous[index-1];
- let current = this.allwords[index];
- current.spell = pinyin.getCamelChars(current.name);
- this.unfit = false;
- this.searchType = 'standard';
- this.searchIndex = index;
- this.getSimilarList(this.allwords[index].name);
- }
- } else {
- if (
- this.synonymous[index].name &&
- !pattern.test(this.synonymous[index].name)
- ) {
- this.$message({
- message: '无法输入纯数字,请输入正确数据!',
- type: 'warning'
- });
- // this.synonymous[index].name = '';
- this.unfit = true;
- } else {
- let current = this.synonymous[index];
- current.spell = pinyin.getCamelChars(current.name);
- this.unfit = false;
- this.searchType = 'similar';
- this.searchIndex = index;
- this.getSimilarList(current.name);
- }
- }
- }
- },
- handlePinyin(e, flag, index) {
- //只能输入英文
- e.target.value = e.target.value.replace(/[^a-zA-Z]/g, '');
- // 解决输入数字不触发更新
- if (flag == 1) {
- //标准词
- this.data.spell = e.target.value;
- } else if (flag == 2) {
- //同义词-修改
- this.allwords[index].spell = e.target.value;
- } else if (flag == 3) {
- //同义词-新增
- this.synonymous[index].spell = e.target.value;
- }
- // e.target.value = e.target.value.replace(/[^a-zA-Z]/g,'');
- },
- getSimilarList(name) {
- //不知道还有没有用
- return
- if (!name) {
- this.closeTable();
- return;
- }
- const param = {
- inputStr: name
- };
- api.getSimilarList(param).then(res => {
- this.similarList = res.data.data;
- });
- },
- addSpan(type) {
- let singleSpan = {
- name: '',
- remark: '',
- isConcept: 0,
- isEdit: true,
- spell: null
- };
- if (type == 55) {
- this.allwords.push(singleSpan);
- this.synonymous.push(singleSpan);
- } else {
- this.synonymous.push(singleSpan);
- }
- },
- warning(msg, type) {
- this.$message({
- showClose: true,
- message: msg,
- type: type || 'warning'
- });
- },
- showConfirmDialog(msg, resolve) {
- this.$alert(msg, '提示', {
- confirmButtonText: '确定',
- type: 'warning'
- })
- .then(() => {
- resolve();
- })
- .catch(() => {});
- },
- deleLine(index, type,item) {
- // 只在界面删除数据,待点确认 后参才真正删除
- if (type == 55) {
- const {libId} = item
- if(libId){
- api.clearConceptInfo({libId}).then((res)=>{
- const result = res.data
- if(result.code == 0){
- this.synonymous.splice(index - 1, 1);
- this.allwords.splice(index, 1);
- }
- })
- }else{
- this.synonymous.splice(index - 1, 1);
- this.allwords.splice(index, 1);
- }
- } else {
- this.synonymous.splice(index, 1);
- }
- },
- // 保存基础术语
- comfirn(flg) {
- if (!this.data.name) {
- this.warning('请输入标准词');
- return;
- }
- if (!this.data.code && !this.unfit && !this.data.type) {
- this.warning('请选择术语类型');
- return;
- }
- // 处于修改标准词状态且没有选中,不能保存
- if (this.show && !this.radioVal) {
- this.warning('请先选择标准词');
- return;
- }
- if(this.data.type == '疾病' && !this.icdCode){
- this.warning('请输入ICD10编码');
- return;
- }
- // 年龄为必填项--2019-6-5需求
- if (this.showMore == 1) {
- if ((!this.minAge && this.minAge !== 0) || !this.maxAge) {
- this.warning('年龄不能为空,区间为0-200');
- return;
- }
- if (
- this.minAge < 0 ||
- this.minAge > 200 ||
- this.maxAge < 0 ||
- this.maxAge > 200
- ) {
- this.warning('年龄必须是0-200');
- return;
- }
- if(this.minValue >= this.maxValue){
- this.warning('最小值小于最大值');
- return;
- }
- }
- // 过滤同义词空数据
- let realData = [];
- if (this.id) {
- //修改用暂存的列表
- realData = this.synonymous.filter(item => {
- return item.name;
- });
- let tmpArr = [];
- for (let k = 0; k < realData.length; k++) {
- if (realData[k].isConcept == 1) {
- let tmpdata = JSON.parse(JSON.stringify(this.data));
- tmpArr.push(realData[k]);
- realData.splice(k, 1);
- tmpdata.isConcept = 0;
- realData.push(tmpdata);
- this.data = tmpArr[0];
- }
- }
- } else {
- realData = this.synonymous.filter(item => {
- return item.name;
- });
- }
- let detailList = [];
- for (let i = 0; i < realData.length; i++) {
- let obj = {}
- realData[i].synonymName = realData[i].name;
- realData[i].typeId = this.data.code;
- // obj.isConcept=realData[i].isConcept
- // obj.remark=realData[i].remark
- // obj.spell=realData[i].spell
- detailList.push(realData[i]);
- // detailList.push(obj);
- }
- // 校验是否有名称全为数字
- const pattern = /[^0-9]/g;
- const tmpData = this.data.name
- if(tmpData&&!tmpData.match(pattern)){
- this.$message({
- message: '无法输入纯数字,请输入正确数据!',
- type: 'warning'
- });
- return false;
- }
- for (let d = 0; d < detailList.length; d++) {
- let dname = detailList[d].name;
- // if(detailList[d].name && !pattern.test(detailList[d].name)){
- if (dname && !dname.match(pattern)) {
- if (!this.unfit) {
- //避免和失焦事件同事弹出
- this.$message({
- message: '无法输入纯数字,请输入正确数据!',
- type: 'warning'
- });
- }
- this.unfit = false;
- return false;
- break;
- }
- }
- // if (this.data.type == '症状' && !this.description) {
- // this.warning('请输入填写单患者界面展示通俗内容');
- // return;
- // }
- let params,sexCode=null;
- if (this.showMore == 1) {// 下拉文字转code
- this.sex.map((v, i) => {
- if (v.name == this.sexType) {
- sexCode = v.value;
- }
- });
- params = {
- conceptId: this.copy ? '' : this.id,
- isConcept: this.data.isConcept,
- libName: this.data.name,
- remark: this.data.remark,
- spell: this.data.spell,
- status: this.data.status||1,
- libType: this.data.typeId||this.data.code,
- // typeId:this.data.typeId,
- synonymName: this.data.synonymName,
- isHasCommon: 1,
- libId: this.data.libId,
- klConceptSub:detailList,
- sexType:sexCode,
- scopeType:this.rangeSelect == '外'?'1':'0',
- maxAge:this.maxAge,
- minAge:this.minAge,
- maxVal:this.maxValue,
- minVal:this.minValue,
- icdCode:this.icdCode||undefined
- }
- }else{
- params = {
- conceptId: this.copy ? '' : this.id,
- isConcept: this.data.isConcept||1,
- libName: this.data.name,
- remark: this.data.remark,
- spell: this.data.spell,
- status: this.data.status||1,
- libType: this.data.typeId||this.data.code,
- // typeId:this.data.typeId||this.data.code,
- libId: this.data.libId,
- sexType:sexCode,
- maxAge:this.maxAge,
- minAge:this.minAge,
- maxVal:this.maxValue,
- minVal:this.minValue,
- icdCode: this.icdCode||undefined,
- scopeType:this.rangeSelect == '外'?1:0,
- isHasCommon: this.data.isHasCommon||0,
- synonymName: '',
- klConceptSub: detailList||[],
- };
- }
- // console.log(this.data)
- // return false
- this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
- api.saveBaseConceptInfo(params).then(res => {
- const result = res.data;
- if (result.code == 0) {
- this.warning(res.data.msg || '操作成功', 'success');
- //返回带搜索条件的首页
- this.$router.push({
- name: 'BasicTermsMaintenance',
- params: Object.assign({}, this.$route.params, { currentPage: 1 })
- });
- /*if(flg == 14){
- this.getDetail(this.id)
- this.radioVal = ''
- this.show = false
- }else{
- this.$router.push({name:'MedicalName'});
- }*/
- } else {
- this.warning(res.data.msg);
- }
- this.saveDisable = false;
- });
- },
- inputAge() {
- // console.log("输入年龄")
- },
- selectType(e) {
- this.typeList.map((v, i) => {
- if (v.name == e) {
- this.showMore = v.isHasCommon;
- this.data.code = v.code
- }
- });
- if (e == '诊断') {
- this.getDioType();
- this.getDdeptList();
- } else {
- this.dioType = '';
- this.dept = '';
- }
- }
- },
- components: {
- SimilarListDrag
- }
- };
- </script>
- <style lang="less" scoped>
- @import '../../less/admin.less';
- table,
- tr,
- td {
- list-style: none;
- }
- /deep/ .radioWrap .el-radio {
- display: block;
- height: 41px;
- line-height: 41px;
- text-align: right;
- margin-left: 0;
- }
- /deep/ .moreInfo .el-form-item .el-form-item__label {
- width: 85px;
- text-align: left;
- }
- // 饿了么分组下拉
- .el-scrollbar {
- .el-select-dropdown__list {
- .el-select-group__wrap {
- min-width: 160px !important;
- display: inline-block !important;
- vertical-align: top !important;
- }
- }
- }
- .range {
- margin-top: 20px;
- }
- .el-select-group__wrap::after {
- background: #fff !important;
- }
- .displayColor {
- color: #ccc;
- cursor: not-allowed;
- }
- .delete {
- cursor: pointer;
- }
- .content {
- background: #fff;
- padding: 20px 20px 30px;
- color: #545455;
- }
- .titl {
- margin: 25px 0 10px;
- }
- .deptbox {
- // width: 100%;
- background: #fff;
- padding: 20px 10px 30px;
- font-size: 14px;
- text-align: left;
- border-collapse: collapse;
- > tr {
- height: 30px;
- text-align: center;
- td {
- width: 135px;
- border: 1px solid #666;
- padding: 5px;
- position: relative;
- }
- input {
- border: none;
- border: 1px solid #ccc;
- width: 100%;
- height: 30px;
- padding: 0 7px;
- box-sizing: border-box;
- border-radius: 4px;
- }
- .ind {
- width: 55px;
- }
- .desc {
- width: 280px;
- }
- .descs {
- width: 50px;
- }
- }
- .addSpan {
- text-align: center;
- cursor: pointer;
- }
- }
- .deptboxTable {
- width: 100%;
- }
- .deptboxChange {
- padding-right: 210px;
- position: relative;
- }
- .actionDo {
- width: 200px;
- position: absolute;
- top: 1px;
- right: 0;
- .btnWrap {
- height: 30px;
- }
- }
- .btn {
- text-align: right;
- margin-top: 20px;
- }
- .necess {
- display: inline-block;
- vertical-align: middle;
- color: red;
- margin-left: 2px;
- }
- .moreInfo {
- border-top: 1px solid #c0c4cc;
- margin-top: 45px;
- p {
- margin: 15px 0;
- }
- }
- .spell {
- text-align: center;
- }
- /deep/.ages {
- margin-top: 20px;
- position: relative;
- .el-input {
- display: inline-block;
- width: auto;
- .el-input__inner {
- width: 60px;
- padding: 0 5px;
- text-align: center;
- }
- .el-input__inner::-webkit-outer-spin-button,
- .el-input__inner::-webkit-inner-spin-button {
- -webkit-appearance: none;
- }
- .el-input__inner[type='number'] {
- -moz-appearance: textfield;
- }
- }
- .ageLine {
- display: inline-block;
- margin: 0 35px;
- }
- }
- /deep/ .marT {
- margin-top: 20px;
- }
- /deep/.description {
- position: relative;
- .necess {
- position: absolute;
- left: -158px;
- z-index: 2;
- }
- .el-input__inner {
- width: 200px;
- height: 40px;
- line-height: 40px;
- // text-align: center;
- }
- }
- </style>
|