From c12a6cdcbbef8ebcb07db87bbb702b7c4e792815 Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Fri, 17 Sep 2021 23:43:37 +0800
Subject: [PATCH] 改接口
---
src/views/securityUnitOperation/operationAnalysis.vue | 201 +++++++++++++++++++++++++++++++++++--------------
1 files changed, 142 insertions(+), 59 deletions(-)
diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index c50cbfc..b7360e7 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -6,36 +6,26 @@
<div class="rowTitle">
<img src="../../../public/img/bajgxt/u1618.png" />
<span>数据概览</span>
- <el-select
+ <avue-input-tree
class="select1"
- ref="treeForm"
- v-model="node.title"
- placeholder="请选择"
- >
- <el-option style="height: auto;" :value="node">
- <el-tree
- :data="options1"
- default-expand-all
- node-key="id"
- @node-click="handleNodeClick"
- :props="props"
- >
- </el-tree>
- </el-option>
- </el-select>
- <el-select
+ default-expand-all
+ v-model="value1"
+ placeholder="请选择辖区"
+ type="tree"
+ :dic="options1"
+ :props="props"
+ @change="handleNodeClick"
+ ></avue-input-tree>
+ <avue-input-tree
class="select2"
+ default-expand-all
v-model="value2"
- placeholder="请选择"
+ placeholder="请选择公司"
+ type="tree"
+ :dic="options2"
+ :props="props2"
@change="changeCompanys"
- >
- <el-option
- v-for="item in options2"
- :key="item.departmentid"
- :label="item.enterpriseName"
- :value="item.departmentid"
- ></el-option>
- </el-select>
+ ></avue-input-tree>
<el-button @click="toOperationTable">进入数据统计表</el-button>
</div>
@@ -87,8 +77,8 @@
@click="showTable('fw')"
>
<span>服务对象预警(家)</span>
- <span>{{ card.czBaoan }}</span>
- <span>服务对象不多于1家</span>
+ <span>{{ yj.fuwu }}</span>
+ <span>服务对象小于2家</span>
</div>
<div
class="box-card"
@@ -96,8 +86,8 @@
@click="showTable('pq')"
>
<span>派遣预警(家)</span>
- <span>{{ card.kh }}</span>
- <span>派遣比例低于50%</span>
+ <span>{{ yj.paiqian }}</span>
+ <span>派遣率小于50%</span>
</div>
<div
class="box-card"
@@ -105,8 +95,8 @@
@click="showTable('cz')"
>
<span>持证上岗预警(家)</span>
- <span>{{ card.sheb }}</span>
- <span>持证率低于50%</span>
+ <span>{{ yj.chizheng }}</span>
+ <span>持证率小于50%</span>
</div>
</div>
</div>
@@ -171,116 +161,117 @@
<el-table-column :key="gridData.type" type="index"> </el-table-column>
<el-table-column
:key="gridData.type"
- prop="realName"
+ prop="enterprisename"
label="保安公司名称"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="deptName"
+ prop="jurisdictionName"
label="所属辖区"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="sex"
+ prop="znum"
label="服务对象数"
:formatter="sexFormatter"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="cardid"
+ prop="dispatchUnitName"
label="服务单位名称"
:show-overflow-tooltip="true"
></el-table-column>
- <el-table-column
+ <!-- <el-table-column
:key="gridData.type"
prop="age"
label="备注"
:show-overflow-tooltip="true"
width="100"
- ></el-table-column>
+ ></el-table-column> -->
</template>
<template v-if="gridData.type === 'pq'">
<el-table-column :key="gridData.type" type="index"> </el-table-column>
<el-table-column
:key="gridData.type"
- prop="enterpriseName"
+ prop="enterprisename"
label="保安公司名称"
- width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="znum"
+ prop="jurisdictionName"
label="所属辖区"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="cznum"
+ prop="znum"
label="保安总人数"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="czl"
+ prop="cnum"
label="派遣人数"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="sbnum"
+ prop="pnum"
label="派遣比例"
+ :formatter="kslFormatter"
:show-overflow-tooltip="true"
></el-table-column>
- <el-table-column
+ <!-- <el-table-column
:key="gridData.type"
prop="sbl"
label="备注"
:show-overflow-tooltip="true"
- ></el-table-column>
+ ></el-table-column> -->
</template>
<template v-if="gridData.type === 'cz'">
<el-table-column :key="gridData.type" type="index"> </el-table-column>
<el-table-column
:key="gridData.type"
- prop="enterpriseName"
+ prop="enterprisename"
label="保安公司名称"
width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="znum"
+ prop="jurisdictionName"
label="所属辖区"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="cznum"
+ prop="znum"
label="保安总人数"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="painum"
+ prop="cnum"
label="持证人数"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
:key="gridData.type"
- prop="fwnum"
+ prop="pnum"
label="持证比例"
+ :formatter="kslFormatter"
:show-overflow-tooltip="true"
></el-table-column>
- <el-table-column
+ <!-- <el-table-column
:key="gridData.type"
prop="pql"
label="备注"
:show-overflow-tooltip="true"
- ></el-table-column>
+ ></el-table-column> -->
</template>
</el-table>
<el-pagination
@@ -305,7 +296,10 @@
getCompanys,
queryYearKh,
queryYearG,
- selectAge
+ selectAge,
+ getSecurityUnitServerLessPage,
+ getSecurityUnitDispatcherLessPage,
+ getSecurityUnitHoldLessPage
} from "../../api/securityUnitOperation/securityUnitOperation";
export default {
data() {
@@ -328,6 +322,11 @@
addsheb: 0,
baoanPq: 0,
addbaoanPq: 0
+ },
+ yj: {
+ fuwu: 0,
+ paiqian: 0,
+ chizheng: 0
},
options0: [
{
@@ -378,6 +377,11 @@
label: "title",
value: "id"
},
+ props2: {
+ children: "children",
+ label: "enterpriseName",
+ value: "departmentid"
+ },
node: {}, //选中的记录
gridData: {
data: [],
@@ -391,22 +395,39 @@
};
},
methods: {
+ kslFormatter(row) {
+ if (row.pnum && row.pnum !== "0") {
+ return row.pnum + "%";
+ } else {
+ return row.pnum;
+ }
+ },
+ changePage() {
+ this.showcurTable(this.gridData.type);
+ },
showTable(type) {
this.gridData.type = type;
+ this.gridData.current = 1;
+ this.gridData.data = [];
+ this.showcurTable(type);
+ },
+ showcurTable(type) {
this.dialogTableVisible = true;
+ // this.dialogloading = true;
if (type === "fw") {
this.gridData.title = "服务对象预警保安公司";
+ this.getSecurityUnitServerLessPage();
} else if (type === "pq") {
this.gridData.title = "派遣预警保安公司";
+ this.getSecurityUnitDispatcherLessPage();
} else if (type === "cz") {
this.gridData.title = "持证上岗预警保安公司";
+ this.getSecurityUnitHoldLessPage();
}
},
//点击节点
handleNodeClick(data) {
- this.node = data;
- this.value1 = data.id;
- this.$refs.treeForm.blur();
+ this.value1 = data;
this.getCompanys();
},
setAgeEchart() {
@@ -452,7 +473,7 @@
lazyTrees().then(res => {
if (res.data.code === 200) {
this.options1 = res.data.data;
- this.value1 = this.options1[0] ? this.options1[0].id : "";
+ // this.value1 = this.options1[0] ? this.options1[0].id : "";
this.node = this.options1[0];
this.getCompanys();
} else {
@@ -465,7 +486,7 @@
getCompanys({ jurisdiction: this.value1 }).then(res => {
if (res.data.code === 200) {
this.options2 = res.data.data;
- this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
+ // this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
this.enterpriseName = this.options2[0]
? this.options2[0].enterpriseName
: "";
@@ -568,11 +589,70 @@
baoanPq: 0,
addbaoanPq: 0
};
+ this.yj = {
+ fuwu: 0,
+ paiqian: 0,
+ chizheng: 0
+ };
this.ageData = {
qing: 0,
zhong: 0,
lao: 0
};
+ },
+ getSecurityUnitServerLessPage() {
+ let params = {
+ jurisdiction: this.value1,
+ departmentid: this.value2,
+ current: this.gridData.current,
+ size: 10
+ };
+ getSecurityUnitServerLessPage(params).then(res => {
+ if (res.data.code === 200) {
+ this.yj.fuwu = res.data.data.total;
+ this.gridData.data = res.data.data.records;
+ this.gridData.total = res.data.data.total;
+ }
+ if (this.dialogloading) {
+ this.dialogloading = false;
+ }
+ });
+ },
+ getSecurityUnitDispatcherLessPage() {
+ let params = {
+ jurisdiction: this.value1,
+ departmentid: this.value2,
+ current: this.gridData.current,
+ size: 10
+ };
+ getSecurityUnitDispatcherLessPage(params).then(res => {
+ if (res.data.code === 200) {
+ this.yj.paiqian = res.data.data.total;
+ this.gridData.data = res.data.data.records;
+ this.gridData.total = res.data.data.total;
+ }
+ if (this.dialogloading) {
+ this.dialogloading = false;
+ }
+ });
+ },
+ getSecurityUnitHoldLessPage() {
+ let params = {
+ jurisdiction: this.value1,
+ departmentid: this.value2,
+ current: this.gridData.current,
+ size: 10
+ };
+ getSecurityUnitHoldLessPage(params).then(res => {
+ if (res.data.code === 200) {
+ this.yj.chizheng = res.data.data.total;
+ this.gridData.data = res.data.data.records;
+ this.gridData.total = res.data.data.total;
+ }
+ if (this.dialogloading) {
+ this.dialogloading = false;
+ }
+ });
},
changeCompanys() {
this.options2.forEach(item => {
@@ -585,6 +665,9 @@
this.getQueryYearKh();
this.getQueryYearG();
this.setAgeEchart();
+ this.getSecurityUnitServerLessPage();
+ this.getSecurityUnitDispatcherLessPage();
+ this.getSecurityUnitHoldLessPage();
}
},
mounted() {
--
Gitblit v1.9.3