lion 3 years ago
parent 15d1502699
commit c8e24b99e9

@ -23,3 +23,12 @@ export function getApplyCharts(params) {
params:params
})
}
export function getChildrenCharts(params) {
return request({
url: '/api/admin/other/childrens',
method: 'get',
params:params
})
}

@ -0,0 +1,10 @@
import request from '@/utils/request'
export function index(params) {
return request({
url: '/api/admin/other/streetlists',
method: 'get',
params:params
})
}

@ -5,17 +5,32 @@
<lx-header icon="md-apps" :text="bookName" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
</div>
<div class="wrap" :style="{'height':mapHeight+'px'}">
<echartsLine v-if="showCharts" ref="echartsLine1" :rotate="60" :color="['#147d38','#333']" :lineDataX='monthX' :lineDataY='monthY'>
</echartsLine>
<div>
年份<el-date-picker v-model="book_year" value-format="yyyy" type="year" @change='getCharts' placeholder="选择年">
</el-date-picker>
</div>
<div style='display: flex;justify-content: space-between;'>
<div class="wrap" :style="{'height':mapHeight+'px','width':chartWidth}">
<echartsLine v-if="showCharts" ref="echartsLine1" :rotate="60" :color="['#147d38','#333']" :lineDataX='monthX'
:lineDataY='monthY'>
</echartsLine>
</div>
<div class='children' v-if="chartWidth=='80%'">
<p>台账总数{{childrenChart.total}}</p>
<p>办理残疾证儿童人数{{childrenChart.number}}</p>
<p>未办理残疾证儿童人数{{childrenChart.empyty_number}}</p>
</div>
</div>
</div>
</template>
<script>
import echartsLine from "@/views/jsc/components/echartsLine.vue";
import {
getBooks
getBooks,
getChildrenCharts
} from "@/api/book.js"
export default {
components: {
@ -25,10 +40,13 @@
return {
bookName: '',
tableNames: '',
mapHeight: 0,
mapHeight: 0,
book_year:'',
monthX: [],
monthY: [],
showCharts:false,
monthY: [],
chartWidth: '100%',
showCharts: false,
childrenChart: {},
tableNameObjs: {
number: 'disabilities',
drug: 'medicines',
@ -40,12 +58,12 @@
raise: 'raises',
cars: 'fuels',
address: 'starts_addresses',
starts: 'starts_subsidys',
reform:'reforms',
train:'trains',
double:'double',
insure:'insures',
cancel:'cancels'
starts: 'starts_subsidys',
reform: 'reforms',
train: 'trains',
double: 'double',
insure: 'insures',
cancel: 'cancels'
},
bookTypeObjs: {
number: '残疾人证统计',
@ -58,12 +76,12 @@
raise: '托养统计',
cars: '燃油补贴统计',
address: '创业租金补贴统计',
starts: '自主创业补贴统计',
reform:'无障碍改造统计',
train:'培训记录统计',
double:'两项补贴统计',
insure:'商业保险统计',
cancel:'死亡注销统计'
starts: '自主创业补贴统计',
reform: '无障碍改造统计',
train: '培训记录统计',
double: '两项补贴统计',
insure: '商业保险统计',
cancel: '死亡注销统计'
}
}
@ -72,17 +90,22 @@
this.initHeight()
if (this.$route.path) {
let path = this.$route.path.split("_")[1]
console.log(path)
for (var k in this.bookTypeObjs) {
if (path == k) {
this.bookName = this.bookTypeObjs[k]
}
}
for (var k in this.tableNameObjs) {
if (path == k) {
this.tableNames = this.tableNameObjs[k]
this.getCharts()
}
}
for (var k in this.tableNameObjs) {
if (path == k) {
this.tableNames = this.tableNameObjs[k]
this.getCharts()
}
}
if (path == 'children') {
this.chartWidth = '80%'
getChildrenCharts().then(res => {
this.childrenChart = res
})
}
}
},
@ -90,17 +113,22 @@
initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
},
async getCharts(){
},
async getCharts() {
this.showCharts = false
const res = await getBooks({
table_name: this.tableNames,
year:this.book_year,
table_name: this.tableNames,
})
for(var m of res){
this.monthX.push(m.month)
this.monthY.push(m.total)
}
this.showCharts = true
}
this.monthX = []
this.monthY = []
for (var m of res) {
this.monthX.push(m.month)
this.monthY.push(m.total)
}
this.showCharts = true
}
},
}
@ -110,4 +138,9 @@
.wrap {
width: 100%;
}
.children {
padding: 20px;
font-size: 18px;
}
</style>

