<template>
  <div :class="$style.feedbackForm">
    <audit-form-top-banner>
      <div :class="$style.titleHide">
        <sd-detail-form
          ref="docform"
          form-id="iamWorkRectCarryOutHistory"
          page-id="audit/rectFeedback/iamWorkRectCarryOutHistory"
          :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
          :class="$style.form"
          :read-only="true"
          @close="close(true)"
          ><template v-slot="{ model, fields }">
            <table>
              <colgroup>
                <col style="width: 200px;" />
                <col />
                <col style="width: 200px;" />
                <col />
              </colgroup>
              <tr>
                <!-- 整改状态 -->
                <sd-form-item-td name="rectStatus" :colspan="model.rectStatus === '03' ? 1 : 3" />
                <!-- 整改完成日期 -->
                <sd-form-item-td v-if="model.rectStatus === '03'" name="rectFinishDate" />
              </tr>
              <tr v-show="model.rectStatus === '01'">
                <!-- 是否超期未整改 -->
                <sd-form-item-td
                  name="isTrue"
                  :colspan="model.isTrue === '1' || model.isTrue === 1 ? 1 : 3"
                >
                  <span>{{ model.isTrue === 1 ? '是' : '否' }}</span>
                </sd-form-item-td>
                <!-- 超期原因 -->
                <sd-form-item-td
                  v-if="model.isTrue === '1' || model.isTrue === 1"
                  name="overdueReason"
                />
              </tr>
              <tr v-show="model.rectStatus !== '04' && model.rectStatus !== '03'">
                <!-- 预计整改完成日期 -->
                <sd-form-item-td name="expectedCompleteDate" :colspan="3" />
              </tr>
              <tr>
                <!-- 整改情况说明 -->
                <sd-form-item-td name="description" :colspan="3" />
              </tr>
              <tr>
                <!-- 完成日期 -->
                <sd-form-item-td name="rectMoneyType" />
                <sd-form-item-td name="rectMoneySum" />
              </tr>
              <tr>
                <!-- 成果利用 -->
                <sd-form-item-td name="resultUse" />
                <!-- 成果利用数量 -->
                <sd-form-item-td name="resultUseSum" />
              </tr>
              <tr>
                <!-- 处分信息 -->
                <sd-form-item-td name="punishInfo" />
                <!-- 处分人数 -->
                <sd-form-item-td name="punishSum" />
              </tr>
              <tr>
                <!-- 向司法机关移送或报案线索 -->
                <sd-form-item-td name="transferToJustice" />
                <!-- 涉案人员 -->
                <sd-form-item-td name="personInvolved" />
              </tr>
              <tr>
                <sd-form-item-td name="attachment" :colspan="3">
                  <template v-slot:read-and-edit>
                    <sd-attachment
                      v-model="model.attachment"
                      :group-id="JSON.parse(fields.attachment.value).value"
                      :read-only="true"
                    />
                  </template>
                </sd-form-item-td>
              </tr>
            </table>
          </template>
        </sd-detail-form>
      </div>
    </audit-form-top-banner>
  </div>
</template>

<script>
import crossWindowWatcher from '@/common/services/cross-window-watcher'
import auditFormTopBanner from '../../components/audit-form-top-banner'
import components from './_import-components/audit-feedback-form-import'

export default {
  name: 'AuditFeedbackForm',
  metaInfo: {
    title: '整改问题清单',
  },
  components: {
    ...components,
    auditFormTopBanner,
  },
  mixins: [],
  data() {
    return {
      rectplanExpand: true,
      findExpand: true,
      trackExpand: true,
      delayExpand: true,
      zgqrExpand: true,
      lsxxExpand: true,
      bgExpand: true,
    }
  },
  methods: {
    close(flag) {
      crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
      window.close()
    },
    saved() {
      return false
    },
  },
}
</script>

<style module lang="scss">
@import '@/webflow/sd-flow-form.scss';
.titleHide {
  :global(.title_sd-detail-form_common) {
    display: none;
  }
}
.feedbackForm {
  width: 100%;
  height: 100%;
  :global(span.toptitle.toptitle_audit-form-top-banner_product::after) {
    content: '反馈单';
  }
  :global(span.toptitle.toptitle_audit-form-top-banner_product span) {
    display: none;
  }
}
.tablexm tr td {
  border: none !important;
}
</style>
