diff --git a/src/assets/img/icon-del.png b/src/assets/img/icon-del.png new file mode 100644 index 000000000..e79000569 Binary files /dev/null and b/src/assets/img/icon-del.png differ diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue index f654f89f7..d44de3c73 100644 --- a/src/views/modules/communityService/policy/addPolicy.vue +++ b/src/views/modules/communityService/policy/addPolicy.vue @@ -10,9 +10,10 @@ class="div_form"> - @@ -26,6 +27,7 @@ - +
增加细则
@@ -146,7 +148,7 @@ size="small" type="primary" :disabled="btnDisable" - @click="handleComfirm">确 定 + @click="handleAdd">确 定 @@ -287,9 +289,14 @@ export default { this.formData = data + if (data.attachmentList) { + this.fileList = data.attachmentList + } + this.$nextTick(() => { data.ruleList.forEach((element, index) => { + this.$refs['ref_rule' + index][0].setRule(element.resiRuleList, element.houseRuleList, element.statRuleList) }); }) @@ -363,28 +370,66 @@ export default { }, - async handleComfirm () { - - - this.handleAdd() - - }, - async handleAdd () { let isOk = false this.ruleList.forEach((oneRule, index) => { - if (!oneRule.ruleName) { - this.$message.error('政策细则不能为空') - isOk = false - } + // if (!oneRule.ruleName) { + // this.$message.error('政策细则不能为空') + // isOk = false + // } let refObj = this.$refs['ref_rule' + index][0] - refObj.getRule() + refObj.getRule(true, true, true) if (refObj.okflag) { 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 + + }); + oneRule.houseRuleList = refObj.houseRuleList + oneRule.houseRuleList.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 + + }); + oneRule.statRuleList = refObj.statRuleList + oneRule.statRuleList.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 + + }); + isOk = true } else { @@ -393,16 +438,21 @@ export default { } }); + + if (!isOk) { return false } this.formData.ruleList = this.ruleList + console.log(this.formData.ruleList) + + this.btnDisable = true setTimeout(() => { this.btnDisable = false - }, 10000) + }, 5000) this.$refs['ref_form'].validate((valid, messageObj) => { if (!valid) { app.util.validateRule(messageObj) @@ -418,6 +468,7 @@ export default { async addFuwu () { console.log(this.formData) + this.formData.attachmentList = [...this.fileList] let url = '/heart/policy/add' if (this.formType === 'add') { @@ -440,6 +491,7 @@ export default { this.resetData() this.$emit('handleOk') } else { + this.btnDisable = false this.$message.error(msg) } }, @@ -616,8 +668,9 @@ export default { @import "@/assets/scss/modules/management/form-main.scss"; .btn-add-rule { + margin-left: 150px; display: flex; - justify-content: center; + justify-content: flex-start; margin-bottom: 20px; } diff --git a/src/views/modules/communityService/policy/personList.vue b/src/views/modules/communityService/policy/personList.vue index be4bf5663..e8d1ff80b 100644 --- a/src/views/modules/communityService/policy/personList.vue +++ b/src/views/modules/communityService/policy/personList.vue @@ -1,5 +1,5 @@