|
@@ -1,17 +1,27 @@
|
|
|
<template>
|
|
|
<div class="container-remindDlg">
|
|
|
<el-dialog title="权限详情" v-dialogDrag :visible.sync="isPermissionDetailShow" :close-on-click-modal="false" :modal-append-to-body="false" @close="cancelHandle" center width="800px">
|
|
|
- <el-table :data="tableData" border style="margin: 20px 0" height="500">
|
|
|
- <el-table-column label="行业" align="center" prop="PermissionName"> </el-table-column>
|
|
|
- <el-table-column label="状态" align="center" prop="Status"> </el-table-column>
|
|
|
+ <el-table :data="filterAuth" :span-method="objectSpanMethod" @selection-change="handleSelectionChange" ref="authTable" border style="margin-top: 20px">
|
|
|
+ <el-table-column label="行业" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.PermissionName }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="产品类型" align="center" v-if="isMerge">
|
|
|
+ <template slot-scope="scope">{{ scope.row.PermissionTypeName }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.Status }}</template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="服务期限" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.StartDate + "—" + scope.row.EndDate }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="剩余天数" align="center" prop="ExpireDay"> </el-table-column>
|
|
|
+ <el-table-column label="剩余天数" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.ExpireDay }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="fromType == 'edit'" type="selection" width="70" align="center" label-class-name="DisabledSelection" :selectable="canSelect"> </el-table-column>
|
|
|
</el-table>
|
|
|
<div style="margin-bottom: 20px" v-if="Points">
|
|
|
<span>研选服务点数</span>
|
|
|
- <span>{{Points}}</span>
|
|
|
+ <span>{{ Points }}</span>
|
|
|
<span class="editsty" @click="lookNumber">明细>></span>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -52,6 +62,13 @@ export default {
|
|
|
isShowResearchNumber: false, // 研选服务点数明细 弹框
|
|
|
tableListResearch: [], // 严选数据
|
|
|
Points: "",
|
|
|
+ indexArrEquity: [], //权益
|
|
|
+ spanArrEquity: [], //权益
|
|
|
+ posEquity: 0, //权益
|
|
|
+ filterAuth: [], //权限表格
|
|
|
+ indexArrEquity: [], //权益
|
|
|
+ spanArrEquity: [], //权益
|
|
|
+ posEquity: 0, //权益
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -76,8 +93,108 @@ export default {
|
|
|
CompanyId: this.researchDetailId,
|
|
|
});
|
|
|
if (res.Ret !== 200) return;
|
|
|
- this.tableData = res.Data.RaiItem.PermissionList[0].Items;
|
|
|
this.Points = res.Data.RaiItem.Points || "";
|
|
|
+ let arr = res.Data.RaiItem.PermissionList[0].Items;
|
|
|
+ this.filterAuth = arr.filter((item) => {
|
|
|
+ return item.Status === "正式" || item.Status === "试用" || item.Status === "永续" || item.Status == "关闭";
|
|
|
+ });
|
|
|
+ this.getRowSpan();
|
|
|
+ },
|
|
|
+ /* 处理合并数组 */
|
|
|
+ getRowSpan() {
|
|
|
+ this.filterAuth.map((v, i, s) => {
|
|
|
+ if (!v.PermissionTypeName) {
|
|
|
+ this.indexArrEquity.push(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (var i = 0; i < this.filterAuth.length; i++) {
|
|
|
+ let element = this.filterAuth[i];
|
|
|
+ if (i === 0) {
|
|
|
+ this.spanArrEquity.push(1);
|
|
|
+ this.posEquity = 0;
|
|
|
+ } else {
|
|
|
+ // 判断当前元素与上一个元素是否相同(line为标记)
|
|
|
+ if (element.PermissionName === this.filterAuth[i - 1].PermissionName) {
|
|
|
+ if (element.IsMerge) {
|
|
|
+ // 主客观都有,需要合并
|
|
|
+ this.spanArrEquity[this.posEquity] += 1;
|
|
|
+ this.spanArrEquity.push(0);
|
|
|
+ } else {
|
|
|
+ // 主客观都有 不需要合并,说明是服务期限或者状态不一样
|
|
|
+ this.spanArrEquity[this.posEquity] += 0.5;
|
|
|
+ this.spanArrEquity.push(0.5);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.spanArrEquity.push(1);
|
|
|
+ this.posEquity = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 合并行规则 */
|
|
|
+ objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
+ if (!this.isMerge) {
|
|
|
+ // 产品类型不显示
|
|
|
+ const _row = this.spanArrEquity[rowIndex];
|
|
|
+ if (_row == 0) {
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //处理行的合并
|
|
|
+ if (this.indexArrEquity.includes(rowIndex)) {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: 1,
|
|
|
+ colspan: 2,
|
|
|
+ };
|
|
|
+ } else if (columnIndex === 1) {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 权益行业主客观合并
|
|
|
+ const _row = this.spanArrEquity[rowIndex];
|
|
|
+ if (_row == 2) {
|
|
|
+ // 为2 是主客观都有,合并,这时合并行业和产品类型
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: 1,
|
|
|
+ colspan: 2,
|
|
|
+ };
|
|
|
+ } else if (columnIndex === 1) {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else if (_row == 0) {
|
|
|
+ // 为0 表示不需要这行,被合并掉了
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: 0,
|
|
|
+ };
|
|
|
+ } else if (_row == 1.5) {
|
|
|
+ // 为1.5 是主客观都有,但不合并,这时合并行业
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: 2,
|
|
|
+ colspan: 1,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else if (_row == 0.5) {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 查看
|
|
|
lookNumber() {
|