reportApproveConfig.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. },
  47. //检查是否有审批流
  48. checkClassifyNameArr(type=1,classify=[]){
  49. this.checkLoading=true
  50. let params = {
  51. ReportType:type,
  52. ClassifyFirstId:classify[classify.length-2]||0,
  53. ClassifySecondId:classify[classify.length-1]||0,
  54. }
  55. approveInterence.checkClassifyApprove(params).then(res=>{
  56. this.checkLoading=false
  57. if(res.Ret!==200) return
  58. this.hasApproveFlow = res.Data||false
  59. })
  60. },
  61. // 频度翻译
  62. getFrequencyTrans(frequency){
  63. const map = {
  64. '年度':this.$t('ReportManage.smart_annually'),
  65. '半年度':this.$t('ReportManage.smart_semi_annually'),
  66. '季度':this.$t('ReportManage.smart_quarterly'),
  67. '月度':this.$t('ReportManage.smart_monthly'),
  68. '双周度':this.$t('ReportManage.smart_bi_weekly'),
  69. '周度':this.$t('ReportManage.smart_weekly'),
  70. '日度':this.$t('ReportManage.smart_daily'),
  71. '不定时':this.$t('ReportManage.smart_irregularly'),
  72. }
  73. return map[frequency]||''
  74. },
  75. },
  76. mounted(){
  77. this.getBaseConfig()
  78. }
  79. }