刘翔宇-旅管家 3 years ago
parent 292792ad5c
commit fdb20d52dc

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function list(data) {
return request({
url: '/api/admin/pipeline-build/index',
method: 'get',
params:data
})
}
export function get(id) {
return request({
url: '/api/admin/pipeline-build/show',
method: 'get',
params: { id }
})
}
export function save(data) {
return request({
url: '/api/admin/pipeline-build/save',
method: 'post',
data
})
}
export function store(data) {
return request({
url: '/api/admin/pipeline-build/store',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/pipeline-build/destroy',
method: 'get',
params:{ id }
})
}

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function list(data) {
return request({
url: '/api/admin/equipment/index',
method: 'get',
params:data
})
}
export function get(id) {
return request({
url: '/api/admin/equipment/show',
method: 'get',
params: { id }
})
}
export function save(data) {
return request({
url: '/api/admin/equipment/save',
method: 'post',
data
})
}
export function store(data) {
return request({
url: '/api/admin/equipment/store',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/equipment/destroy',
method: 'get',
params:{ id }
})
}

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function list(data) {
return request({
url: '/api/admin/pipeline-standard/index',
method: 'get',
params:data
})
}
export function get(id) {
return request({
url: '/api/admin/pipeline-standard/show',
method: 'get',
params: { id }
})
}
export function save(data) {
return request({
url: '/api/admin/pipeline-standard/save',
method: 'post',
data
})
}
export function store(data) {
return request({
url: '/api/admin/pipeline-standard/store',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/pipeline-standard/destroy',
method: 'get',
params:{ id }
})
}

@ -20,3 +20,12 @@ export function listCommonuser(params) {
params:params
})
}
export function remoteStatistic(params) {
return request({
url: '/api/admin/other/remot-statistic',
method: 'get',
params:params
})
}

@ -7,3 +7,14 @@ export function indexChart(data) {
params:data
})
}
export function indexNewChart(data) {
return request({
url: '/api/admin/other/statistic-new',
method: 'get',
params:data
})
}

