123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <template>
- <span :class="$style.remindconfig">
- <audit-form-top-banner :handel-save-form="saveForm" @handelSaveForm="saveForm">
- <sd-detail-form
- v-if="initialled"
- ref="docform"
- :page-id="'onl:66b2a4cdc379410f8364320c0ecac5c9'"
- :record-id="this.id ? this.id : null"
- :read-only="false"
- :class="[$style.form]"
- @close="close(true)"
- @saved="saved"
- >
- <template v-slot="{ formData, model, fields }">
- <table :class="$style.remindTable">
- <p :class="$style.title">提醒设置</p>
- <tr>
- <td colspan="4" :class="$style.subTable">
- <sd-form-by-builder
- v-if="initialled"
- :form-data="initDaF(formData.pageFormData)"
- ></sd-form-by-builder>
- </td>
- </tr>
- </table>
- </template>
- </sd-detail-form> </audit-form-top-banner
- ></span>
- </template>
- <script>
- import { message } from '@/common/one-ui'
- import auditFormTopBanner from '@product/iam/components/audit-form-top-banner'
- import cpmService from '../../cpm-service.js'
- import components from './_import-components/cpm-improve-remind-config-import'
- export default {
- name: 'CpmImproveRemindConfig',
- metaInfo: {
- title: '整改提醒',
- },
- components: {
- ...components,
- auditFormTopBanner,
- },
- data() {
- return {
- initialled: false,
- id: this.$route.query.id ? this.$route.query.id : '',
- flag: true,
- orgId: '',
- }
- },
- created() {
- const ini = setInterval(() => {
- try {
- cpmService.getRemindConfigId().then((res) => {
- clearInterval(ini)
- if (!res.data.id) {
- this.id = null
- } else {
- this.id = res.data.id
- }
- setTimeout(() => {
- this.initialled = true
- if (this.id === null) {
- // 设置orgId
- cpmService.getCurrentUserGroup().then((res) => {
- this.orgId = res.data
- })
- }
- }, 100)
- })
- } catch {}
- }, 100)
- },
- methods: {
- saved(t) {
- const idobj = t.pageFormData.pageFieldInfos.find((i) => i.name === 'id').value
- this.id = idobj
- const id = this.$route.params.id ? this.$route.params.id : this.$route.query.id
- if (id === null || id === undefined || id === '') {
- let path = this.$route.fullPath
- path = path.replace('?id=&pageId', '?id=' + this.id + '&pageId')
- debugger
- window.location.href = '#' + path
- }
- message.success({ content: '保存成功!' }, 1).then(() => {})
- },
- // 保存
- saveForm() {
- this.$refs.docform.saveBtnClick()
- },
- close(flag) {
- window.close()
- },
- initDaF(array) {
- if (array) {
- array.attrFD.keepHiddenCell = false
- }
- if (this.flag) {
- setTimeout(() => {
- this.$refs.docform.setFieldValue('ZGJH_TXGZSD', 'true')
- this.$refs.docform.setFieldValue('ZGFK_TXGZSD', 'true')
- this.$refs.docform.setFieldValue('ZGCQ_TXGZSD', 'true')
- if (this.id === null) {
- this.$refs.docform.setFieldValue('ORG_ID', this.orgId.id)
- this.$refs.docform.setFieldValue('ORG_NAME', this.orgId.name)
- }
- }, 1000)
- this.flag = false
- }
- return array
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- @import '@/webflow/sd-flow-form.scss';
- .remind-table {
- table-layout: auto !important;
- :global(.ant-form-item-label) {
- width: 15% !important;
- }
- }
- .title {
- font-size: $btn-font-size-sm;
- font-weight: bold;
- text-align: center;
- }
- .remindconfig {
- :global(.ant-layout) {
- background: #fff;
- }
- :global(.ant-layout-header) {
- background: #fff;
- }
- :global(.close-btn_audit-form-top-banner_product) {
- display: none;
- }
- }
- .subTable {
- border: none !important;
- }
- </style>
|