|
@ -70,11 +70,14 @@ |
|
|
v-model="formData.content"></el-input> |
|
|
v-model="formData.content"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<div v-for="(item,index) in ruleList" |
|
|
<div v-for="(item,index) in formData.ruleList" |
|
|
:key="index"> |
|
|
:key="index"> |
|
|
|
|
|
|
|
|
<el-form-item :label="'政策细则'+(index+1)" |
|
|
<el-form-item :label="'政策细则'+(index+1)" |
|
|
prop="principalName" |
|
|
:prop="`ruleList.${index}.ruleName`" |
|
|
|
|
|
:rules="[ |
|
|
|
|
|
{ required: true, message: '政策细则'+(index+1)+'不能为空', trigger: 'change' }, |
|
|
|
|
|
]" |
|
|
label-width="150px" |
|
|
label-width="150px" |
|
|
style="display: block"> |
|
|
style="display: block"> |
|
|
<el-input class="item_width_short" |
|
|
<el-input class="item_width_short" |
|
@ -89,15 +92,13 @@ |
|
|
style="margin-left:20px" |
|
|
style="margin-left:20px" |
|
|
@click="delRule(index)">删除细则</el-button> |
|
|
@click="delRule(index)">删除细则</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
<div class="item_rule"> |
|
|
|
|
|
<div class="item_label">{{'匹配规则'+(index+1)}}</div> |
|
|
|
|
|
|
|
|
<el-form-item :label="'匹配规则'+(index+1)" |
|
|
|
|
|
prop="principalName" |
|
|
|
|
|
label-width="150px" |
|
|
|
|
|
style="display: block"> |
|
|
|
|
|
<rule :ref="'ref_rule'+index" |
|
|
<rule :ref="'ref_rule'+index" |
|
|
:formType="formType" |
|
|
:formType="formType" |
|
|
:index="index"></rule> |
|
|
:index="index"></rule> |
|
|
</el-form-item> |
|
|
</div> |
|
|
<div v-if="index===(ruleList.length-1)" |
|
|
<div v-if="index===(ruleList.length-1)" |
|
|
class="btn-add-rule"> |
|
|
class="btn-add-rule"> |
|
|
<el-button type="primary" |
|
|
<el-button type="primary" |
|
@ -214,7 +215,14 @@ export default { |
|
|
content: '',// |
|
|
content: '',// |
|
|
categoryList: [], |
|
|
categoryList: [], |
|
|
attachmentList: [], |
|
|
attachmentList: [], |
|
|
ruleList: [], |
|
|
ruleList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
ruleName: '', |
|
|
|
|
|
resiRuleList: [], |
|
|
|
|
|
houseRuleList: [], |
|
|
|
|
|
statRuleList: [] |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -267,10 +275,10 @@ export default { |
|
|
detail: [] |
|
|
detail: [] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.ruleList.push(obj) |
|
|
this.formData.ruleList.push(obj) |
|
|
}, |
|
|
}, |
|
|
delRule (index) { |
|
|
delRule (index) { |
|
|
this.ruleList.splice(index, 1); |
|
|
this.formData.ruleList.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async loadFormInfo () { |
|
|
async loadFormInfo () { |
|
@ -286,7 +294,7 @@ export default { |
|
|
let arr = element.codePath.split(',') |
|
|
let arr = element.codePath.split(',') |
|
|
this.demandIdArray.push(arr) |
|
|
this.demandIdArray.push(arr) |
|
|
}); |
|
|
}); |
|
|
this.ruleList = data.ruleList |
|
|
this.formData.ruleList = data.ruleList |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.formData = data |
|
|
this.formData = data |
|
@ -373,10 +381,19 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleAdd () { |
|
|
async handleAdd () { |
|
|
|
|
|
|
|
|
|
|
|
var oDate1 = new Date(this.formData.startDate); |
|
|
|
|
|
var oDate2 = new Date(this.formData.endDate); |
|
|
|
|
|
if (oDate1.getTime() > oDate2.getTime()) { |
|
|
|
|
|
this.$message.error('结束日期必须大于开始日期') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let isOk = false |
|
|
let isOk = false |
|
|
|
|
|
|
|
|
for (let index = 0; index < this.ruleList.length; index++) { |
|
|
for (let index = 0; index < this.formData.ruleList.length; index++) { |
|
|
let oneRule = this.ruleList[index] |
|
|
let oneRule = this.formData.ruleList[index] |
|
|
|
|
|
|
|
|
let refObj = this.$refs['ref_rule' + index][0] |
|
|
let refObj = this.$refs['ref_rule' + index][0] |
|
|
|
|
|
|
|
@ -446,7 +463,7 @@ export default { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.formData.ruleList = this.ruleList |
|
|
// this.formData.ruleList = this.ruleList |
|
|
console.log(this.formData.ruleList) |
|
|
console.log(this.formData.ruleList) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -457,7 +474,7 @@ export default { |
|
|
}, 5000) |
|
|
}, 5000) |
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
if (!valid) { |
|
|
if (!valid) { |
|
|
app.util.validateRule(messageObj) |
|
|
// app.util.validateRule(messageObj) |
|
|
this.btnDisable = false |
|
|
this.btnDisable = false |
|
|
} else { |
|
|
} else { |
|
|
this.addFuwu() |
|
|
this.addFuwu() |
|
@ -640,6 +657,18 @@ export default { |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule () { |
|
|
dataRule () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.ruleList.forEach((element, index) => { |
|
|
|
|
|
// let one = [ |
|
|
|
|
|
// { required: true, message: '政策细则' + (index + 1) + '不能为空', trigger: 'blur' } |
|
|
|
|
|
// ] |
|
|
|
|
|
// rules['ruleName' + (index + 1)] = one |
|
|
|
|
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
|
|
|
|
|
|
policyLevel: [ |
|
|
policyLevel: [ |
|
@ -651,9 +680,7 @@ export default { |
|
|
title: [ |
|
|
title: [ |
|
|
{ required: true, message: '政策标题不能为空', trigger: 'change' } |
|
|
{ required: true, message: '政策标题不能为空', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
content: [ |
|
|
|
|
|
{ required: true, message: '政策内容不能为空', trigger: 'change' } |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -691,4 +718,20 @@ export default { |
|
|
.item_width_short { |
|
|
.item_width_short { |
|
|
width: 380px; |
|
|
width: 380px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item_rule { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: start; |
|
|
|
|
|
} |
|
|
|
|
|
.item_label { |
|
|
|
|
|
flex: 0 0 150px; |
|
|
|
|
|
line-height: 30px; |
|
|
|
|
|
text-align: right; |
|
|
|
|
|
padding-right: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
.item_label:before { |
|
|
|
|
|
content: "*"; |
|
|
|
|
|
color: #f56c6c; |
|
|
|
|
|
margin-right: 4px; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|