master
loveflow 11 months ago
parent 5d17a45beb
commit 48a926702c

@ -16,6 +16,6 @@ window.$SYSTEMCONFIG = {
}; };
window.$SERVICE = { window.$SERVICE = {
BASEURL:"http://1.94.45.26:10004/zhapi" BASEURL:"http://121.41.91.94:8080/zhapi"
//BASEURL: "http://1.94.45.26:10006/zhapi", //后端服务地址 //BASEURL: "http://1.94.45.26:10006/zhapi", //后端服务地址
}; };

@ -47,3 +47,19 @@ export function CompanySum(params) {
params, params,
}); });
} }
//企业详情风险整改信息
export function RectificationInformation(params) {
return request({
url: "/tbRectificationOfAProblem/RectificationInformation",
method: "post",
params,
});
}
//企业详情分数类型
export function CompanyDetails(params) {
return request({
url: "/tbRectificationOfAProblem/CompanyDetails",
method: "post",
params,
});
}

@ -88,11 +88,11 @@ export function TaskTemplateList(params) {
}); });
} }
//处置方式管理-删除 //处置方式管理-删除
export function DispositionRemove(params) { export function DispositionRemove(data) {
return request({ return request({
url: "/tbRulesSetting/DispositionRemove", url: "/tbRulesSetting/DispositionRemove",
method: "post", method: "post",
params, data,
}); });
} }
//处置方式管理-任务单新增 //处置方式管理-任务单新增

