Browse Source

Merge branch 'dev-policy0718'

master
jiangyy 3 years ago
parent
commit
953afb13bf
  1. 4
      src/assets/scss/modules/management/form-main.scss
  2. 117
      src/views/modules/communityService/policy/addPolicy.vue
  3. 5
      src/views/modules/communityService/policy/rule.vue

4
src/assets/scss/modules/management/form-main.scss

@ -15,6 +15,10 @@
width: 220px; width: 220px;
} }
.item_width_3{
width: 780px;
}
.list_item_width_1 { .list_item_width_1 {
width: 165px; width: 165px;
} }

117
src/views/modules/communityService/policy/addPolicy.vue

@ -61,11 +61,11 @@
prop="content" prop="content"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_1" <el-input class="item_width_3"
type="textarea" type="textarea"
maxlength="1000" maxlength="1000"
show-word-limit show-word-limit
:rows="3" :rows="10"
placeholder="请输入政策内容" placeholder="请输入政策内容"
v-model="formData.content"></el-input> v-model="formData.content"></el-input>
</el-form-item> </el-form-item>
@ -399,74 +399,82 @@ export default {
let refObj = this.$refs['ref_rule' + index][0] let refObj = this.$refs['ref_rule' + index][0]
refObj.getRule(true, true, true) refObj.getRule()
if (refObj.okflag) { if (refObj.okflag) {
if (refObj.personChecked) {
oneRule.resiRuleList = refObj.resiRuleList if (!refObj.personChecked && !refObj.houseChecked && !refObj.staticChecked) {
oneRule.resiRuleList.forEach(element => { this.$message.error('请选择匹配规则' + (index + 1))
element.itemList = [] isOk = false
element.colOption = [] break
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 { } 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 if (!element.colValLabel) {
oneRule.houseRuleList.forEach(element => { element.colValLabel = element.colVal
element.itemList = [] }
element.colOption = [] if (!element.nextLogicalRelName) {
element.nextLogicalRelName = ''
}
if (!element.colValLabel) { element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName
element.colValLabel = element.colVal
}
if (!element.nextLogicalRelName) {
element.nextLogicalRelName = ''
}
element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName });
} else {
oneRule.resiRuleList = []
}
}); if (refObj.houseChecked) {
} else {
oneRule.houseRuleList = []
}
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.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName
element.itemList = []
element.colOption = []
if (!element.colValLabel) { });
element.colValLabel = element.colVal } else {
} oneRule.houseRuleList = []
if (!element.nextLogicalRelName) { }
element.nextLogicalRelName = ''
}
element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName if (refObj.staticChecked) {
}); oneRule.statRuleList = refObj.statRuleList
} else { oneRule.statRuleList.forEach(element => {
oneRule.statRuleList = [] 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 { } else {
isOk = false isOk = false
@ -482,6 +490,7 @@ export default {
// this.formData.ruleList = this.ruleList // this.formData.ruleList = this.ruleList
console.log(this.formData.ruleList) console.log(this.formData.ruleList)
// return false // return false

5
src/views/modules/communityService/policy/rule.vue

@ -464,8 +464,11 @@ export default {
}, 500); }, 500);
return false return false
} }
this.resiRuleList = resiRuleList this.resiRuleList = resiRuleList
if (this.resiRuleList && this.resiRuleList.length > 0) { if (this.resiRuleList && this.resiRuleList.length > 0) {
this.personChecked = true
for (let i = 0; i < this.resiRuleList.length; i++) { for (let i = 0; i < this.resiRuleList.length; i++) {
let element = this.resiRuleList[i] let element = this.resiRuleList[i]
@ -490,6 +493,7 @@ export default {
this.houseRuleList = houseRuleList this.houseRuleList = houseRuleList
if (this.houseRuleList && this.houseRuleList.length > 0) { if (this.houseRuleList && this.houseRuleList.length > 0) {
this.houseChecked = true
this.houseRuleList.forEach((element, index) => { this.houseRuleList.forEach((element, index) => {
let selHouseItem = this.houseItemList.filter((item) => let selHouseItem = this.houseItemList.filter((item) =>
@ -504,6 +508,7 @@ export default {
} }
this.statRuleList = statRuleList this.statRuleList = statRuleList
if (this.statRuleList && this.statRuleList.length > 0) { if (this.statRuleList && this.statRuleList.length > 0) {
this.staticChecked = true
this.statRuleList.forEach((element, index) => { this.statRuleList.forEach((element, index) => {
let selStaticItem = this.staticItemList.filter((item) => let selStaticItem = this.staticItemList.filter((item) =>

Loading…
Cancel
Save