|
|
|
@ -5,9 +5,8 @@ |
|
|
|
:data="tableData" |
|
|
|
border |
|
|
|
style="width: 100%" |
|
|
|
row-key="id" |
|
|
|
class="el-table__body-wrapper tbody" |
|
|
|
height="200" |
|
|
|
:height="window.pageHeight < 600 ? 260 : window.pageHeight - 340" |
|
|
|
@row-click="rowick" |
|
|
|
highlight-current-row |
|
|
|
> |
|
|
|
@ -50,7 +49,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width=""> |
|
|
|
<!-- <el-table-column label="操作"> |
|
|
|
<template> |
|
|
|
<el-tag |
|
|
|
class="move" |
|
|
|
@ -60,18 +59,18 @@ |
|
|
|
<i class="el-icon-d-caret" style="width: 1rem; height: 1rem"></i> |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> --> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!-- 按钮区域 --> |
|
|
|
<div style="margin-left: 10px; width: 10%"> |
|
|
|
<div style="margin-top: 20px"> |
|
|
|
<div style="margin-left: 10px; width: 10%" class="editButton"> |
|
|
|
<div style="width:100%;"> |
|
|
|
<el-button type="success" @click="add">新增</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<div style="margin-top: 5px;width:100%;"> |
|
|
|
<el-button type="primary" @click="edit">编辑</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<div style="margin-top: 5px;width:100%;"> |
|
|
|
<el-button type="danger" @click="del">删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -120,7 +119,7 @@ |
|
|
|
></el-input> </el-form-item |
|
|
|
></el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="警告范围" prop="criticalRangeValue"> |
|
|
|
<el-form-item label="警告范围" prop=""> |
|
|
|
<el-input |
|
|
|
v-model="form.criticalRangeValue" |
|
|
|
style="width: 100%" |
|
|
|
@ -128,7 +127,7 @@ |
|
|
|
></el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="偏低诊断" prop="lowerDiagnosisId"> |
|
|
|
<el-select v-model="form.lowerDiagnosisId" placeholder="请选择"> |
|
|
|
<el-select v-model="form.lowerDiagnosisId" placeholder="请选择" filterable :filter-method="remoteMethods" default-first-option clearable @change="quckEditdigoisce"> |
|
|
|
<el-option |
|
|
|
v-for="item in diagnosis" |
|
|
|
:key="item.id" |
|
|
|
@ -140,9 +139,9 @@ |
|
|
|
></el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="偏高诊断" prop="upperDiagnosisId"> |
|
|
|
<el-select v-model="form.upperDiagnosisId" placeholder="请选择"> |
|
|
|
<el-select v-model="form.upperDiagnosisId" placeholder="请选择" filterable :filter-method="remoteMethodes" default-first-option clearable @change="quckEditdigoisces"> |
|
|
|
<el-option |
|
|
|
v-for="item in diagnosis" |
|
|
|
v-for="item in diagnosies" |
|
|
|
:key="item.id" |
|
|
|
:label="item.displayName" |
|
|
|
:value="item.id" |
|
|
|
@ -153,8 +152,8 @@ |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisible = false,id=curRowes.id">取 消</el-button> |
|
|
|
<el-button type="primary" @click="onsbmint">确 定</el-button> |
|
|
|
<el-button @click="dialogVisible = false">关 闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
@ -180,7 +179,7 @@ export default { |
|
|
|
{ required: true, message: "请输入年龄上限", trigger: "blur" }, |
|
|
|
], |
|
|
|
referenceRangeValue: [ |
|
|
|
{ required: true, message: "请输入引用范围", trigger: "blur" }, |
|
|
|
{ required: true, message: "请输入参考范围", trigger: "blur"}, |
|
|
|
], |
|
|
|
criticalRangeValue: [ |
|
|
|
{ required: true, message: "请输入临界范围", trigger: "blur" }, |
|
|
|
@ -212,7 +211,10 @@ export default { |
|
|
|
id: "", //新增/编辑 或删除的记录 id |
|
|
|
forSexId: [], //性别 |
|
|
|
diagnosis: [], //偏低诊断 |
|
|
|
diagnosies:[],//偏高诊断 |
|
|
|
tableData: [], |
|
|
|
curRowes:{}, |
|
|
|
diagnosisId:"" |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -225,7 +227,7 @@ export default { |
|
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(["itemSet"]), |
|
|
|
...mapState(["itemSet","window"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getlist(itemId, ReferenceRangeTypeFlag) { |
|
|
|
@ -236,11 +238,52 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
remoteMethods(keyWords){ |
|
|
|
if (keyWords) { |
|
|
|
this.diagnosis = []; |
|
|
|
this.diagnosisId.forEach(item => { |
|
|
|
if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
|| item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
) { |
|
|
|
this.diagnosis.push(item); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.quckeDitd = deepCopy(this.diagnosis); |
|
|
|
} |
|
|
|
}, |
|
|
|
remoteMethodes(keyWords){ |
|
|
|
if (keyWords) { |
|
|
|
this.diagnosies = []; |
|
|
|
this.diagnosisId.forEach(item => { |
|
|
|
if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
|| item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
|
|
|
) { |
|
|
|
this.diagnosies.push(item); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.quckeDitd = deepCopy(this.diagnosies); |
|
|
|
} |
|
|
|
}, |
|
|
|
rowick(row) { |
|
|
|
this.id = row.id; |
|
|
|
this.form = row; |
|
|
|
getapi(`/api/app/reference-range/${row.id}`).then((res) => { |
|
|
|
this.curRowes = res.data; |
|
|
|
this.id = res.data.id; |
|
|
|
}); |
|
|
|
}, |
|
|
|
quckEditdigoisce(e){ |
|
|
|
if(!e){ |
|
|
|
this.remoteMethods() |
|
|
|
} |
|
|
|
}, |
|
|
|
quckEditdigoisces(e){ |
|
|
|
if(!e){ |
|
|
|
this.remoteMethodes() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//ldddw(forSexId, 'id', scope.row.forSexId, 'displayName') |
|
|
|
ldddw(arrayData, key, value, display) { |
|
|
|
return dddw(arrayData, key, value, display); |
|
|
|
@ -255,31 +298,43 @@ export default { |
|
|
|
//诊断 |
|
|
|
postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => { |
|
|
|
this.diagnosis = res.data; |
|
|
|
this.diagnosies=res.data |
|
|
|
this.diagnosisId=res.data |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
add() { |
|
|
|
this.addtoedit() |
|
|
|
this.id = ""; |
|
|
|
this.dialogVisible = true; |
|
|
|
if (this.$refs.form !== undefined){ |
|
|
|
this.$refs.form.resetFields() |
|
|
|
} |
|
|
|
Object.assign(this.$data.form, this.$options.data().form) |
|
|
|
this.form = { |
|
|
|
itemId: this.itemId, |
|
|
|
referenceRangeTypeFlag: this.ReferenceRangeTypeFlag, |
|
|
|
}; |
|
|
|
this.dialogVisible = true; |
|
|
|
}, |
|
|
|
|
|
|
|
//编辑弹框 |
|
|
|
edit() { |
|
|
|
if (!this.id) { |
|
|
|
alert("请先选中要编辑的记录"); |
|
|
|
this.$message.warning("请先选中要编辑的记录"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.dialogVisible = true; |
|
|
|
if (this.$refs.form !== undefined){ |
|
|
|
this.$refs.form.resetFields() |
|
|
|
} |
|
|
|
this.form={...this.curRowes} |
|
|
|
this.addtoedit() |
|
|
|
}, |
|
|
|
|
|
|
|
del() { |
|
|
|
//this.$message.success("删除操作"); |
|
|
|
if (!this.id) { |
|
|
|
alert("请先选中要删除的记录"); |
|
|
|
this.$message.warning("请先选中要删除的记录"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { |
|
|
|
@ -304,17 +359,13 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//确定新增或者编辑 |
|
|
|
onsbmint() { |
|
|
|
this.$refs["form"].validate((v) => { |
|
|
|
if (v) { |
|
|
|
if (!this.id) { |
|
|
|
confirmationRequest(){ |
|
|
|
if (!this.id) { |
|
|
|
postapi("/api/app/reference-range", this.form).then((res) => { |
|
|
|
if(res.code!=-1){ |
|
|
|
this.$message.success("新增成功"); |
|
|
|
this.getlist(this.itemId, this.ReferenceRangeTypeFlag); |
|
|
|
this.id = res.data.id; |
|
|
|
this.id = this.curRowes.id; |
|
|
|
this.dialogVisible=false |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -329,6 +380,38 @@ export default { |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
//确定新增或者编辑 |
|
|
|
onsbmint() { |
|
|
|
this.$refs["form"].validate((v) => { |
|
|
|
let that=this |
|
|
|
if (v) { |
|
|
|
if(that.form.referenceRangeValue.includes('-')){ |
|
|
|
let before=/^\d+\.?\d?$/.test(that.form.referenceRangeValue.match(/(\S*)-/)[1]) |
|
|
|
let after=/^\d+\.?\d?$/.test(that.form.referenceRangeValue.match(/-(\S*)/)[1]) |
|
|
|
if(before && after){ |
|
|
|
console.log(that.form) |
|
|
|
if(that.form.criticalRangeValue!="" && that.form.criticalRangeValue!=undefined){ |
|
|
|
if(that.form.criticalRangeValue.includes('-')){ |
|
|
|
let criticalBefore=/^\d+\.?\d?$/.test(that.form.criticalRangeValue.match(/(\S*)-/)[1]) |
|
|
|
let criticalAfter=/^\d+\.?\d?$/.test(that.form.criticalRangeValue.match(/-(\S*)/)[1]) |
|
|
|
if(criticalBefore && criticalAfter){ |
|
|
|
that.confirmationRequest() |
|
|
|
}else{ |
|
|
|
return that.$message.warning("警告范围值-符号前后必须是数字"); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return that.$message.warning("警告范围值必须以-符号隔开"); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
that.confirmationRequest() |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return that.$message.warning("参考范围值-符号前后必须是数字"); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return that.$message.warning("参考范围值必须以-符号隔开"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -353,5 +436,9 @@ export default { |
|
|
|
<style scoped> |
|
|
|
.box { |
|
|
|
display: flex; |
|
|
|
margin-top: 15px; |
|
|
|
} |
|
|
|
:deep .editButton .el-button{ |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
</style> |