|
@@ -14,120 +14,23 @@
|
|
<!-- 权益拆分 -->
|
|
<!-- 权益拆分 -->
|
|
<div v-if="autharr[0] && autharr[0].RaiMerge == 2" class="qy_menuList">
|
|
<div v-if="autharr[0] && autharr[0].RaiMerge == 2" class="qy_menuList">
|
|
<el-table :data="autharr[0].dataList" :show-header="false" border :span-method="spanMethod">
|
|
<el-table :data="autharr[0].dataList" :show-header="false" border :span-method="spanMethod">
|
|
- <el-table-column align="center">
|
|
|
|
|
|
+ <el-table-column align="center" :width="autharr[0].dataList[0][key].width?autharr[0].dataList[0][key].width:''"
|
|
|
|
+ v-for="key in Object.keys(autharr[0].dataList[0])" :key="key">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span v-if="!scope.row.PermissionTypeName">
|
|
|
|
- {{scope.row.PermissionTypeName}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox :label="scope.row.PermissionTypeName.value" v-else @change="handleCheckQY(scope.row.PermissionTypeName)"
|
|
|
|
- v-model="scope.row.PermissionTypeName.isCheckAll" :disabled="scope.row.PermissionTypeName.isDisabled"
|
|
|
|
- :indeterminate="scope.row.PermissionTypeName.isIndeterminate"></el-checkbox>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(22)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-checkbox v-if="scope.row.medicine.value === '医药'" :label="scope.row.medicine.value" :indeterminate="scope.row.medicine.isIndeterminate"
|
|
|
|
- @change="handleCheckQY(scope.row.medicine)" v-model="scope.row.medicine.isCheckAll" :disabled="scope.row.medicine.isDisabled"></el-checkbox>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.medicine.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.medicine.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(21)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-checkbox v-if="scope.row.consumption.value === '消费'" :label="scope.row.consumption.value" :indeterminate="scope.row.consumption.isIndeterminate"
|
|
|
|
- @change="handleCheckQY(scope.row.consumption)" v-model="scope.row.consumption.isCheckAll" :disabled="scope.row.consumption.isDisabled"></el-checkbox>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.consumption.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.consumption.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(20)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-checkbox v-if="scope.row.technology.value === '科技'" :label="scope.row.technology.value" :indeterminate="scope.row.technology.isIndeterminate"
|
|
|
|
- @change="handleCheckQY(scope.row.technology)" v-model="scope.row.technology.isCheckAll" :disabled="scope.row.technology.isDisabled"></el-checkbox>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.technology.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.technology.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(19)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-checkbox v-if="scope.row.smart.value === '智造'" :label="scope.row.smart.value" :indeterminate="scope.row.smart.isIndeterminate"
|
|
|
|
- @change="handleCheckQY(scope.row.smart)" v-model="scope.row.smart.isCheckAll" :disabled="scope.row.smart.isDisabled"></el-checkbox>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.smart.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.smart.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(23)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.strategy.value === '策略'">
|
|
|
|
- {{scope.row.strategy.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.strategy.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.strategy.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(29)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.experts.value === '专家'">
|
|
|
|
- {{scope.row.experts.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.experts.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.experts.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(30)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.roadshow.value === '路演服务'">
|
|
|
|
- {{scope.row.roadshow.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.roadshow.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.roadshow.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(53)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.fixedCrop.value === '固收'">
|
|
|
|
- {{scope.row.fixedCrop.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.fixedCrop.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.fixedCrop.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" v-if="autharr[0].existIds.includes(31)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.choose.value === '研选订阅'">
|
|
|
|
- {{scope.row.choose.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.choose.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.choose.isDisabled">{{''}}</el-checkbox>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" width="100px" v-if="autharr[0].existIds.includes(52)">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-if="scope.row.points.value === '研选扣点包'">
|
|
|
|
- {{scope.row.points.value}}
|
|
|
|
- </span>
|
|
|
|
- <el-checkbox-group v-model="qyCheckList" v-else >
|
|
|
|
- <el-checkbox :label="scope.row.points.value" class="checkbox-flex"
|
|
|
|
- :disabled="scope.row.points.isDisabled">{{''}}</el-checkbox>
|
|
|
|
|
|
+ <!-- 主客观 区分的品种+复选框-->
|
|
|
|
+ <el-checkbox :label="scope.row[key].value" @change="handleCheckQY(scope.row[key])"
|
|
|
|
+ v-model="scope.row[key].isCheckAll" :disabled="scope.row[key].isDisabled"
|
|
|
|
+ :indeterminate="scope.row[key].isIndeterminate"
|
|
|
|
+ v-if="(scope.row[key].ids && scope.row[key].ids.length) || (scope.row[key].bothIds&& scope.row[key].bothIds.length)"></el-checkbox>
|
|
|
|
+ <!-- 不区分 只有复选框-->
|
|
|
|
+ <el-checkbox-group v-model="qyCheckList" v-else-if="typeof(scope.row[key].value)=='number'">
|
|
|
|
+ <el-checkbox :label="scope.row[key].value" class="checkbox-flex"
|
|
|
|
+ :disabled="scope.row[key].isDisabled">{{''}}</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
|
|
+ <!-- 只有品种名称 -->
|
|
|
|
+ <template v-else>
|
|
|
|
+ {{scope.row[key].value}}
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -169,54 +72,41 @@ export default {
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
autharr(value){
|
|
autharr(value){
|
|
|
|
+ // console.log(value,'valuevaluevaluevalue');
|
|
if(value[0] && value[0].customType=='权益') this.qyCheckList = value[0].CheckList
|
|
if(value[0] && value[0].customType=='权益') this.qyCheckList = value[0].CheckList
|
|
},
|
|
},
|
|
qyCheckList(value){
|
|
qyCheckList(value){
|
|
|
|
+ let checkedIds=value||[]
|
|
// 根据复选框选择的情况 改变医药、消费、科技、智造、主客观复选框的状态
|
|
// 根据复选框选择的情况 改变医药、消费、科技、智造、主客观复选框的状态
|
|
- let arr = ['medicine','consumption','technology','smart']
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- let element = arr[i];
|
|
|
|
- let arrLength = value.filter(item => {
|
|
|
|
- return item == this.autharr[0].dataList[1][element].value || item == this.autharr[0].dataList[2][element].value
|
|
|
|
- }).length
|
|
|
|
- if(arrLength == 2){
|
|
|
|
- this.autharr[0].dataList[0][element].isCheckAll=true
|
|
|
|
- this.autharr[0].dataList[0][element].isIndeterminate=false
|
|
|
|
- }else if(arrLength == 1){
|
|
|
|
- this.autharr[0].dataList[0][element].isCheckAll=false
|
|
|
|
- this.autharr[0].dataList[0][element].isIndeterminate=true
|
|
|
|
|
|
+ this.autharr[0].dataList.map(it =>{
|
|
|
|
+ if(it.PermissionTypeName&&it.PermissionTypeName.value){
|
|
|
|
+ let idArr = [...checkedIds,...it.PermissionTypeName.ids]
|
|
|
|
+ let idArrLen = idArr.length
|
|
|
|
+ // 去重后的
|
|
|
|
+ let idRemovalArrLen = [...new Set(idArr)].length
|
|
|
|
+ it.PermissionTypeName.isCheckAll = idArrLen-idRemovalArrLen == it.PermissionTypeName.ids.length
|
|
|
|
+ it.PermissionTypeName.isIndeterminate = idArrLen-idRemovalArrLen < it.PermissionTypeName.ids.length &&
|
|
|
|
+ idArrLen-idRemovalArrLen > 0
|
|
}else{
|
|
}else{
|
|
- this.autharr[0].dataList[0][element].isCheckAll=false
|
|
|
|
- this.autharr[0].dataList[0][element].isIndeterminate=false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for (let i = 0; i < 2; i++) {
|
|
|
|
- let arrLength = value.filter(item => {
|
|
|
|
- return item == this.autharr[0].dataList[i+1].medicine.value || item == this.autharr[0].dataList[i+1].consumption.value ||
|
|
|
|
- item == this.autharr[0].dataList[i+1].technology.value || item == this.autharr[0].dataList[i+1].smart.value
|
|
|
|
- }).length
|
|
|
|
- if(arrLength == 4){
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isCheckAll=true
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isIndeterminate=false
|
|
|
|
- }else if(arrLength == 0){
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isCheckAll=false
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isIndeterminate=false
|
|
|
|
- }else{
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isCheckAll=false
|
|
|
|
- this.autharr[0].dataList[i+1].PermissionTypeName.isIndeterminate=true
|
|
|
|
|
|
+ Object.values(it).forEach(permission =>{
|
|
|
|
+ if(permission.bothIds && permission.bothIds.length>1){
|
|
|
|
+ // 有主客观的
|
|
|
|
+ let idArr = [...checkedIds,...permission.bothIds]
|
|
|
|
+ let idArrLen = idArr.length
|
|
|
|
+ // 去重后的
|
|
|
|
+ let idRemovalArrLen = [...new Set(idArr)].length
|
|
|
|
+ permission.isCheckAll = idArrLen-idRemovalArrLen == permission.bothIds.length
|
|
|
|
+ permission.isIndeterminate = idArrLen-idRemovalArrLen < permission.bothIds.length &&
|
|
|
|
+ idArrLen-idRemovalArrLen > 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- qyCheckList:[],
|
|
|
|
- permissionIds:{
|
|
|
|
- 19:36, //智造
|
|
|
|
- 20:37, //科技
|
|
|
|
- 21:38, //消费
|
|
|
|
- 22:39, //医药
|
|
|
|
- } //主观:客观
|
|
|
|
|
|
+ qyCheckList:[]
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -234,7 +124,6 @@ export default {
|
|
// 权益拆分
|
|
// 权益拆分
|
|
checkArr = this.qyCheckList
|
|
checkArr = this.qyCheckList
|
|
}
|
|
}
|
|
-
|
|
|
|
customInterence.addTryout({
|
|
customInterence.addTryout({
|
|
CompanyId:this.id,
|
|
CompanyId:this.id,
|
|
ChartPermissionId:checkArr.join()
|
|
ChartPermissionId:checkArr.join()
|
|
@@ -261,10 +150,14 @@ export default {
|
|
item.Items.map((it,i)=>{
|
|
item.Items.map((it,i)=>{
|
|
if(item.CheckList.includes(it.ChartPermissionId) && it.PermissionType==1){
|
|
if(item.CheckList.includes(it.ChartPermissionId) && it.PermissionType==1){
|
|
// 主观被选上,将客观的ID也push上
|
|
// 主观被选上,将客观的ID也push上
|
|
- item.CheckList.push(this.permissionIds[it.ChartPermissionId])
|
|
|
|
|
|
+ let ob=item.Items.find(pe => pe.PermissionName == it.PermissionName && pe.PermissionType==2)
|
|
|
|
+ item.CheckList.push(ob?ob.ChartPermissionId:0)
|
|
}else if(!item.CheckList.includes(it.ChartPermissionId) && it.PermissionType==1){
|
|
}else if(!item.CheckList.includes(it.ChartPermissionId) && it.PermissionType==1){
|
|
- if(item.CheckList.indexOf(this.permissionIds[it.ChartPermissionId])!=-1){
|
|
|
|
- item.CheckList.splice(item.CheckList.indexOf(this.permissionIds[it.ChartPermissionId]),1)
|
|
|
|
|
|
+ // 主观被去除,将客观的ID也去除
|
|
|
|
+ let ob=item.Items.find(pe => pe.PermissionName == it.PermissionName && pe.PermissionType==2)
|
|
|
|
+ let obIndex = item.CheckList.indexOf(ob?ob.ChartPermissionId:0)
|
|
|
|
+ if(obIndex!=-1){
|
|
|
|
+ item.CheckList.splice(obIndex,1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -277,7 +170,7 @@ export default {
|
|
// 权益选择套餐方法
|
|
// 权益选择套餐方法
|
|
// 合并单元格
|
|
// 合并单元格
|
|
spanMethod({ row, rowIndex, column,columnIndex }){
|
|
spanMethod({ row, rowIndex, column,columnIndex }){
|
|
- if([5,6,7,8,9].includes(columnIndex)){
|
|
|
|
|
|
+ if(Object.values(row)[columnIndex].merge){
|
|
if(rowIndex == 1){
|
|
if(rowIndex == 1){
|
|
return [2,1]
|
|
return [2,1]
|
|
}else if(rowIndex == 2){
|
|
}else if(rowIndex == 2){
|
|
@@ -286,65 +179,26 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleCheckQY(item){
|
|
handleCheckQY(item){
|
|
- let arr = ['medicine','consumption','technology','smart']
|
|
|
|
- let arrCh = ['医药','消费','科技','智造']
|
|
|
|
// 全选
|
|
// 全选
|
|
if(item.isCheckAll){
|
|
if(item.isCheckAll){
|
|
- if(item.value == '主观'){
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
- this.qyCheckList.push(this.autharr[0].dataList[1][element].value)
|
|
|
|
- this.qyCheckList = [...new Set(this.qyCheckList)]
|
|
|
|
- }
|
|
|
|
- }else if(item.value == '客观'){
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
- this.qyCheckList.push(this.autharr[0].dataList[2][element].value)
|
|
|
|
- this.qyCheckList = [...new Set(this.qyCheckList)]
|
|
|
|
- }
|
|
|
|
|
|
+ if(["客观","主观"].includes(item.value)){
|
|
|
|
+ this.qyCheckList = [...new Set([...this.qyCheckList,...item.ids])]
|
|
}else{
|
|
}else{
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
- const elementCh = arrCh[i];
|
|
|
|
- if(item.value == elementCh){
|
|
|
|
- this.qyCheckList.push(this.autharr[0].dataList[1][element].value,this.autharr[0].dataList[2][element].value)
|
|
|
|
- this.qyCheckList = [...new Set(this.qyCheckList)]
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ this.qyCheckList = [...new Set([...this.qyCheckList,...item.bothIds])]
|
|
}
|
|
}
|
|
}else{ //全部不选
|
|
}else{ //全部不选
|
|
- if(item.value == '主观'){
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
|
|
+ if(["客观","主观"].includes(item.value)){
|
|
|
|
+ item.ids.map(pId =>{
|
|
// 需要删除的索引
|
|
// 需要删除的索引
|
|
- let deleteIndex = this.qyCheckList.findIndex(id=> {
|
|
|
|
- return id == this.autharr[0].dataList[1][element].value && (!this.autharr[0].dataList[2][element].isDisabled)
|
|
|
|
- });
|
|
|
|
|
|
+ let deleteIndex = this.qyCheckList.findIndex(id=> id==pId && !(this.autharr[0].defaultAuth.includes(id)));
|
|
if(deleteIndex!=-1) this.qyCheckList.splice(deleteIndex,1)
|
|
if(deleteIndex!=-1) this.qyCheckList.splice(deleteIndex,1)
|
|
- }
|
|
|
|
- }else if(item.value == '客观'){
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
- let deleteIndex = this.qyCheckList.findIndex(id=> {
|
|
|
|
- return id == this.autharr[0].dataList[2][element].value && (!this.autharr[0].dataList[2][element].isDisabled)
|
|
|
|
- });
|
|
|
|
- if(deleteIndex!=-1) this.qyCheckList.splice(deleteIndex,1)
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
}else{
|
|
}else{
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- const element = arr[i];
|
|
|
|
- const elementCh = arrCh[i];
|
|
|
|
- if(item.value == elementCh){
|
|
|
|
- for (let i = 0; i < 2; i++) {
|
|
|
|
- let deleteIndex = this.qyCheckList.findIndex(id=> {
|
|
|
|
- return id == this.autharr[0].dataList[i+1][element].value && (!this.autharr[0].dataList[i+1][element].isDisabled)
|
|
|
|
- });
|
|
|
|
- if(deleteIndex!=-1) this.qyCheckList.splice(deleteIndex,1)
|
|
|
|
- }
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ item.bothIds.map(pId =>{
|
|
|
|
+ // 需要删除的索引
|
|
|
|
+ let deleteIndex = this.qyCheckList.findIndex(id=> id==pId && !(this.autharr[0].defaultAuth.includes(id)));
|
|
|
|
+ if(deleteIndex!=-1) this.qyCheckList.splice(deleteIndex,1)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|