@ -1,42 +1,111 @@
<template>
<div class="dashboard-container">
<div class="app-container" style="background-color: #eff2f9;">
<div class="dashboard-text">当前登陆人: {{ name }}</div>
<el-row :gutter="20">
<el-col :span="16" style="margin-bottom:15px">
<el-col :span="24" style="margin-bottom:15px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>巡查养护统计</span>
<DatePicker :value="select.date" placeholder="选择所属月份" placement="bottom" style="width: 130px;float: right;"
type="month" @on-change="changeMonth"></DatePicker>
<span style="font-size: 14px;">雨水设施总量</span>
<div style="font-size: 10px;color: #999;">{{newtotal.equipment.remark}}</div>
</div>
<div class="text item">
<el-table :data="tableTypeData" class="v-table" :height="300" style="width: 100%">
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsType"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div>{{scope.row[column.field]}}</div>
</template>
<el-table :data="[newtotal.equipment]" class="v-table" style="width: 100%">
<el-table-column prop="end_date" label="截止日期" align="center">
</el-table-column>
<el-table-column prop="inspection_well_total" label="窨井数量" align="center">
</el-table-column>
<el-table-column prop="side_well_total" label="边井数量" align="center">
</el-table-column>
<el-table-column prop="length" label="管网长度" align="center">
</el-table-column>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="8">
<el-col :span="16" style="margin-bottom:15px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>巡查类型分析</span>
<span style="font-size: 14px;">当月巡养运维统计</span>
</div>
<div class="text item">
<pie-chart :chartData="rptChartData"></pie-chart>
<el-row :gutter="20">
<el-col :span="8">
<el-table :data="tableTypeDataNew" class="v-table" style="width: 100%" height="295">
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsTypeNew"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="8">
<div class="text item">
<pie-chart :chartData="rptChartData"></pie-chart>
</div>
</el-col>
<el-col :span="8">
<div class="text item">
<pie-chart :chartData="rptYChartData"></pie-chart>
</div>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
<el-col :span="8" style="margin-bottom:15px;">
<el-col :span="24" style="margin-bottom:10px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">管网建设情况</span>
</div>
<div class="text item">
<el-table :data="[newtotal.pipeline_builds]" class="v-table" style="width: 100%">
<el-table-column prop="year" label="年份" align="center">
</el-table-column>
<el-table-column prop="road_total" label="道路数量" align="center">
</el-table-column>
<el-table-column prop="length_total" label="管网长度" align="center">
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">管网达标情况</span>
</div>
<div class="text item">
<el-table :data="[newtotal.pipeline_standards]" class="v-table" style="width: 100%">
<el-table-column prop="end_date" label="截止日期" align="center">
</el-table-column>
<el-table-column prop="year_1" label="1年以下" align="center">
</el-table-column>
<el-table-column prop="year_1_3" label="1-3年" align="center">
</el-table-column>
<el-table-column prop="year_3_5" label="3-5年" align="center">
</el-table-column>
<el-table-column prop="year_5" label="5年以上" align="center">
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
</el-col>
<el-col :span="16" style="margin-bottom:15px">
<el-col :span="16" style="margin-bottom:15px;" v-if="false">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>片区/单位统计</span>
@ -46,28 +115,16 @@
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsArea"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>养护类型分析</span>
</div>
<div class="text item">
<pie-chart :chartData="rptYChartData"></pie-chart>
</div>
</el-card>
</el-col>
<el-col :span="12" style="margin-bottom:15px">
<el-col :span="12" style="margin-bottom:15px" v-if="false">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>雨管巡查</span>
@ -101,7 +158,7 @@
</el-col>
<el-col :span="12" style="margin-bottom:15px">
<el-col :span="12" style="margin-bottom:15px" v-if="false">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>雨管养护</span>
@ -189,6 +246,25 @@
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<el-card class="box-card">
<div slot="header" class="clearfix" style="display:flex;justify-content:space-between;">
<span>巡养运维月度统计</span>
<el-radio-group v-model="stype" size="mini" @change="changeStype">
<el-radio-button :label="item.value" v-for="(item,index) in stypes">{{item.label}}</el-radio-button>
</el-radio-group>
<el-date-picker v-model="select.year" type="year" value-format="yyyy" placeholder="选择年"
@change="changeYear">
</el-date-picker>
</div>
<div class="text item">
<line-chart :chartData="lineArr" />
</div>
</el-card>
</el-col>
</el-row>
</div>
@ -214,20 +290,63 @@
import PieChart from "./components/PieChart.vue"
import LineChart from "./components/LineChart.vue"
import {
indexChart
indexChart,
indexNewChart
} from '../../api/dashboard/dashboard.js'
export default {
name: 'Dashboard',
components: {
PieChart
PieChart,
LineChart
},
data() {
return {
stypes: [{
value: 0,
label: "巡查"
}, {
value: 1,
label: "养护"
}, {
value: 2,
label: "维修"
}, {
value: 3,
label: "工单"
}],
stype: 0,
lineArr: {
xArr: [],
legendArr: [],
series: [{
name: '',
type: 'line',
stack: 'Total',
data: []
},
{
name: '',
type: 'line',
stack: 'Total',
data: []
},
{
name: '',
type: 'line',
stack: 'Total',
data: []
}
]
},
tableTypeDataNew: [],
newtotal: {},
tableData: [],
rptChartData: [],
rptYChartData:[],
rptChartData: [],
rptYChartData: [],
mainData: [],
comData: [],
dailyData: [],
@ -238,7 +357,8 @@
page_size: 10
},
select: {
date: ""
date: "",
year: "2022"
},
insStatus: ["待审核", "已审核", "已办结", "已退回", "缺陷办结"],
comStatus: ['', "已提交", "已审核", "已办结"],
@ -443,6 +563,43 @@
}
],
columnsTypeNew: [{
field: "typeName",
title: "类型",
type: "string",
width: 60
},
{
field: "total",
title: "上报",
type: "string",
align: "center",
width: 80
},
{
field: "end_type_total",
title: "已办结",
type: "string",
align: "center",
width: 80
},
{
field: "wait_end",
title: "未办结",
type: "string",
align: "center",
width: 80
}
],
legendArr: [
["巡查上报", "巡查办结", "巡查待办"],
["养护上报", "养护办结", "养护待办"],
["维修上报", "维修办结", "维修待办"],
["工单上报", "工单办结", "工单待办"]
]
}
},
computed: {
@ -454,7 +611,7 @@
created() {
this.select.date = this.$moment().format("yyyy-MM")
this.initload()
this.load();
//this.load();
this.indexChart();
},
methods: {
@ -472,12 +629,76 @@
}
},
changeStype(e) {
this.loadTypeLine(e)
},
changeYear(e) {
this.stype = 0;
this.indexChart();
},
initload() {},
loadTypeLine(index) {
this.lineArr.xArr = [];
this.lineArr.legendArr = this.legendArr[index]
this.lineArr.series[0].data = [];
this.lineArr.series[1].data = [];
this.lineArr.series[2].data = [];
let type = ["inspections", "maintain", "repair", "worksheet"][index];
Object.keys(this.newtotal.maintenance_list).map((key, item) => {
this.lineArr.xArr.push(key);
let total = this.newtotal.maintenance_list[key][type].total;
this.lineArr.series[0].data.push(total);
this.lineArr.series[0].name = this.lineArr.legendArr[0];
let end_type_total = this.newtotal.maintenance_list[key][type].end_type_total;
this.lineArr.series[1].data.push(end_type_total);
this.lineArr.series[1].name = this.lineArr.legendArr[1];
let wait_end = this.newtotal.maintenance_list[key][type].wait_end;
this.lineArr.series[2].data.push(wait_end);
this.lineArr.series[2].name = this.lineArr.legendArr[2];
});
},
indexChart() { //
this.tableTypeDataNew = [];
indexNewChart(this.select).then(res => {
this.newtotal = res;
this.tableTypeDataNew.push({
type: "1",
typeName: "巡查",
total: res.maintenance.inspections.total,
end_type_total: res.maintenance.inspections.end_type_total,
wait_end: res.maintenance.inspections.wait_end
})
indexChart(this.select).then(response => {
this.tableTypeDataNew.push({
type: "2",
typeName: "养护",
total: res.maintenance.maintain.total,
end_type_total: res.maintenance.maintain.end_type_total,
wait_end: res.maintenance.maintain.wait_end
})
console.log(response)
this.tableTypeDataNew.push({
type: "3",
typeName: "维修",
total: res.maintenance.repair.total,
end_type_total: res.maintenance.repair.end_type_total,
wait_end: res.maintenance.repair.wait_end
})
this.tableTypeDataNew.push({
type: "4",
typeName: "工单",
total: res.maintenance.worksheet.total,
end_type_total: res.maintenance.worksheet.end_type_total,
wait_end: res.maintenance.worksheet.wait_end
})
this.loadTypeLine(0);
});
indexChart(this.select).then(response => {
this.tableTypeData = response.type_total;
this.tableAreaData = response.area_total;
@ -494,13 +715,12 @@
value: item.total,
name: item.type_name
});
}
else{
_xarr.push(item.type_name);
_yarr.push({
value: item.total,
name: item.type_name
});
} else {
_xarr.push(item.type_name);
_yarr.push({
value: item.total,
name: item.type_name
});
}
})
this.rptYChartData = {
@ -529,6 +749,7 @@
}
if (type == 2) {
url = "/admin/#/rain/maintain/maintain"
}
if (type == 3) {
url = "/admin/#/common/index"
@ -610,7 +831,10 @@
}
</script>
<style lang="scss" scoped>
<style lang="scss" scoped>
#app .main-container{
background: #eff2f9 !important;
}
.dashboard {
&-container {
margin: 30px;

@ -0,0 +1,306 @@
<template>
<div class="container">
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="管网建设情况" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</slot>
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
:label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='format'">
{{scope.row[column.field]?scope.row[column.field].name:""}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
<el-dialog class="common-dialog" title="管网建设情况编辑" :visible.sync="dialogFormVisible" width="40%">
<div class="dialogConcent">
<el-scrollbar style="flex: 1">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row>
<el-col :span="24">
<el-form-item label="年份" prop="year">
<el-date-picker v-model="form.year" value-format="yyyy" type="year" placeholder="请填写年份">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="道路数量" prop="road_total">
<el-input v-model="form.road_total" placeholder="请填写道路数量" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="管网长度" prop="length_total">
<el-input v-model="form.length_total" placeholder="请填写管网长度" autocomplete="off">
<template slot="append">m</template></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form')"></el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import {
list,
get,
store,
save,
del
} from '../../../api/basic/construction.js'
import LxHeader from "@/components/LxHeader/index.vue";
export default {
components: {
LxHeader
},
data() {
return {
tableHeight: 0,
dialogFormVisible: false,
formLabelWidth: "120px",
tableData: [],
tableHeight: 0,
searchFields: {
keyword: ""
},
paginations: {
page: 1,
page_size: 15,
total: 0
},
form: {
year: "",
road_total: "",
length_total: "",
remark: "",
id: ""
},
rules: {
year: [{
required: true,
message: '请选择年份',
trigger: 'change',
}],
road_total: [{
required: true,
message: '请填写道路数量',
trigger: 'blur',
}],
length_total: [{
required: true,
message: '请填写管网长度',
trigger: 'blur',
}],
},
columns: [{
field: "year",
title: "年份",
type: "string",
align: "center",
width:80
},
{
field: "road_total",
title: "道路数量",
type: "string",
align: "center",
width:120
},
{
field: "length_total",
title: "管网长度",
type: "string",
align: "center",
width:120
},
{
field: "remark",
title: "备注",
type: "string",
align: "center"
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center",
width:160
},
{
field: "操作",
title: "操作",
width: 220,
type: "opt",
}
],
}
},
created() {
this.initLoad();
this.load();
},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
list({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.keyword
}).then(response => {
this.tableData = response.data;
this.paginations.total = response.total;
}).catch(error => {
console.log(error)
reject(error)
});
},
info(obj) {
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
// this.$set(that.form,res);
that.form = result;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
var result = Object.assign(this.form, obj)
this.form = result;
}
this.dialogFormVisible = true;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del(obj.id).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
save(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
} else {
store(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
}
} else {
this.$Message.error('数据校验失败');
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
}
}
}
</script>
<style>
.dialogConcent {
overflow-y: auto;
}
.width100 {
width: 100%;
}
</style>

