master
lion 12 months ago
parent 33c445e75f
commit e85f0b1a19

@ -100,7 +100,7 @@
</div>
<div class="catalog_right" v-else>
<xy-table @getHeight="initHeight" :defaultExpandAll='false' :isPage="false" rowKey="id" :list="list"
<xy-table @getHeight="initHeight" @cell-dblclick="dbclick" :defaultExpandAll='false' :isPage="false" rowKey="id" :list="list"
:table-item="table_item">
<template v-slot:catalog_name>
<el-table-column align='center' label="所属目录" width="240" header-align="center">
@ -559,7 +559,10 @@
},
dbclick(row, column, cell, event){
console.log("row",row)
this.editIndex("editor",row.row.id)
},
editIndex(type, id) {
if (type == 'editor') {
this.$refs.addRecord.id = id

@ -18,7 +18,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>填报区域
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" @change="changeArea" :disabled="(stateObj.is_admin && type==='add')?false:true" v-model="form.area_id" placeholder="请选择">
<el-select style="width:100%" @change="changeArea" :disabled="(stateObj.is_admin)?false:true" 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>
@ -31,7 +31,7 @@
<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"
<el-date-picker style="width:100%" @change="changeYear" format="yyyy" value-format="yyyy" v-model="form.year" type="year"
placeholder="选择年">
</el-date-picker>
</div>
@ -48,7 +48,21 @@
</div>
</div>
</template>
<template v-slot:year_datas v-if="form.year_datas.length>0">
<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">
<xy-table style="width:850px" :list="form.year_datas" :isPage="false" :height="150"
:table-item="year_datas_item">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</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">
@ -127,7 +141,38 @@
list_areas: [],
list_types: [],
list_datas: [],
year_datas:[],
year_datas_item:[{
prop: 'year',
label: '年份',
align: 'center',
width: 100
},{
prop: 'all_year',
label: '年度总预算',
align: 'center',
width: 150
},{
prop: 'quarter_1',
label: '第一季度预算',
align: 'center',
width: 150
},{
prop: 'quarter_2',
label: '第二季度预算',
align: 'center',
width: 150
},{
prop: 'quarter_3',
label: '第三季度预算',
align: 'center',
width: 150
},{
prop: 'quarter_4',
label: '第四季度预算',
align: 'center',
width: 150
}],
//
fill_datas:[],
fill_datas_item: [{
@ -153,7 +198,8 @@
business_id: '',
area_id: '',
year: '',
month: '',
month: '',
year_datas:[],
id_fill_datas_fill_id_relation: []
},
rules: {
@ -194,7 +240,14 @@
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(res.id_business_datas_business_id_relation){
this.list_datas = res.id_business_datas_business_id_relation.sort((a, b) => parseInt(a.sort) - parseInt(b.sort))
}
// this.list_datas = res.id_business_datas_business_id_relation ? res.id_business_datas_business_id_relation : []
//
this.year_datas = res.id_budgets_business_id_relation
this.form.year_datas = res.id_budgets_business_id_relation.filter(item=>{return item.area_id===this.form.area_id && item.year==this.form.year})
//
if(this.type==='add'){
this.form.area_id = this.stateObj.area_id ? this.stateObj.area_id : ''
@ -210,15 +263,22 @@
area_id: this.area_id,
business_type_id: item.id,
business_data_id: item1.id,
value: 0
value: 0,
sort:item1.sort
})
}
})
})
console.log("_arr",_arr)
this.fill_datas = _arr
this.fill_datas = _arr.sort()
}
},
changeYear(e){
//
console.log(e,this.year_datas)
this.form.year_datas = this.year_datas.filter(item=>{return item.area_id===this.form.area_id && item.year==e})
},
changeArea(e){
this.form.area_id = e ? e : ''
let _arr = []
@ -232,12 +292,16 @@
area_id: e,
business_type_id: item.id,
business_data_id: item1.id,
value: 0
value: 0,
sort:item1.sort
})
}
})
})
this.fill_datas = _arr
this.form.year_datas = this.year_datas.filter(item=>{return item.area_id === e && item.year===this.form.year})
console.log("this.form.year_datas",e,this.year_datas,this.form.year_datas)
},
@ -301,7 +365,6 @@
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
})
},
},
@ -318,13 +381,18 @@
} else {
this.id = ''
this.business_id = ''
this.business_name = ''
this.business_name = ''
this.list_areas = []
this.list_types = []
this.list_datas = []
this.year_datas = []
this.type = "add"
this.form = {
business_id: '',
area_id: '',
year: '',
month: '',
month: '',
year_datas:[],
id_fill_datas_fill_id_relation: []
}
this.$refs['dialog'].reset()

@ -85,6 +85,13 @@
</template>
</el-table-column>
</template>
<!-- <template v-slot:sort>
<el-table-column align='center' label="排序" width="100">
<template slot-scope="scope">
<el-input placeholder="请输入排序" style="width:100%" v-model="scope.row.sort"></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">
@ -147,7 +154,7 @@
prop: 'name',
label: '数据名称',
align: 'left',
width: 620
width: 630
}],
form: {
name: '',
@ -204,7 +211,8 @@
},
addDataRow() {
this.form.id_business_datas_business_id_relation.push({
name:''
name:'',
sort:0
})
},
delDataRow(index,id) {
@ -291,8 +299,10 @@
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:[]
if(res.id_business_datas_business_id_relation){
this.form.id_business_datas_business_id_relation = res.id_business_datas_business_id_relation.sort((a, b) => parseInt(a.sort) - parseInt(b.sort))
}
// this.form.id_business_datas_business_id_relation = res.id_business_datas_business_id_relation?res.id_business_datas_business_id_relation:[]
})
},