@ -7,7 +7,7 @@
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="搜索" />
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['check'].isShow = true,$refs['check'].type = 'add'">添加</Button> -->

@ -95,12 +95,12 @@ export default {
[this.getEventType(i.edit_input)]: (e) => {
if (i.field==='name' || i.field==='idcard'|| i.field==='number') {
this.openRecords()
this.form = Object.assign({}, this.form);
// this.form = Object.assign({}, this.form);
}else{
this.form[i.field] = e;
}
this.form = Object.assign({}, this.form);
},
},
scopedSlots:

@ -316,7 +316,7 @@ export default {
title: "",
op,
select: {
page: 1,
page: 1,
page_size: 40,
table_name: "",
filter: [

@ -0,0 +1,203 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div>
<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.number="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 class="table-tree">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%; margin-bottom: 20px"
row-key="id" border default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column type="index" align="center"> </el-table-column>
<el-table-column prop="mingcheng" label="名称" sortable>
</el-table-column>
<el-table-column prop="id" label="id" sortable>
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button type="primary" @click="addchildren(scope.row)" size="small" style="margin-left: 10px"
ghost>子级</Button>
<Button type="error" @click="del(scope.row)" size="small" style="margin-left: 10px" ghost>删除</Button>
<Button type="primary" @click="edit(scope.row)" size="small" style="margin-left: 10px" ghost>编辑</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog title="编辑" :visible.sync="dialogFormVisible" width="60%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row>
<el-col :span="12">
<el-form-item label="父级">
<el-input v-model="form.pname" disabled autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="18">
<el-form-item label="名称" prop="mingcheng">
<el-input v-model="form.mingcheng" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
destroy as del,
save,
show
} from "@/api/system/baseForm.js"
import {
index as listStreet
} from "@/api/street.js"
export default {
components: {
LxHeader,
},
created() {
this.initLoad();
this.load();
},
mounted() {},
data() {
return {
dialogFormVisible: false,
formLabelWidth: "120px",
form: {
mingcheng: "",
id: "",
pid: "0",
pname: "金坛区",
},
rules: {
mingcheng: [{
required: true,
message: "请输入名称",
trigger: "blur",
}, ]
},
tableHeight: 0,
//
searchFields: {
tableName: 'streetlists',
page: 1,
page_size: 999,
keyword: ''
},
tableData: [],
list: [],
};
},
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;
},
load() {
var that = this;
listStreet()
.then((response) => {
that.tableData = response;
})
.catch((error) => {
//reject(error)
});
},
edit(obj) {
// this.form.name =
if(obj){
this.form = obj
}
this.dialogFormVisible = true;
},
addchildren(obj) {
this.form = this.$options.data().form;
if (obj) {
this.form.pname = obj.mingcheng;
this.form.pid = obj.id;
this.dialogFormVisible = true;
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
save({
table_name: this.searchFields.tableName,
...that.form
})
.then((response) => {
this.$Message.success("操作成功");
that.dialogFormVisible = false;
that.load();
})
.catch((error) => {
reject(error);
});
} else {
this.$Message.error("数据校验失败");
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
if (formName == "form") that.dialogFormVisible = false;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: "确认要删除数据?",
onOk: () => {
del({
id: obj.id,
table_name: this.searchFields.tableName
})
.then((response) => {
this.$Message.success("操作成功");
that.load();
})
.catch((error) => {
console.log(error);
reject(error);
});
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
},
});
}
},
},
};
</script>
Loading…
Cancel
Save