Browse Source

社区自查街道版完成,标签最终版

V1.0
mk 2 years ago
parent
commit
b90a6c3651
  1. 120
      src/views/modules/communityService/labelConfig/addForm.vue
  2. 417
      src/views/modules/satisfaction/communitySelfInsp/communityDialog.vue
  3. 5
      src/views/modules/satisfaction/communitySelfInsp/formList.vue
  4. 106
      src/views/modules/satisfaction/communitySelfInsp/index.vue

120
src/views/modules/communityService/labelConfig/addForm.vue

@ -8,11 +8,7 @@
:rules="rules"
>
<!-- v-if="!formState&& addFormLabel" -->
<el-form-item
label="标签名称"
label-width="100px"
prop="tagName"
>
<el-form-item label="标签名称" label-width="100px" prop="tagName">
<el-autocomplete
v-model="formData.tagName"
value-key="tagName"
@ -22,7 +18,10 @@
@select="handleSelect"
></el-autocomplete>
</el-form-item>
<span style="position: relative;top: 10px;">您可以按关键词查找使用已有标签也可以新建标签</span>
<span style="position: relative; top: 10px"
>您可以按关键词查找使用已有标签也可以
<a @click="clearRow" style="cursor: pointer;">新建标签</a> </span
>
<!-- <el-form-item label="标签名称(新增)" label-width="100px" prop="tagName" v-else>
<el-input
v-model="formData.tagName"
@ -32,7 +31,9 @@
></el-input>
</el-form-item> -->
</el-form>
<p style="margin-left: 15px"><b style="color: #f56c6c">*</b> 设置标签查询条件</p>
<p style="margin-left: 15px">
<b style="color: #f56c6c">*</b> 设置标签查询条件
</p>
<el-table border :data="tableData" style="width: 100%" height="200">
<el-table-column label="选择数据源" align="center" width="120">
<template slot-scope="scope">
@ -54,7 +55,7 @@
</el-table-column>
<el-table-column label="字段类别" align="center" width="120">
<template slot-scope="scope" v-if="scope.row.dataSource == 'resi'">
<template slot-scope="scope" v-if="scope.row.dataSource == 'resi'||scope.row.dataSource == 'house'">
<el-select
v-model="scope.row.itemGroupId"
placeholder="请选择"
@ -84,9 +85,9 @@
v-for="item in scope.row.itemIdOpction"
:label="item.label"
:value="
scope.row.dataSource == 'resi' ? item.itemId : item.colKey
scope.row.dataSource == 'resi'|| scope.row.dataSource == 'house'? item.itemId : item.colKey
"
:key="scope.row.dataSource == 'resi' ? item.itemId : item.colKey"
:key="scope.row.dataSource == 'resi'|| scope.row.dataSource == 'house' ? item.itemId : item.colKey"
>
</el-option>
</el-select>
@ -121,7 +122,6 @@
"
v-model="scope.row.colVal"
@change="changeFormState = true"
placeholder="请选择"
clearable
>
@ -139,7 +139,6 @@
"
v-model="scope.row.colVal"
@change="changeFormState = true"
placeholder="请输入"
clearable
>
@ -149,7 +148,6 @@
class="item_width_2"
v-model="scope.row.colVal"
@change="changeFormState = true"
:min="0"
size="mini"
label="请输入"
@ -159,7 +157,6 @@
item.itemType === 'datepicker' || item.itemType === 'date'
"
@change="changeFormState = true"
v-model="scope.row.colVal"
class="item_width_2"
type="datetime"
@ -175,7 +172,6 @@
placeholder="请输入"
v-model="scope.row.colVal"
@change="changeFormState = true"
>
</el-input>
</template>
@ -190,7 +186,6 @@
v-model="scope.row.nextLogicalRel"
placeholder="请选择"
@change="changeFormState = true"
clearable
>
<el-option
@ -203,12 +198,7 @@
</el-select>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
align="center"
width="120"
>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
type="primary"
@ -234,7 +224,11 @@
</template>
</el-table-column>
</el-table>
<p v-if="changeFormState && !formState">您已变更了{{this.formData.tagName}}标签的查询条件请按新条件修改原标签名称便于以后再次查找使用</p>
<p v-if="changeFormState && !formState && formData.tagName" style="color: #F56C6C">
您已变更了{{
this.formData.tagName
}}标签的查询条件请按新条件修改原标签名称便于以后再次查找使用
</p>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" @click="handleComfirm"
@ -287,8 +281,8 @@ export default {
{ label: "并且", value: "and" },
{ label: "或者", value: "or" },
],
formState:true,
changeFormState:false
formState: false,
changeFormState: false,
};
},
created() {},
@ -308,9 +302,9 @@ export default {
this.tagId = row.tagId;
this.tagObj = row;
for (let i in this.tableData) {
await this.handleChangeSource(this.tableData[i], [i], type,true);
await this.handleChangeFieldsType(this.tableData[i], [i], type,true);
await this.handleChangeFieldsName(this.tableData[i], [i], type,true);
await this.handleChangeSource(this.tableData[i], [i], type, true);
await this.handleChangeFieldsType(this.tableData[i], [i], type, true);
await this.handleChangeFieldsName(this.tableData[i], [i], type, true);
}
},
querySearchAsync(val, cb) {
@ -329,9 +323,9 @@ export default {
cb(results);
}, 3000 * Math.random());
},
handelChangeTagName(val){
if(this.formData.tagName.length == 0 ){
this.formType = 'info'
handelChangeTagName(val) {
if (this.formData.tagName.length == 0) {
this.formType = "info";
}
},
createStateFilter(val) {
@ -340,8 +334,8 @@ export default {
};
},
async handleSelect(item) {
this.formState = item.editable
await this.initForm('edit', item);
this.formState = item.editable;
await this.initForm("edit", item);
},
async getLabelList() {
const url = "/governance/resiSearchTag/listResiSearchTags";
@ -356,14 +350,14 @@ export default {
}
},
//
async handleChangeSource(row, index, type,state) {
if(!state){
this.changeFormState = true
async handleChangeSource(row, index, type, state) {
if (!state) {
this.changeFormState = true;
}
if (row.dataSource == "resi") {
if (row.dataSource == "resi" || row.dataSource == "house") {
let url = "/oper/customize/icformitemgroup/list";
let params = {
formCode: "resident_base_info",
formCode: row.dataSource == 'resi'?"resident_base_info":'community_info',
};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
@ -381,24 +375,6 @@ export default {
this.tableData[index].queryType = "";
this.tableData[index].itemIdOpction = [];
}
} else if (row.dataSource == "house") {
let url = "/governance/policy/item-list/house";
let params = {};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.tableData[index].itemIdOpction = data;
} else {
this.$message.error(msg);
}
this.hadeleClearForm(this.tableData[index], index);
if (!type) {
this.tableData[index].itemGroupId = "";
this.tableData[index].itemId = "";
this.tableData[index].colKey = "";
this.tableData[index].colVal = "";
this.tableData[index].nextLogicalRel = "";
this.tableData[index].queryType = "";
}
} else if (row.dataSource == "stat") {
let url = "/governance/policy/item-list/stat";
let params = {};
@ -432,12 +408,12 @@ export default {
},
//
async handleChangeFieldsType(row, index, type,state) {
if(!state){
this.changeFormState = true
async handleChangeFieldsType(row, index, type, state) {
if (!state) {
this.changeFormState = true;
}
// console.log(row, index, "row");
if (row.dataSource != "resi") return;
if (row.dataSource == "stat") return;
const url = "/oper/customize/icformitem/getItemListV2";
let params = {
groupId: row.itemGroupId,
@ -460,13 +436,14 @@ export default {
}
},
//
async handleChangeFieldsName(row, index, type,state) {
if(!state){
this.changeFormState = true
async handleChangeFieldsName(row, index, type, state) {
console.log(row);
if (!state) {
this.changeFormState = true;
}
var arr = [];
// colKeycolumnName
if (row.dataSource == "house" || row.dataSource == "stat") {
if ( row.dataSource == "stat") {
arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].colKey;
@ -477,7 +454,9 @@ export default {
}
// this.tableData[index].colVal = ''
// this.tableData[index].queryType = ''
} else if (row.dataSource == "resi" && row.itemId != "") {
} else if ((row.dataSource == "resi"||row.dataSource == "house") && row.itemId != "") {
console.log(row);
arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].columnName;
@ -511,7 +490,6 @@ export default {
} else {
this.$set(this.tableData[index], "correspondingOpction", arr);
}
},
async getCompareList() {
const url = "/sys/dict/data/dictlist";
@ -587,7 +565,7 @@ export default {
async addSubmit() {
var url = "";
var params = {};
if ( this.changeFormState && this.formState) {
if (this.changeFormState && this.formState) {
url = "/governance/resiSearchTag/updateResiSearchTag";
params = {
tagName: this.formData.tagName,
@ -680,13 +658,19 @@ export default {
},
//
handleClickDelete(index) {
this.changeFormState = true
this.changeFormState = true;
this.tableData.splice(index, 1);
},
handleClearItemId(row, index) {
this.tableData[index].colVal = "";
this.tableData[index].queryType = "";
},
clearRow() {
this.tableData = [];
this.formData.tagName = "";
this.formState = false
this.handleClickAddRow();
},
},
props: {},
computed: {},

417
src/views/modules/satisfaction/communitySelfInsp/communityDialog.vue

@ -0,0 +1,417 @@
<template>
<div class="">
<el-cascader
v-model="formData.agencyId"
:options="orgOptions"
:props="{
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
}"
:clearable="true"
:change-on-select="true"
:filterable="false"
:multiple="false"
placeholder="请选择"
@change="handleChangeCascader"
class="cascader"
/>
<el-date-picker
v-model="formData.period"
type="month"
value-format="yyyy-MM"
class="cascader"
placeholder="选择日期"
style="width: 202px"
clearable
@change="handleChangePicker"
>
</el-date-picker>
<div style="padding-left: 10px; margin-top: 10px">
本月已参与调研人数 {{ personQty }}
</div>
<section class="content_box">
<div class="left">
<img src="../../../../assets/img/satisfaction/zhdf.png" alt="Image" />
<div class="left_right">
<div>
{{ synthesisScore < 0 ? Math.abs(synthesisScore) : synthesisScore }}
</div>
<div>综合得分</div>
</div>
<div class="right_box">
<div :class="synthesisState ? 'up' : 'down'">
<img
src="@/assets/images/index/up.png"
alt=""
v-if="synthesisState && synthesisScoreBtLastMonth != 0"
/>
<img
src="@/assets/images/index/down.png"
alt=""
v-if="
!synthesisState &&
synthesisScoreBtLastMonth != 0 &&
synthesisScoreBtLastMonth != null
"
/>
<span>{{
synthesisScoreBtLastMonth < 0
? Math.abs(synthesisScoreBtLastMonth)
: synthesisScoreBtLastMonth
}}</span>
</div>
<div style="color: #999">较上月</div>
</div>
</div>
<div class="right">
<div class="box" v-for="(item, index) in score" :key="index">
<div class="card">
<img :src="item.imgUrl" alt="Image" />
<div class="right_right">
<div>{{ item.score }}</div>
<div>{{ item.satisfactionCategoryName }}</div>
</div>
<div class="right_box">
<div>
<img
src="@/assets/images/index/up.png"
alt=""
v-if="item.state && item.scoreDiffBtLastMonth != 0"
/>
<img
src="@/assets/images/index/down.png"
alt=""
v-if="!item.state && item.scoreDiffBtLastMonth != 0"
/>
<span :class="item.state ? 'up' : 'down'">
{{
item.scoreDiffBtLastMonth < 0
? Math.abs(item.scoreDiffBtLastMonth)
: item.scoreDiffBtLastMonth
}}
</span>
</div>
<div style="color: #999">较上月</div>
</div>
</div>
</div>
</div>
</section>
<section class="bto-box">
<div id="myCharts"></div>
</section>
</div>
</template>
<script>
import { requestGet } from "@/js/dai/request";
import * as echarts from "echarts";
export default {
data() {
return {
personQty: "", //
myChart: {},
option: {
tooltip: {
trigger: "axis",
},
legend: {
data: ["满意", "基本满意", "不满意"],
bottom: "10%",
icon: "rect",
itemWidth: 20,
itemHeight: 5,
itemGap: 20,
},
grid: {
left: "3%",
right: "4%",
bottom: "25%",
containLabel: true,
},
toolbox: {},
xAxis: {
type: "category",
boundaryGap: true,
axisLine: {
show: true,
},
axisTick: {
show: false,
},
data: [], // yourDataArrayx
splitLine: {
show: true,
lineStyle: {
width: 60, //
color: "#000",
opacity: 0,
},
// 2
},
},
yAxis: {
type: "value",
name: "单位(个)",
min: 0,
},
series: [
{
name: "满意",
type: "bar",
data: [],
barWidth: 16, //
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#2c7cf2" }, //
{ offset: 1, color: "#80b3ff" }, //
]),
},
},
{
name: "基本满意",
type: "bar",
data: [],
barWidth: 16, //
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#3ca267" }, //
{ offset: 1, color: "#82cca0" }, //
]),
},
},
{
name: "不满意",
type: "bar",
data: [],
barWidth: 16, //
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#edb42d" }, //
{ offset: 1, color: "#ffd981" }, //
]),
},
},
],
},
satisfactionCategory: [], //
satisfactionCategoryName: [],
score: [], //
synthesisScore: "",
synthesisScoreBtLastMonth: "",
synthesisState: false,
formData: {
period: "",
agencyId: "",
},
orgOptions: [],
selectedOptions: "",
};
},
props: {
communityId: {
type: String,
default: "",
},
period: {
type: String,
default: "",
},
satisfaction_category: {
type: Array,
default: () => [],
},
},
created() {},
async mounted() {
this.formData.period = this.period;
this.formData.agencyId = this.communityId;
this.initEcharts();
await this.getCharts(this.communityId);
await this.getOrgTreeList();
},
methods: {
async getCharts() {
let url = "/governance/satisfaction/communitySelfInsp/stats/synthesis";
const { formData } = this;
const { data, code, msg } = await requestGet(url, {
...formData,
});
if (code == 0) {
this.score = [];
this.option.series.forEach((series) => (series.data = []));
this.option.xAxis.data = [];
this.satisfactionCategory = [];
this.synthesisScore = data.synthesisScore;
this.synthesisScoreBtLastMonth = data.synthesisScoreBtLastMonth;
this.synthesisState = this.synthesisScoreBtLastMonth >= 0;
if (this.synthesisScoreBtLastMonth < 0) {
this.synthesisScoreBtLastMonth = Math.abs(
this.synthesisScoreBtLastMonth
);
}
this.personQty = data.personQty;
const allowedCategories = this.satisfaction_category.map(
(item) => item.value
);
for (const item of data.categoryDatas) {
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`),
scoreDiffBtLastMonth: item.scoreDiffBtLastMonth,
state: item.scoreDiffBtLastMonth >= 0,
});
if (item.scoreDiffBtLastMonth < 0) {
item.scoreDiffBtLastMonth = Math.abs(item.scoreDiffBtLastMonth);
}
}
}
this.myChart.setOption(this.option);
} else {
this.$message.error(msg);
}
},
initEcharts() {
this.myChart = echarts.init(document.getElementById("myCharts"));
this.myChart.setOption(this.option);
let than = this;
this.myChart.on("click", function (params) {
than.handelClickChart(params.name, params.seriesName);
});
},
handelClickChart(name, seriesName) {
this.$emit("handelClickChart", name, seriesName);
},
getOrgTreeList() {
this.$http
.post("/gov/org/customeragency/agencygridtree", {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
let rowData = res.data.subAgencyList.map((item) => ({
agencyId: item.agencyId,
agencyName: item.agencyName,
subAgencyList: null,
}));
res.data.subAgencyList = rowData;
this.orgOptions = [res.data];
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
handleChangeCascader(val) {
this.formData.agencyId = val[1];
this.getCharts();
},
handleChangePicker() {
this.getCharts();
},
},
components: {},
computed: {},
watch: {},
};
</script>
<style scoped lang="scss">
.cascader {
margin-left: 10px;
}
.content_box {
display: flex;
height: 160px;
margin-top: 10px;
padding: 0 10px;
box-sizing: border-box;
.left {
background: #f7faff;
margin-right: 10px;
min-width: 300px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
padding: 10px;
box-sizing: border-box;
img {
margin-right: 8px;
}
}
img {
width: 50px;
height: 50px;
margin-right: 15px;
}
.left_right,
.right_right {
display: flex;
flex-direction: column;
flex: 1;
:nth-child(1) {
font-size: 18px;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
:nth-child(2) {
font-size: 14px;
font-family: PingFang SC;
color: #666666;
}
}
.right_box {
img {
margin: 0;
width: 10px;
height: 14px;
}
}
.right {
flex: 1;
display: grid;
grid-template-columns: repeat(4, 1fr);
.box {
height: 75px;
margin: 0 10px 10px 0;
.card {
background: #f7faff;
width: 100%;
height: 100%;
display: flex;
align-items: center;
border-radius: 5px;
padding: 20px;
box-sizing: border-box;
}
}
}
}
#myCharts {
width: 1200px;
height: 400px;
}
</style>

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

@ -176,6 +176,7 @@ export default {
...this.formData,
pageNo: this.pageNo,
pageSize: this.pageSize,
agencyId: this.communityId
};
let url = '/governance/satisfaction/communitySelfInsp/inspResult/list'
const { data, code, msg } = await requestGet(url, params)
@ -207,6 +208,10 @@ export default {
seriesName: {
type: String,
default: ''
},
communityId:{
type: String,
default: ''
}
},
//

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

@ -62,7 +62,13 @@
alt="Image"
/>
<div class="left_right">
<div>{{ synthesisScore }}</div>
<div>
{{
synthesisScore < 0
? Math.abs(synthesisScore)
: synthesisScore
}}
</div>
<div>综合得分</div>
</div>
<div class="right_box">
@ -81,9 +87,11 @@
synthesisScoreBtLastMonth != null
"
/>
<span>{{ synthesisScoreBtLastMonth < 0
<span>{{
synthesisScoreBtLastMonth < 0
? Math.abs(synthesisScoreBtLastMonth)
: synthesisScoreBtLastMonth}}</span>
: synthesisScoreBtLastMonth
}}</span>
</div>
<div style="color: #999">较上月</div>
</div>
@ -537,30 +545,97 @@
</div>
</section>
</div>
<div></div>
</div>
</div>
<el-dialog
v-if="showFormList && user.level == 'community'"
v-if="showCommunitDialog"
:visible.sync="showCommunitDialog"
:title="communitDialogTitle"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="1250px"
top="5vh"
class="dialog-h"
@closed="showCommunitDialog = false"
>
<community-dialog
:communityId="communityId"
:period="formData.period"
:satisfaction_category="dicts.satisfaction_category"
@handelClickChart="handelClickChart"
>
</community-dialog>
<el-dialog
v-if="showFormList"
:visible.sync="showFormList"
:close-on-click-modal="false"
:close-on-press-escape="false"
title="社区自查"
:modal-append-to-body="false"
append-to-body
width="820px"
top="5vh"
class="dialog-h"
@closed="showFormList = false"
>
<form-list
@handleClose="handleClose"
@handelDetail="handelDetail"
@handelFollowUpList="handelFollowUpList"
:period="formData.period"
:seriesName="seriesName"
:inspRecordId="inspRecordId"
:communityId="communityId"
></form-list>
<el-dialog
width="920px"
class="dialog-h"
title="社区自查报告详情"
:close-on-click-modal="false"
v-if="showFollowUpDetail"
:visible.sync="showFollowUpDetail"
append-to-body
>
<follow-Detail
:period="formData.period"
:inspResultId="inspResultId"
@handleClose="showFollowUpDetail = false"
></follow-Detail>
</el-dialog>
<el-dialog
width="820px"
class="dialog-h"
title="回访记录"
:close-on-click-modal="false"
v-if="showFollowUpList"
:visible.sync="showFollowUpList"
append-to-body
>
<follow-list :id="inspResultId"></follow-list>
</el-dialog>
</el-dialog>
</el-dialog>
<el-dialog
v-if="showFormList"
:visible.sync="showFormList"
:close-on-click-modal="false"
:close-on-press-escape="false"
title="社区自查"
append-to-body
width="820px"
top="5vh"
class="dialog-h"
@closed="showFormList = false"
>
<form-list
ref="ref_add_form"
@handleClose="handleClose"
:satisfactionCategoryStr="satisfactionCategoryStr"
@handelDetail="handelDetail"
@handelFollowUpList="handelFollowUpList"
:period="formData.period"
:modal-append-to-body="false"
:seriesName="seriesName"
:inspRecordId="inspRecordId"
:communityId="communityId"
></form-list>
<el-dialog
width="920px"
@ -607,10 +682,12 @@ import * as echarts from "echarts";
import formList from "./formList";
import followList from "./followList";
import followDetail from "./followUpDetail";
import communityDialog from "./communityDialog";
import util from "@js/util.js";
export default {
components: { formList, followList, followDetail },
components: { formList, followList, followDetail, communityDialog },
data() {
return {
@ -742,6 +819,9 @@ export default {
total: 0,
pageNo: 1,
pageSize: 20,
showCommunitDialog: false,
communitDialogTitle: "",
communityId: "",
};
},
computed: {
@ -840,9 +920,6 @@ export default {
},
handelClickChart(name, seriesName) {
this.showFormList = true;
this.satisfactionCategoryStr = this.dicts.satisfaction_category.filter(
(item) => item.label == name
)[0].value;
this.seriesName =
seriesName == "满意"
? "veryGood"
@ -970,6 +1047,11 @@ export default {
this.formData = {};
this.initData();
},
handleView(row) {
this.communityId = row.agencyId;
this.showCommunitDialog = true;
this.communitDialogTitle = `${row.agencyName}满意度自查详情`;
},
},
props: {},

Loading…
Cancel
Save