@ -28,6 +28,16 @@ export function groupByReduce(arr, property, perty) {
return acc; return acc;
}, {}); }, {});
} }
//归类-求和
export function groupSum(list, property, perty) {
return list.reduce((acc, item) => {
if (!acc[item[property]]) {
acc[item[property]] = 0;
}
acc[item[property]] += item[perty];
return acc;
}, {});
}
//list根据属性去重 //list根据属性去重
export function uniqueByProperty(arr, prop) { export function uniqueByProperty(arr, prop) {

@ -47,9 +47,9 @@ export default {
this.option = { this.option = {
grid: { grid: {
left: "14", left: "5%",
top: "5%", // top: "5%", //
right: "0", right: "5%",
bottom: "0", bottom: "0",
}, },
xAxis: { xAxis: {

@ -7,11 +7,8 @@
let bgImg = require("@/assets/images/team/gauge.png"); let bgImg = require("@/assets/images/team/gauge.png");
export default { export default {
props: { props: {
chartObj: { riskScore: {
type: Object, type: [Number, String],
default: () => {
return {};
},
}, },
}, },
data() { data() {
@ -24,28 +21,6 @@ export default {
}, },
methods: { methods: {
setOption() { setOption() {
let dataList = this.chartObj.data;
let maxArr = [];
let maxValue = 0;
let xData = [];
let yData = [];
let total = 0;
dataList.forEach((item) => {
xData.push(item.name);
yData.push(item.value);
if (maxValue < item.value) {
maxValue = item.value;
}
});
dataList.forEach((item) => {
maxArr.push(maxValue);
total = total + item.value;
});
if (!total) {
total = 1;
}
this.option = { this.option = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -75,7 +50,7 @@ export default {
type: "bar", type: "bar",
data: [ data: [
{ {
value: 80, value: parseInt(this.riskScore),
itemStyle: { itemStyle: {
//color: "rgba(35, 176, 176, 1)", //color: "rgba(35, 176, 176, 1)",
shadowColor: "rgba(35, 176, 176, 0.5)", shadowColor: "rgba(35, 176, 176, 0.5)",
@ -180,7 +155,7 @@ export default {
}, },
data: [ data: [
{ {
value: 80, value: parseInt(this.riskScore),
name: "", name: "",
}, },
], ],
@ -266,7 +241,7 @@ export default {
}, },
}, },
watch: { watch: {
chartObj: { riskScore: {
handler(newval) { handler(newval) {
this.setOption(); this.setOption();
}, },

@ -96,12 +96,12 @@
</div> </div>
<div class="zgBody zgGaugeBody" v-if="chartType == 'gauge'"> <div class="zgBody zgGaugeBody" v-if="chartType == 'gauge'">
<div class="topWrap"> <div class="topWrap">
<div class="label">民爆</div> <div class="label" v-for="item in companyTypes" :key="item">
<div class="label">易制毒</div> {{ item }}
<div class="label">重点消防单位</div> </div>
</div> </div>
<div class="midWrap canvasDefault"> <div class="midWrap canvasDefault">
<gaugeWrap :chartObj="qyObj"></gaugeWrap> <gaugeWrap :riskScore="riskScore"></gaugeWrap>
</div> </div>
<div class="btmWrap"> <div class="btmWrap">
<div class="tableWrap"> <div class="tableWrap">
@ -147,8 +147,10 @@ import {
CompanySumList, CompanySumList,
RectificationOverview, RectificationOverview,
CompanySum, CompanySum,
RectificationInformation,
CompanyDetails,
} from "@/api/enterpriseTeamWork/problemRectify/index.js"; } from "@/api/enterpriseTeamWork/problemRectify/index.js";
import { groupByReduce } from "@/loveflow/util.js"; import { groupSum } from "@/loveflow/util.js";
export default { export default {
components: { screenMain, barWrap, gaugeWrap, pieWrap, mapWrap }, components: { screenMain, barWrap, gaugeWrap, pieWrap, mapWrap },
mixins: [tableListMixins, commonMixins], mixins: [tableListMixins, commonMixins],
@ -175,12 +177,12 @@ export default {
}, },
{ {
// slot: "riskSlot", // slot: "riskSlot",
prop: "abarbeitungStatus", prop: "riskType",
label: "扣分项", label: "扣分项",
}, },
{ {
//slot: "ysSlot", //slot: "ysSlot",
prop: "changeContent", prop: "factorAnomalyDetail",
label: "要素异常信息", label: "要素异常信息",
}, },
], ],
@ -190,15 +192,17 @@ export default {
timeValue: "", timeValue: "",
title: "各区域整改企业数量", title: "各区域整改企业数量",
companyList: [], companyList: [],
url: {
list: "/tbRectificationOfAProblem/RectificationOfAProblemListDetails",
},
pieObj: { pieObj: {
total: 0, total: 0,
color: ["#2B82F3", "#66C3FF", "#E4FEF0", "#FF745A", "#FEF699"], color: ["#2B82F3", "#66C3FF", "#E4FEF0", "#FF745A", "#FEF699"],
data: [], data: [],
name: "总数", name: "总数",
}, },
url: {
list: "/tbRectificationOfAProblem/RectificationInformation",
},
riskScore: 0,
companyTypes: [],
}; };
}, },
mounted() { mounted() {
@ -235,13 +239,17 @@ export default {
RectificationOverview().then((res) => { RectificationOverview().then((res) => {
if (res.code == 200) { if (res.code == 200) {
let data = res.data || []; let data = res.data || [];
let temp = groupSum(data, "area", "count");
this.qyObj.data = []; this.qyObj.data = [];
for (let i = 0; i < data.length; i++) {
Object.keys(temp).forEach((key) => {
this.qyObj.data.push({ this.qyObj.data.push({
name: data[i]["area"], name: key,
value: data[i]["count"], value: temp[key],
}); });
} });
} }
}); });
CompanySum().then((res) => { CompanySum().then((res) => {
@ -268,36 +276,27 @@ export default {
this.searchParam.endTime = year + "-" + month + "-" + day + " 23:59:59"; this.searchParam.endTime = year + "-" + month + "-" + day + " 23:59:59";
this.getOverList(); this.getOverList();
}, },
//
changeChart(val) { changeChart(val) {
this.getOverList(); this.getOverList();
}, },
areaChange(val) { areaChange(val) {
this.chartType = "pie"; this.chartType = "pie";
OverviewList(this.searchParam).then((res) => { RectificationOverview({ area: val }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let data = res.data || []; let data = res.data || [];
/* let obj = groupByReduce(data, "companyId"); /* let obj = groupSum(data, "companyId");
console.log(this.companyList); */ console.log(this.companyList); */
this.pieObj.data = []; this.pieObj.data = [];
this.pieObj.data.push( let total = 0;
{ for (let i = 0; i < data.length; i++) {
name: "未按要求整改", this.pieObj.data.push({
value: 2, name: data[i]["abarbeitung_status"],
}, value: data[i]["count"],
{ });
name: "整改中", total += data[i]["count"];
value: 12, }
}, this.pieObj.total = total;
{
name: "按照要求整改",
value: 21,
},
{
name: "已整改",
value: 31,
}
);
this.pieObj.total = data.length;
} }
}); });
}, },
@ -321,8 +320,19 @@ export default {
console.log(obj); console.log(obj);
this.title = obj.companyName; this.title = obj.companyName;
this.chartType = "gauge"; this.chartType = "gauge";
this.queryParam.companyName = obj.companyName; if (obj.companyId) {
this.searchQuery(); this.queryParam.companyId = obj.companyId;
this.searchQuery();
CompanyDetails({ companyId: obj.companyId }).then((res) => {
if (res.code == 200) {
let data = res.data || {};
this.companyTypes = data.companyTypes;
this.riskScore = data.RiskScore;
}
});
}
}, },
mapClick(e) { mapClick(e) {
console.log(e); console.log(e);

@ -45,7 +45,7 @@ export default {
}, },
}, },
{ {
value: 4, value: 2,
name: "", name: "",
itemStyle: { itemStyle: {
normal: { normal: {

@ -372,11 +372,11 @@ export default {
label: "纳入监管次数", label: "纳入监管次数",
}, },
{ {
prop: "total", prop: "rectificationNoNum",
label: "连续未整改次数", label: "连续未整改次数",
}, },
{ {
prop: "risk", prop: "controlDeductionItem",
//slot: "riskSlot", //slot: "riskSlot",
label: "未整改项", label: "未整改项",
}, },

@ -231,7 +231,13 @@ export default {
}, },
del() { del() {
console.log(this.delArr); console.log(this.delArr);
DispositionRemove(this.delArr).then((res) => { let list = [];
for (let i = 0; i < this.delArr.length; i++) {
list.push({
id: this.delArr[i],
});
}
DispositionRemove(list).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",

Loading…
Cancel
Save