@ -0,0 +1,356 @@
<template>
<div class="container">
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="现有设施情况" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</slot>
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
:label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='format'">
{{scope.row[column.field]?scope.row[column.field].name:""}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
<el-dialog class="common-dialog" title="管网建设情况编辑" :visible.sync="dialogFormVisible" width="40%">
<div class="dialogConcent">
<el-scrollbar style="flex: 1">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row>
<el-col :span="24">
<el-form-item label="截止日期" prop="end_date">
<el-date-picker v-model="form.end_date" type="date" value-format="yyyy-MM-dd" placeholder="请填写截止日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="边井数量" prop="inspection_well_total">
<el-input v-model="form.inspection_well_total" placeholder="请填写边井数量" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="窨井数量" prop="side_well_total">
<el-input v-model="form.side_well_total" placeholder="请填写边井数量" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="管网长度" prop="length">
<el-input v-model="form.length" placeholder="请填写管网长度" autocomplete="off">
<template slot="append">m</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form')"></el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import {
list,
get,
store,
save,
del
} from '../../../api/basic/equipment.js'
import {
remoteStatistic
} from '../../../api/common.js'
import LxHeader from "@/components/LxHeader/index.vue";
export default {
components: {
LxHeader
},
data() {
return {
tableHeight: 0,
dialogFormVisible: false,
formLabelWidth: "120px",
tableData: [],
tableHeight: 0,
searchFields: {
keyword: ""
},
paginations: {
page: 1,
page_size: 15,
total: 0
},
form: {
end_date: "",
inspection_well_total: "",
side_well_total: "",
length: "",
remark: "",
id: ""
},
rules: {
end_date: [{
required: true,
message: '请选择截止日期',
trigger: 'change',
}],
inspection_well_total: [{
required: true,
message: '请填写窨井数量',
trigger: 'blur',
}],
side_well_total: [{
required: true,
message: '请填写边井数量',
trigger: 'blur',
}],
},
columns: [{
field: "end_date",
title: "截止日期",
type: "string",
align: "center",
width: 120
},
{
field: "inspection_well_total",
title: "窨井数量",
type: "string",
align: "center",
width: 120
},
{
field: "side_well_total",
title: "边井数量",
type: "string",
align: "center",
width: 120
},
{
field: "length",
title: "管网长度",
type: "string",
align: "center",
width: 120
},
{
field: "remark",
title: "备注",
type: "string",
align: "left"
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center",
width: 160
},
{
field: "操作",
title: "操作",
width: 220,
type: "opt",
}
],
}
},
created() {
this.initLoad();
this.load();
},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
list({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.keyword
}).then(response => {
this.tableData = response.data;
this.paginations.total = response.total;
}).catch(error => {
console.log(error)
reject(error)
});
},
info(obj) {
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
// this.$set(that.form,res);
that.form = result;
}).catch(error => {
//reject(error)
})
},
loadStatic() {
// //
// "zgg": "387911.35",//
// "zggbjg": "202929.93",//
// //
// "jcj": "18753",//
// "csk": "1083",//
// "yb": "28320",//
// "qtj": "0",//
// "ysbz": "10",//
// "ljbz": "25",//
// //
// "zg": "207525.03", //
// "zggj": "33554",//
// //
// "xqg": "1285575.04",//
// "xqggj": "212757",//
// //
// "ydbq": "75",//
// "wdbq": "149"//
remoteStatistic().then(data => {
let res=data.result;
this.form.length =parseFloat(res.zgg) + parseFloat(res.zggbjg) + parseFloat(res.zg) + parseFloat(res.xqg);
this.form.inspection_well_total =parseInt(res.jcj) + parseInt(res.zggj)+ parseInt(res.xqggj);
this.form.side_well_total = (parseInt(res.csk) + parseInt(res.yb)).toFixed(2);
this.form.remark = "明细:管网主干管的长度:"+res.zgg+",主干管边井管的长度:"+res.zggbjg+",管井检查井的数量:"+res.jcj+",出水口的数量:"+res.csk+",雨篦的数量:"+res.yb+",其他井的数量:"+res.qtj+",雨水泵站的数量:"+res.ysbz+",立交泵站的数量:"+res.ljbz+",支管管网 的长度:"+res.zg+",支管管井的数量:"+res.zggj+",小区管网的长度:"+res.xqg+",小区管井的数量:"+res.xqggj;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
var result = Object.assign(this.form, obj)
this.form = result;
} else {
this.loadStatic()
}
this.dialogFormVisible = true;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del(obj.id).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
save(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
} else {
store(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
}
} else {
this.$Message.error('数据校验失败');
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
}
}
}
</script>
<style>
.dialogConcent {
overflow-y: auto;
}
.width100 {
width: 100%;
}
</style>

