|
@@ -336,6 +336,7 @@ export default {
|
|
|
item.groupChildId = "child" + item.subId;
|
|
|
//TODO => 赋值时一定要注意set更新页面
|
|
|
this.$set(item, "baseTypes", [...this.baseTypeList]);
|
|
|
+ // this.$set(key, "baseTypes", [...this.baseTypeList]);
|
|
|
this.$set(
|
|
|
item,
|
|
|
"baseTermTypeList",
|
|
@@ -352,7 +353,6 @@ export default {
|
|
|
} else if (item.subEqValue) {
|
|
|
item.dataType = "2";
|
|
|
}
|
|
|
-
|
|
|
// disable
|
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
|
const del =
|
|
@@ -366,7 +366,6 @@ export default {
|
|
|
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]
|
|
|
);
|
|
@@ -387,6 +386,7 @@ export default {
|
|
|
if (dragDel.length > 0) {
|
|
|
const obj = this.baseTypeList.find((it) => it.type === 1);
|
|
|
if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
|
|
|
+ console.log(item);
|
|
|
let klRuleByIdSub = this.form.klRuleByIdSub;
|
|
|
klRuleByIdSub.forEach((item, i, arr) => {
|
|
|
if (arr[0].subType == 1) {
|
|
@@ -593,6 +593,7 @@ export default {
|
|
|
subLenCode: "",
|
|
|
dataType: "",
|
|
|
key: 0,
|
|
|
+ del: true,
|
|
|
},
|
|
|
]);
|
|
|
} else {
|
|
@@ -653,25 +654,24 @@ export default {
|
|
|
return item.remark.split("|")[0] == (key % 3) + 1;
|
|
|
}
|
|
|
});
|
|
|
- console.log(screenArr);
|
|
|
}
|
|
|
- const klRuleByIdSub = this.form.klRuleByIdSub;
|
|
|
- klRuleByIdSub.forEach((item, i) => {
|
|
|
- arr.forEach((it) => {
|
|
|
- if (item.groupId == it.groupId) {
|
|
|
- if (key == 0 && val == 1) {
|
|
|
- const arrList = this.baseTypeList.filter((it) => {
|
|
|
- return it.type == 1;
|
|
|
- });
|
|
|
- if (i > 0) {
|
|
|
- this.$set(item, "baseTypes", arrList);
|
|
|
- }
|
|
|
- } else if (val != 1) {
|
|
|
- this.$set(item, "baseTypes", this.baseTypeList);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ // const klRuleByIdSub = this.form.klRuleByIdSub;
|
|
|
+ // klRuleByIdSub.forEach((item, i) => {
|
|
|
+ // arr.forEach((it) => {
|
|
|
+ // if (item.groupId == it.groupId) {
|
|
|
+ // if (key == 0) {
|
|
|
+ // this.$set(item, "baseTypes", this.baseTypeList);
|
|
|
+ // } else {
|
|
|
+ // const arrList = this.baseTypeList.filter((it) => {
|
|
|
+ // return it.type == 1;
|
|
|
+ // });
|
|
|
+ // if (i > 0) {
|
|
|
+ // this.$set(item, "baseTypes", arrList);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
}
|
|
|
//危急值实验室子项目已选医学标准术语判断
|
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
@@ -684,7 +684,6 @@ export default {
|
|
|
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);
|
|
@@ -765,24 +764,19 @@ export default {
|
|
|
obj.forEach((item, i, arr) => {
|
|
|
len.forEach((its, index) => {
|
|
|
if (item.groupId == its.groupId) {
|
|
|
- console.log(index);
|
|
|
this.$set(its, "key", index);
|
|
|
+ if (its.key > 0 && index > 0) {
|
|
|
+ const arrList = this.baseTypeList.filter((it) => {
|
|
|
+ return it.type == 1;
|
|
|
+ });
|
|
|
+ this.$set(its, "baseTypes", arrList);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
- if (arr[0].subType == 1) {
|
|
|
- const arr = this.baseTypeList.filter((it) => {
|
|
|
- return it.type == 1;
|
|
|
- });
|
|
|
- if (i > 0) {
|
|
|
- this.$set(item, "baseTypes", arr);
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
} else {
|
|
|
// 添加分组 在列表中相同groupId之后添加
|
|
|
-
|
|
|
// 添加分组时判断是否需要加disabled和添加默认值
|
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
|
obj.disabled = true;
|
|
@@ -813,10 +807,10 @@ export default {
|
|
|
this.$set(obj, "key", 0);
|
|
|
this.dragArr = null;
|
|
|
}
|
|
|
+ console.log(this.form.klRuleByIdSub);
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.tableView.scrollFun();
|
|
|
});
|
|
|
- console.log(this.form);
|
|
|
},
|
|
|
// 删除分组
|
|
|
delGroup(groupId) {
|
|
@@ -826,7 +820,7 @@ export default {
|
|
|
this.form.klRuleByIdSub = list;
|
|
|
},
|
|
|
// 删除规则
|
|
|
- delGroupChild(groupChildId, index, groupId, del) {
|
|
|
+ delGroupChild(groupChildId, index, groupId, del, key) {
|
|
|
let newGroupList;
|
|
|
const dragDel =
|
|
|
localStorage
|
|
@@ -834,40 +828,55 @@ export default {
|
|
|
.match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
|
|
|
let list;
|
|
|
if (dragDel.length > 0) {
|
|
|
- console.log(del);
|
|
|
+ const arr = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
+ return item.groupId != groupId;
|
|
|
+ });
|
|
|
if (del) {
|
|
|
- console.log(123);
|
|
|
- newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
- return i != index && i != index + 1 && i != index + 2;
|
|
|
- });
|
|
|
- } else if (del == undefined) {
|
|
|
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 % 3 == 0 || index % 3 == 1) {
|
|
|
- newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
- return i != index;
|
|
|
- });
|
|
|
+ if (key == 0 && arr.length > 0) {
|
|
|
+ newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
+ return item.groupId != groupId;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ 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: "",
|
|
|
+ key: 0,
|
|
|
+ del: true,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ } else if (key == 1) {
|
|
|
+ let klRuleByIdSub = JSON.parse(
|
|
|
+ JSON.stringify(this.form.klRuleByIdSub)
|
|
|
+ );
|
|
|
+ for (let i = klRuleByIdSub.length - 1; i >= 0; i--) {
|
|
|
+ if (
|
|
|
+ klRuleByIdSub[i].groupId == groupId &&
|
|
|
+ klRuleByIdSub[i].key > 0
|
|
|
+ ) {
|
|
|
+ console.log(i);
|
|
|
+ klRuleByIdSub.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newGroupList = klRuleByIdSub;
|
|
|
} else {
|
|
|
newGroupList = this.form.klRuleByIdSub.filter(
|
|
|
(item) => item.groupChildId != groupChildId
|
|
@@ -980,12 +989,12 @@ export default {
|
|
|
.match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
|
|
|
const subobj = this.baseTypeList.find((it) => it.type == 1);
|
|
|
let obj = this.form.klRuleByIdSub;
|
|
|
- const mutex = obj.some((item, i, arr) => {
|
|
|
- return item.subLenCode == "";
|
|
|
- });
|
|
|
const len = this.form.klRuleByIdSub.filter((item, i) => {
|
|
|
return item.groupId == groupId;
|
|
|
});
|
|
|
+ const mutex = len.some((item, i, arr) => {
|
|
|
+ return item.subLenCode == "";
|
|
|
+ });
|
|
|
const inx =
|
|
|
len.length % 3 == 2
|
|
|
? index + 1
|
|
@@ -997,13 +1006,13 @@ export default {
|
|
|
//判断3条规则是否都已选中
|
|
|
dragDel.length > 0 &&
|
|
|
len[0].subType == 1 &&
|
|
|
- len.length > 2 &&
|
|
|
+ len.length > 1 &&
|
|
|
index > 0 &&
|
|
|
- this.form.klRuleByIdSub[0].subType == 1 &&
|
|
|
key > 0
|
|
|
) {
|
|
|
+ console.log(123);
|
|
|
if (!mutex && len.length == 3) {
|
|
|
- console.log(123);
|
|
|
+ console.log(456);
|
|
|
//判断是否存在符合互斥条件的两条出具,若存在,置空另一条出具
|
|
|
if (this.dragArr.indexOf(this.dragVal) > -1) {
|
|
|
//剂型给药途径互斥判断
|