5 changed files with 251 additions and 14 deletions
-
7src/api/report/com_auth_customer_report.js
-
227src/views/modules/report/com_auth_customer_report.vue
-
27src/views/modules/yieldReport/com_split_order_switch_roll.vue
-
2src/views/modules/yieldReport/com_switch_roll.vue
-
2src/views/modules/yieldReport/otherReport/other_switch_roll.vue
@ -0,0 +1,7 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 获取查询列
|
||||
|
export const getAuthRoles = data => createAPI('report/getAuthRoles', 'POST', data) |
||||
|
|
||||
|
// 赋值权限
|
||||
|
export const saveAuthCustomerReport = data => createAPI('report/saveAuthSingleCustomerReport', 'POST', data) |
||||
@ -0,0 +1,227 @@ |
|||||
|
<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"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 300px;" |
||||
|
label-width="80px"> |
||||
|
<el-row> |
||||
|
<el-form-item :label="'角色ID:'"> |
||||
|
<el-input v-model="pageData.roleId" readonly="readonly" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'角色名称:'"> |
||||
|
<el-input v-model="pageData.roleName" readonly="readonly" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-row> |
||||
|
<!-- 主材料 --> |
||||
|
<el-form> |
||||
|
<el-table height="240" |
||||
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
||||
|
:data="authRoleList" |
||||
|
border |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%; margin-top: 0px;"> |
||||
|
<el-table-column |
||||
|
type="selection" |
||||
|
width="55"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in authRoleArray" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-checkbox true-label="Y" false-label="N" v-if="item.columnProp === 'checkedFlag' && item.columnAttr === 'check'" |
||||
|
v-model="scope.row[item.columnProp]" style="margin-top: 5px;"></el-checkbox> |
||||
|
<span v-else>{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</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="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/*引入js*/ |
||||
|
import { |
||||
|
getAuthRoles, |
||||
|
saveAuthCustomerReport, |
||||
|
} from '@/api/report/com_auth_single_customer_report.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '报表赋权', |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
roleId: '', |
||||
|
roleName: '', |
||||
|
}, |
||||
|
customerReportList: [], |
||||
|
customerReportArray: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerReportId', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "reportId", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "报表ID", |
||||
|
columnWidth: 120, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerRoleName', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "roleName", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "角色名称", |
||||
|
columnWidth: 140, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'ori', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5307, |
||||
|
serialNumber: '5307CustomerColumnDefaultValue', |
||||
|
tableId: "5307Customer", |
||||
|
tableName: "查询列", |
||||
|
columnProp: "checkedFlag", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "授权", |
||||
|
columnWidth: 90, |
||||
|
columnHidden: false, |
||||
|
columnAttr: 'check', |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
], |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
/*初始化页面参数*/ |
||||
|
init(currentRow) { |
||||
|
//设置参数 |
||||
|
debugger; |
||||
|
this.pageData.roleId = currentRow.roleId; |
||||
|
this.pageData.roleName = currentRow.roleName; |
||||
|
//刷新页面的参数 |
||||
|
this.refreshPageData(); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
//调用原始页面的刷新方法 |
||||
|
this.$emit('refreshCurrentPage'); |
||||
|
}, |
||||
|
|
||||
|
/*刷新当前的页面参数*/ |
||||
|
refreshPageData(){ |
||||
|
//刷新材料的数据 |
||||
|
this.refreshAuthRoleTable(); |
||||
|
}, |
||||
|
|
||||
|
//刷新当前卷的时间数据 |
||||
|
refreshAuthRoleTable(){ |
||||
|
getAuthRoles(this.pageData).then(({data}) => { |
||||
|
this.authRoleList = data.rows; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的css类*/ |
||||
|
customerCellClassName({row, column, rowIndex, columnIndex}) { |
||||
|
if(column.property == 'sortNo'){ |
||||
|
return 'customer-number-cell'; |
||||
|
}else if(columnIndex === 2){ |
||||
|
return 'customer-text-cell'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的cess样式*/ |
||||
|
customerCellStyle({row, column, rowIndex, columnIndex}) { |
||||
|
if(columnIndex === 2){ |
||||
|
return 'padding: 0px 0px;'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*保存已经修改好的参数数据*/ |
||||
|
saveAuthCustomerReportBun(){ |
||||
|
let requestData = {pageData: JSON.stringify(this.pageData), authRoles: JSON.stringify(this.authRoleList)}; |
||||
|
saveAuthCustomerReport(requestData).then(({data}) => { |
||||
|
if(data.code === 200){ |
||||
|
this.$message.success(data.msg); |
||||
|
//关闭当前的页面 |
||||
|
this.closeDialog(); |
||||
|
}else{ |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
// |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/*调节页面button和input的上下间距*/ |
||||
|
.customer-css .customer-button{ |
||||
|
margin-top: 25px; |
||||
|
} |
||||
|
|
||||
|
/*调节样式*/ |
||||
|
.customer-item{ |
||||
|
margin-top: -10px; |
||||
|
} |
||||
|
/*fieldset下table的样式*/ |
||||
|
.customer-fieldset /deep/ .el-table__header th.is-leaf{ |
||||
|
line-height: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content{ |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue