Browse Source

增加统计参数设置

zhanglei
yunuo970428 2 years ago
parent
commit
220a94a2b3
  1. 45
      anrui-system-ui/src/api/statisticalparameter/statisticalparameter.js
  2. 15
      anrui-system-ui/src/main.js
  3. 11
      anrui-system-ui/src/router/index.js
  4. 7
      anrui-system-ui/src/utils/auth.js
  5. 200
      anrui-system-ui/src/views/statisticalparameter/statisticalparameter.vue
  6. 243
      anrui-system-ui/src/views/statisticalparameter/statisticalparameterAdd.vue

45
anrui-system-ui/src/api/statisticalparameter/statisticalparameter.js

@ -0,0 +1,45 @@
import request from '@/utils/request'
export function listPage(data) {
return request({
url: '/portal/v1/SysReportParameterMain/listPage',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
export function details(data) {
return request({
url: '/portal/v1/SysReportParameterMain/getInit',
method: 'get',
params: data
})
}
export function selectList(data) {
return request({
url: '/portal/v1/SysReportParameter/selectList',
method: 'post',
params: data
})
}
export function saveOrUpdate(data) {
return request({
url: '/portal/v1/SysReportParameter/saveOrUpdate',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 根据当前登录用户的角色获取菜单分页列表页面右上角按钮的隐藏
export function getButtonPermissions(data) {
return request({
url: '/portal/v1/sysfunction/getButtonPermissions',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}

15
anrui-system-ui/src/main.js

@ -38,7 +38,7 @@ Vue.component('Pagination', Pagination)
import Print from '@/utils/print' // 引入附件的js文件
Vue.use(Print) // 注册
import {setStorage, getStorage} from "./utils/auth.js"
import {setStorage, getStorage, setDefaultOrgPathName, setDefaultOrgPath } from "./utils/auth.js"
let token = null;
token = GetQueryString("token")
@ -57,6 +57,19 @@ function GetQueryString(name) {
return null;
}
var one = window.location.href.indexOf('&organizationData') + 18
console.log(1111, one)
if (parseInt(one) > 18) {
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
var data1 = decodeURIComponent(data)
console.log(data1, 858585)
if (data1 !== undefined) {
const obj = JSON.parse(data1)
setDefaultOrgPath(obj.defaultOrgPath)
setDefaultOrgPathName(obj.defaultOrgPathName)
}
}
import VueAMap from 'vue-amap'
Vue.use(VueAMap)

11
anrui-system-ui/src/router/index.js

@ -292,6 +292,17 @@ export const constantRoutes = [
meta: { title: '财务参数', noCache: true }
}]
},
{
path: '/statisticalparameter',
component: Layout,
redirect: '/statisticalparameter',
children: [{
path: '/statisticalparameter',
component: () => import('@/views/statisticalparameter/statisticalparameter.vue'),
name: 'StatisticalParameter',
meta: { title: '统计参数', noCache: true }
}]
},
// {
// path: '/workflow',
// component: Layout,

7
anrui-system-ui/src/utils/auth.js

@ -20,6 +20,13 @@ export function getStorage() {
// return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.1eyJ1c2VyTm8iOiJhNjRhYzA5OC0yZWJjLTQyMDgtOGY4Ni0wNmJlYTkwZmNlMTgiLCJpc3MiOiJXQksiLCJleHAiOjE2NDQ3MTU3MTl9.EBobsRKVpMbyVxjg3TvGOJ9dZHYJYVlr6xagjrikymE';
}
export function setDefaultOrgPathName(data) {
return sessionStorage.setItem('defaultOrgPathName', data)
}
export function setDefaultOrgPath(data) {
return sessionStorage.setItem('defaultOrgPath', data)
}
export function setStorage(session) {
return sessionStorage.setItem('token', session)

200
anrui-system-ui/src/views/statisticalparameter/statisticalparameter.vue

@ -0,0 +1,200 @@
<template>
<div class="app-container">
<!--列表页面-->
<div v-show="viewState == 1">
<button-bar view-title="统计参数设置" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<!--Start查询列表部分-->
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<!-- <el-form-item label="资方名称">-->
<!-- <el-input v-model="listQuery.params.manageName" placeholder="" clearable/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系人">-->
<!-- <el-input v-model="listQuery.params.name" placeholder="" clearable/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系电话">-->
<!-- <el-input v-model="listQuery.params.mobile" placeholder="" clearable/>-->
<!-- </el-form-item>-->
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</div>
</div>
</div>
<!--End查询列表部分-->
<div class="listtop">
<div class="tit">统计参数表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;">
<el-table-column fixed label="序号" type="index" width="80" :index="indexMethod" align="center"/>
<el-table-column fixed label="操作" align="center" width="80">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column prop="parameterValue" label="参数" align="center"/>
<el-table-column prop="useOrgName" label="分公司" align="center"/>
</el-table>
</div>
<!--End 主页面主要部分-->
<div class="pages">
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<!--End查询列表部分-->
</div>
</div>
<!--新增及修改 -->
<statisticalparameterAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { listPage, getButtonPermissions } from '@/api/statisticalparameter/statisticalparameter'
import statisticalparameterAdd from './statisticalparameterAdd'
export default {
name: 'Capital',
components: {
Pagination,
pageye,
ButtonBar,
statisticalparameterAdd
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1, // 1 2 3 4
tableKey: 0,
list: [],
sids: [], // SIDs
FormLoading: false,
listLoading: false,
//
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
useOrgName: '',
orgPath: ''
}
}
}
},
created() {
//
this.getList()
},
mounted() {
getButtonPermissions({ userSid: window.sessionStorage.getItem('userSid'), url: this.$route.path, type: 0 }).then((res) => {
if (res.success) {
for (var i = 0; i < res.data.length; i++) {
for (var k = 0; k < this.btnList.length; k++) {
if (res.data[i].buttonId === this.btnList[k].btnKey) {
this.btnList.splice(k, 1)
}
}
}
this.$refs['btnbar'].setButtonList(this.btnList)
}
})
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
listPage(this.listQuery).then(response => {
this.listLoading = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
useOrgName: '',
orgPath: ''
}
}
this.init()
},
toEdit(row) {
this.viewState = 2
this.$refs['divAdd'].showEdit(row)
},
//
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>

243
anrui-system-ui/src/views/statisticalparameter/statisticalparameterAdd.vue

@ -0,0 +1,243 @@
<template>
<div class="app-container">
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<el-row style="border-top: 1px solid #e0e3eb">
<el-col :span="24">
<div class="span-sty"><span>分公司</span></div>
<el-form-item><span class="addinputInfo">{{ formobj.useOrgName }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">
<div>参数列表</div>
<el-button type="primary" size="mini" @click="handleAdd">新增</el-button>
</div>
<el-table :key="tableKey" :data="formobj.list" :index="index" border style="width: 100%">
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleEdit(scope.row, scope.$index)">编辑</el-button>
<el-button type="danger" size="mini" @click="handleDelete(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="表名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.tableNameValue }}</span>
</template>
</el-table-column>
<el-table-column label="列名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.colTextString }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<el-dialog :visible="dialogVisible" width="60%" :show-close="false">
<el-form class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="4" class="tleftb">
<span>表名</span>
</el-col>
<el-col :span="20">
<el-form-item>
<el-select v-model="TableNameKey" placeholder="" @change="changeTableName">
<el-option v-for="item in tableName_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>列名</span>
</el-col>
<el-col :span="20">
<el-form-item>
<el-select v-model="listingText" placeholder="" multiple>
<el-option v-for="item in columnName_list" :key="item.colName" :label="item.colText" :value="item.colText"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" style="text-align: center" class="dialog-footer">
<el-button type="primary" size="small" @click="handleConFirm">确定</el-button>
<el-button size="small" @click="handleColse">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { details, selectList, saveOrUpdate } from '@/api/statisticalparameter/statisticalparameter'
import { pullDown } from '@/api/system/postManage/index'
export default {
name: 'FinancialParameterAdd',
data() {
return {
viewTitle: '',
submitdisabled: false,
dialogVisible: false,
tableKey: 0,
index: 0,
TableName: '', //
TableNameKey: '', // Key
tableIndex: '', // --
tableName_list: [], //
listing: [], // valuekey
listingText: [], // key
columnName_list: [], //
formobj: {
useOrgName: '',
sid: '',
list: []
},
rules: {}
}
},
methods: {
showEdit(row) {
this.viewTitle = '【编辑】统计参数'
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
pullDown({ type: 'tableType' }).then((resp) => {
if (resp.success) {
this.tableName_list = resp.data
}
})
details({ sid: row.sid }).then((res) => {
if (res.success) {
this.formobj = res.data
}
})
},
handleAdd() {
this.dialogVisible = true
},
changeTableName(value) {
const choose = this.tableName_list.filter((item) => item.dictKey === value)
if (choose !== null && choose.length > 0) {
this.TableName = choose[0].dictValue
this.listingText = []
selectList({ tableKey: value }).then((res) => {
if (res.success) {
this.columnName_list = res.data
}
})
} else {
this.TableName = ''
this.listingText = []
}
},
handleEdit(row, index) {
this.dialogVisible = true
this.tableIndex = index
this.TableNameKey = row.tableNameKey
this.changeTableName(this.TableNameKey)
this.listingText = row.colTextString.split(',')
},
handleDelete(index) {
this.formobj.list.splice(index, 1)
},
handleConFirm() {
if (this.TableNameKey === '') {
this.$message({ showClose: true, type: 'error', message: '请选择表名' })
return
}
if (this.listingText.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择列名' })
return
} else {
const aa = []
this.columnName_list.forEach((e) => {
this.listingText.forEach((k) => {
if (e.colText === k) {
aa.push({
colName: e.colName,
colText: e.colText
})
}
})
})
this.listing = aa
}
// -
if (this.tableIndex === '') {
this.formobj.list.push({
tableNameValue: this.TableName,
tableNameKey: this.TableNameKey,
list: this.listing,
colTextString: this.listingText.join(',')
})
} else {
// --
this.formobj.list[this.tableIndex].tableNameValue = this.TableName
this.formobj.list[this.tableIndex].tableNameKey = this.TableNameKey
this.formobj.list[this.tableIndex].list = this.listing
this.formobj.list[this.tableIndex].colTextString = this.listingText.join(',')
}
this.handleColse()
},
handleColse() {
this.TableName = ''
this.TableNameKey = ''
this.tableIndex = ''
this.listing = []
this.listingText = []
this.dialogVisible = false
},
saveOrUpdate() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
saveOrUpdate(this.formobj).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
})
}
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
useOrgName: '',
sid: '',
list: []
}
this.submitdisabled = false
this.$emit('doback')
}
}
}
</script>
<style scoped>
.span-sty {
width: 130px !important;
}
.addinputInfo {
margin-left: 120px !important;
}
.title {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>
Loading…
Cancel
Save