master
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 }
|
||||
})
|
||||
}
|
||||
@ -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…
Reference in new issue