|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
|
|
|
width="380px" style="height: 490px;" class="customer-dialog"> |
|
|
|
width="520px" style="height: 490px;" class="customer-dialog"> |
|
|
|
<el-form :inline="true" label-position="top" style="height: 300px;" |
|
|
|
label-width="80px"> |
|
|
|
<el-row> |
|
|
|
@ -16,8 +16,8 @@ |
|
|
|
<el-form> |
|
|
|
<el-table height="240" |
|
|
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
|
|
|
:data="authRoleList" |
|
|
|
border |
|
|
|
:data="customerReportList" |
|
|
|
border ref="customerReportTable" |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%; margin-top: 0px;"> |
|
|
|
<el-table-column |
|
|
|
@ -25,7 +25,7 @@ |
|
|
|
width="55"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in authRoleArray" :key="index" |
|
|
|
v-for="(item,index) in columnReportArray" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
@ -47,7 +47,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 0px;"> |
|
|
|
<el-button type="primary" @click="saveAuthCustomerReportBun">保存</el-button> |
|
|
|
<el-button type="primary" @click="saveCustomerReportAuthsBun">保存</el-button> |
|
|
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
@ -58,9 +58,9 @@ |
|
|
|
<script> |
|
|
|
/*引入js*/ |
|
|
|
import { |
|
|
|
getAuthRoles, |
|
|
|
saveAuthCustomerReport, |
|
|
|
} from '@/api/report/com_auth_single_customer_report.js'; |
|
|
|
getCustomerReportAuths, |
|
|
|
saveCustomerReportAuths, |
|
|
|
} from '@/api/report/com_auth_customer_report.js'; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -72,20 +72,19 @@ export default { |
|
|
|
roleName: '', |
|
|
|
}, |
|
|
|
customerReportList: [], |
|
|
|
customerReportArray: [ |
|
|
|
columnReportArray: [ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5307, |
|
|
|
serialNumber: '5307CustomerReportId', |
|
|
|
tableId: "5307Customer", |
|
|
|
tableName: "查询列", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ReportReportId', |
|
|
|
tableId: "5306Report", |
|
|
|
tableName: "自定义报表", |
|
|
|
columnProp: "reportId", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "报表ID", |
|
|
|
columnWidth: 120, |
|
|
|
columnWidth: '', |
|
|
|
columnHidden: false, |
|
|
|
columnAttr: 'ori', |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
@ -94,17 +93,16 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5307, |
|
|
|
serialNumber: '5307CustomerRoleName', |
|
|
|
tableId: "5307Customer", |
|
|
|
tableName: "查询列", |
|
|
|
columnProp: "roleName", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ReportReportName', |
|
|
|
tableId: "5306Report", |
|
|
|
tableName: "自定义报表", |
|
|
|
columnProp: "reportName", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "角色名称", |
|
|
|
columnWidth: 140, |
|
|
|
columnLabel: "报表名称", |
|
|
|
columnWidth: '', |
|
|
|
columnHidden: false, |
|
|
|
columnAttr: 'ori', |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
@ -113,17 +111,34 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5307, |
|
|
|
serialNumber: '5307CustomerColumnDefaultValue', |
|
|
|
tableId: "5307Customer", |
|
|
|
tableName: "查询列", |
|
|
|
columnProp: "checkedFlag", |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ReportReportType', |
|
|
|
tableId: "5306Report", |
|
|
|
tableName: "自定义报表", |
|
|
|
columnProp: "reportType", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "授权", |
|
|
|
columnWidth: 90, |
|
|
|
columnLabel: "报表分类", |
|
|
|
columnWidth: '', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5306, |
|
|
|
serialNumber: '5306ReportReportRemark', |
|
|
|
tableId: "5306Report", |
|
|
|
tableName: "自定义报表", |
|
|
|
columnProp: "reportRemark", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "备注", |
|
|
|
columnWidth: '', |
|
|
|
columnHidden: false, |
|
|
|
columnAttr: 'check', |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
@ -138,8 +153,9 @@ export default { |
|
|
|
methods: { |
|
|
|
/*初始化页面参数*/ |
|
|
|
init(currentRow) { |
|
|
|
//清空参数 |
|
|
|
this.customerReportList = []; |
|
|
|
//设置参数 |
|
|
|
debugger; |
|
|
|
this.pageData.roleId = currentRow.roleId; |
|
|
|
this.pageData.roleName = currentRow.roleName; |
|
|
|
//刷新页面的参数 |
|
|
|
@ -156,13 +172,23 @@ export default { |
|
|
|
/*刷新当前的页面参数*/ |
|
|
|
refreshPageData(){ |
|
|
|
//刷新材料的数据 |
|
|
|
this.refreshAuthRoleTable(); |
|
|
|
this.refreshCustomerReportAuthTable(); |
|
|
|
}, |
|
|
|
|
|
|
|
//刷新当前卷的时间数据 |
|
|
|
refreshAuthRoleTable(){ |
|
|
|
getAuthRoles(this.pageData).then(({data}) => { |
|
|
|
this.authRoleList = data.rows; |
|
|
|
//刷新定制报表的权限 |
|
|
|
refreshCustomerReportAuthTable(){ |
|
|
|
getCustomerReportAuths(this.pageData).then(({data}) => { |
|
|
|
this.customerReportList = data.rows; |
|
|
|
//循环判断是否选定当前的行 |
|
|
|
//延时1秒执行 |
|
|
|
setTimeout(() => { |
|
|
|
this.customerReportList.forEach(row => { |
|
|
|
let authedFlag = row.authedFlag; |
|
|
|
if(authedFlag === 'Y'){ |
|
|
|
this.$refs.customerReportTable.toggleRowSelection(row); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 300) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -183,9 +209,15 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
/*保存已经修改好的参数数据*/ |
|
|
|
saveAuthCustomerReportBun(){ |
|
|
|
let requestData = {pageData: JSON.stringify(this.pageData), authRoles: JSON.stringify(this.authRoleList)}; |
|
|
|
saveAuthCustomerReport(requestData).then(({data}) => { |
|
|
|
saveCustomerReportAuthsBun(){ |
|
|
|
let checkedList = this.$refs.customerReportTable.selection; |
|
|
|
//判断选中行数 |
|
|
|
if(checkedList.length === 0){ |
|
|
|
this.$message.error('请选择赋权限的报表!') |
|
|
|
return false; |
|
|
|
} |
|
|
|
let requestData = {pageData: JSON.stringify(this.pageData), customerReports: JSON.stringify(checkedList)}; |
|
|
|
saveCustomerReportAuths(requestData).then(({data}) => { |
|
|
|
if(data.code === 200){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
//关闭当前的页面 |
|
|
|
|