|
@@ -250,6 +250,8 @@
|
|
|
:showMsg="showMsg"
|
|
|
:showMsg2="showMsg2"
|
|
|
:ruleTermCodeStr="ruleTermCodeStr"
|
|
|
+ :isStaticChild="isStatic"
|
|
|
+ :isRedMsgs="isRedMsg"
|
|
|
@subTypeChange="subTypeChange"
|
|
|
@searchConcept="searchConcept"
|
|
|
@addGroup="addGroup"
|
|
@@ -263,6 +265,15 @@
|
|
|
@ChildDataTypeChange="ChildDataTypeChange"
|
|
|
@childSubCodeChange="childSubCodeChange"
|
|
|
/>
|
|
|
+ <AddNewRuleContent
|
|
|
+ ref="ruleContent"
|
|
|
+ v-if="(!form.parHasSub && !tableShow) || contentRuls"
|
|
|
+ @ruleContent="ruleContent"
|
|
|
+ :isContent="isEdit"
|
|
|
+ :formEidtCopy="formEidt"
|
|
|
+ :isError="isErr"
|
|
|
+ >
|
|
|
+ </AddNewRuleContent>
|
|
|
<el-form-item>
|
|
|
<div class="form_btn">
|
|
|
<el-button
|
|
@@ -281,10 +292,22 @@
|
|
|
import api from "@api/knowledgeLib.js";
|
|
|
import { formRules } from "./rules";
|
|
|
import AddNewRuleTable from "./AddNewRuleTable";
|
|
|
+import AddNewRuleContent from "./AddNewRuleContent";
|
|
|
export default {
|
|
|
name: "AddRule",
|
|
|
data() {
|
|
|
return {
|
|
|
+ isRedMsg: [],
|
|
|
+ isErr: false, //控制护理开单项里面的错误提示
|
|
|
+ staicData: {
|
|
|
+ //护理开单项里面的数据
|
|
|
+ gljtxx: [],
|
|
|
+ fjxx: "",
|
|
|
+ },
|
|
|
+ formEidt: {},
|
|
|
+ isEdit: false, //判断是否是编辑页面
|
|
|
+ isStatic: false, //判断关联静态知识的tabel列是否显示
|
|
|
+ contentRuls: false, //判断规则内容为列表还是表单
|
|
|
title: "规则维护-添加规则",
|
|
|
ruleTypeList: [], //规则类型列表 1
|
|
|
ruleTermTypeList: [], //规则术语类型列表 2
|
|
@@ -316,6 +339,7 @@ export default {
|
|
|
created() {
|
|
|
this.getTypeList();
|
|
|
this.setDict();
|
|
|
+
|
|
|
const param = this.$route.params;
|
|
|
let info = param.data;
|
|
|
if (info) {
|
|
@@ -328,13 +352,22 @@ export default {
|
|
|
this.initEdidData();
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {},
|
|
|
+ watch: {},
|
|
|
methods: {
|
|
|
+ //护理开单项子组件里面的传过来的值
|
|
|
+ ruleContent(data) {
|
|
|
+ this.staicData = data;
|
|
|
+ },
|
|
|
clearValidate(data) {
|
|
|
this.$refs.ruleForm.clearValidate(data);
|
|
|
},
|
|
|
// 编辑初始化
|
|
|
async initEdidData() {
|
|
|
// 规则术语类型初始化
|
|
|
+ this.contentRuls = false;
|
|
|
+ this.isEdit = false;
|
|
|
+ this.isRedMsg = [];
|
|
|
const newruleTermTypeList = await this.ruleTypeList.find(
|
|
|
(it) => it.id == this.form.parRuleType
|
|
|
);
|
|
@@ -343,16 +376,67 @@ export default {
|
|
|
const obj = await this.ruleTermTypeList.find(
|
|
|
(it1) => it1.code == this.form.parLenCode
|
|
|
);
|
|
|
- console.log(obj);
|
|
|
this.baseTypeList = obj.subMenuList;
|
|
|
this.subRuleMaxNum = obj.number;
|
|
|
-
|
|
|
this.conceptList = [
|
|
|
{
|
|
|
conceptName: this.form.parlibName,
|
|
|
conceptId: this.form.parConceptId,
|
|
|
},
|
|
|
];
|
|
|
+ // 加载护理开单项的推送内容
|
|
|
+ if (!this.form.klRuleByIdSub) {
|
|
|
+ this.isEdit = true;
|
|
|
+ this.contentRuls = true;
|
|
|
+ this.formEidt = JSON.parse(JSON.stringify(this.form));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //加载护理非开单项的关联静态知识
|
|
|
+ if (this.form.parRuleType == 8) {
|
|
|
+ this.isStatic = true;
|
|
|
+ if (Array.isArray(this.form.klRuleByIdGroup)) {
|
|
|
+ let itemCopy = {}; //用来存放对象
|
|
|
+ let itemsCopy = {};
|
|
|
+ let klRuleByIdSub = []; //中间数组
|
|
|
+ this.form.klRuleByIdGroup.forEach((item, index) => {
|
|
|
+ let obj = {
|
|
|
+ groupType: item.groupType,
|
|
|
+ klRuleStaticSub: item.klRuleStaticSub,
|
|
|
+ };
|
|
|
+ itemCopy = JSON.parse(JSON.stringify(obj));
|
|
|
+ klRuleByIdSub.push(itemCopy);
|
|
|
+ });
|
|
|
+ if (Array.isArray(this.form.klRuleByIdSub)) {
|
|
|
+ this.form.klRuleByIdSub.forEach((item) => {
|
|
|
+ this.$set(item, "ruleStatic", []);
|
|
|
+ this.$set(item, "ruleStaticList", []);
|
|
|
+ this.$set(item, "ruleStaticLists", []);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.form.klRuleByIdSub.forEach((item, index) => {
|
|
|
+ klRuleByIdSub.forEach((items) => {
|
|
|
+ if (items.groupType == item.groupType) {
|
|
|
+ this.form.klRuleByIdSub[index].ruleStaticLists =
|
|
|
+ items.klRuleStaticSub;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.form.klRuleByIdSub.forEach((item, index) => {
|
|
|
+ if (Array.isArray(item.ruleStaticLists)) {
|
|
|
+ item.ruleStaticLists.forEach((items) => {
|
|
|
+ let obj = {
|
|
|
+ id: items.conceptId,
|
|
|
+ name: items.name,
|
|
|
+ };
|
|
|
+ itemsCopy = JSON.parse(JSON.stringify(obj));
|
|
|
+ this.form.klRuleByIdSub[index].ruleStaticList.push(itemsCopy);
|
|
|
+ this.form.klRuleByIdSub[index].ruleStatic.push(itemsCopy.id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //加载列表规则内容
|
|
|
if (this.form.parConceptId && this.checkFirstPlace && this.conceptList) {
|
|
|
this.firstPlace = this.conceptList.find(
|
|
|
(it) => it.conceptId === this.form.parConceptId
|
|
@@ -411,6 +495,30 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.$set(item, "disabled", true);
|
|
|
+
|
|
|
+ if (this.form.parLenCode == "108" && this.form.parRuleType == "8") {
|
|
|
+ const subobj = this.baseTypeList.find((it) => it.type == "2");
|
|
|
+ subobj.subMenuList.push({
|
|
|
+ code: "108",
|
|
|
+ creator: "0",
|
|
|
+ firstPlace: null,
|
|
|
+ gmtCreate: "1970-01-01 12:00:00",
|
|
|
+ gmtModified: "1970-01-01 12:00:00",
|
|
|
+ id: 27106,
|
|
|
+ isDeleted: "N",
|
|
|
+ modifier: "0",
|
|
|
+ name: "实验室检查子项目",
|
|
|
+ number: null,
|
|
|
+ orderNo: 1,
|
|
|
+ parentId: 27103,
|
|
|
+ planCode: "rule",
|
|
|
+ remark: "",
|
|
|
+ ruleType: 8,
|
|
|
+ subMenuList: [],
|
|
|
+ type: null,
|
|
|
+ });
|
|
|
+ this.$set(item, "baseTermTypeList", subobj.subMenuList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
const dragDel =
|
|
@@ -463,32 +571,59 @@ export default {
|
|
|
this.$set(item, "baseTermTypeList", screenArr);
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.form);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
//药品数据处理
|
|
|
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) {
|
|
|
- //如果没找相同日期添加一个新对象
|
|
|
+ //处理修改接口请求的数据
|
|
|
+ //先将数据深拷贝,避免数据污染
|
|
|
+ let infoCopy = JSON.parse(JSON.stringify(info));
|
|
|
+ infoCopy.klRuleByIdSubCopy = [];
|
|
|
+ if (info.klRuleByIdGroup.length > 0) {
|
|
|
+ let klRuleByIdSub = {};
|
|
|
+ info.klRuleByIdGroup.forEach((item) => {
|
|
|
+ if (item.klRuleByIdSub && Array.isArray(item.klRuleByIdSub)) {
|
|
|
+ item.klRuleByIdSub.forEach((items) => {
|
|
|
+ klRuleByIdSub = JSON.parse(JSON.stringify(items));
|
|
|
+ infoCopy.klRuleByIdSubCopy.push(klRuleByIdSub);
|
|
|
+ });
|
|
|
+ infoCopy.klRuleByIdSub = [...item.klRuleByIdSub];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ Array.isArray(info.klRuleByIdGroup) &&
|
|
|
+ info.klRuleByIdGroup.length == 0
|
|
|
+ ) {
|
|
|
+ this.form = JSON.parse(JSON.stringify(info));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //判断是否存在klRuleByIdSub,没有就是护理开单项直接赋值
|
|
|
+ if (!info.klRuleByIdGroup[0].klRuleByIdSub) {
|
|
|
+ this.form = JSON.parse(JSON.stringify(info));
|
|
|
+ } else {
|
|
|
+ let arr = JSON.parse(JSON.stringify(infoCopy.klRuleByIdSubCopy));
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ this.getDragData2(info, dataArr);
|
|
|
+ }
|
|
|
},
|
|
|
getDragData2(info, dataArr) {
|
|
|
let arr = [];
|
|
@@ -506,34 +641,153 @@ export default {
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.isErr = false;
|
|
|
+ this.isRedMsg = [];
|
|
|
let params = JSON.parse(JSON.stringify(this.form));
|
|
|
- params.klRuleInfoSaveSub = params.klRuleByIdSub;
|
|
|
- delete params.klRuleByIdSub;
|
|
|
- params.klRuleInfoSaveSub.forEach((item, i, arr) => {
|
|
|
- if (i === 0) {
|
|
|
- item.groupType = 1;
|
|
|
- } else {
|
|
|
- if (item.groupId == arr[i - 1].groupId) {
|
|
|
- item.groupType = arr[i - 1].groupType;
|
|
|
- item.subMsg = arr[i - 1].subMsg;
|
|
|
+ if (params.klRuleByIdSub) {
|
|
|
+ params.klRuleInfoSaveSub = params.klRuleByIdSub;
|
|
|
+ delete params.klRuleByIdSub;
|
|
|
+ params.klRuleInfoSaveSub.forEach((item, i, arr) => {
|
|
|
+ if (i === 0) {
|
|
|
+ item.groupType = 1;
|
|
|
} else {
|
|
|
- item.groupType = arr[i - 1].groupType + 1;
|
|
|
+ if (item.groupId == arr[i - 1].groupId) {
|
|
|
+ item.groupType = arr[i - 1].groupType;
|
|
|
+ item.subMsg = arr[i - 1].subMsg;
|
|
|
+ } else {
|
|
|
+ item.groupType = arr[i - 1].groupType + 1;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- params.klRuleInfoSaveSub.forEach((ite) => {
|
|
|
- delete ite.groupId;
|
|
|
- delete ite.groupChildId;
|
|
|
- delete ite.rowIndex;
|
|
|
- delete ite.baseTypes;
|
|
|
- delete ite.baseTermTypeList;
|
|
|
- delete ite.conceptList;
|
|
|
- });
|
|
|
+ });
|
|
|
+ params.klRuleInfoSaveSub.forEach((ite) => {
|
|
|
+ delete ite.groupId;
|
|
|
+ delete ite.groupChildId;
|
|
|
+ delete ite.rowIndex;
|
|
|
+ delete ite.baseTypes;
|
|
|
+ delete ite.baseTermTypeList;
|
|
|
+ delete ite.conceptList;
|
|
|
+ });
|
|
|
+ }
|
|
|
if (this.parId) {
|
|
|
params.parId = this.isCopy ? undefined : this.parId;
|
|
|
params.parStatus = this.isCopy ? 1 : this.form.parStatus;
|
|
|
}
|
|
|
- this.saveRule(params);
|
|
|
+ //改造params,保存护理开单项类型的
|
|
|
+ let paramsCopy = JSON.parse(JSON.stringify(params));
|
|
|
+ //先遍历子集klRuleInfoSaveSub
|
|
|
+ paramsCopy.klRuleInfoSaveGroup = [];
|
|
|
+ let obj = {
|
|
|
+ groupType: 0,
|
|
|
+ klRuleInfoSaveSub: [],
|
|
|
+ };
|
|
|
+ this.$set(obj, "ruleStatic", []);
|
|
|
+ if (
|
|
|
+ params.klRuleInfoSaveSub &&
|
|
|
+ Array.isArray(params.klRuleInfoSaveSub)
|
|
|
+ ) {
|
|
|
+ if (params.klRuleInfoSaveSub.length > 0) {
|
|
|
+ params.klRuleInfoSaveSub.forEach((item) => {
|
|
|
+ obj.groupType = item.groupType;
|
|
|
+ obj.klRuleInfoSaveSub = [item];
|
|
|
+ let objCopy = JSON.parse(JSON.stringify(obj));
|
|
|
+ //可以处理objCopy,将groupType相同的放入klRuleInfoSaveSub里面
|
|
|
+ paramsCopy.klRuleInfoSaveGroup.push(objCopy);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup.push(obj);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup.push(obj);
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ paramsCopy.klRuleInfoSaveSub &&
|
|
|
+ Array.isArray(paramsCopy.klRuleInfoSaveSub)
|
|
|
+ ) {
|
|
|
+ //护理非开单项的关联静态知识的处理
|
|
|
+ paramsCopy.klRuleInfoSaveSub.forEach((item, ind) => {
|
|
|
+ let ruleObj = {};
|
|
|
+ if (Array.isArray(item.ruleStatic)) {
|
|
|
+ item.ruleStatic.forEach((items, index) => {
|
|
|
+ ruleObj.conceptId = items;
|
|
|
+ ruleObj.orderNo = index;
|
|
|
+ let ruleObjCopy = JSON.parse(JSON.stringify(ruleObj));
|
|
|
+ //将关联静态知识的对象放入数组内
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[ind].ruleStatic.push(
|
|
|
+ ruleObjCopy
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //删除第二层的klRuleInfoSaveSub
|
|
|
+ delete paramsCopy.klRuleInfoSaveSub;
|
|
|
+ //清除子集的关联静态知识
|
|
|
+ paramsCopy.klRuleInfoSaveGroup.forEach((item, index) => {
|
|
|
+ if (index + 1 >= paramsCopy.klRuleInfoSaveGroup.length) return;
|
|
|
+ if (
|
|
|
+ item.groupType ==
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[index + 1].groupType
|
|
|
+ ) {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[index + 1].ruleStatic = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //判断护理开单是否附加信息和关联静态信息是否都没存在值
|
|
|
+ let flagRule = false;
|
|
|
+ //附加信息
|
|
|
+ if (this.staicData.fjxx) {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[0].groupType = "1";
|
|
|
+ paramsCopy.parMsg = this.staicData.fjxx;
|
|
|
+ flagRule = true;
|
|
|
+ } else {
|
|
|
+ paramsCopy.parMsg = "";
|
|
|
+ }
|
|
|
+ //关联静态知识
|
|
|
+ if (this.staicData.gljtxx.length > 0) {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[0].groupType = "1";
|
|
|
+ let rule = {};
|
|
|
+ this.staicData.gljtxx.forEach((item, index) => {
|
|
|
+ rule.conceptId = item;
|
|
|
+ rule.orderNo = index;
|
|
|
+ let ruleCopy = JSON.parse(JSON.stringify(rule));
|
|
|
+ paramsCopy.klRuleInfoSaveGroup[0].ruleStatic.push(ruleCopy);
|
|
|
+ });
|
|
|
+ flagRule = true;
|
|
|
+ }
|
|
|
+ //如果是护理项并且静态知识和附加信息都没有值
|
|
|
+ if (this.contentRuls && !flagRule) {
|
|
|
+ this.isErr = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //如果护理非开单项关联静态知识和附加信息都没有值
|
|
|
+ if (this.isStatic) {
|
|
|
+ if (Array.isArray(paramsCopy.klRuleInfoSaveGroup)) {
|
|
|
+ paramsCopy.klRuleInfoSaveGroup.forEach((item) => {
|
|
|
+ if (Array.isArray(item.klRuleInfoSaveSub)) {
|
|
|
+ item.klRuleInfoSaveSub.forEach((items) => {
|
|
|
+ if (items.ruleStatic && Array.isArray(items.ruleStatic)) {
|
|
|
+ if (items.ruleStatic.length > 0 || items.subMsg) {
|
|
|
+ this.isRedMsg.push(false);
|
|
|
+ } else {
|
|
|
+ this.isRedMsg.push(true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isRedMsg.push(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断护理非开单项里面的附加信息和关联静态知识是否填写
|
|
|
+ if (this.isStatic && this.isRedMsg.length > 0) {
|
|
|
+ let flag = this.isRedMsg.some((item) => {
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ //都填写了
|
|
|
+ if (!flag) this.saveRule(paramsCopy);
|
|
|
+ } else {
|
|
|
+ this.saveRule(paramsCopy);
|
|
|
+ }
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -545,6 +799,14 @@ export default {
|
|
|
},
|
|
|
// table_form 规则类型选中
|
|
|
ruleTypeChange(val) {
|
|
|
+ //先初始化
|
|
|
+ this.contentRuls = false;
|
|
|
+ this.isStatic = false;
|
|
|
+ this.isRedMsg = [];
|
|
|
+ //是否护理非开单项
|
|
|
+ if (val === 8) {
|
|
|
+ this.isStatic = true;
|
|
|
+ }
|
|
|
this.form.parLenCode = "";
|
|
|
const obj = this.ruleTypeList.find((it) => it.id === val);
|
|
|
this.ruleTermTypeList = obj.subMenuList;
|
|
@@ -553,11 +815,24 @@ export default {
|
|
|
},
|
|
|
// table_form 规则术语类型选中
|
|
|
ruleTermChange(val) {
|
|
|
+ this.contentRuls = false;
|
|
|
+ this.isRedMsg = [];
|
|
|
const obj = this.ruleTermTypeList.find((it) => it.code === val);
|
|
|
this.form.parLenName = obj.name;
|
|
|
this.baseTypeList = obj.subMenuList;
|
|
|
this.subRuleMaxNum = obj.number;
|
|
|
this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
|
|
|
+ if (!this.form.parHasSub) {
|
|
|
+ this.contentRuls = true;
|
|
|
+ }
|
|
|
+ //初始化护理开单项的输入框
|
|
|
+ if (this.contentRuls) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.isEdit = false;
|
|
|
+ this.$refs.ruleContent.clearFormData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
this.isShow = obj.subMenuList.length ? 1 : 0;
|
|
|
this.setInitGroupData();
|
|
|
},
|
|
@@ -623,10 +898,40 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.$set(item, "disabled", true);
|
|
|
+ // //因为字典传的时候第三个值没有护理所以重新赋值为9,因为这里后端逻辑问题先注释后面可能有用
|
|
|
+ // this.baseTypeList.forEach((item)=>{
|
|
|
+ // if(item.type==9){
|
|
|
+ // types[2]='9'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
this.$set(item, "subType", parseInt(types[2]));
|
|
|
const subobj = this.baseTypeList.find(
|
|
|
(it) => it.type == types[2]
|
|
|
);
|
|
|
+ if (
|
|
|
+ this.form.parLenCode == "108" &&
|
|
|
+ this.form.parRuleType == "8"
|
|
|
+ ) {
|
|
|
+ subobj.subMenuList.push({
|
|
|
+ code: "108",
|
|
|
+ creator: "0",
|
|
|
+ firstPlace: null,
|
|
|
+ gmtCreate: "1970-01-01 12:00:00",
|
|
|
+ gmtModified: "1970-01-01 12:00:00",
|
|
|
+ id: 27106,
|
|
|
+ isDeleted: "N",
|
|
|
+ modifier: "0",
|
|
|
+ name: "实验室检查子项目",
|
|
|
+ number: null,
|
|
|
+ orderNo: 1,
|
|
|
+ parentId: 27103,
|
|
|
+ planCode: "rule",
|
|
|
+ remark: "",
|
|
|
+ ruleType: 8,
|
|
|
+ subMenuList: [],
|
|
|
+ type: null,
|
|
|
+ });
|
|
|
+ }
|
|
|
this.$set(item, "baseTermTypeList", subobj.subMenuList);
|
|
|
this.$set(item, "subLenCode", types[1]);
|
|
|
this.$set(item, "subDescription", this.firstPlace.conceptName);
|
|
@@ -636,6 +941,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.$set(this.form, "klRuleByIdSub", obj);
|
|
|
+ if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
|
|
|
+ this.form.klRuleByIdSub[0].dataType = "1";
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -718,7 +1026,6 @@ export default {
|
|
|
const list = obj.subMenuList.filter((it) => {
|
|
|
return it.code == val && it.remark.split("|")[0] == 3;
|
|
|
});
|
|
|
- console.log(obj.subMenuList);
|
|
|
const dragArr = list[0].remark.split("|")[1].split(",");
|
|
|
this.dragArr = dragArr;
|
|
|
arr[1].dragArr = arr[2].dragArr = dragArr;
|
|
@@ -737,23 +1044,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- // 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) {
|
|
@@ -771,6 +1061,11 @@ export default {
|
|
|
return !types[3].includes(item.code);
|
|
|
});
|
|
|
}
|
|
|
+ if (this.form.parLenCode == "108" && this.form.parRuleType == "8") {
|
|
|
+ const subobj = this.baseTypeList.find((it) => it.type == "2");
|
|
|
+ subobj.subMenuList.splice(1, 1);
|
|
|
+ this.$set(obj, "baseTermTypeList", subobj.subMenuList);
|
|
|
+ }
|
|
|
}
|
|
|
this.$set(
|
|
|
this.form.klRuleByIdSub[index],
|
|
@@ -802,13 +1097,19 @@ export default {
|
|
|
// this.form.klRuleByIdSub = data;
|
|
|
},
|
|
|
// 添加分组 || 规则
|
|
|
- addGroup(date, key, arg = { index: null, groupId: null }) {
|
|
|
+ addGroup(date, key, arg = { index: null, groupId: null }, index) {
|
|
|
/**
|
|
|
* @params
|
|
|
* date:存在则添加规则 不存在则添加分组
|
|
|
* arg:{index:添加规则用索引,groupId:添加分组用确切id}
|
|
|
*/
|
|
|
!date && (date = new Date().valueOf());
|
|
|
+ let dataType = "";
|
|
|
+ if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
|
|
|
+ dataType = "1";
|
|
|
+ } else {
|
|
|
+ dataType = "";
|
|
|
+ }
|
|
|
const obj = {
|
|
|
groupId: date,
|
|
|
groupChildId: "child" + new Date().valueOf(),
|
|
@@ -827,9 +1128,35 @@ export default {
|
|
|
subMinValue: "",
|
|
|
subEqValue: "",
|
|
|
subLenCode: "",
|
|
|
- dataType: "",
|
|
|
+ dataType: dataType,
|
|
|
};
|
|
|
-
|
|
|
+ if (
|
|
|
+ this.form.parLenCode == "108" &&
|
|
|
+ this.form.parRuleType == "8" &&
|
|
|
+ index == "1"
|
|
|
+ ) {
|
|
|
+ const subobj = this.baseTypeList.find((it) => it.type == "2");
|
|
|
+ subobj.subMenuList.push({
|
|
|
+ code: "108",
|
|
|
+ creator: "0",
|
|
|
+ firstPlace: null,
|
|
|
+ gmtCreate: "1970-01-01 12:00:00",
|
|
|
+ gmtModified: "1970-01-01 12:00:00",
|
|
|
+ id: 27106,
|
|
|
+ isDeleted: "N",
|
|
|
+ modifier: "0",
|
|
|
+ name: "实验室检查子项目",
|
|
|
+ number: null,
|
|
|
+ orderNo: 1,
|
|
|
+ parentId: 27103,
|
|
|
+ planCode: "rule",
|
|
|
+ remark: "",
|
|
|
+ ruleType: 8,
|
|
|
+ subMenuList: [],
|
|
|
+ type: null,
|
|
|
+ });
|
|
|
+ this.$set(obj, "baseTermTypeList", subobj.subMenuList);
|
|
|
+ }
|
|
|
if (typeof arg.index == "number") {
|
|
|
// 添加规则 直接在当前位置之后添加
|
|
|
this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
|
|
@@ -883,6 +1210,12 @@ export default {
|
|
|
.match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
|
|
|
[];
|
|
|
const types = dict[0].split("-");
|
|
|
+ // //因为字典传的时候第三个值没有护理所以重新赋值为9,因为这里后端逻辑问题先注释后面可能有用
|
|
|
+ // this.baseTypeList.forEach((item)=>{
|
|
|
+ // if(item.type==9){
|
|
|
+ // types[2]='9'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
this.$set(obj, "disabled", true);
|
|
|
this.$set(obj, "subType", parseInt(types[2]));
|
|
|
const subobj = this.baseTypeList.find((it) => it.type == types[2]);
|
|
@@ -1204,18 +1537,21 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- "form.klRuleByIdSub": {
|
|
|
+ form: {
|
|
|
handler(val) {
|
|
|
- this.form.klRuleByIdSub.forEach((item, i, arr) => {
|
|
|
- if (i == 0) {
|
|
|
- item.rowIndex = 1;
|
|
|
- } else if (item.groupId == arr[i - 1].groupId) {
|
|
|
- item.rowIndex = arr[i - 1].rowIndex;
|
|
|
- } else {
|
|
|
- item.rowIndex = arr[i - 1].rowIndex + 1;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (val.klRuleByIdSub) {
|
|
|
+ this.form.klRuleByIdSub.forEach((item, i, arr) => {
|
|
|
+ if (i == 0) {
|
|
|
+ item.rowIndex = 1;
|
|
|
+ } else if (item.groupId == arr[i - 1].groupId) {
|
|
|
+ item.rowIndex = arr[i - 1].rowIndex;
|
|
|
+ } else {
|
|
|
+ item.rowIndex = arr[i - 1].rowIndex + 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
+ immediate: true,
|
|
|
deep: true,
|
|
|
},
|
|
|
},
|
|
@@ -1258,8 +1594,6 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
showHasSub() {
|
|
|
- console.log(this.ruleTermCodeStrs);
|
|
|
- console.log(this.subDict);
|
|
|
if (this.ruleTermCodeStrs.length > 2) {
|
|
|
console.log(this.subDict.indexOf(this.ruleTermCodeStrs) != -1);
|
|
|
return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;
|
|
@@ -1270,6 +1604,6 @@ export default {
|
|
|
return this.dict.indexOf(this.ruleTermCodeStrs) > -1;
|
|
|
},
|
|
|
},
|
|
|
- components: { AddNewRuleTable },
|
|
|
+ components: { AddNewRuleTable, AddNewRuleContent },
|
|
|
};
|
|
|
</script>
|