@ -0,0 +1,332 @@
<template>
<div class="container">
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="管网达标情况" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</slot>
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
:label="column.title" :width="column.width">
<template slot-scope="scope">
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='format'">
{{scope.row[column.field]?scope.row[column.field].name:""}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
<el-dialog class="common-dialog" title="管网达标情况编辑" :visible.sync="dialogFormVisible" width="40%">
<div class="dialogConcent">
<el-scrollbar style="flex: 1">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row>
<el-col :span="24">
<el-form-item label="截止日期" prop="end_date">
<el-date-picker
v-model="form.end_date"
type="date"
value-format="yyyy-MM-dd"
placeholder="请填写截止日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="1年以下" prop="year_1">
<el-input v-model="form.year_1" placeholder="请填写1年以下" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="1-3年" prop="year_1_3">
<el-input v-model="form.year_1_3" placeholder="请填写1-3年" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="3-5年" prop="year_3_5">
<el-input v-model="form.year_3_5" placeholder="请填写3-5年" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="5年以上" prop="year_5">
<el-input v-model="form.year_5" placeholder="请填写5年以上" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" v-preventReClick @click="submitForm('form')"></el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import {
list,
get,
store,
save,
del
} from '../../../api/basic/standard.js'
import LxHeader from "@/components/LxHeader/index.vue";
export default {
components: {
LxHeader
},
data() {
return {
tableHeight: 0,
dialogFormVisible: false,
formLabelWidth: "120px",
tableData: [],
tableHeight: 0,
searchFields: {
keyword: ""
},
paginations: {
page: 1,
page_size: 15,
total: 0
},
form: {
end_date:"",
year_1:"",
year_1_3:"",
year_3_5:"",
year_5:"",
remark:"",
id:""
},
rules: {
end_date:[{
required: true,
message: '请填写截止日期',
trigger: 'change',
}],
year_1:[{
required: true,
message: '请填写1年以下',
trigger: 'blur',
}],
year_1_3:[{
required: true,
message: '请填写1-3年',
trigger: 'blur',
}],
year_3_5:[{
required: true,
message: '请填写3-5年',
trigger: 'blur',
}],
year_5:[{
required: true,
message: '请填写5年以上',
trigger: 'blur',
}],
},
columns: [{
field: "end_date",
title: "截止日期",
type: "string",
align: "center"
},
{
field: "year_1",
title: "1年以下",
type: "string",
align: "center"
},
{
field: "year_1_3",
title: "1-3年",
type: "string",
align: "center"
},
{
field: "year_3_5",
title: "3-5年",
type: "string",
align: "center"
},
{
field: "year_5",
title: "5年以上",
type: "string",
align: "center"
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center"
},
{
field: "操作",
title: "操作",
width: 220,
type: "opt",
}
],
}
},
created() {
this.initLoad();
this.load();
},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
list({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.keyword
}).then(response => {
this.tableData = response.data;
this.paginations.total = response.total;
}).catch(error => {
console.log(error)
reject(error)
});
},
info(obj) {
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
// this.$set(that.form,res);
that.form = result;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
var result = Object.assign(this.form, obj)
this.form = result;
}
this.dialogFormVisible = true;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del(obj.id).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
save(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
} else {
store(that.form).then(response => {
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
}
} else {
this.$Message.error('数据校验失败');
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
}
}
}
</script>
<style>
.dialogConcent {
overflow-y: auto;
}
.width100{
width:100%;
}
</style>
Loading…
Cancel
Save