Browse Source

Merge branch 'mk' into dev

feature
mk 2 years ago
parent
commit
72ed72d489
  1. 12
      src/views/modules/satisfaction/communitySelfInsp/formList.vue
  2. 313
      src/views/modules/satisfaction/communitySelfInsp/index.vue
  3. 26
      src/views/modules/satisfaction/satisfactionProvince/index.vue

12
src/views/modules/satisfaction/communitySelfInsp/formList.vue

@ -92,6 +92,8 @@ export default {
await this.getTableData() await this.getTableData()
if (this.satisfactionCategoryStr) { if (this.satisfactionCategoryStr) {
this.formData.satisfactionCategory = this.satisfactionCategoryStr this.formData.satisfactionCategory = this.satisfactionCategoryStr
this.formData.inspRecordId = this.inspRecordId
console.log(this.formData.satisfactionCategory);
} }
}, },
// //
@ -137,12 +139,13 @@ export default {
this.getTableData(); this.getTableData();
}, },
async getTableData() { async getTableData() {
try { console.log(this.formData);
let params = { var params = {
...this.formData, ...this.formData,
pageNo: this.currentPage, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
}; };
console.log(params);
let url = '/governance/satisfaction/communitySelfInsp/inspResult/list' let url = '/governance/satisfaction/communitySelfInsp/inspResult/list'
const { data, code, msg } = await requestGet(url, params) const { data, code, msg } = await requestGet(url, params)
if (code == 0) { if (code == 0) {
@ -151,9 +154,6 @@ export default {
} else { } else {
console.log(err); console.log(err);
} }
} catch (err) {
console.log(err);
}
}, },
}, },
// //

313
src/views/modules/satisfaction/communitySelfInsp/index.vue

