<template>
  <div class="acceptance-legal-review">
    <div class="tempalte-content" style="min-height: auto; padding: 0px 20px ">
      <contract-files :details="contractInfo"></contract-files>
      <up-acceptance-sheet :details="upFiles"></up-acceptance-sheet>
      <down-acceptance-sheet v-show="downFiles.file.length" :details="downFiles"></down-acceptance-sheet>
      <acceptance-conclusion :deatails-info="conclusionInfo" :disabled="true"></acceptance-conclusion>
    </div>
  </div>
</template>

<script >

import ContractFiles from '../ContractFiles.vue'
import DownAcceptanceSheet from '../DownAcceptanceSheet'
import UpAcceptanceSheet from '../UpAcceptanceSheet.vue'
import AcceptanceConclusion from '../AcceptanceConclusion'
export default {
  name: 'AcceptanceLegalReview',
  components: {
    ContractFiles,
    UpAcceptanceSheet,
    DownAcceptanceSheet,
    AcceptanceConclusion
  },
  props: {
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      submitDisable: false,
      contractInfo: {},
      upFiles: {},
      downFiles: {
        file: []
      },
      signConfirm: {},
      conclusionInfo: {}
    }
  },
  watch: {
    detailsInfo: {
      handler(newV) {
        if (newV && Object.keys(newV).length) {
          const {
            purchContract, // 采购
            salesContract, // 销售
            acceptanceUpstreamFileSign, // 上游
            signConfirmFiles, // 下游
            approvalConclusion,
            approvalComment
          } = JSON.parse(JSON.stringify(newV))

          this.conclusionInfo = { approvalConclusion, approvalComment }

          this.contractInfo = {
            purchContract,
            salesContract
          }

          this.upFiles = { file: acceptanceUpstreamFileSign }
          this.downFiles = { file: signConfirmFiles || [] }
        }
      },
      immediate: true,
      deep: true
    }
  }

}
</script>

  <style lang="scss" scoped>
    /* .template-examine .submit-btn {
      position: absolute;
      bottom: 40px;
      right: 40px;
    } */
  </style>