@ -0,0 +1,236 @@
<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="(stateObj.is_admin)?false:true" 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:all_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-input v-model="form.all_year" type="number" placeholder="请输入年度总预算" style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:quarter_1>
<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.quarter_1" type="number" placeholder="请输入第一季度预算" style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:quarter_2>
<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.quarter_2" type="number" placeholder="请输入第二季度预算" style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:quarter_3>
<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.quarter_3" type="number" placeholder="请输入第三季度预算" style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:quarter_4>
<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.quarter_4" type="number" placeholder="请输入第四季度预算" style="width: 100%;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
} 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: 'budgets',
list_areas: [],
form: {
business_id: '',
area_id: '',
year: '',
all_year: 0,
quarter_1:0,
quarter_2:0,
quarter_3:0,
quarter_4:0,
},
rules: {
business_id: [{
required: true,
message: '请选择业务'
}],
area_id: [{
required: true,
message: '请选择区域'
}],
year: [{
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 : []//
if(this.type==='add'){
this.form.area_id = this.stateObj.area_id ? this.stateObj.area_id : ''
}
},
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
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 : []
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.getBusiness()
if (this.type === 'editor') {
this.getDetail()
}else{
this.form.year = this.$moment(new Date).format("YYYY")
}
} else {
this.id = ''
this.business_id = ''
this.business_name = ''
this.type = "add"
this.form = {
business_id: '',
area_id: '',
year: '',
all_year: '',
quarter_1:0,
quarter_2:0,
quarter_3:0,
quarter_4:0,
}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
// ::v-deep .area_ids,
// ::v-deep .name{
// flex-basis: 100%;
// }
</style>

@ -0,0 +1,187 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'normal'" :title="'数据查看'">
<template v-slot:default>
<el-descriptions class="margin-top" :column="2" border direction="vertical">
<el-descriptions-item>
<template slot="label">
业务类型
</template>
{{form.business_id_details?form.business_id_details[0]['name']:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
填报区域
</template>
{{form.area_id_details?form.area_id_details[0]['name']:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
填报年份
</template>
{{form.year}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
填报月份
</template>
{{monthArr[parseInt(form.month)-1]}}
</el-descriptions-item>
<el-descriptions-item v-if="year_datas.length>0" :span="2">
<template slot="label">
年度预算
</template>
<div>
<xy-table :list="year_datas" :isPage="false" :height="150"
:table-item="year_datas_item">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</el-descriptions-item>
<el-descriptions-item :span="2">
<template slot="label">
数据填报
</template>
<div>
<xy-table :list="fill_datas" :isPage="false" :height="550"
:table-item="fill_datas_item">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</el-descriptions-item>
</el-descriptions>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
} from "@/api/system/baseForm.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'show',
id: '',
table_name: 'fills',
year_datas: [],
business_id: '',
monthArr: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
year_datas_item: [{
prop: 'year',
label: '年份',
align: 'center',
// width: 100
}, {
prop: 'all_year',
label: '年度总预算',
align: 'center',
width: 150
}, {
prop: 'quarter_1',
label: '第一季度预算',
align: 'center',
width: 150
}, {
prop: 'quarter_2',
label: '第二季度预算',
align: 'center',
width: 150
}, {
prop: 'quarter_3',
label: '第三季度预算',
align: 'center',
width: 150
}, {
prop: 'quarter_4',
label: '第四季度预算',
align: 'center',
width: 150
}],
fill_datas:[],
fill_datas_item: [{
type: 'index',
width: 50,
}, {
prop: 'business_type.name',
label: '填报类别',
align: 'left',
// width: 620
}, {
prop: 'business_data.name',
label: '填报数据',
align: 'left',
width: 320
}, {
prop: 'value',
label: '填报值',
align: 'left',
width: 320
}],
form: {},
}
},
created() {},
methods: {
async getBusiness() {
const res = await show({
id: this.business_id,
table_name: 'businesses',
json_data_fields: ['area_ids'],
})
//
this.year_datas = res.id_budgets_business_id_relation.filter(item => {
return item.area_id === this.form.area_id && item.year == this.form.year
})
console.log(this.form.area_id,this.form.year,this.year_datas)
},
async getDetail() {
await show({
id: this.id,
table_name: this.table_name,
json_data_fields: ['area_id', 'business_id'],
}).then(res => {
this.form = this.base.deepCopy(res)
this.form.business_id_details = res.business_id_details?res.business_id_details:[],
this.form.area_id_details = res.area_id_details?res.area_id_details:[]
this.fill_datas = res.id_fill_datas_fill_id_relation?res.id_fill_datas_fill_id_relation:[]
})
},
},
watch: {
async isShow(newVal) {
if (newVal) {
await this.getDetail()
await this.getBusiness()
} else {
this.id = ''
this.business_id = ''
this.year_datas = []
this.fill_datas = []
this.type = "show"
this.form = {}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
// ::v-deep .area_ids,
// ::v-deep .name{
// flex-basis: 100%;
// }
</style>

@ -24,22 +24,30 @@
<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>
: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>
<div style="margin-bottom:10px">
<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,'month')"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editYear('add',scope.row.id)"></el-button>
<el-button type="primary" size="small" @click="goData(scope.row.id,'year')"></el-button>
</div>
</template>
</el-table-column>
</template>
@ -47,19 +55,23 @@
</div>
<add-fill ref="addFill" @refresh="getList"></add-fill>
<add-year ref="addYear" @refresh="getList"></add-year>
</div>
</template>
<script>
import addFill from './components/addFill.vue';
import addYear from './components/addYear.vue';
import {
index,
destroy
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
addFill
addFill,
addYear
},
data() {
return {
@ -68,8 +80,8 @@
table_name: 'businesses',
page: 1,
page_size: 10,
},
stateObj:{},
},
stateObj: {},
total: 0,
list: [],
table_item: [{
@ -87,22 +99,48 @@
}
},
created() {
created() {
this.stateObj = state.state
this.getList()
},
methods: {
goData(id){
this.$router.push({ path: '/report/filldata', query: { id: id } })
methods: {
goData(id, type) {
if (type === 'month') {
this.$router.push({
path: '/report/filldata',
query: {
id: id,
area_id: this.stateObj.area_id
}
})
}
if (type === 'year') {
this.$router.push({
path: '/report/yeardata',
query: {
id: id,
area_id: this.stateObj.area_id
}
})
}
},
editIndex(type, id) {
if (type == 'add') {
this.$refs.addFill.setBusinessId(id)
this.$refs.addFill.business_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
},
editYear(type, id) {
if (type == 'add') {
this.$refs.addYear.setBusinessId(id)
this.$refs.addYear.business_id = id
}
this.$refs.addYear.type = type
this.$refs.addYear.isShow = true
},
pageIndexChange(e) {
this.select.page = e
this.getList()
@ -116,9 +154,9 @@
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'],
is_auth:this.stateObj.is_admin?'':1,
table_name: this.select.table_name,
json_data_fields: ['area_ids'],
is_auth: this.stateObj.is_admin ? '' : 1,
filter: [{
"key": "name",
"op": "like",

@ -11,15 +11,22 @@
<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>
<el-select style="width:100%" clearable v-model="select.area_id" placeholder="请选择区域">
<el-option v-for="item in list_area" :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>
@ -66,7 +73,7 @@
</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="600" header-align="center">
<el-table-column align='center' label="业务类别" width="240" header-align="center">
<template slot-scope="scope">
<template
@ -97,15 +104,18 @@
</template>
</template>
</el-table-column>
</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="showIndex('show',scope.row.id,scope.row.business_id)">查看</el-button>
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" type="primary" size="small"
@click="editIndex('editor',scope.row.id,scope.row.business_id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" style="margin:0 10px"
@confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
@ -114,20 +124,23 @@
</xy-table>
</div>
<add-fill ref="addFill" @refresh="getList"></add-fill>
<add-fill ref="addFill" @refresh="getList"></add-fill>
<show-fill ref="showFill"></show-fill>
</div>
</template>
<script>
import addFill from './components/addFill.vue';
import addFill from './components/addFill.vue';
import showFill from './components/showFill.vue';
import {
index,
destroy
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
addFill
addFill,
showFill
},
data() {
return {
@ -136,12 +149,14 @@
table_name: 'fills',
page: 1,
page_size: 10,
business_id: '',
year:'',
month:''
},
stateObj:{},
business_id: '',
area_id: '',
year: '',
month: ''
},
stateObj: {},
list_bus: [],
list_area: [],
monthArr: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
total: 0,
list: [],
@ -189,12 +204,16 @@
}
},
created() {
this.stateObj = state.state
created() {
this.stateObj = state.state
if (this.$route.query.id) {
this.select.business_id = parseInt(this.$route.query.id)
}
if (this.$route.query.area_id) {
this.select.area_id = parseInt(this.$route.query.area_id)
}
this.getBusinessList()
this.getAreaList()
this.getList()
},
methods: {
@ -206,6 +225,22 @@
})
this.list_bus = res.data
},
async getAreaList() {
const res = await index({
page_size: 999,
page: 1,
table_name: 'areas',
})
this.list_area = res.data
},
showIndex(type, id, business_id) {
if (type == 'show') {
this.$refs.showFill.id = id
this.$refs.showFill.business_id = business_id
}
this.$refs.showFill.type = type
this.$refs.showFill.isShow = true
},
editIndex(type, id, business_id) {
if (type == 'editor') {
this.$refs.addFill.id = id
@ -234,11 +269,15 @@
"key": "business_id",
"op": "eq",
"value": this.select.business_id ? this.select.business_id : ''
},{
}, {
"key": "area_id",
"op": "eq",
"value": this.select.area_id ? this.select.area_id : ''
}, {
"key": "year",
"op": "eq",
"value": this.select.year ? this.select.year : ''
},{
}, {
"key": "month",
"op": "eq",
"value": this.select.month ? this.select.month : ''
@ -251,8 +290,8 @@
var that = this;
destroy({
id: id,
table_name: this.select.table_name,
destroy_relation:['id_fill_datas_fill_id_relation']
table_name: this.select.table_name,
destroy_relation: ['id_fill_datas_fill_id_relation']
}).then(response => {
this.$Message.success('操作成功');
this.getList()

@ -0,0 +1,273 @@
<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-select style="width:100%" clearable v-model="select.area_id" placeholder="请选择区域">
<el-option v-for="item in list_area" :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>
<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: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:btns>
<el-table-column align='center' fixed="right" label="操作" width="240" header-align="center">
<template slot-scope="scope">
<el-button v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" type="primary" size="small"
@click="editIndex('editor',scope.row.id,scope.row.business_id)">编辑</el-button>
<el-popconfirm v-if="stateObj.login_id===scope.row.admin_id || stateObj.is_admin" 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-year ref="addYear" @refresh="getList"></add-year>
</div>
</template>
<script>
import addYear from './components/addYear.vue';
import {
index,
destroy
} from "@/api/system/baseForm.js"
import state from '@/store/modules/user.js'
export default {
components: {
addYear
},
data() {
return {
select: {
name: '',
table_name: 'budgets',
page: 1,
page_size: 10,
business_id: '',
area_id: '',
year: '',
},
stateObj: {},
list_bus: [],
list_area:[],
total: 0,
list: [],
table_item: [{
type: 'index',
width: 50,
fixed: 'left'
}, {
prop: 'year',
label: '预算年份',
align: 'center',
width: 120
}, {
prop: 'business_id',
label: '预算业务',
align: 'center',
width: 360,
}, {
prop: 'area_id',
label: '填报区域',
align: 'center',
width: 120
}, {
prop: 'all_year',
label: '年度总预算',
align: 'center',
width: 120
}, {
prop: 'quarter_1',
label: '第一季度预算',
align: 'center',
width: 120
}, {
prop: 'quarter_2',
label: '第二季度预算',
align: 'center',
width: 120
}, {
prop: 'quarter_3',
label: '第三季度预算',
align: 'center',
width: 120
}, {
prop: 'quarter_4',
label: '第四季度预算',
align: 'center',
width: 120
}, {
prop: 'admin.name',
label: '填报人',
align: 'center',
width: 120
}, {
prop: 'created_at',
label: '填报时间',
align: 'center',
width: 180
}]
}
},
created() {
this.stateObj = state.state
if (this.$route.query.id) {
this.select.business_id = parseInt(this.$route.query.id)
}
if (this.$route.query.area_id) {
this.select.area_id = parseInt(this.$route.query.area_id)
}
this.getBusinessList()
this.getAreaList()
this.getList()
},
methods: {
async getBusinessList() {
const res = await index({
page_size: 999,
page: 1,
table_name: 'businesses',
})
this.list_bus = res.data
},
async getAreaList() {
const res = await index({
page_size: 999,
page: 1,
table_name: 'areas',
})
this.list_area = res.data
},
editIndex(type, id, business_id) {
if (type == 'editor') {
this.$refs.addYear.id = id
this.$refs.addYear.setBusinessId(business_id)
this.$refs.addYear.business_id = business_id
}
this.$refs.addYear.type = type
this.$refs.addYear.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": "area_id",
"op": "eq",
"value": this.select.area_id ? this.select.area_id : ''
}, {
"key": "year",
"op": "eq",
"value": this.select.year ? this.select.year : ''
}, {
"key": "area_id",
"op": "eq",
"value": this.select.area_id ? this.select.area_id : ''
}],
})
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>

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin_test',
outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save