|
@@ -482,12 +482,12 @@
|
|
|
this.disFeatureListResult = []
|
|
|
this.disFormulaListResult = []
|
|
|
let errStrList = [];
|
|
|
- for(let i = 0; i < this.disFeatureList.length; i++) {
|
|
|
+ for(let i = 0; i < this.disFeatureList.length; i++) { //如果有任意一项有值,就检测,所有项都没值,则删掉这条数据
|
|
|
if(this.disFeatureList[i].type || this.disFeatureList[i].code || this.disFeatureList[i].standard || this.disFeatureList[i].relation || this.disFeatureList[i].midResult) {
|
|
|
this.disFeatureListResult.push(this.disFeatureList[i])
|
|
|
}
|
|
|
}
|
|
|
- for(let i = 0; i < this.disFormulaList.length; i++) {
|
|
|
+ for(let i = 0; i < this.disFormulaList.length; i++) { //如果有任意一项有值,就检测,所有项都没值,则删掉这条数据
|
|
|
if(this.disFormulaList[i].type || this.disFormulaList[i].formula ) {
|
|
|
this.disFormulaListResult.push(this.disFormulaList[i])
|
|
|
}
|
|
@@ -511,6 +511,7 @@
|
|
|
}
|
|
|
const disFormulaList = this.disFormulaListResult;
|
|
|
let codeErrorNum = 0;
|
|
|
+ //必填项是否填写
|
|
|
for(let i=0; i < disFeatureList.length; i++) {
|
|
|
if(!disFeatureList[i].type) {
|
|
|
disFeatureList[i].typeNull = "未选择类型"
|
|
@@ -541,6 +542,8 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //化验项有结果则必须有关联词
|
|
|
if(disFeatureList[i].type == '3' && disFeatureList[i].midResult && !disFeatureList[i].relation) {
|
|
|
disFeatureList[i].relationNull = "未填写关联词"
|
|
|
const errStr = "第" + (i+ 1) +"行化验项数据填写不完整"
|
|
@@ -564,7 +567,7 @@
|
|
|
|
|
|
|
|
|
if(disFeatureList[i].type == '3' && !disFeatureList[i].midResult ) { //化验项下面诊断公式如果有用到,判断是否填写结果项
|
|
|
- const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code}(?=\\D|\\s?)`)
|
|
|
+ const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code.replace('.','\\.')}(?=\\D|\\s?)`)
|
|
|
// const regex2 = new RegExp(`、\\s*、{1,}`)
|
|
|
// const regex2 = new RegExp(`([^0-9]|\\s{0,1})${disFeatureList[i].code}([^0-9]|\\s{0,1})`)
|
|
|
let hasError = disFormulaList.find(item => {return regex2.test(item.formula)})
|
|
@@ -579,9 +582,7 @@
|
|
|
}
|
|
|
if(disFeatureList[i].type == '4' && !disFeatureList[i].relation ) { //辅检项下面诊断公式如果有用到,判断是否填写结果项(辅检结果是填在关联词列)
|
|
|
const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code.replace('.','\\.')}(?=\\D|\\s?)`)
|
|
|
- console.log('regex2', regex2)
|
|
|
let hasError = disFormulaList.find(item => {return regex2.test(item.formula)})
|
|
|
- console.log('hasError', hasError)
|
|
|
if(hasError) {
|
|
|
disFeatureList[i].verifyRelation = "数据异常"
|
|
|
const errStr = "第" + (i+ 1) +"行辅捡项数据异常"
|
|
@@ -713,13 +714,13 @@
|
|
|
if(res.data.code === '0') {
|
|
|
const data = res.data.data
|
|
|
for (let i = 0; i < data.length; i++ ) {
|
|
|
- if(!data[i].uniqueName) {
|
|
|
+ if(!data[i].uniqueName) { //判断是否存在公表项
|
|
|
this.disFeatureListResult[data[i].index].verifyUnique="公表项不存在"
|
|
|
} else {
|
|
|
this.disFeatureListResult[data[i].index].verifyUnique=""
|
|
|
}
|
|
|
this.disFeatureListResult[data[i].index].uniqueName = data[i].uniqueName
|
|
|
- if(data[i].uniqueName) {
|
|
|
+ if(data[i].uniqueName) { //有公表项和结果,则将公表项和结果拼接起来,结果用、分隔
|
|
|
if(this.disFeatureListResult[data[i].index].midResult) {
|
|
|
let midResult = this.disFeatureListResult[data[i].index].midResult.replace(' ', '').split('、')
|
|
|
for (let j = 0; j < midResult.length; j++) {
|