cpm-improve-rect-problem-form.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <audit-form-top-banner :handel-save-form="saveForm" @handelSaveForm="saveForm">
  3. <sd-detail-form
  4. ref="docform"
  5. :page-id="this.$route.query.pageId ? this.$route.query.pageId : null"
  6. :record-id="this.id"
  7. :read-only="false"
  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="initDaF(formData.pageFormData)"></sd-form-by-builder>
  17. </td>
  18. </tr>
  19. </table>
  20. </template>
  21. </sd-detail-form>
  22. </audit-form-top-banner>
  23. </template>
  24. <script>
  25. import { message } from '@/common/one-ui'
  26. import auditFormTopBanner from '@product/iam/components/audit-form-top-banner'
  27. import cpmService from '../../cpm-service.js'
  28. import components from './_import-components/cpm-improve-rect-problem-form-import'
  29. export default {
  30. name: 'CpmImproveRectProblemForm',
  31. metaInfo: {
  32. title: '问题整改清单录入',
  33. },
  34. components: {
  35. ...components,
  36. auditFormTopBanner,
  37. },
  38. data() {
  39. return {
  40. initialled: false,
  41. id: this.$route.query.id ? this.$route.query.id : '',
  42. flag: true,
  43. }
  44. },
  45. methods: {
  46. saved(t) {
  47. const idobj = t.pageFormData.pageFieldInfos.find((i) => i.name === 'id').value
  48. this.id = idobj
  49. const id = this.$route.params.id ? this.$route.params.id : this.$route.query.id
  50. if (id === null || id === undefined || id === '') {
  51. let path = this.$route.fullPath
  52. path = path.replace('?id=&pageId', '?id=' + this.id + '&pageId')
  53. window.location.href = '#' + path
  54. }
  55. message.success({ content: '保存成功!' }, 1).then((r) => {})
  56. },
  57. // 保存
  58. saveForm() {
  59. this.$refs.docform.saveBtnClick()
  60. },
  61. close(flag) {
  62. window.close()
  63. },
  64. initDaF(array) {
  65. if (array) {
  66. array.attrFD.keepHiddenCell = false
  67. }
  68. if (this.flag) {
  69. setTimeout(() => {
  70. this.$refs.docform.setFieldValue('BASE_INFO', 'true')
  71. this.$refs.docform.setFieldValue('SUPPORT_LIST', 'true')
  72. }, 1000)
  73. this.flag = false
  74. }
  75. return array
  76. },
  77. },
  78. }
  79. </script>
  80. <style module lang="scss">
  81. @use '@/common/design' as *;
  82. @import '@/webflow/sd-flow-form.scss';
  83. .detailForm {
  84. width: 100% !important;
  85. margin: 0px;
  86. :global(.sd-form-table) {
  87. // width: 100% !important;
  88. }
  89. }
  90. </style>