|
|
@ -1,8 +1,7 @@ |
|
|
|
|
|
|
|
<template> |
|
|
|
|
|
|
|
<div class='g-main dialog-h-content'> |
|
|
|
<h3>{{agencyName}}{{period.substr(5,2)}}月份满意度调查</h3> |
|
|
|
<h3>{{ agencyName }}{{ period.substr(5, 2) }}月份满意度调查</h3> |
|
|
|
<p>尊敬的居民朋友</p> |
|
|
|
<p style="text-indent: 2em; ">为了更好地推进社区工作,为您提供更全面、优质的服务,请您根据真实情况填写此表,我们将认真对待您提出的问题,并承诺对您提供的信息保密,感谢您的配合!</p> |
|
|
|
<div class="card" v-for="(item, index) in formList" :key="index"> |
|
|
@ -12,40 +11,41 @@ |
|
|
|
<el-radio class="f-bot16" v-model.trim="form[item.pkey]" disabled label="good">基本满意</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model.trim="form[item.pkey]" disabled label="bad">不满意</el-radio> |
|
|
|
</section> |
|
|
|
<p v-if="form[item.pkey] == 'bad'">{{ index + 1 }}.1您具体对那些方面不满意</p> |
|
|
|
<p v-if="form[item.pkey] == 'bad'">{{ index + 1 }}.1您具体对哪些方面不满意</p> |
|
|
|
<section class="f-hflex" v-for="(itemK, indexK) in item.children" v-if="form[item.pkey] == 'bad'"> |
|
|
|
<el-radio class="f-bot16" v-model.trim="form[item.value]" :label="itemK.value" disabled |
|
|
|
>{{ itemK.label }}</el-radio> |
|
|
|
<el-input v-if="indexK == item.children.length -1 && form[item.pkey] == 'bad'" disabled placeholder="请填写不满意原因" v-model.trim="form[item.reason]"></el-input> |
|
|
|
<el-radio class="f-bot16" v-model.trim="form[item.value]" :label="itemK.value" disabled>{{ itemK.label |
|
|
|
}}</el-radio> |
|
|
|
<el-input v-if="indexK == item.children.length - 1 && form[item.pkey] == 'bad'" disabled placeholder="请填写不满意原因" |
|
|
|
v-model.trim="form[item.reason]"></el-input> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|
<p>8、姓名:{{form.reporterName}}</p> |
|
|
|
<p>9、电话:{{form.reporterMobile}}</p> |
|
|
|
<p>8、姓名:{{ form.reporterName }}</p> |
|
|
|
<p>9、电话:{{ form.reporterMobile }}</p> |
|
|
|
<p>10、您是否接受回访</p> |
|
|
|
<section class="f-hflex"> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-2">未知</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-1">不接受回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="0">接受回访/待回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="1">已回访</el-radio> |
|
|
|
</section> |
|
|
|
<p v-if="form.followUpStatus === 0">11、请选择合适您的回访方式</p> |
|
|
|
<section class="f-hflex" v-if="form.followUpStatus === 0"> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="0">未知</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="1">电话回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="2">上门回访</el-radio> |
|
|
|
</section> |
|
|
|
<p >请填写您的家庭住址</p> |
|
|
|
<el-input v-model="form.resideAddress" disabled></el-input> |
|
|
|
<el-row type="flex" justify="end" class="f-top12"> |
|
|
|
<el-col :span="2"> |
|
|
|
<el-button @click="handleClose"> 取消</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-2">未知</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-1">不接受回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="0">接受回访/待回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="1">已回访</el-radio> |
|
|
|
</section> |
|
|
|
<p v-if="form.followUpStatus === 0">11、请选择合适您的回访方式</p> |
|
|
|
<section class="f-hflex" v-if="form.followUpStatus === 0"> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="0">未知</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="1">电话回访</el-radio> |
|
|
|
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="2">上门回访</el-radio> |
|
|
|
</section> |
|
|
|
<p>请填写您的家庭住址</p> |
|
|
|
<el-input v-model="form.resideAddress" disabled></el-input> |
|
|
|
<el-row type="flex" justify="end" class="f-top12"> |
|
|
|
<el-col :span="2"> |
|
|
|
<el-button @click="handleClose"> 取消</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { requestGet } from "@/js/dai/request"; |
|
|
|
import { requestGet } from "@/js/dai/request"; |
|
|
|
export default { |
|
|
|
//数据 |
|
|
|
data() { |
|
|
@ -61,14 +61,14 @@ export default { |
|
|
|
formList: [], |
|
|
|
form: { |
|
|
|
// 是否满意:veryGood,good,bad |
|
|
|
evaCulturalFacility:'', |
|
|
|
evaSportsFacility:'', |
|
|
|
evaEcologicalEnv:'', |
|
|
|
evaSocialSecurity:'', |
|
|
|
evaSocialAssistance:'', |
|
|
|
evaOldPeopleProvide:'', |
|
|
|
evaBasicEducation:'', |
|
|
|
evaMedical:'', |
|
|
|
evaCulturalFacility: '', |
|
|
|
evaSportsFacility: '', |
|
|
|
evaEcologicalEnv: '', |
|
|
|
evaSocialSecurity: '', |
|
|
|
evaSocialAssistance: '', |
|
|
|
evaOldPeopleProvide: '', |
|
|
|
evaBasicEducation: '', |
|
|
|
evaMedical: '', |
|
|
|
|
|
|
|
// 二级选中 对应值 cultureFacilityAsp 01 02 03 09 |
|
|
|
cultureFacilityAsp: '', |
|
|
@ -89,46 +89,52 @@ export default { |
|
|
|
medicalReason: '', |
|
|
|
|
|
|
|
// 居民信息 |
|
|
|
reporterName:'', |
|
|
|
reporterMobile:'', |
|
|
|
reporterName: '', |
|
|
|
reporterMobile: '', |
|
|
|
followUpStatus: null, |
|
|
|
expectFollowUpWay:'', |
|
|
|
resideAddress:'', |
|
|
|
expectFollowUpWay: '', |
|
|
|
resideAddress: '', |
|
|
|
}, |
|
|
|
agencyName:this.$store.state.user.agencyName, |
|
|
|
agencyName: this.$store.state.user.agencyName, |
|
|
|
}; |
|
|
|
}, |
|
|
|
//创建前 |
|
|
|
async created() { |
|
|
|
await this.getDicts() |
|
|
|
await this.handleArr() |
|
|
|
await this.transformInitialArray() |
|
|
|
await this.getInspResult() |
|
|
|
}, |
|
|
|
//方法 |
|
|
|
methods: { |
|
|
|
handleArr() { |
|
|
|
const transformArray = (initialArray) => { |
|
|
|
const resultMap = new Map(); |
|
|
|
for (const item of initialArray) { |
|
|
|
const baseValue = item.value.slice(0, -2); |
|
|
|
const endValue = item.value.slice(-2); |
|
|
|
const modifiedBaseValue = baseValue.charAt(0).toUpperCase() + baseValue.slice(1,-3); |
|
|
|
const reasonValue = baseValue.charAt(0) + baseValue.slice(1,-3) + 'Reason'; |
|
|
|
if (!resultMap.has(baseValue)) { |
|
|
|
resultMap.set(baseValue, { label: item.label, value: baseValue, children: [] ,pkey:`eva${modifiedBaseValue}`,reason:reasonValue}); |
|
|
|
} |
|
|
|
if (["01", "02", "03", "09"].includes(endValue)) { |
|
|
|
resultMap.get(baseValue).children.push(item); |
|
|
|
} |
|
|
|
} |
|
|
|
transformInitialArray() { |
|
|
|
const resultMap = new Map(); |
|
|
|
|
|
|
|
return [...resultMap.values()].filter(item => item.children.length > 0); |
|
|
|
}; |
|
|
|
// 先找到所有的“父”项 |
|
|
|
this.dicts.satisfaction_ns_aspect.forEach(item => { |
|
|
|
const endValue = item.value.slice(-2); |
|
|
|
if (isNaN(endValue)) { |
|
|
|
resultMap.set(item.value, { |
|
|
|
label: item.label, |
|
|
|
value: item.value, |
|
|
|
children: [], |
|
|
|
pkey: `eva${item.value.charAt(0).toUpperCase() + item.value.slice(1, -3)}`, |
|
|
|
reason: `${item.value.replace('Asp', '')}Reason` // 修改这里 |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 然后为每一个父项找到子项 |
|
|
|
this.dicts.satisfaction_ns_aspect.forEach(item => { |
|
|
|
const parentValue = item.value.slice(0, -2); |
|
|
|
if (resultMap.has(parentValue)) { |
|
|
|
resultMap.get(parentValue).children.push(item); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
this.formList = [...resultMap.values()]; |
|
|
|
console.log(this.formList); |
|
|
|
}, |
|
|
|
|
|
|
|
this.formList = transformArray(this.dicts.satisfaction_ns_aspect); |
|
|
|
console.log(this.formList); |
|
|
|
}, |
|
|
|
|
|
|
|
async getDicts() { |
|
|
|
try { |
|
|
|
const requests = [ |
|
|
@ -150,17 +156,17 @@ export default { |
|
|
|
console.log("获取字典失败: ", error); |
|
|
|
} |
|
|
|
}, |
|
|
|
async getInspResult(){ |
|
|
|
async getInspResult() { |
|
|
|
const url = `/governance/satisfaction/communitySelfInsp/inspResult/detail/${this.inspResultId}` |
|
|
|
const {data,code,msg} = await requestGet(url) |
|
|
|
if(code == 0){ |
|
|
|
this.form = {...data.reporter,...data.satisfaction} |
|
|
|
const { data, code, msg } = await requestGet(url) |
|
|
|
if (code == 0) { |
|
|
|
this.form = { ...data.reporter, ...data.satisfaction } |
|
|
|
console.log(this.form); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleClose(){ |
|
|
|
handleClose() { |
|
|
|
this.$emit('handleClose') |
|
|
|
} |
|
|
|
}, |
|
|
@ -170,14 +176,14 @@ export default { |
|
|
|
computed: {}, |
|
|
|
//监听 |
|
|
|
watch: {}, |
|
|
|
props:{ |
|
|
|
inspResultId:{ |
|
|
|
type:String, |
|
|
|
default:'' |
|
|
|
props: { |
|
|
|
inspResultId: { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
}, |
|
|
|
period:{ |
|
|
|
type:String, |
|
|
|
default:'' |
|
|
|
period: { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -205,4 +211,5 @@ h3 { |
|
|
|
.f-font-color { |
|
|
|
color: #000; |
|
|
|
font-weight: 400; |
|
|
|
}</style> |
|
|
|
} |
|
|
|
</style> |
|
|
|