|
@@ -289,8 +289,11 @@ export default {
|
|
|
this.parId = info.parId;
|
|
|
this.isCopy = param.copy;
|
|
|
this.title = "规则维护-" + (this.isCopy ? "复制" : "修改") + "规则";
|
|
|
- this.form = JSON.parse(JSON.stringify(info));
|
|
|
+
|
|
|
+ this.getDragData(info);
|
|
|
+
|
|
|
// 编辑初始化选择框
|
|
|
+
|
|
|
this.initEdidData();
|
|
|
}
|
|
|
},
|
|
@@ -386,10 +389,9 @@ 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) {
|
|
|
+ if (arr[i].key != 0 && arr[i].subType == 1) {
|
|
|
const arr = this.baseTypeList.filter((it) => {
|
|
|
return it.type == 1;
|
|
|
});
|
|
@@ -398,14 +400,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- if (i == 2) {
|
|
|
+ if (item.key == 2) {
|
|
|
//获取互斥项code
|
|
|
+ console.log(item);
|
|
|
const list = obj.subMenuList.filter((it) => {
|
|
|
return (
|
|
|
it.code == arr[i - 1].subLenCode &&
|
|
|
it.remark.split("|")[0] == 3
|
|
|
);
|
|
|
});
|
|
|
+ console.log(list);
|
|
|
const dragArr = list[0].remark.split("|")[1].split(",");
|
|
|
this.dragArr = dragArr;
|
|
|
this.dragVal = item.subLenCode;
|
|
@@ -417,19 +421,55 @@ export default {
|
|
|
);
|
|
|
this.$set(item, "baseTermTypeList", screenArr);
|
|
|
} else {
|
|
|
- const screenArr = obj.subMenuList.filter((item) => {
|
|
|
- if (item.remark == "") {
|
|
|
- return item;
|
|
|
+ const screenArr = obj.subMenuList.filter((it) => {
|
|
|
+ if (it.remark == "") {
|
|
|
+ return it;
|
|
|
} else {
|
|
|
- return item.remark.split("|")[0] == i + 1;
|
|
|
+ return it.remark.split("|")[0] == (item.key % 3) + 1;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
this.$set(item, "baseTermTypeList", screenArr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //药品数据处理
|
|
|
+ getDragData(info) {
|
|
|
+ let dataArr = [];
|
|
|
+ let arr = JSON.parse(JSON.stringify(info.klRuleByIdSub));
|
|
|
+ arr.map((mapItem) => {
|
|
|
+ if (dataArr.length == 0) {
|
|
|
+ dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
|
|
|
+ } else {
|
|
|
+ let res = dataArr.some((item) => {
|
|
|
+ //判断相同日期,有就添加到当前项
|
|
|
+ if (item.groupType == mapItem.groupType) {
|
|
|
+ item.List.push(mapItem);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!res) {
|
|
|
+ //如果没找相同日期添加一个新对象
|
|
|
+ dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.getDragData2(info, dataArr);
|
|
|
+ },
|
|
|
+ getDragData2(info, dataArr) {
|
|
|
+ let arr = [];
|
|
|
+ dataArr.map((item) => {
|
|
|
+ item.List.map((it, i) => {
|
|
|
+ it.key = i;
|
|
|
+ it.del = i == 0 ? true : false;
|
|
|
+ arr.push(it);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ info.klRuleByIdSub = arr;
|
|
|
+ this.form = JSON.parse(JSON.stringify(info));
|
|
|
+ },
|
|
|
// 提交
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|