|
@@ -260,7 +260,9 @@ export default {
|
|
parLenCode: '',
|
|
parLenCode: '',
|
|
klRuleByIdSub: []
|
|
klRuleByIdSub: []
|
|
},
|
|
},
|
|
- rules: formRules
|
|
|
|
|
|
+ rules: formRules,
|
|
|
|
+ dragVal: null,
|
|
|
|
+ dragArr: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -335,12 +337,66 @@ export default {
|
|
|
|
|
|
// disable
|
|
// disable
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
|
|
+ const del =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDelDict')
|
|
|
|
+ .match(
|
|
|
|
+ new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
|
|
|
|
+ ) || [];
|
|
if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
this.$set(item, 'disabled', false);
|
|
this.$set(item, 'disabled', false);
|
|
|
|
+ if (del.length > 0 && item.subType == del[0].split('-')[2]) {
|
|
|
|
+ const delType = del[0].split('-');
|
|
|
|
+ const types = del[0].split('-');
|
|
|
|
+ let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
|
|
|
|
+ const subobj = this.baseTypeList.find(it => it.type == types[2]);
|
|
|
|
+ const screenArr = subobj.subMenuList.filter(item => {
|
|
|
|
+ return !types[3].includes(item.code);
|
|
|
|
+ });
|
|
|
|
+ this.$set(item, 'baseTermTypeList', screenArr);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$set(item, 'disabled', true);
|
|
this.$set(item, 'disabled', true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ const dragDel =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDragDict')
|
|
|
|
+ .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
|
|
|
|
+ //药品开单合理判断
|
|
|
|
+ if (dragDel.length > 0) {
|
|
|
|
+ const obj = this.baseTypeList.find(it => it.type === 1);
|
|
|
|
+ if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
|
|
+ if (i == 2) {
|
|
|
|
+ //获取互斥项code
|
|
|
|
+ const list = obj.subMenuList.filter(it => {
|
|
|
|
+ return (
|
|
|
|
+ it.code == arr[i - 1].subLenCode &&
|
|
|
|
+ it.remark.split('|')[0] == 3
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ const dragArr = list[0].remark.split('|')[1].split(',');
|
|
|
|
+ this.dragArr = dragArr;
|
|
|
|
+ this.dragVal = item.subLenCode;
|
|
|
|
+ //取出互斥项
|
|
|
|
+ const screenArr = obj.subMenuList.filter(item =>
|
|
|
|
+ dragArr.some(
|
|
|
|
+ ele => ele === item.code && item.remark.split('|')[0] == 3
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ this.$set(item, 'baseTermTypeList', screenArr);
|
|
|
|
+ } else {
|
|
|
|
+ const screenArr = obj.subMenuList.filter(item => {
|
|
|
|
+ if (item.remark == '') {
|
|
|
|
+ return item;
|
|
|
|
+ } else {
|
|
|
|
+ return item.remark.split('|')[0] == i + 1;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.$set(item, 'baseTermTypeList', screenArr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
@@ -421,11 +477,45 @@ export default {
|
|
.getItem('zskDicts')
|
|
.getItem('zskDicts')
|
|
.match(new RegExp(this.firstPlace.checkedType + '-\\d+', 'g')) ||
|
|
.match(new RegExp(this.firstPlace.checkedType + '-\\d+', 'g')) ||
|
|
[];
|
|
[];
|
|
|
|
+ const del =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDelDict')
|
|
|
|
+ .match(
|
|
|
|
+ new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
|
|
|
|
+ ) || [];
|
|
const types = dict[0].split('-');
|
|
const types = dict[0].split('-');
|
|
let obj = this.form.klRuleByIdSub;
|
|
let obj = this.form.klRuleByIdSub;
|
|
obj.forEach((item, i, arr) => {
|
|
obj.forEach((item, i, arr) => {
|
|
if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
this.$set(item, 'disabled', false);
|
|
this.$set(item, 'disabled', false);
|
|
|
|
+ if (del.length > 0) {
|
|
|
|
+ const delType = del[0].split('-');
|
|
|
|
+ if (
|
|
|
|
+ item.subType == delType[2] ||
|
|
|
|
+ item.subLenCode == delType[3]
|
|
|
|
+ ) {
|
|
|
|
+ this.$set(this.form.klRuleByIdSub, i, {
|
|
|
|
+ groupId: item.groupId,
|
|
|
|
+ groupChildId: 'child' + new Date().valueOf(),
|
|
|
|
+ baseTypes: this.baseTypeList,
|
|
|
|
+ baseTermTypeList: [],
|
|
|
|
+ conceptList: [],
|
|
|
|
+ subDescription: '',
|
|
|
|
+ parRuleType: '',
|
|
|
|
+ subConceptId: '',
|
|
|
|
+ subType: '',
|
|
|
|
+ subMaxOperator: '',
|
|
|
|
+ subMaxUnit: '',
|
|
|
|
+ subMaxValue: '',
|
|
|
|
+ subMinOperator: '',
|
|
|
|
+ subMinUnit: '',
|
|
|
|
+ subMinValue: '',
|
|
|
|
+ subEqValue: '',
|
|
|
|
+ subLenCode: '',
|
|
|
|
+ dataType: ''
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$set(item, 'disabled', true);
|
|
this.$set(item, 'disabled', true);
|
|
this.$set(item, 'subType', parseInt(types[2]));
|
|
this.$set(item, 'subType', parseInt(types[2]));
|
|
@@ -493,12 +583,73 @@ export default {
|
|
// 基础规则类型切换
|
|
// 基础规则类型切换
|
|
subTypeChange(val, index) {
|
|
subTypeChange(val, index) {
|
|
// index
|
|
// index
|
|
|
|
+ const dragDel =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDragDict')
|
|
|
|
+ .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
|
|
const obj = this.baseTypeList.find(it => it.type === val);
|
|
const obj = this.baseTypeList.find(it => it.type === val);
|
|
|
|
+ let dragType = false;
|
|
|
|
+ let isDel = false;
|
|
|
|
+ let screenArr;
|
|
|
|
+ //药品开单合理判断
|
|
|
|
+ if (dragDel.length > 0) {
|
|
|
|
+ dragType = true;
|
|
|
|
+ const types = dragDel[0].split('-');
|
|
|
|
+ if (this.dragArr && index > 0) {
|
|
|
|
+ //获取互斥项code
|
|
|
|
+ const list = obj.subMenuList.filter(it => {
|
|
|
|
+ return it.code == this.dragVal && it.remark.split('|')[0] == 3;
|
|
|
|
+ });
|
|
|
|
+ const dragArr = list[0].remark.split('|')[1].split(',');
|
|
|
|
+ this.dragArr = dragArr;
|
|
|
|
+ //取出互斥项
|
|
|
|
+ screenArr = obj.subMenuList.filter(item =>
|
|
|
|
+ dragArr.some(
|
|
|
|
+ ele => ele === item.code && item.remark.split('|')[0] == 3
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ screenArr = obj.subMenuList.filter(item => {
|
|
|
|
+ if (item.remark == '') {
|
|
|
|
+ return item;
|
|
|
|
+ } else {
|
|
|
|
+ return item.remark.split('|')[0] == index + 1;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ let klRuleByIdSub = this.form.klRuleByIdSub;
|
|
|
|
+ klRuleByIdSub.forEach((item, i, arr) => {
|
|
|
|
+ if (arr[0].subType == 1) {
|
|
|
|
+ const arr = this.baseTypeList.filter(it => {
|
|
|
|
+ return it.type == 1;
|
|
|
|
+ });
|
|
|
|
+ this.$set(item, 'baseTypes', arr);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //危急值实验室子项目已选医学标准术语判断
|
|
|
|
+ if (this.form.parHasSub && this.firstPlace) {
|
|
|
|
+ const del =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDelDict')
|
|
|
|
+ .match(
|
|
|
|
+ new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
|
|
|
|
+ ) || [];
|
|
|
|
+ if (del.length > 0) {
|
|
|
|
+ isDel = true;
|
|
|
|
+ const types = del[0].split('-');
|
|
|
|
+ let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
|
|
|
|
+ const subobj = this.baseTypeList.find(it => it.type == types[2]);
|
|
|
|
+ screenArr = subobj.subMenuList.filter(item => {
|
|
|
|
+ return !types[3].includes(item.code);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
this.$set(
|
|
this.$set(
|
|
this.form.klRuleByIdSub[index],
|
|
this.form.klRuleByIdSub[index],
|
|
'baseTermTypeList',
|
|
'baseTermTypeList',
|
|
- obj.subMenuList
|
|
|
|
|
|
+ (isDel && val == 2) || dragType ? screenArr : obj.subMenuList
|
|
);
|
|
);
|
|
this.$set(this.form.klRuleByIdSub[index], 'subLenCode', '');
|
|
this.$set(this.form.klRuleByIdSub[index], 'subLenCode', '');
|
|
this.$set(this.form.klRuleByIdSub[index], 'dataType', '');
|
|
this.$set(this.form.klRuleByIdSub[index], 'dataType', '');
|
|
@@ -532,6 +683,7 @@ export default {
|
|
* arg:{index:添加规则用索引,groupId:添加分组用确切id}
|
|
* arg:{index:添加规则用索引,groupId:添加分组用确切id}
|
|
*/
|
|
*/
|
|
!date && (date = new Date().valueOf());
|
|
!date && (date = new Date().valueOf());
|
|
|
|
+
|
|
const obj = {
|
|
const obj = {
|
|
groupId: date,
|
|
groupId: date,
|
|
groupChildId: 'child' + new Date().valueOf(),
|
|
groupChildId: 'child' + new Date().valueOf(),
|
|
@@ -555,6 +707,21 @@ export default {
|
|
if (typeof arg.index == 'number') {
|
|
if (typeof arg.index == 'number') {
|
|
// 添加规则 直接在当前位置之后添加
|
|
// 添加规则 直接在当前位置之后添加
|
|
this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
|
|
this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
|
|
|
|
+ const dragDel =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDragDict')
|
|
|
|
+ .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
|
|
|
|
+ if (dragDel.length > 0) {
|
|
|
|
+ let obj = this.form.klRuleByIdSub;
|
|
|
|
+ obj.forEach((item, i, arr) => {
|
|
|
|
+ if (arr[0].subType == 1) {
|
|
|
|
+ const arr = this.baseTypeList.filter(it => {
|
|
|
|
+ return it.type == 1;
|
|
|
|
+ });
|
|
|
|
+ this.$set(item, 'baseTypes', arr);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// 添加分组 在列表中相同groupId之后添加
|
|
// 添加分组 在列表中相同groupId之后添加
|
|
|
|
|
|
@@ -597,10 +764,52 @@ export default {
|
|
this.form.klRuleByIdSub = list;
|
|
this.form.klRuleByIdSub = list;
|
|
},
|
|
},
|
|
// 删除规则
|
|
// 删除规则
|
|
- delGroupChild(groupChildId) {
|
|
|
|
- const newGroupList = this.form.klRuleByIdSub.filter(
|
|
|
|
- item => item.groupChildId != groupChildId
|
|
|
|
- );
|
|
|
|
|
|
+ delGroupChild(groupChildId, index) {
|
|
|
|
+ let newGroupList;
|
|
|
|
+ const dragDel =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDragDict')
|
|
|
|
+ .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
|
|
|
|
+ let list;
|
|
|
|
+ if (dragDel.length > 0) {
|
|
|
|
+ if (index == 0) {
|
|
|
|
+ const date = new Date().valueOf();
|
|
|
|
+ newGroupList = [
|
|
|
|
+ {
|
|
|
|
+ groupId: date,
|
|
|
|
+ groupChildId: 'child' + new Date().valueOf(),
|
|
|
|
+ baseTypes: this.baseTypeList,
|
|
|
|
+ baseTermTypeList: [],
|
|
|
|
+ conceptList: [],
|
|
|
|
+ subDescription: '',
|
|
|
|
+ parRuleType: '',
|
|
|
|
+ subConceptId: '',
|
|
|
|
+ subType: '',
|
|
|
|
+ subMaxOperator: '',
|
|
|
|
+ subMaxUnit: '',
|
|
|
|
+ subMaxValue: '',
|
|
|
|
+ subMinOperator: '',
|
|
|
|
+ subMinUnit: '',
|
|
|
|
+ subMinValue: '',
|
|
|
|
+ subEqValue: '',
|
|
|
|
+ subLenCode: '',
|
|
|
|
+ dataType: ''
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
|
|
+ } else if (index == 0 || index == 1) {
|
|
|
|
+ newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
|
+ return i == 0;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ newGroupList = this.form.klRuleByIdSub.filter(
|
|
|
|
+ item => item.groupChildId != groupChildId
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ newGroupList = this.form.klRuleByIdSub.filter(
|
|
|
|
+ item => item.groupChildId != groupChildId
|
|
|
|
+ );
|
|
|
|
+ }
|
|
this.form.klRuleByIdSub = newGroupList;
|
|
this.form.klRuleByIdSub = newGroupList;
|
|
},
|
|
},
|
|
setDict() {
|
|
setDict() {
|
|
@@ -622,7 +831,7 @@ export default {
|
|
const param = {
|
|
const param = {
|
|
excludedConceptIds: [this.form.parRuleType],
|
|
excludedConceptIds: [this.form.parRuleType],
|
|
libType: this.form.parLenCode,
|
|
libType: this.form.parLenCode,
|
|
- name: val,
|
|
|
|
|
|
+ name: val
|
|
};
|
|
};
|
|
api
|
|
api
|
|
.searchConcept(param)
|
|
.searchConcept(param)
|
|
@@ -667,7 +876,6 @@ export default {
|
|
},
|
|
},
|
|
childClearNumText(index) {
|
|
childClearNumText(index) {
|
|
let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
|
|
let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
|
|
-
|
|
|
|
obj[index].subMaxOperator = '';
|
|
obj[index].subMaxOperator = '';
|
|
obj[index].subMaxValue = '';
|
|
obj[index].subMaxValue = '';
|
|
obj[index].subMaxUnit = '';
|
|
obj[index].subMaxUnit = '';
|
|
@@ -698,6 +906,75 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
childSubCodeChange(val, index, numTypes) {
|
|
childSubCodeChange(val, index, numTypes) {
|
|
|
|
+ const dragDel =
|
|
|
|
+ localStorage
|
|
|
|
+ .getItem('zskDragDict')
|
|
|
|
+ .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
|
|
|
|
+ const inx = index == 1 ? index + 1 : index == 2 ? index - 1 : index;
|
|
|
|
+ const subobj = this.baseTypeList.find(it => it.type == 1);
|
|
|
|
+ let obj = this.form.klRuleByIdSub;
|
|
|
|
+ const mutex = obj.some((item, i, arr) => {
|
|
|
|
+ return item.subLenCode == '';
|
|
|
|
+ });
|
|
|
|
+ //判断药品合理性总条数是否大于1条,是否存在第二条或第三条类型为1,存在触发互斥
|
|
|
|
+ if (
|
|
|
|
+ //判断3条规则是否都已选中
|
|
|
|
+ dragDel.length > 0 &&
|
|
|
|
+ index > 0 &&
|
|
|
|
+ this.form.klRuleByIdSub.length > 1 &&
|
|
|
|
+ this.form.klRuleByIdSub[0].subType == 1
|
|
|
|
+ ) {
|
|
|
|
+ if (this.form.klRuleByIdSub.length == 3 && !mutex) {
|
|
|
|
+ //判断是否存在符合互斥条件的两条出具,若存在,置空另一条出具
|
|
|
|
+ if (this.dragArr.indexOf(this.dragVal) > -1) {
|
|
|
|
+ //剂型给药途径互斥判断
|
|
|
|
+ const arr = this.baseTypeList.filter(it => {
|
|
|
|
+ return it.type == 1;
|
|
|
|
+ });
|
|
|
|
+ this.$set(this.form.klRuleByIdSub, inx, {
|
|
|
|
+ groupId: this.form.klRuleByIdSub[inx].groupId,
|
|
|
|
+ groupChildId: 'child' + new Date().valueOf(),
|
|
|
|
+ baseTypes: arr,
|
|
|
|
+ baseTermTypeList: [],
|
|
|
|
+ conceptList: [],
|
|
|
|
+ subDescription: '',
|
|
|
|
+ parRuleType: '',
|
|
|
|
+ subConceptId: '',
|
|
|
|
+ subType: '',
|
|
|
|
+ subMaxOperator: '',
|
|
|
|
+ subMaxUnit: '',
|
|
|
|
+ subMaxValue: '',
|
|
|
|
+ subMinOperator: '',
|
|
|
|
+ subMinUnit: '',
|
|
|
|
+ subMinValue: '',
|
|
|
|
+ subEqValue: '',
|
|
|
|
+ subLenCode: '',
|
|
|
|
+ dataType: ''
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ const list = subobj.subMenuList.filter(it => {
|
|
|
|
+ return it.code == val && it.remark.split('|')[0] == 3;
|
|
|
|
+ });
|
|
|
|
+ //获取互斥项code
|
|
|
|
+ const dragArr = list[0].remark.split('|')[1].split(',');
|
|
|
|
+ this.dragArr = dragArr;
|
|
|
|
+ //获取互斥项
|
|
|
|
+ const screenArr = subobj.subMenuList.filter(item =>
|
|
|
|
+ dragArr.some(
|
|
|
|
+ ele => ele === item.code && item.remark.split('|')[0] == 3
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ if (this.form.klRuleByIdSub[inx]) {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.form.klRuleByIdSub[inx],
|
|
|
|
+ 'baseTermTypeList',
|
|
|
|
+ screenArr
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.dragVal = val;
|
|
|
|
+ }
|
|
if ((numTypes + ',').indexOf(val + ',') > -1) {
|
|
if ((numTypes + ',').indexOf(val + ',') > -1) {
|
|
this.$set(this.form.klRuleByIdSub[index], 'dataType', '1');
|
|
this.$set(this.form.klRuleByIdSub[index], 'dataType', '1');
|
|
} else {
|
|
} else {
|
|
@@ -705,6 +982,13 @@ export default {
|
|
}
|
|
}
|
|
this.childClearConcept(index);
|
|
this.childClearConcept(index);
|
|
this.childClearNumText(index);
|
|
this.childClearNumText(index);
|
|
|
|
+ },
|
|
|
|
+ // 去重
|
|
|
|
+ unique(arr, obj) {
|
|
|
|
+ return arr.reduce((cur, next) => {
|
|
|
|
+ obj[next] ? '' : (obj[next] = true && cur.push(next));
|
|
|
|
+ return cur;
|
|
|
|
+ }, []);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|