diff --git a/src/assets/scss/modules/management/form-main.scss b/src/assets/scss/modules/management/form-main.scss index 60f24394..b0502675 100644 --- a/src/assets/scss/modules/management/form-main.scss +++ b/src/assets/scss/modules/management/form-main.scss @@ -15,6 +15,10 @@ width: 220px; } + .item_width_3{ + width: 780px; + } + .list_item_width_1 { width: 165px; } diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue index 4f2b7c3d..5b6718dc 100644 --- a/src/views/modules/communityService/policy/addPolicy.vue +++ b/src/views/modules/communityService/policy/addPolicy.vue @@ -61,11 +61,11 @@ prop="content" label-width="150px" style="display: block"> - @@ -399,74 +399,82 @@ export default { let refObj = this.$refs['ref_rule' + index][0] - refObj.getRule(true, true, true) + refObj.getRule() if (refObj.okflag) { - if (refObj.personChecked) { - oneRule.resiRuleList = refObj.resiRuleList - oneRule.resiRuleList.forEach(element => { - element.itemList = [] - element.colOption = [] - - if (!element.colValLabel) { - element.colValLabel = element.colVal - } - if (!element.nextLogicalRelName) { - element.nextLogicalRelName = '' - } - - element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName - - }); + + if (!refObj.personChecked && !refObj.houseChecked && !refObj.staticChecked) { + this.$message.error('请选择匹配规则' + (index + 1)) + isOk = false + break } else { - oneRule.resiRuleList = [] - } - if (refObj.houseChecked) { + if (refObj.personChecked) { + oneRule.resiRuleList = refObj.resiRuleList + oneRule.resiRuleList.forEach(element => { + element.itemList = [] + element.colOption = [] - oneRule.houseRuleList = refObj.houseRuleList - oneRule.houseRuleList.forEach(element => { - element.itemList = [] - element.colOption = [] + if (!element.colValLabel) { + element.colValLabel = element.colVal + } + if (!element.nextLogicalRelName) { + element.nextLogicalRelName = '' + } - if (!element.colValLabel) { - element.colValLabel = element.colVal - } - if (!element.nextLogicalRelName) { - element.nextLogicalRelName = '' - } + element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName - element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName + }); + } else { + oneRule.resiRuleList = [] + } - }); - } else { - oneRule.houseRuleList = [] - } + if (refObj.houseChecked) { - if (refObj.staticChecked) { + oneRule.houseRuleList = refObj.houseRuleList + oneRule.houseRuleList.forEach(element => { + element.itemList = [] + element.colOption = [] - oneRule.statRuleList = refObj.statRuleList + if (!element.colValLabel) { + element.colValLabel = element.colVal + } + if (!element.nextLogicalRelName) { + element.nextLogicalRelName = '' + } - oneRule.statRuleList.forEach(element => { - element.itemList = [] - element.colOption = [] + element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName - if (!element.colValLabel) { - element.colValLabel = element.colVal - } - if (!element.nextLogicalRelName) { - element.nextLogicalRelName = '' - } + }); + } else { + oneRule.houseRuleList = [] + } - element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName + if (refObj.staticChecked) { - }); + oneRule.statRuleList = refObj.statRuleList - } else { - oneRule.statRuleList = [] - } + oneRule.statRuleList.forEach(element => { + element.itemList = [] + element.colOption = [] - isOk = true + if (!element.colValLabel) { + element.colValLabel = element.colVal + } + if (!element.nextLogicalRelName) { + element.nextLogicalRelName = '' + } + + element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName + + }); + + } else { + oneRule.statRuleList = [] + } + + isOk = true + } } else { isOk = false @@ -482,6 +490,7 @@ export default { // this.formData.ruleList = this.ruleList console.log(this.formData.ruleList) + // return false diff --git a/src/views/modules/communityService/policy/rule.vue b/src/views/modules/communityService/policy/rule.vue index 5ede5c82..5eb178ed 100644 --- a/src/views/modules/communityService/policy/rule.vue +++ b/src/views/modules/communityService/policy/rule.vue @@ -464,8 +464,11 @@ export default { }, 500); return false } + + this.resiRuleList = resiRuleList if (this.resiRuleList && this.resiRuleList.length > 0) { + this.personChecked = true for (let i = 0; i < this.resiRuleList.length; i++) { let element = this.resiRuleList[i] @@ -490,6 +493,7 @@ export default { this.houseRuleList = houseRuleList if (this.houseRuleList && this.houseRuleList.length > 0) { + this.houseChecked = true this.houseRuleList.forEach((element, index) => { let selHouseItem = this.houseItemList.filter((item) => @@ -504,6 +508,7 @@ export default { } this.statRuleList = statRuleList if (this.statRuleList && this.statRuleList.length > 0) { + this.staticChecked = true this.statRuleList.forEach((element, index) => { let selStaticItem = this.staticItemList.filter((item) =>