<template>
  <a-card :bordered="true">

        <a-tabs style="text-align: center">
          <a-tab-pane tab="流程正文" key="1" forceRender>
            <process-udget-plan-form  :isNew="isNew" :processData="processData" :disabled="disabled"  @afterSubmit="afterSub" @close="close" :task="task" @passTask="passTask" @backTask="backTask" :hieg="hieg" @loadData="loadData" :isPlanType="isPlanType"
                                      :isSourceCapital="isSourceCapital" :routePlanName="routePlanName" :itemId="itemId"/>
          </a-tab-pane>

          <a-tab-pane tab="流程节点图" key="2" forceRender>
            <historic-pictrue :pictureId="pictureId" :procInstId="procInstId" />
          </a-tab-pane>
          <a-tab-pane tab="审批历史" key="3" forceRender>
            <historic-detail :pictureId="pictureId" :procInstId="procInstId"/>
          </a-tab-pane>
          <a-tab-pane tab="制式表格" key="4" forceRender v-if="isTable">
            <ProcessMaterialsPlanList :isTable="isTable"   :materWared="this.$route.query.item"/>
          </a-tab-pane>
        </a-tabs>

   <!-- <a-tabs style="text-align: center">
      <a-tab-pane tab="流程正文" key="1" forceRender>
        <process-udget-plan-form :isNew="isNew" :processData="processData" :disabled="disabled" @afterSubmit="afterSub" @close="close" :task="task" @passTask="passTask" @backTask="backTask" :hieg="hieg" @loadData="loadData"/>
      </a-tab-pane>

        <a-tab-pane tab="流程节点图" key="2" forceRender>
          <historic-pictrue :pictureId="pictureId" :procInstId="procInstId" />
        </a-tab-pane>
        <a-tab-pane tab="审批历史" key="3" forceRender>
          <historic-detail :pictureId="pictureId" :procInstId="procInstId"/>
        </a-tab-pane>
    </a-tabs>-->
  </a-card>
</template>

<script>

  import ProcessUdgetPlanForm from './ProcessUdgetPlanForm'
  import historicPictrue from '../historicPictrue'
  import historicDetail from '../historicDetail'
  import ProcessMaterialsPlanList from '../../accessrecords/plan/ProcessMaterialsPlanList'
  var docxx = require("docx-preview");
  export default {
    name: 'ProcessUdgetPlan',
    components: {ProcessUdgetPlanForm,historicPictrue, historicDetail,ProcessMaterialsPlanList},
    data() {
      return {
        tabKey:2,
        noDisabled:true,
        onlineDisabled:true
      }
    },
    props: {
      /*流程数据*/
      isNew: {type: Boolean, default: false, required: false},
      task: {type: Boolean, default: false, required: false},
      isTable:{type: Boolean, default: false, required: false},
      /*采购类型*/
      isPlanType: {type: Boolean, default: false, required: false},
      /*资金来源*/
      isSourceCapital:{type: Boolean, default: false, required: false},
      routePlanName:{type:String,default:'',required: false},
      itemId:{type:String,default:'',required: false},
      processData:{
        type:Object,
        default:()=>{return {}},
        required:false
      },
      pictureId: {
        type: String,
        default: '',
        required: true
      },
      procInstId: {
        type: String,
        default: '',
        required: true
      },
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      hieg: {
        type: Boolean,
        default: true,
        required: false
      },
    },
    // props: {
    //   /*流程数据*/
    //   processData:{
    //     type:Object,
    //     default:()=>{return {}},
    //     required:false
    //   },
    //   /*是否新增*/
    //   isNew: {type: Boolean, default: false, required: false},
    //   /*是否处理流程*/
    //   task: {type: Boolean, default: false, required: false},
    //   //流程表单data
    //   formData: {
    //     type: Object,
    //     default: () => {
    //     },
    //     required: false
    //   },
    //   //表单模式：false流程表单 true普通表单
    //   formBpm: {
    //     type: Boolean,
    //     default: false,
    //     required: false
    //   },
    //   //表单禁用
    //   disabled: {
    //     type: Boolean,
    //     default: false,
    //     required: false
    //   }
    // },
    created() {
      console.log(this.itemId,"this.itemId")
       this.$route.query.item=this.itemId
    },
    methods: {
      afterSub(formData){
        this.$emit('afterSubmit',formData)
      },
      close() {
        //todo 关闭后的回调
        this.$emit('close')
      },
      /*通过审批*/
      passTask() {
        this.$emit('passTask')
      },
      /*驳回审批*/
      backTask() {
        this.$emit('backTask')
      },
      loadData(){
        this.$emit('loadData')
      },
      changeTables(val){
        this.planType=Number(val);
      },
    },
  }
</script>

<style scoped>

</style>