@ -5,8 +5,6 @@
<div class="m-search"> <div class="m-search">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> <el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'">
<el-form-item label="自评周期"> <el-form-item label="自评周期">
<!-- <el-input v-model="formData.name" placeholder="请输入" size="small" class="u-item-width-normal"
clearable></el-input> -->
<el-date-picker v-model="formData.period" type="date" value-format="yyyy-MM" placeholder="选择日期" <el-date-picker v-model="formData.period" type="date" value-format="yyyy-MM" placeholder="选择日期"
style="width: 202px" clearable> style="width: 202px" clearable>
</el-date-picker> </el-date-picker>
@ -23,16 +21,16 @@
<div class="m-table"> <div class="m-table">
<div class="div_btn"> <div class="div_btn">
<el-button type="primary" size="small" <el-button type="primary" size="small" class="diy-button--white el-button--default"
class="diy-button--white el-button--default" @click="handleCreateMonthlySurvey">生成本月社区自查问卷表</el-button> @click="handleCreateMonthlySurvey">生成本月社区自查问卷表</el-button>
</div> </div>
<div class="m-table-item" :style="{ height: maxTableHeight + 'px', width: '100%' }"> <div class="m-table-item" :style="{ height: maxTableHeight + 'px', width: '100%' }">
<div>本月已参与调研人数 500</div> <div>本月已参与调研人数 {{ personQty }}</div>
<section class="content_box"> <section class="content_box">
<div class="left"> <div class="left">
<img src="../../../../assets/img/satisfaction/zhdf.png" alt="Image"> <img src="../../../../assets/img/satisfaction/zhdf.png" alt="Image">
<div class="left_right"> <div class="left_right">
<div>85.12</div> <div>{{ synthesisScore }}</div>
<div>综合得分</div> <div>综合得分</div>
</div> </div>
</div> </div>
@ -57,32 +55,29 @@
</div> </div>
<el-dialog v-if="showFormList" :visible.sync="showFormList" :close-on-click-modal="false" <el-dialog v-if="showFormList" :visible.sync="showFormList" :close-on-click-modal="false"
:close-on-press-escape="false" title="社区自查" :modal-append-to-body="false" width="820px" top="5vh" :close-on-press-escape="false" title="社区自查" :modal-append-to-body="false" width="820px" top="5vh"
class="dialog-h" @closed="showFormList = false" > class="dialog-h" @closed="showFormList = false">
<form-list ref="ref_add_form" @handleClose="handleClose" :satisfactionCategoryStr="satisfactionCategoryStr" <form-list ref="ref_add_form" @handleClose="handleClose" :satisfactionCategoryStr="satisfactionCategoryStr"
@handelDetail="handelDetail" @handelFollowUpList="handelFollowUpList" :period="formData.period"></form-list> @handelDetail="handelDetail" @handelFollowUpList="handelFollowUpList" :period="formData.period" :inspRecordId="formData.inspRecordId"></form-list>
<el-dialog width="920px" class="dialog-h" title="社区自查报告详情" :close-on-click-modal="false" <el-dialog width="920px" class="dialog-h" title="社区自查报告详情" :close-on-click-modal="false"
v-if="showFollowUpDetail" :visible.sync="showFollowUpDetail" append-to-body > v-if="showFollowUpDetail" :visible.sync="showFollowUpDetail" append-to-body>
<follow-Detail></follow-Detail> <follow-Detail></follow-Detail>
</el-dialog> </el-dialog>
<el-dialog width="820px" class="dialog-h" title="回访记录" :close-on-click-modal="false" v-if="showFollowUpList" <el-dialog width="820px" class="dialog-h" title="回访记录" :close-on-click-modal="false" v-if="showFollowUpList"
:visible.sync="showFollowUpList" append-to-body > :visible.sync="showFollowUpList" append-to-body>
<follow-list></follow-list> <follow-list></follow-list>
</el-dialog> </el-dialog>
</el-dialog> </el-dialog>
<el-dialog title="调查问卷" <el-dialog title="调查问卷" :visible.sync="showTduckImage" width="550px">
:visible.sync="showTduckImage" <el-image :src="qrCodeImgUrl">
width="550px"> <div slot="placeholder" class="image-slot">
<el-image :src="qrCodeImgUrl"> 加载中<span class="dot">...</span>
<div slot="placeholder" class="image-slot"> </div>
加载中<span class="dot">...</span>
</div>
</el-image> </el-image>
<div> <div>
<span>问卷链接</span> {{questionnaireUrl}} <span>问卷链接</span> {{ questionnaireUrl }}
</div> </div>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer"> </span>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -96,12 +91,12 @@ import followDetail from "./followUpDetail";
import util from "@js/util.js"; import util from "@js/util.js";
export default { export default {
components: { formList, followList,followDetail }, components: { formList, followList, followDetail },
data() { data() {
return { return {
searchH: 20, searchH: 20,
formData: { formData: {
period: "",// period: "",//
inspRecordId: "", inspRecordId: "",
@ -133,7 +128,7 @@ export default {
containLabel: true, containLabel: true,
}, },
toolbox: {}, toolbox: {},
xAxis: { xAxis: {
type: "category", type: "category",
boundaryGap: true, boundaryGap: true,
@ -149,19 +144,19 @@ export default {
lineStyle: { lineStyle: {
width: 60, // width: 60, //
color: "#000", color: "#000",
opacity:0 opacity: 0
}, },
// 2 // 2
}, },
}, },
yAxis: { yAxis: {
type: "value", type: "value",
name: "单位(个)", name: "单位(个)",
min: 0, min: 0,
}, },
series: [ series: [
{ {
@ -202,7 +197,7 @@ export default {
}, },
], ],
}, },
satisfactionCategory: [],// satisfactionCategory: [],//
satisfactionCategoryName: [], satisfactionCategoryName: [],
score: [], // score: [], //
@ -210,10 +205,12 @@ export default {
showFormList: false, // showFormList: false, //
showFollowUpDetail: false,// showFollowUpDetail: false,//
showFollowUpList: false,//访 showFollowUpList: false,//访
showTduckImage:false, showTduckImage: false,
qrCodeImgUrl:'',// qrCodeImgUrl: '',//
questionnaireUrl:'' questionnaireUrl: '',
synthesisScore: '',
personQty: ''
}; };
}, },
@ -231,11 +228,16 @@ export default {
this.agencyId = this.user.agencyId; this.agencyId = this.user.agencyId;
await this.getDicts(); await this.getDicts();
await this.getTableData(); await this.getTableData();
await this.initEcharts(); this.$nextTick(() => {
this.initEcharts();
})
}, },
created(){ created() {
let date = new Date() let date = new Date()
this.formData.period = util.formatDate(date,'yyyy-MM') this.formData.period = util.formatDate(date, 'yyyy-MM')
},
activated() {
this.handleWindowResize()
}, },
methods: { methods: {
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
@ -267,16 +269,16 @@ export default {
handelFollowUpList() { handelFollowUpList() {
this.showFollowUpList = true; this.showFollowUpList = true;
}, },
async handleCreateMonthlySurvey(){ async handleCreateMonthlySurvey() {
try{ try {
let url = '/governance/satisfaction/communitySelfInsp/generateQuestionnaire' let url = '/governance/satisfaction/communitySelfInsp/generateQuestionnaire'
const {data,code} = await requestPost(url) const { data, code } = await requestPost(url)
if(code == 0){ if (code == 0) {
this.showTduckImage = true this.showTduckImage = true
this.qrCodeImgUrl = data.qrCodeImgUrl this.qrCodeImgUrl = data.qrCodeImgUrl
this.questionnaireUrl = data.questionnaireUrl this.questionnaireUrl = data.questionnaireUrl
} }
}catch(err){ } catch (err) {
console.log(err); console.log(err);
} }
}, },
@ -290,7 +292,6 @@ export default {
// console.log(params.seriesName); // // console.log(params.seriesName); //
than.handelClickChart(params.name); than.handelClickChart(params.name);
}); });
window.addEventListener("resize", this.handleWindowResize); window.addEventListener("resize", this.handleWindowResize);
}, },
handleWindowResize() { handleWindowResize() {
@ -303,6 +304,7 @@ export default {
this.satisfactionCategoryStr = this.dicts.satisfaction_category.filter( this.satisfactionCategoryStr = this.dicts.satisfaction_category.filter(
(item) => item.label == name (item) => item.label == name
)[0].value; )[0].value;
console.log(this.satisfactionCategoryStr);
}, },
handleClose() { handleClose() {
this.showFormList = false; this.showFormList = false;
@ -315,113 +317,116 @@ export default {
// //
async getTableData() { async getTableData() {
this.tableLoading = true; // this.tableLoading = true;
this.tableData = [ // this.tableData = [
{ // {
satisfactionCategory: "culturalFacility", // satisfactionCategory: "culturalFacility",
satisfactionCategoryName: "文化设施", // satisfactionCategoryName: "",
score: "20", // score: "20",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "sportsFacility", // satisfactionCategory: "sportsFacility",
satisfactionCategoryName: "体育设施", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "ecologicalEnv", // satisfactionCategory: "ecologicalEnv",
satisfactionCategoryName: "生态环境", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "socialSecurity", // satisfactionCategory: "socialSecurity",
satisfactionCategoryName: "社会治安", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "socialAssistance", // satisfactionCategory: "socialAssistance",
satisfactionCategoryName: "社会救助", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "oldPeopleProvide", // satisfactionCategory: "oldPeopleProvide",
satisfactionCategoryName: "老有所养", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "basicEducation", // satisfactionCategory: "basicEducation",
satisfactionCategoryName: "基础教育", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
{ // {
satisfactionCategory: "medical", // satisfactionCategory: "medical",
satisfactionCategoryName: "病有所医", // satisfactionCategoryName: "",
score: "50", // score: "50",
badQty: 40, // badQty: 40,
goodQty: 20, // goodQty: 20,
veryGoodQty: 30, // veryGoodQty: 30,
}, // },
]; // ];
const allowedCategories = this.dicts.satisfaction_category.map( // const allowedCategories = this.dicts.satisfaction_category.map(
(item) => item.value // (item) => item.value
); // );
this.tableData.forEach((item) => { // this.tableData.forEach((item) => {
if (allowedCategories.includes(item.satisfactionCategory)) {
this.option.series[0].data.push(item.veryGoodQty);
this.option.series[1].data.push(item.goodQty);
this.option.series[2].data.push(item.badQty);
this.option.xAxis.data.push(item.satisfactionCategoryName);
this.satisfactionCategory.push(item.satisfactionCategory);
this.score.push({
score: item.score,
satisfactionCategoryName: item.satisfactionCategoryName,
imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`),
});
}
});
console.log(this.score, "综合得分");
// const url = "/governance/satisfaction/communitySelfInsp/stats/synthesis";
// const { formData } = this;
// const { data, code, msg } = await requestGet(url, {...formData});
// this.tableLoading = false;
// if (code === 0) {
// this.total = data.total || 0;
// this.tableData = data.categoryDatas;
// const allowedCategories = this.dicts.satisfaction_category.map(item => item.value)
// this.tableData.forEach(item => {
// if (allowedCategories.includes(item.satisfactionCategory)) { // if (allowedCategories.includes(item.satisfactionCategory)) {
// this.option.series[0].data.push(item.veryGoodQty) // this.option.series[0].data.push(item.veryGoodQty);
// this.option.series[1].data.push(item.goodQty) // this.option.series[1].data.push(item.goodQty);
// this.option.series[2].data.push(item.badQty) // this.option.series[2].data.push(item.badQty);
// this.option.xAxis.data.push(item.satisfactionCategoryName) // this.option.xAxis.data.push(item.satisfactionCategoryName);
// this.satisfactionCategory.push(item.satisfactionCategory) // this.satisfactionCategory.push(item.satisfactionCategory);
// this.score.push({ score: item.score, satisfactionCategoryName: item.satisfactionCategoryName, imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`) }); // this.score.push({
// score: item.score,
// satisfactionCategoryName: item.satisfactionCategoryName,
// imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`),
// });
// } // }
// }); // });
// } else { // console.log(this.score, "");
// this.$message.error(msg); const url = "/governance/satisfaction/communitySelfInsp/stats/synthesis";
// }
const { formData } = this;
const { data, code, msg } = await requestGet(url, { ...formData });
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.categoryDatas;
this.formData.inspRecordId = data.inspRecordId;
this.synthesisScore = data.synthesisScore;
this.personQty = data.personQty
const allowedCategories = this.dicts.satisfaction_category.map(item => item.value)
this.tableData.forEach(item => {
if (allowedCategories.includes(item.satisfactionCategory)) {
this.option.series[0].data.push(item.veryGoodQty)
this.option.series[1].data.push(item.goodQty)
this.option.series[2].data.push(item.badQty)
this.option.xAxis.data.push(item.satisfactionCategoryName)
this.satisfactionCategory.push(item.satisfactionCategory)
this.score.push({ score: item.score, satisfactionCategoryName: item.satisfactionCategoryName, imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`) });
}
});
} else {
this.$message.error(msg);
}
}, },
// //

26
src/views/modules/satisfaction/satisfactionProvince/index.vue

@ -42,8 +42,8 @@
@handelClickEdit="handelClickEdit"></form-list> @handelClickEdit="handelClickEdit"></form-list>
<el-dialog width="820px" class="dialog-h" title="省满意度调查详情" :close-on-click-modal="false" <el-dialog width="820px" class="dialog-h" title="省满意度调查详情" :close-on-click-modal="false"
v-if="showProvinceFollowUpDetail" :visible.sync="showProvinceFollowUpDetail" append-to-body> v-if="showProvinceFollowUpDetail" :visible.sync="showProvinceFollowUpDetail" append-to-body>
<follow-detail :detailObj="detailObj" :formType="formType" @handleCancle="showProvinceFollowUpDetail = false" <follow-detail :detailObj="detailObj" :formType="formType"
@handleComfirm="handleComfirm"></follow-detail> @handleCancle="showProvinceFollowUpDetail = false" @handleComfirm="handleComfirm"></follow-detail>
</el-dialog> </el-dialog>
</el-dialog> </el-dialog>
</div> </div>
@ -150,7 +150,6 @@ export default {
}, },
...mapGetters(["clientHeight", "iframeHeight"]), ...mapGetters(["clientHeight", "iframeHeight"]),
}, },
watch: {},
created() { created() {
let date = new Date() let date = new Date()
this.formData.periodStart = util.formatDate(date, 'yyyy-MM') this.formData.periodStart = util.formatDate(date, 'yyyy-MM')
@ -167,11 +166,11 @@ export default {
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
async getDicts() { async getDicts() {
try { try {
const requests = [ const requests = [
this.$http.post("sys/dict/data/dictlist", { this.$http.post("sys/dict/data/dictlist", {
dictType: "satisfaction_category", dictType: "satisfaction_category",
}), }),
]; ];
const dictKeys = ['satisfaction_category']; // const dictKeys = ['satisfaction_category']; //
@ -187,8 +186,6 @@ export default {
console.log("获取字典失败: ", error); console.log("获取字典失败: ", error);
} }
}, },
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
initEcharts() { initEcharts() {
this.myChart = echarts.init(document.getElementById('myCharts')); this.myChart = echarts.init(document.getElementById('myCharts'));
@ -204,7 +201,6 @@ export default {
window.addEventListener('resize', this.handleWindowResize); window.addEventListener('resize', this.handleWindowResize);
}, },
handleWindowResize() { handleWindowResize() {
if (this.myChart) { if (this.myChart) {
this.myChart.resize(); this.myChart.resize();
@ -231,20 +227,20 @@ export default {
this.showProvinceFollowUpDetail = false this.showProvinceFollowUpDetail = false
this.save(form) this.save(form)
}, },
async save(form) { async save(form) {
try{ try {
const url = '/governance/provinceEvaluationRecord/updateInfo' const url = '/governance/provinceEvaluationRecord/updateInfo'
form.periodName = null form.periodName = null
const {code} = await requestPost(url,form) const { code } = await requestPost(url, form)
if(code == 0){ if (code == 0) {
this.getTableData() this.getTableData()
this.$refs['ref_form_list'].getTableData() this.$refs['ref_form_list'].getTableData()
this.$message.success('保存成功') this.$message.success('保存成功')
this.showProvinceFollowUpDetail = false this.showProvinceFollowUpDetail = false
} }
}catch(err){ } catch (err) {
console.log(err); console.log(err);
} }
}, },
// //
handleSearch(val) { handleSearch(val) {
@ -361,7 +357,9 @@ export default {
this.getTableData(); this.getTableData();
}, },
}, },
activated() {
this.handleWindowResize()
},
props: {}, props: {},
}; };
</script> </script>

Loading…
Cancel
Save