master
parent
c487278833
commit
18dd9cf562
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-input v-model="select.name" placeholder="请输入名称"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-button type="primary" size="small" @click="editIndex('add')">新增</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:area_ids>
|
||||
<el-table-column align='left' label="填报区域" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.area_ids_details && scope.row.area_ids_details.length>0">
|
||||
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.area_ids_details">
|
||||
{{item.name}}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' label="操作" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small" @click="editIndex('add',scope.row.id)">数据填报</el-button>
|
||||
<el-button type="primary" size="small" @click="goData(scope.row.id)">填报查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-fill ref="addFill" @refresh="getList"></add-fill>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addFill from './components/addFill.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addFill
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'businesses',
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
},
|
||||
total: 0,
|
||||
list: [],
|
||||
table_item: [{
|
||||
type: 'index',
|
||||
width: 50
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: '业务名称',
|
||||
align: 'left',
|
||||
}, {
|
||||
prop: 'area_ids',
|
||||
label: '所属区域',
|
||||
align: 'left',
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
goData(id){
|
||||
this.$router.push({ path: '/report/filldata', query: { id: id } })
|
||||
},
|
||||
editIndex(type, id) {
|
||||
if (type == 'add') {
|
||||
this.$refs.addFill.setBusinessId(id)
|
||||
this.$refs.addFill.business_id = id
|
||||
}
|
||||
this.$refs.addFill.type = type
|
||||
this.$refs.addFill.isShow = true
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
table_name: this.select.table_name,
|
||||
json_data_fields: ['area_ids'],
|
||||
filter: [{
|
||||
"key": "name",
|
||||
"op": "like",
|
||||
"value": this.select.name
|
||||
}],
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-select style="width:100%" clearable v-model="select.business_id" placeholder="请选择业务">
|
||||
<el-option v-for="item in list_bus" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-date-picker style="width:100%" format="yyyy" value-format="yyyy" v-model="select.year" type="year"
|
||||
placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div>
|
||||
<el-date-picker style="width:100%" format="MM月" value-format="MM" v-model="select.month" type="month" placeholder="选择月份">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-button type="primary" size="small" @click="editIndex('add')">新增</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:month>
|
||||
<el-table-column align='center' width="120" label="填报月份" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
{{monthArr[parseInt(scope.row.month)-1]}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:business_id>
|
||||
<el-table-column align='center' width="360" label="填报业务" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.business_id_details && scope.row.business_id_details.length>0">
|
||||
<el-tag>{{scope.row.business_id_details[0]['name']}}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:area_id>
|
||||
<el-table-column align='center' width="240" label="填报区域" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.area_id_details && scope.row.area_id_details.length>0">
|
||||
<el-tag>{{scope.row.area_id_details[0]['name']}}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:fill_data>
|
||||
<el-table-column align='center' label="填报数据" width="600" header-align="center">
|
||||
<el-table-column align='center' label="业务类别" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<template
|
||||
v-if="scope.row.id_fill_datas_fill_id_relation && scope.row.id_fill_datas_fill_id_relation.length>0">
|
||||
<template v-for="item in scope.row.id_fill_datas_fill_id_relation">
|
||||
<div class="product-item">{{item.business_type_id}}</div>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align='center' label="填报数据" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<template
|
||||
v-if="scope.row.id_fill_datas_fill_id_relation && scope.row.id_fill_datas_fill_id_relation.length>0">
|
||||
<template v-for="item in scope.row.id_fill_datas_fill_id_relation">
|
||||
<div class="product-item">{{item.business_data_id}}</div>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align='center' label="数据值" width="120" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<template
|
||||
v-if="scope.row.id_fill_datas_fill_id_relation && scope.row.id_fill_datas_fill_id_relation.length>0">
|
||||
<template v-for="item in scope.row.id_fill_datas_fill_id_relation">
|
||||
<div class="product-item">{{item.value}}</div>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' fixed="right" label="操作" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small"
|
||||
@click="editIndex('editor',scope.row.id,scope.row.business_id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-fill ref="addFill" @refresh="getList"></add-fill>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addFill from './components/addFill.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addFill
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'fills',
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
business_id: '',
|
||||
year:'',
|
||||
month:''
|
||||
},
|
||||
list_bus: [],
|
||||
monthArr: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
total: 0,
|
||||
list: [],
|
||||
table_item: [{
|
||||
type: 'index',
|
||||
width: 50,
|
||||
fixed: 'left'
|
||||
}, {
|
||||
prop: 'year',
|
||||
label: '填报年份',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
prop: 'month',
|
||||
label: '填报月份',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
prop: 'business_id',
|
||||
label: '填报业务',
|
||||
align: 'center',
|
||||
width: 360,
|
||||
}, {
|
||||
prop: 'area_id',
|
||||
label: '填报区域',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
prop: 'fill_data',
|
||||
label: '填报数据',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
prop: 'admin.name',
|
||||
label: '填报人',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
|
||||
prop: 'created_at',
|
||||
label: '填报时间',
|
||||
align: 'center',
|
||||
width: 180
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.$route.query.id) {
|
||||
this.select.business_id = parseInt(this.$route.query.id)
|
||||
}
|
||||
this.getBusinessList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getBusinessList() {
|
||||
const res = await index({
|
||||
page_size: 999,
|
||||
page: 1,
|
||||
table_name: 'businesses',
|
||||
})
|
||||
this.list_bus = res.data
|
||||
},
|
||||
editIndex(type, id, business_id) {
|
||||
if (type == 'editor') {
|
||||
this.$refs.addFill.id = id
|
||||
this.$refs.addFill.setBusinessId(business_id)
|
||||
this.$refs.addFill.business_id = business_id
|
||||
}
|
||||
this.$refs.addFill.type = type
|
||||
this.$refs.addFill.isShow = true
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
table_name: this.select.table_name,
|
||||
json_data_fields: ['area_id', 'business_id'],
|
||||
filter: [{
|
||||
"key": "business_id",
|
||||
"op": "eq",
|
||||
"value": this.select.business_id ? this.select.business_id : ''
|
||||
},{
|
||||
"key": "year",
|
||||
"op": "eq",
|
||||
"value": this.select.year ? this.select.year : ''
|
||||
},{
|
||||
"key": "month",
|
||||
"op": "eq",
|
||||
"value": this.select.month ? this.select.month : ''
|
||||
}],
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .product-item {
|
||||
margin: 0 -10px;
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
::v-deep .el-table td.el-table__cell div .product-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-input v-model="select.name" placeholder="请输入名称"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="editIndex('add')">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:area_ids>
|
||||
<el-table-column align='left' label="填报区域" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.area_ids_details && scope.row.area_ids_details.length>0">
|
||||
<el-tag style="margin-right:5px;margin-bottom:5px" v-for="item in scope.row.area_ids_details">
|
||||
{{item.name}}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' label="操作" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-index ref="addIndex" @refresh="getList"></add-index>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addIndex from './components/addIndex.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addIndex
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'businesses',
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
},
|
||||
total: 0,
|
||||
list: [],
|
||||
table_item: [{
|
||||
type: 'index',
|
||||
width: 50
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: '业务名称',
|
||||
align: 'left',
|
||||
}, {
|
||||
prop: 'area_ids',
|
||||
label: '所属区域',
|
||||
align: 'left',
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
editIndex(type, id, pName) {
|
||||
if (type == 'editor') {
|
||||
this.$refs.addIndex.id = id
|
||||
}
|
||||
this.$refs.addIndex.type = type
|
||||
this.$refs.addIndex.isShow = true
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
table_name: this.select.table_name,
|
||||
json_data_fields: ['area_ids'],
|
||||
filter: [{
|
||||
"key": "name",
|
||||
"op": "like",
|
||||
"value": this.select.name
|
||||
}],
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue