6 changed files with 520 additions and 1 deletions
@ -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' } |
|||
}) |
|||
} |
@ -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> |
@ -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: [], // 列名下拉多选存value值和key值 |
|||
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…
Reference in new issue