|
@@ -61,16 +61,15 @@
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="less">
|
|
|
-
|
|
|
.popper_class {
|
|
|
// background: #fff !important;
|
|
|
- border: 1px solid #FFA0A0 !important;
|
|
|
+ border: 1px solid #ffa0a0 !important;
|
|
|
color: #999999 !important;
|
|
|
padding: 3px 50px 3px 10px !important;
|
|
|
margin-left: -10px;
|
|
|
}
|
|
|
-.popper__arrow{
|
|
|
- border-top-color: #FFA0A0!important;
|
|
|
+.popper__arrow {
|
|
|
+ border-top-color: #ffa0a0 !important;
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
@@ -253,6 +252,10 @@
|
|
|
@setFormData="setFormData"
|
|
|
@editKlRuleByIdSub="editKlRuleByIdSub"
|
|
|
@clearValidate="clearValidate"
|
|
|
+ @childClearConcept="childClearConcept"
|
|
|
+ @childClearNumText="childClearNumText"
|
|
|
+ @ChildDataTypeChange="ChildDataTypeChange"
|
|
|
+ @childSubCodeChange="childSubCodeChange"
|
|
|
/>
|
|
|
<el-form-item>
|
|
|
<div class="form_btn">
|
|
@@ -384,6 +387,7 @@ export default {
|
|
|
},
|
|
|
// 提交
|
|
|
submitForm(formName) {
|
|
|
+ console.log(this.form);
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
let params = JSON.parse(JSON.stringify(this.form));
|
|
@@ -420,7 +424,7 @@ export default {
|
|
|
},
|
|
|
// 子集修改父级的数组
|
|
|
setFormData(index, data) {
|
|
|
- this.form.klRuleByIdSub[index].conceptList = data;
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "conceptList", data);
|
|
|
},
|
|
|
// table_form 规则类型选中
|
|
|
ruleTypeChange(val) {
|
|
@@ -536,28 +540,35 @@ export default {
|
|
|
subTypeChange(val, index) {
|
|
|
// index
|
|
|
const obj = this.baseTypeList.find((it) => it.type === val);
|
|
|
- this.form.klRuleByIdSub[index].baseTermTypeList = obj.subMenuList;
|
|
|
- this.form.klRuleByIdSub[index].subLenCode = "";
|
|
|
- this.form.klRuleByIdSub[index].dataType = "";
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ this.form.klRuleByIdSub[index],
|
|
|
+ "baseTermTypeList",
|
|
|
+ obj.subMenuList
|
|
|
+ );
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subLenCode", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "dataType", "");
|
|
|
+
|
|
|
this.clearConcept(index);
|
|
|
this.clearNumText(index);
|
|
|
},
|
|
|
clearConcept(index) {
|
|
|
- this.form.klRuleByIdSub[index].subConceptId = "";
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
|
|
|
this.conceptList = [];
|
|
|
},
|
|
|
clearNumText(index) {
|
|
|
- this.form.klRuleByIdSub[index].subMaxOperator = "";
|
|
|
- this.form.klRuleByIdSub[index].subMaxValue = "";
|
|
|
- this.form.klRuleByIdSub[index].subMaxUnit = "";
|
|
|
- this.form.klRuleByIdSub[index].subMinOperator = "";
|
|
|
- this.form.klRuleByIdSub[index].subMinValue = "";
|
|
|
- this.form.klRuleByIdSub[index].subMinUnit = "";
|
|
|
- this.form.klRuleByIdSub[index].subEqValue = "";
|
|
|
- this.form.klRuleByIdSub[index].subEqOperator = "";
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMaxOperator", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMaxValue", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMaxUnit", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMinOperator", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMinValue", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subMinUnit", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subEqValue", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subEqOperator", "");
|
|
|
},
|
|
|
editKlRuleByIdSub(data) {
|
|
|
- this.form.klRuleByIdSub = data;
|
|
|
+ this.$set(this.form, "klRuleByIdSub", data);
|
|
|
+ // this.form.klRuleByIdSub = data;
|
|
|
},
|
|
|
// 添加分组 || 规则
|
|
|
addGroup(date, arg = { index: null, groupId: null }) {
|
|
@@ -622,7 +633,6 @@ export default {
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.tableView.scrollFun();
|
|
|
-
|
|
|
});
|
|
|
},
|
|
|
// 删除分组
|
|
@@ -693,6 +703,54 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 子组件调用方法
|
|
|
+ */
|
|
|
+ childClearConcept(index) {
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "conceptList", []);
|
|
|
+ },
|
|
|
+ childClearNumText(index) {
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
|
|
|
+
|
|
|
+ obj[index].subMaxOperator = "";
|
|
|
+ obj[index].subMaxValue = "";
|
|
|
+ obj[index].subMaxUnit = "";
|
|
|
+ obj[index].subMinOperator = "";
|
|
|
+ obj[index].subMinValue = "";
|
|
|
+ obj[index].subMinUnit = "";
|
|
|
+ obj[index].subEqValue = "";
|
|
|
+ // this.$set(obj[index], "subEqValue", "");
|
|
|
+ obj[index].subEqOperator = "";
|
|
|
+ // this.klRuleByIdSub = obj;
|
|
|
+ // this.$emit("editKlRuleByIdSub", obj);
|
|
|
+ this.editKlRuleByIdSub(obj);
|
|
|
+ },
|
|
|
+ ChildDataTypeChange(val, index) {
|
|
|
+ // this.form.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
|
|
|
+ this.$set(
|
|
|
+ this.form.klRuleByIdSub[index],
|
|
|
+ "subEqOperator",
|
|
|
+ val === "2" ? "=" : ""
|
|
|
+ );
|
|
|
+
|
|
|
+ this.childClearNumText(index);
|
|
|
+ // TODO 新增的内容追踪不到
|
|
|
+ this.form.klRuleByIdSub.forEach((item, i) => {
|
|
|
+ if (index === i) {
|
|
|
+ this.$set(item, "dataType", val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ childSubCodeChange(val, index, numTypes) {
|
|
|
+ if ((numTypes + ",").indexOf(val + ",") > -1) {
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
|
|
|
+ }
|
|
|
+ this.childClearConcept(index);
|
|
|
+ this.childClearNumText(index);
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -710,16 +768,6 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
|
- // "form.parHasSub"(val) {
|
|
|
- // console.log(val);
|
|
|
- // console.log(this.form);
|
|
|
- // // if (!val || val == 0) {
|
|
|
- // // // this.form.klRuleByIdSub = [];
|
|
|
- // // this.$set(this.form, "klRuleByIdSub", []);
|
|
|
-
|
|
|
- // // console.log(this.form);
|
|
|
- // // }
|
|
|
- // }
|
|
|
},
|
|
|
computed: {
|
|
|
disable: function () {
|