<!--
 * @Author: Aimee~
 * @Date: 2023-05-11 12:02:45
 * @LastEditTime: 2023-07-05 10:04:59
 * @LastEditors: Aimee
 * @FilePath: /douhuo-agent/src/components/OrderDetailInfo/OrganizationSchemes.vue
 * @Description:预估方案和结案方案一同处理
-->
<template>
  <div>
    <a-card :bordered="false" v-if="schemes[0]" style="margin-top: 24px" :title="`预估方案 (${schemes[0].business_type.title})`">
      <template #extra v-if="closeScheme == '{}'">
        <a @click.stop="surePlan"><span>新增结案方案</span></a>
      </template>
      <a-descriptions
        layout="horizontal"
        size="middle"
        :bordered="true"
        :column="{ xxl: 4, xl: 4, lg: 4, md: 1, sm: 1, xs: 1 }"
      >
        <a-descriptions-item
          v-for="item in schemes[0].params"
          :key="item.key"
          :label="item.title"
          :span="2"
        >
          <div class="row jc_sb">{{ item.value || '--' }}</div>
        </a-descriptions-item>
      </a-descriptions>
    </a-card>
    <a-card :bordered="false" v-if="closeScheme != '{}'&& closeScheme.status" style="margin-top: 24px" :title="`结案方案 (${closeScheme.status.text})`">
      <template #extra >
        <a @click.stop="surePlan"><span>查看结案方案</span></a>
      </template>
      <a-descriptions
        layout="horizontal"
        size="middle"
        :bordered="true"
        :column="{ xxl: 4, xl: 4, lg: 4, md: 1, sm: 1, xs: 1 }"
      >
        <a-descriptions-item
          v-for="item in closeScheme.params"
          :key="item.key"
          :label="item.title"
          :span="2"
        >
          <div class="row jc_sb">{{ item.value || '--' }}</div>
        </a-descriptions-item>
      </a-descriptions>
    </a-card>
  </div>
</template>
<script>
import ItemPopover from './modules/ItemPopover.vue'
export default {
  components: {
    ItemPopover
  },
  name: 'OrganizationSchemes',
  props: {
    schemes: {
      type: Array,
      default: () => {
        return []
      }
    },
    itemId: {
      type: String,
      default: ''
    },
    orderId: {
      type: String,
      default: ''
    },
    closeScheme: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {}
  },
  methods: {
    surePlan () {
      this.$router.push({
        name: 'ConfirmPlan',
        params: {
          itemId: this.itemId,
          orderId: this.orderId
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
.row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.ai_start {
  align-items: flex-start;
}
.jc_start {
  justify-content: flex-start;
}
.jc_sb {
  justify-content: space-between;
}
.js_start {
  justify-content: start;
}
.a-des-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  .pl50 {
    margin-left: 50px;
  }
  .inputT {
    flex: 1;
    margin-left: 50px;
  }
}
</style>
