master
lion 1 year ago
parent c487278833
commit 18dd9cf562

@ -276,13 +276,16 @@ export default {
display: flex;
align-items: center;
padding-right: 80px;
// padding-right: 80px;
padding: 0 60px;
flex-direction: column;
&-label{
padding: 0 20px;
width:100%;
text-align: left;
// padding: 0 20px;
}
&-content{
width:100%;
}
}
.el-form-item{

@ -210,10 +210,6 @@
flex-basis: 100%;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
::v-deep .el-checkbox__input .el-checkbox__inner {
border-radius: 50%;
}

@ -171,7 +171,4 @@
flex-basis: 100%;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
</style>

@ -217,7 +217,4 @@
flex-basis: 100%;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
</style>

@ -130,8 +130,5 @@
::v-deep .name,
::v-deep .sort{
flex-basis: 100%;
}
::v-deep .xy-table-item-content{
width: calc(100% - 140px);
}
</style>

@ -151,8 +151,4 @@
::v-deep .catalog_ids .xy-table-item {
align-items: flex-start;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
</style>

@ -48,7 +48,6 @@
<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('child',scope.row.id,scope.row.name)"></el-button> -->
<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>

@ -414,9 +414,6 @@
align-items: flex-start;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
::v-deep .el-checkbox__input .el-checkbox__inner {
border-radius: 50%;

@ -367,10 +367,6 @@
align-items: flex-start;
}
::v-deep .xy-table-item-content {
width: calc(100% - 140px);
}
::v-deep .el-checkbox__input .el-checkbox__inner {
border-radius: 50%;
}

@ -149,8 +149,5 @@
::v-deep .name,
::v-deep .sort{
flex-basis: 100%;
}
::v-deep .xy-table-item-content{
width: calc(100% - 140px);
}
</style>

@ -0,0 +1,317 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="'数据填报'" :form="form"
:rules='rules' @submit="submit">
<template v-slot:business_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>业务类型
</div>
<div class="xy-table-item-content">
<el-input v-model="business_name" disabled placeholder="请输入业务名称" style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:area_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>填报区域
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" disabled v-model="form.area_id" placeholder="请选择">
<el-option v-for="item in list_areas" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>填报年份
</div>
<div class="xy-table-item-content">
<el-date-picker style="width:100%" format="yyyy" value-format="yyyy" v-model="form.year" type="year"
placeholder="选择年">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:month>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>填报月份
</div>
<div class="xy-table-item-content">
<el-date-picker style="width:100%" format="MM月" value-format="MM" v-model="form.month" type="month" placeholder="选择月">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:id_fill_datas_fill_id_relation>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>数据填报
</div>
<div class="xy-table-item-content">
<!-- <el-button type="primary" style="margin-bottom:10px" size="small" @click="addRow"></el-button> -->
<xy-table style="width:850px" :list="fill_datas" :isPage="false" :height="550"
:table-item="fill_datas_item">
<template v-slot:business_type_id>
<el-table-column align='left' label="业务类别" width="320">
<template slot-scope="scope">
<template v-for="item in list_types">
<div v-if="item.id === scope.row.business_type_id">
{{item.name}}
</div>
</template>
</template>
</el-table-column>
</template>
<template v-slot:business_data_id>
<el-table-column align='left' label="业务数据" width="320">
<template slot-scope="scope">
<template v-for="item in list_datas">
<div v-if="item.id === scope.row.business_data_id">
{{item.name}}
</div>
</template>
</template>
</el-table-column>
</template>
<template v-slot:value>
<el-table-column align='left' label="数据值" width="160">
<template slot-scope="scope">
<el-input v-model="scope.row.value" style="width:100%"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
index,
destroy
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
stateObj: {},
business_name: '', //
business_id: '', // id
area_id: '',
table_name: 'fills',
list_areas: [],
list_types: [],
list_datas: [],
//
fill_datas:[],
fill_datas_item: [{
type: 'index',
width: 50,
}, {
prop: 'business_type_id',
label: '填报类别',
align: 'left',
width: 620
}, {
prop: 'business_data_id',
label: '填报数据',
align: 'left',
width: 620
}, {
prop: 'value',
label: '填报值',
align: 'left',
width: 620
}],
form: {
business_id: '',
area_id: '',
year: '',
month: '',
id_fill_datas_fill_id_relation: []
},
rules: {
year: [{
required: true,
message: '请选择年份'
}],
month: [{
required: true,
message: '请选择月份'
}]
}
}
},
created() {
this.stateObj = state.state
},
methods: {
//
setBusinessId(id){
this.form.business_id = id
},
async getBusiness() {
const res = await show({
id: this.business_id,
table_name: 'businesses',
json_data_fields: ['area_ids'],
})
this.business_name = res.name
this.list_areas = res.area_ids_details ? res.area_ids_details : []
this.list_types = res.id_business_types_business_id_relation ? res.id_business_types_business_id_relation : []
this.list_datas = res.id_business_datas_business_id_relation ? res.id_business_datas_business_id_relation : []
//
if(this.type==='add'){
this.form.area_id = this.stateObj.area_id ? this.stateObj.area_id : ''
let _arr = []
this.list_types.map(item=>{
this.list_datas.map(item1=>{
if(item.area_id===this.stateObj.area_id){
_arr.push({
business_id: this.business_id,
year: this.$moment(new Date()).format("YYYY"),
month: this.$moment(new Date()).format("MM"),
area_id: this.area_id,
business_type_id: item.id,
business_data_id: item1.id,
value: 0
})
}
})
})
console.log("_arr",_arr)
this.fill_datas = _arr
}
},
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
this.fill_datas.map(item=>{
item.year = this.form.year
item.month = this.form.month
item.area_id = this.form.area_id
})
this.form.id_fill_datas_fill_id_relation = this.fill_datas
console.log("this.form", this.form)
// return
// //
// if (this.form.id_fill_datas_fill_id_relation.length > 0) {
// //
// for (var p of this.form.id_fill_datas_fill_id_relation) {
// if (this.base.isNull(p.business_type_id)) {
// this.$message({
// type: 'warning',
// message: ``
// })
// return
// }
// if (this.base.isNull(p.business_data_id)) {
// this.$message({
// type: 'warning',
// message: ``
// })
// return
// }
// }
// }
// return
save({
table_name: this.table_name,
...this.form
}).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增成功' : '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
table_name: this.table_name,
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.business_id = res.business_id
this.form.area_id = res.area_id ? res.area_id : [],
this.form.id_fill_datas_fill_id_relation = res.id_fill_datas_fill_id_relation ? res
.id_fill_datas_fill_id_relation : []
this.fill_datas = this.form.id_fill_datas_fill_id_relation
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.getBusiness()
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.year = this.$moment(new Date).format("YYYY")
this.form.month = this.$moment(new Date).format("MM")
}
} else {
this.id = ''
this.business_id = ''
this.business_name = ''
this.type = "add"
this.form = {
business_id: '',
area_id: '',
year: '',
month: '',
id_fill_datas_fill_id_relation: []
}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
// ::v-deep .area_ids,
// ::v-deep .name{
// flex-basis: 100%;
// }
</style>

@ -0,0 +1,329 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增业务类型' : '编辑业务类型'"
:form="form" :rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>业务名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入业务名称" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:area_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>填报区域
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.area_ids" multiple collapse-tags
placeholder="请选择">
<el-option v-for="item in list_areas" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:id_business_types_business_id_relation>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>业务类别
</div>
<div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addRow"></el-button>
<xy-table style="width:850px" :list="form.id_business_types_business_id_relation" :isPage="false" :height="350"
:table-item="business_types_item">
<template v-slot:name>
<el-table-column align='left' label="类别名称" width="340">
<template slot-scope="scope">
<el-input placeholder="请输入类别名称" style="width:100%" v-model="scope.row.name"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:area_id>
<el-table-column align='left' label="所属区域" width="340">
<template slot-scope="scope">
<el-select style="width:100%"
v-model="scope.row.area_id" placeholder="请选择所属区域">
<el-option v-for="(item,index) in list_areas" :key="index" :label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="120" header-align="center">
<template slot-scope="scope">
<el-popconfirm style="margin:0 10px"
@confirm="delRow(scope.$index,scope.row.id)" title="确认删除该项业务类别?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</template>
<template v-slot:id_business_datas_business_id_relation>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>业务填报数据
</div>
<div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addDataRow"></el-button>
<xy-table style="width:850px" :list="form.id_business_datas_business_id_relation" :isPage="false" :height="350"
:table-item="business_datas_item">
<template v-slot:name>
<el-table-column align='left' label="填报数据名称" width="680">
<template slot-scope="scope">
<el-input placeholder="请输入填报数据名称" style="width:100%" v-model="scope.row.name"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="120" header-align="center">
<template slot-scope="scope">
<el-popconfirm style="margin:0 10px"
@confirm="delDataRow(scope.$index,scope.row.id)" title="确认删除该项业务填报数据?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
index,
destroy
} from "@/api/system/baseForm.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
table_name: 'businesses',
list_areas: [],
//
business_types_item:[{
type: 'index',
width: 50,
}, {
prop: 'name',
label: '类别名称',
align: 'left',
width: 620
}, {
prop: 'area_id',
label: '所属区域',
align: 'left',
width: 620
}],
//
business_datas_item:[{
type: 'index',
width: 50,
}, {
prop: 'name',
label: '数据名称',
align: 'left',
width: 620
}],
form: {
name: '',
area_ids: [],
id_business_types_business_id_relation:[],
id_business_datas_business_id_relation:[]
},
rules: {
name: [{
required: true,
message: '请输入业务名称'
}],
area_ids: [{
required: true,
message: '请选择填报区域'
}]
}
}
},
created() {
this.getAreaList()
},
methods: {
async getAreaList() {
const res = await index({
page_size: 999,
page: 1,
table_name: 'areas',
sort_type:'ASC',
sort_name:'sort',
})
this.list_areas = res.data
},
addRow() {
this.form.id_business_types_business_id_relation.push({
name:'',
area_id:''
})
},
delRow(index,id) {
if(id){
destroy({
id: id,
table_name: 'business_types'
}).then(response => {
this.form.id_business_types_business_id_relation.splice(index, 1)
}).catch(error => {
console.log(error)
reject(error)
})
}else{
this.form.id_business_types_business_id_relation.splice(index, 1)
}
},
addDataRow() {
this.form.id_business_datas_business_id_relation.push({
name:''
})
},
delDataRow(index,id) {
if(id){
destroy({
id: id,
table_name: 'business_datas'
}).then(response => {
this.form.id_business_datas_business_id_relation.splice(index, 1)
}).catch(error => {
console.log(error)
reject(error)
})
}else{
this.form.id_business_datas_business_id_relation.splice(index, 1)
}
},
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
console.log("this.form", this.form)
//
if (this.form.id_business_types_business_id_relation.length > 0) {
//
for (var p of this.form.id_business_types_business_id_relation) {
if (this.base.isNull(p.name)) {
this.$message({
type: 'warning',
message: `业务类别名称不能为空`
})
return
}
if (this.base.isNull(p.area_id)) {
this.$message({
type: 'warning',
message: `请选择业务类别所属区域`
})
return
}
}
}
//
if (this.form.id_business_datas_business_id_relation.length > 0) {
//
for (var p of this.form.id_business_datas_business_id_relation) {
if (this.base.isNull(p.name)) {
this.$message({
type: 'warning',
message: `业务填报数据名称不能为空`
})
return
}
}
}
// return
save({
table_name: this.table_name,
...this.form
}).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增成功' : '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
table_name: this.table_name,
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.area_ids = res.area_ids ? res.area_ids : [],
this.form.id_business_types_business_id_relation = res.id_business_types_business_id_relation?res.id_business_types_business_id_relation:[]
this.form.id_business_datas_business_id_relation = res.id_business_datas_business_id_relation?res.id_business_datas_business_id_relation:[]
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = "add"
this.list_areas = []
this.form = {
name: '',
area_ids: [],
id_business_types_business_id_relation:[],
id_business_datas_business_id_relation:[]
}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
// ::v-deep .area_ids,
// ::v-deep .name{
// flex-basis: 100%;
// }
</style>

@ -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…
Cancel
Save