|
@@ -7,7 +7,7 @@
|
|
|
:param="$route.params"
|
|
|
linkTo="DiagBase"
|
|
|
></crumbs>
|
|
|
- <el-form :model="form" ref="ruleForm" class="addDepartForm">
|
|
|
+ <el-form ref="ruleForm" class="addDepartForm">
|
|
|
<el-form-item class="addDiagName" v-if="!isEdit" label="选择添加疾病名称:" >
|
|
|
<input class="searchInput" @focus="focuInput" type="text" v-model = "searchDiagVal">
|
|
|
<span class="searchName" @click="searchDiag">搜索</span>
|
|
@@ -23,7 +23,7 @@
|
|
|
</ul>
|
|
|
</el-form-item>
|
|
|
<el-form-item class="isRequired" label="已选添加疾病名称:">
|
|
|
- {{form.name}}
|
|
|
+ {{disName}}
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="symptomList">
|
|
@@ -38,17 +38,17 @@
|
|
|
<td class="FeatureResult">结果</td>
|
|
|
<td class="FeatureOpera"></td>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in disFeatureList" :key="item.indexUnique">
|
|
|
- <td class="FeatureSort">{{index+1}}</td>
|
|
|
- <td class="FeatureType">
|
|
|
- <el-select size="mini" v-model="item.type" placeholder="标签类型" clearable>
|
|
|
- <el-option v-for="item in typeList" :label="item.name" :value="item.val" :key="item.id"></el-option>
|
|
|
+ <tr v-for="(item, index) in disFeatureList" :key="item.index" @click="clickItem">
|
|
|
+ <td class="FeatureSort" :class="item.notRequire ? 'borderRed':''">{{index+1}}</td>
|
|
|
+ <td class="FeatureType" :class="item.notRequire ? 'borderRed':''">
|
|
|
+ <el-select size="mini" v-model.trim="item.type" placeholder="标签类型" clearable>
|
|
|
+ <el-option v-for="item in featureTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
|
|
|
</el-select>
|
|
|
</td>
|
|
|
- <td class="FeatureNumber"><input class="groupInput" type="text" v-model="item.code" @input="handleInp(index,$event)"></td>
|
|
|
- <td class="FeatureStand"><input class="groupInput" type="text" v-model="item.standard" @input="handleInp(index,$event)"></td>
|
|
|
- <td class="FeatureRelate"><input class="groupInput" type="text" v-model="item.relation" @input="handleInp(index,$event)"></td>
|
|
|
- <td class="FeatureResult"><input class="groupInput" type="text" v-model="item.result" @input="handleInp(index,$event)"></td>
|
|
|
+ <td class="FeatureNumber" :class="item.notRequire ? 'borderRed':''"><input class="groupInput" :class="item.codeError ? 'colorRed':''" type="text" v-model.trim="item.code" @input="handleInp(index,$event,'FeatureNumber')"></td>
|
|
|
+ <td class="FeatureStand" :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.standard" @input="handleInp(index,$event,'FeatureStand')"></td>
|
|
|
+ <td class="FeatureRelate" :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.relation" @input="handleInp(index,$event,'FeatureRelate')"></td>
|
|
|
+ <td class="FeatureResult" :class="item.notRequire ? 'borderRed':''"><input class="groupInput" type="text" v-model.trim="item.result" @input="handleInp(index,$event,'FeatureResult')"></td>
|
|
|
<td class="FeatureOpera">
|
|
|
<el-button type="text" size="small" class="delete" @click="addItem(index, 1)">增加</el-button>
|
|
|
<el-button v-if="index !=0" type="text" size="small" class="delete" @click="delItem(index, 1)">删除</el-button>
|
|
@@ -63,14 +63,14 @@
|
|
|
<td class="FormulaNumber">公式</td>
|
|
|
<td class="FormulaOpera"></td>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in disFormulaList" :key="item.indexUnique">
|
|
|
+ <tr v-for="(item, index) in disFormulaList" :key="item.index">
|
|
|
<td class="FormulaSort">{{index +1}}</td>
|
|
|
<td class="FormulaType">
|
|
|
- <el-select size="mini" v-model="item.type" placeholder="标签类型" clearable>
|
|
|
- <el-option v-for="item in typeList" :label="item.name" :value="item.val" :key="item.id"></el-option>
|
|
|
+ <el-select size="mini" v-model.trim="item.type" placeholder="标签类型" clearable>
|
|
|
+ <el-option v-for="item in formulaTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
|
|
|
</el-select>
|
|
|
</td>
|
|
|
- <td class="FormulaNumber"><input class="groupInput" type="text" v-model="item.formula" @input="handleInp(index,$event)"></td>
|
|
|
+ <td class="FormulaNumber"><input class="groupInput" type="text" v-model.trim="item.formula" @input="handleInp(index,$event,'FormulaNumber')"></td>
|
|
|
<td class="FeatureOpera">
|
|
|
<el-button type="text" size="small" class="delete" @click="addItem(index, 2)">增加</el-button>
|
|
|
<el-button v-if="index !=0" type="text" size="small" class="delete" @click="delItem(index, 2)">删除</el-button>
|
|
@@ -103,30 +103,20 @@
|
|
|
<script>
|
|
|
import api from '@api/diagBase.js';
|
|
|
import utils from '@api/utils.js';
|
|
|
+ import apis from '@api/icss.js';
|
|
|
|
|
|
export default {
|
|
|
name: 'AddChronicAndIndexRelation',
|
|
|
data() {
|
|
|
return{
|
|
|
|
|
|
- form: {
|
|
|
- diseaseId: '', //诊断id
|
|
|
- diseaseName:'' //诊断名称
|
|
|
- },
|
|
|
+ disId: '', //诊断id
|
|
|
+ disName:'', //诊断名称
|
|
|
+ modifier: '', //操作人
|
|
|
titleText: '添加关联',
|
|
|
diagList: [],
|
|
|
- typeList: [
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- name: '症状',
|
|
|
- val: '1'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- name: '化验',
|
|
|
- val: '2'
|
|
|
- }
|
|
|
- ],
|
|
|
+ featureTypeList: [],
|
|
|
+ formulaTypeList: [],
|
|
|
disFeatureList: [
|
|
|
{
|
|
|
type:'',
|
|
@@ -153,13 +143,16 @@
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
+ const userLoginDTO = JSON.parse(localStorage.getItem('userLoginDTO'))
|
|
|
+ this.modifier = userLoginDTO && userLoginDTO.linkman
|
|
|
+ this.getDropList()
|
|
|
const { isEdit, data } = this.$route.params;
|
|
|
if(isEdit) {
|
|
|
if(isEdit) {
|
|
|
this.isEdit = isEdit;
|
|
|
- this.titleText = '修改关联';
|
|
|
- this.form.diseaseId = data.diseaseId
|
|
|
- this.form.diseaseName = data.diseaseName
|
|
|
+ // this.titleText = '修改关联';
|
|
|
+ // this.diseaseId = data.diseaseId
|
|
|
+ // this.diseaseName = data.diseaseName
|
|
|
}
|
|
|
} else {
|
|
|
|
|
@@ -175,6 +168,15 @@
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getDropList() {
|
|
|
+ return apis.getKnowledgeEnums().then((res) =>{
|
|
|
+ if(res.data.code === '0') {
|
|
|
+ this.featureTypeList = res.data.data.diagnoseFeatureTypeEnum.filter(item => item.key != 0)
|
|
|
+ this.formulaTypeList = res.data.data.diagnoseTypeEnum
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
close() {
|
|
|
this.diagList = [];
|
|
|
if(this.diagList.length>0){this.$refs['diagList'].style.display = 'none';}
|
|
@@ -198,8 +200,8 @@
|
|
|
})
|
|
|
},
|
|
|
selectDiag(item) {
|
|
|
- this.form.conceptId = item.conceptId
|
|
|
- this.form.name = item.name
|
|
|
+ this.disId = item.conceptId
|
|
|
+ this.disName = item.name
|
|
|
this.$refs['diagList'].style.display='none'
|
|
|
this.searchDiagVal = ''
|
|
|
this.diagList=[]
|
|
@@ -211,7 +213,7 @@
|
|
|
addItem(index, type) {
|
|
|
if(type == 1) {
|
|
|
const item = {
|
|
|
- type:index+1,
|
|
|
+ type:'',
|
|
|
code:'',
|
|
|
standard:'',
|
|
|
relation:'',
|
|
@@ -220,7 +222,7 @@
|
|
|
this.disFeatureList.splice(index+1, 0, item)
|
|
|
}else if(type == 2) {
|
|
|
const item = {
|
|
|
- type:index+1,
|
|
|
+ type:'',
|
|
|
code:'',
|
|
|
standard:'',
|
|
|
relation:'',
|
|
@@ -245,24 +247,70 @@
|
|
|
// })
|
|
|
},
|
|
|
exportDiagnosticAll(){
|
|
|
- // const param = {
|
|
|
- // disId: ''
|
|
|
- // }
|
|
|
- // api.exportDiagnosticAll(param).then((res) => {
|
|
|
- // utils.downloadExportedData(res.data.data,'诊断依据' )
|
|
|
- // })
|
|
|
+ const param = {
|
|
|
+ disId: ''+this.disId
|
|
|
+ }
|
|
|
+ this.diagBaseVerifyData().then(() => {
|
|
|
+ console.log('param', param)
|
|
|
+ api.exportDiagnosticAll(param).then((res) => {
|
|
|
+ utils.downloadExportedData(res.data.data,'诊断依据' )
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
submitForm() {
|
|
|
- if(!this.form.diseaseId) {
|
|
|
+ if(!this.disName) {
|
|
|
this.warning('请选择诊断')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- this.showDelDialog()
|
|
|
+ let notRequireList = [];
|
|
|
+ const disFeatureList = this.disFeatureList;
|
|
|
+ for(let i=0; i < disFeatureList.length; i++) {
|
|
|
+ if(!disFeatureList[i].type||!disFeatureList[i].code||!disFeatureList[i].standard) {
|
|
|
+ disFeatureList[i].notRequire = true
|
|
|
+ const notRequireInfo = "第" + (i+ 1) +"行必填项未填写"
|
|
|
+ notRequireList.push(notRequireInfo)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
|
|
|
+ console.log('notRequireList', notRequireList)
|
|
|
+ if(notRequireList.length >0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let codeErrorNum = 0;
|
|
|
+ for(let i=0; i < disFeatureList.length; i++) {
|
|
|
+ let regex =new RegExp(`${disFeatureList[i].type}\.[1-9]\\d?`)
|
|
|
+ console.log('regex', regex)
|
|
|
+ if(regex.test(disFeatureList[i].code)) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ console.log('error')
|
|
|
+ codeErrorNum++
|
|
|
+ disFeatureList[i].codeError = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
|
|
|
+ if(codeErrorNum > 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // this.showDelDialog()
|
|
|
+ this.diagBaseVerifyData()
|
|
|
+
|
|
|
},
|
|
|
+ diagBaseVerifyData() {
|
|
|
+ const param = {
|
|
|
+ disFeature: this.disFeatureList,
|
|
|
+ disName: this.disName,
|
|
|
+ disformula: this.disFormulaList,
|
|
|
+ id: '',
|
|
|
+ modifier: this.modifier
|
|
|
+ }
|
|
|
+ return api.diagBaseVerifyData(param).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
showDelDialog() {
|
|
|
-
|
|
|
-
|
|
|
this.showConfirmDialog('是否建立该关联?', () => {
|
|
|
const url = this.isEdit ?api.updateIndexConfigList(param) : api.saveIndexConfigLists(param)
|
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
@@ -301,11 +349,19 @@
|
|
|
duration:time || '3000'
|
|
|
})
|
|
|
},
|
|
|
- handleInp(index,e){ //分组不能输入负数
|
|
|
+ handleInp(index,e,type){ //分组不能输入负数
|
|
|
const value = e.target.value;
|
|
|
+ if(type === 'FeatureNumber') {
|
|
|
+ this.disFeatureList[index].code = value.replace(/[^\d.]/g,'')
|
|
|
+ } else if(type==='FeatureStand') {
|
|
|
+ // this.disFeatureList[index].standard = value.replace(/[^\d.]/g,'')
|
|
|
+ }
|
|
|
// const item = this.selectedIndexList[index].indexDesc;
|
|
|
- e.target.value = value.replace(/[^\d]/g,'');
|
|
|
+ // e.target.value = value.replace(/[^\d]/g,'');
|
|
|
// this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
|
|
|
+ },
|
|
|
+ clickItem() {
|
|
|
+ console.log('clickItem')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -324,7 +380,6 @@
|
|
|
line-height: 40px;
|
|
|
padding-left: 20px;
|
|
|
}
|
|
|
-
|
|
|
.searchInput, .searchName {
|
|
|
display: inline-block;
|
|
|
height: 32px;
|
|
@@ -436,6 +491,12 @@
|
|
|
content:"*";
|
|
|
color: red;
|
|
|
}
|
|
|
+ .borderRed {
|
|
|
+ border: 1px solid red !important;
|
|
|
+ }
|
|
|
+ .colorRed {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|