law-work-bench-config.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <a-card>
  3. <sd-detail-form
  4. v-show="showForm"
  5. ref="docform"
  6. page-id="onl:00788856205141a18048cfb8b01b07e7"
  7. :record-id="id"
  8. :class="[$style.form]"
  9. @close="close(true)"
  10. @saved="saved"
  11. >
  12. <template v-slot="{ formData, model, fields }">
  13. <table :class="$style.detailForm">
  14. <tr>
  15. <td colspan="4" style="border:none">
  16. <sd-form-by-builder :form-data="formData.pageFormData"></sd-form-by-builder>
  17. </td>
  18. </tr>
  19. </table>
  20. </template>
  21. </sd-detail-form>
  22. </a-card>
  23. </template>
  24. <script>
  25. import { message } from '@/common/one-ui'
  26. import axios from '@/common/services/axios-instance'
  27. import components from './_import-components/law-work-bench-config-import'
  28. export default {
  29. name: 'LawWorkBenchConfig',
  30. metaInfo: {
  31. title: 'LawWorkBenchConfig',
  32. },
  33. components: {
  34. ...components,
  35. },
  36. data() {
  37. return {
  38. showForm: false,
  39. id: this.$route.query.id ? this.$route.query.id : '',
  40. }
  41. },
  42. mounted() {
  43. const ini = setInterval(() => {
  44. if (
  45. this.$refs.docform &&
  46. (this.$refs.docform.$refs.form || this.$refs.docform.$refs.sdForm)
  47. ) {
  48. clearInterval(ini)
  49. axios({
  50. method: 'post',
  51. url: 'api/xcoa-mobile/v1/iam-page/businessList',
  52. data: {
  53. columns: 'LAW_CASE_SHOW,LAW_DISPUTE_SHOW',
  54. expressions: [],
  55. formId: 'onlhead:00788856205141a18048cfb8b01b07e7',
  56. maxResults: 10,
  57. startPosition: 0,
  58. },
  59. }).then((res) => {
  60. if (res.data.data.length > 0) {
  61. const showCase = res.data.data[0].LAW_CASE_SHOW === '显示' ? '1' : '0'
  62. const showDispute = res.data.data[0].LAW_DISPUTE_SHOW === '显示' ? '1' : '0'
  63. this.$refs.docform.setFieldValue('LAW_CASE_SHOW', showCase)
  64. this.$refs.docform.setFieldValue('LAW_DISPUTE_SHOW', showDispute)
  65. this.id = res.data.data[0].id
  66. } else {
  67. this.$refs.docform.setFieldValue('LAW_CASE_SHOW', '0')
  68. this.$refs.docform.setFieldValue('LAW_DISPUTE_SHOW', '0')
  69. }
  70. this.showForm = true
  71. })
  72. }
  73. }, 100)
  74. },
  75. methods: {
  76. saved(t) {
  77. const idobj = t.pageFormData.pageFieldInfos.find((i) => i.name === 'id').value
  78. this.id = idobj
  79. message.success({ content: '保存成功!' }, 1)
  80. },
  81. // 保存
  82. saveForm() {
  83. this.$refs.docform.saveBtnClick()
  84. },
  85. close(flag) {
  86. window.close()
  87. },
  88. // initDaF(array) {
  89. // if (array) {
  90. // array.attrFD.keepHiddenCell = false
  91. // }
  92. // if (this.flag) {
  93. // setTimeout(() => {
  94. // this.$refs.docform.setFieldValue('BASE_INFO', 'true')
  95. // this.$refs.docform.setFieldValue('SUPPORT_LIST', 'true')
  96. // }, 1000)
  97. // this.flag = false
  98. // }
  99. // return array
  100. // },
  101. },
  102. }
  103. </script>
  104. <style module lang="scss">
  105. @use '@/common/design' as *;
  106. @import '@/webflow/sd-flow-form.scss';
  107. .detailForm {
  108. width: 100% !important;
  109. margin: 0px;
  110. :global(.sd-form-table) {
  111. // width: 100% !important;
  112. }
  113. }
  114. </style>