reportApproveConfig.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. 研报及审批配置,涉及到:
  3. 智能研报
  4. 中文研报(除晨周报)
  5. 英文研报
  6. 审批流配置
  7. 审批管理
  8. 审批详情
  9. */
  10. import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
  11. import {approveInterence} from '@/api/modules/approve.js';
  12. export default{
  13. data(){
  14. return{
  15. ReportApproveType:'',
  16. IsReportApprove:false,
  17. pageLoading:false,
  18. hasApproveFlow:false,
  19. checkLoading:false,
  20. }
  21. },
  22. computed:{
  23. //是否开启审批流
  24. isApprove(){
  25. return this.IsReportApprove
  26. },
  27. //是否开启了ETA审批流
  28. isETAApprove(){
  29. return this.IsReportApprove&&this.ReportApproveType==='eta'
  30. },
  31. //是否开启了接口审批
  32. isOtherApprove(){
  33. return this.IsReportApprove&&this.ReportApproveType==='other'
  34. },
  35. },
  36. methods:{
  37. async getBaseConfig(){
  38. //从基本配置中获取是否开启审批流的数据
  39. this.pageLoading = true
  40. const res = await etaBaseConfigInterence.getBaseConfig()
  41. this.pageLoading = false
  42. if(res.Ret!==200) return
  43. const {IsReportApprove='',ReportApproveType=''} = res.Data
  44. this.IsReportApprove = IsReportApprove==='true'?true:false,
  45. this.ReportApproveType = ReportApproveType
  46. console.log(this.isApprove)
  47. },
  48. //检查是否有审批流
  49. checkClassifyNameArr(type=1,classify=[]){
  50. this.checkLoading=true
  51. let params = {
  52. ReportType:type,
  53. ClassifyFirstId:classify[0]||0,
  54. ClassifySecondId:classify[1]||0,
  55. ClassifyThirId:classify[2]||0,
  56. }
  57. approveInterence.checkClassifyApprove(params).then(res=>{
  58. this.checkLoading=false
  59. if(res.Ret!==200) return
  60. this.hasApproveFlow = res.Data||false
  61. })
  62. },
  63. // 频度翻译
  64. getFrequencyTrans(frequency){
  65. const map = {
  66. '年度':this.$t('ReportManage.smart_annually'),
  67. '半年度':this.$t('ReportManage.smart_semi_annually'),
  68. '季度':this.$t('ReportManage.smart_quarterly'),
  69. '月度':this.$t('ReportManage.smart_monthly'),
  70. '双周度':this.$t('ReportManage.smart_bi_weekly'),
  71. '周度':this.$t('ReportManage.smart_weekly'),
  72. '日度':this.$t('ReportManage.smart_daily'),
  73. '不定时':this.$t('ReportManage.smart_irregularly'),
  74. }
  75. return map[frequency]||''
  76. },
  77. },
  78. mounted(){
  79. this.getBaseConfig()
  80. }
  81. }