reportApproveConfig.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. mounted(){
  63. this.getBaseConfig()
  64. }
  65. }