|
@@ -6,19 +6,21 @@ const privateField = {
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
- * > 1 成本价 2 销售价 3 毛利率
|
|
|
+ * @description 1 成本价 2 销售价 3 毛利率
|
|
|
* 1. 超管可以查看所有
|
|
|
* 2. 供应商(originLevel === '3') 可以查看成本(type === '1)
|
|
|
* 3. 业务公司(originLevel === '2') 根据角色的private_field查看
|
|
|
*/
|
|
|
isDisplayPrivateField(type) {
|
|
|
- if (this.isSupertube) return true
|
|
|
- if (this.originLevel === '3' && type === '1') return true
|
|
|
- if (this.originLevel === '2' && privateField && privateField.includes(type)) return true
|
|
|
+ const vm = this
|
|
|
+ const { isSupertube, originLevel, private_field } = vm
|
|
|
+ if (isSupertube) return true
|
|
|
+ if (originLevel === '3' && type === '1') return true
|
|
|
+ if (originLevel === '2' && private_field && private_field.includes(type)) return true
|
|
|
return false
|
|
|
},
|
|
|
displayPrivateField(isDisplay, value) {
|
|
|
- return isDisplay ? value : '***'
|
|
|
+ return isDisplay ? value : '******'
|
|
|
}
|
|
|
}
|
|
|
}
|