iam-light-service.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. // @ts-nocheck
  2. import Vue from 'vue'
  3. import axios from '@/common/services/axios-instance'
  4. import store from '@/common/store'
  5. import pickValues from '@/common/services/pick-values'
  6. import { message } from 'ant-design-vue'
  7. // import IamSealPickerModal from '@product/iam/seal/iam-seal-picker-modal'
  8. // import AuditSystemMaterialPicker from './components/audit-system-material-picker'
  9. import IcSimpleInfoModal from '../ic/evaluation/ic-simple-info-modal'
  10. import IcWriteResultModal from '../ic/evaluation/ic-write-result-modal'
  11. class IamLightService {
  12. // 系统集成资料
  13. // selectSystemMaterial() {
  14. // return pickValues(AuditSystemMaterialPicker, { single: true })
  15. // }
  16. // // 获取印章
  17. // getYinzhangUrl(flowData) {
  18. // let mixin
  19. // const p = new Promise(function(resolve, reject) {
  20. // mixin = {
  21. // data() {
  22. // return {
  23. // flowData,
  24. // }
  25. // },
  26. // methods: {
  27. // handleOk() {
  28. // if (!this.sealId) {
  29. // message.warn('请选择印章')
  30. // } else {
  31. // axios
  32. // .get('api/framework/v1/attachment-extend/attachments-info/' + this.sealId)
  33. // .then((res) => {
  34. // const code = res.data[0]?.code
  35. // if (code) {
  36. // const url = `${location.origin}${location.pathname}api/framework/v1/task-form-process/download-attachments/${code}?fileName=${res.data[0].name}`
  37. // resolve(url)
  38. // this.visible = false
  39. // this.gaizhangvisible = false
  40. // } else {
  41. // message.warn('对应的印章不存在')
  42. // }
  43. // })
  44. // }
  45. // },
  46. // },
  47. // }
  48. // })
  49. // const mixins = { mixins: [mixin] }
  50. // const c = { ...IamSealPickerModal, ...mixins }
  51. // const vm = new Vue(c).$mount()
  52. // document.body.appendChild(vm.$el)
  53. // return p
  54. // }
  55. // 测试底稿-样本信息
  56. simpleInfo(model, simpleData) {
  57. let mixin
  58. const p = new Promise(function(resolve, reject) {
  59. mixin = {
  60. data() {
  61. return {
  62. model,
  63. simpleData,
  64. }
  65. },
  66. methods: {
  67. handleOk() {
  68. this.$refs.childTable.valid().then((flag) => {
  69. if (flag) {
  70. this.visible = false
  71. resolve(this.value)
  72. }
  73. })
  74. },
  75. },
  76. }
  77. })
  78. const mixins = { mixins: [mixin], store }
  79. const c = { ...IcSimpleInfoModal, ...mixins }
  80. const vm = new Vue(c).$mount()
  81. document.body.appendChild(vm.$el)
  82. return p
  83. }
  84. // 测试底稿-填写结果
  85. writeResult(pageId, readonly, model) {
  86. let mixin
  87. const p = new Promise(function(resolve, reject) {
  88. mixin = {
  89. data() {
  90. return {
  91. pageId,
  92. readonly,
  93. model,
  94. }
  95. },
  96. methods: {
  97. actionBtnClick(evt, button) {
  98. if (button.buttonId === 'save') {
  99. evt.preventDefault()
  100. this.$refs.resultModal.validateFields().then((flag) => {
  101. if (flag) {
  102. const clues = this.$refs.resultModal.getFieldValue('isClues')
  103. const handOverObject = this.$refs.resultModal.getFieldValue('handOver')
  104. if (clues === '1' && !handOverObject) {
  105. return message.warn('请选择移交对象!')
  106. }
  107. this.$refs.resultModal.hide()
  108. const backendData = this.$refs.resultModal.getBackendValues()
  109. resolve(backendData)
  110. }
  111. })
  112. }
  113. },
  114. },
  115. }
  116. })
  117. const mixins = { mixins: [mixin], store }
  118. const c = { ...IcWriteResultModal, ...mixins }
  119. const vm = new Vue(c).$mount()
  120. document.body.appendChild(vm.$el)
  121. return p
  122. }
  123. }
  124. export default new IamLightService()