|
@@ -42,6 +42,7 @@
|
|
|
<el-select
|
|
|
v-model="formData.patrolType"
|
|
|
placeholder="请选择巡更类型"
|
|
|
+ @change="patrolTypeClick"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item,index) in patrolTypeList"
|
|
@@ -88,7 +89,7 @@
|
|
|
>
|
|
|
|
|
|
<el-select
|
|
|
- v-model="formData.contentDtoList[indexs].option"
|
|
|
+ v-model="formData.contentDtoList[indexs].optionValue"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
<el-option
|
|
@@ -145,7 +146,7 @@ export default {
|
|
|
contentDtoList: [
|
|
|
{
|
|
|
content: '',
|
|
|
- option: ''
|
|
|
+ optionValue: ''
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -176,19 +177,19 @@ export default {
|
|
|
optionComposition: [
|
|
|
{
|
|
|
label: '是、否',
|
|
|
- value: 1
|
|
|
+ value: '是、否'
|
|
|
},
|
|
|
{
|
|
|
label: '坏、好',
|
|
|
- value: 2
|
|
|
+ value: '坏、好'
|
|
|
},
|
|
|
{
|
|
|
label: '有、无',
|
|
|
- value: 3
|
|
|
+ value: '有、无',
|
|
|
},
|
|
|
{
|
|
|
label: '差、好',
|
|
|
- value: 4
|
|
|
+ value: '差、好'
|
|
|
}
|
|
|
],
|
|
|
rules: {
|
|
@@ -199,6 +200,33 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+
|
|
|
+ patrolTypeClick () {
|
|
|
+ this.$http.post('/czc-community/patrol/standard/list/content', { communityId: this.formData.communityId, patrolType: this.formData.patrolType }).then(({ status, data, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ if (data.length != 0) {
|
|
|
+ this.formData.contentDtoList = [];
|
|
|
+ data.map((item, index) => {
|
|
|
+ this.formData.contentDtoList.push(
|
|
|
+ {
|
|
|
+ content: item.content,
|
|
|
+ optionValue: item.optionValue
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.formData.contentDtoList = [];
|
|
|
+ this.formData.contentDtoList.push({
|
|
|
+ content: '',
|
|
|
+ optionValue: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
getOrgTreeList () {
|
|
|
this.$http.get('/czc-community/assets/community/list').then(({ status, data, msg }) => {
|
|
|
if (status == 0) {
|
|
@@ -215,8 +243,14 @@ export default {
|
|
|
submit () {
|
|
|
this.$refs.formData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$http.post('/czc-community/patrol/standard/add', this.formData).then(({ status, data, msg }) => {
|
|
|
- debugger
|
|
|
+ let url = ''
|
|
|
+ if (this.params.rowId == '1') {
|
|
|
+ url = '/czc-community/patrol/standard/update'
|
|
|
+ } else {
|
|
|
+ url = '/czc-community/patrol/standard/add'
|
|
|
+ }
|
|
|
+ this.$http.post(url, this.formData).then(({ status, data, msg }) => {
|
|
|
+ this.$message.success(msg);
|
|
|
this.params.callback();
|
|
|
this.$emit('close');
|
|
|
})
|
|
@@ -229,7 +263,7 @@ export default {
|
|
|
this.formData.contentDtoList.push(
|
|
|
{
|
|
|
content: '',
|
|
|
- option: ''
|
|
|
+ optionValue: ''
|
|
|
}
|
|
|
)
|
|
|
},
|
|
@@ -238,10 +272,24 @@ export default {
|
|
|
this.formData.contentDtoList.splice(id, 1);
|
|
|
return;
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created () {
|
|
|
this.getOrgTreeList();//获取社区内容
|
|
|
+ debugger;
|
|
|
+ if (this.params.rowId == '1') {
|
|
|
+
|
|
|
+ this.formData.communityId = this.params.row.communityId;
|
|
|
+ this.formData.patrolType = this.params.row.patrolType;
|
|
|
+ this.formData.contentDtoList = [];
|
|
|
+ this.params.row.contentVos.map((item, index) => {
|
|
|
+ this.formData.contentDtoList.push({
|
|
|
+ content: item.content,
|
|
|
+ optionValue: item.optionValue
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|