cpm-committee-form.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 components from './_import-components/cpm-committee-form-import'
  28. export default {
  29. name: 'CpmCommitteeForm',
  30. metaInfo: {
  31. title: '委员会专题纪要',
  32. },
  33. components: {
  34. ...components,
  35. auditFormTopBanner,
  36. },
  37. data() {
  38. return {
  39. initialled: false,
  40. id: this.$route.query.id ? this.$route.query.id : '',
  41. flag: true,
  42. }
  43. },
  44. methods: {
  45. saved(t) {
  46. const idobj = t.pageFormData.pageFieldInfos.find((i) => i.name === 'id').value
  47. this.id = idobj
  48. const id = this.$route.params.id ? this.$route.params.id : this.$route.query.id
  49. if (id === null || id === undefined || id === '') {
  50. let path = this.$route.fullPath
  51. path = path.replace('?id=&pageId', '?id=' + this.id + '&pageId')
  52. window.location.href = '#' + path
  53. }
  54. message.success({ content: '保存成功!' }, 1).then(() => {})
  55. },
  56. // 保存
  57. saveForm() {
  58. this.$refs.docform.saveBtnClick()
  59. },
  60. close(flag) {
  61. window.close()
  62. },
  63. initDaF(array) {
  64. if (array) {
  65. array.attrFD.keepHiddenCell = false
  66. }
  67. return array
  68. },
  69. },
  70. }
  71. </script>
  72. <style module lang="scss">
  73. @use '@/common/design' as *;
  74. @import '@/webflow/sd-flow-form.scss';
  75. .detailForm {
  76. width: 100% !important;
  77. margin: 0;
  78. :global(.sd-form-table) {
  79. width: 90% !important;
  80. }
  81. }
  82. </style>