<template>
  <div class="order_detail">
    <el-row :gutter="20">
      <el-col :md="24" class="order_detail_body">
        <el-card shadow="hover">
          <el-col :md="21">
            <p class="title_sub"><span class="green">{{ name }}</span> 	河南足力健老人鞋 {{ createtime }}</p>
          </el-col>
          <el-col :md="24" class="order_detail_content">
            <el-col :md="24" class="order_detail_item">
              合并订单：{{ detailData.F_OrderList }}
            </el-col>
            <el-col :md="6" class="order_detail_item">
              合并类型：{{ detailData.F_Type }}
            </el-col>
            <el-col :md="6" class="order_detail_item">
              赠送商品：{{ detailData.F_Gift }}
            </el-col>
            <el-col :md="6" class="order_detail_item">
              减免金额：{{ detailData.F_Money }}
            </el-col>
            <el-col :md="6" class="order_detail_item">
              销售备注：{{ detailData.F_Remark }}
            </el-col>
            <!-- <el-col :md="8" :offset="16"> -->
              <!-- <el-button type="primary" size="mini" plain @click="edit()">编辑</el-button> -->
            <!-- </el-col> -->
          </el-col>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getConsolidateOrderList } from '@/api/orderManagement/consolidateOrderList'

export default {
  name: 'Detail',
  props: {
    rowid: {
      type: String,
      default: ''
    },
    layerid: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      detailData: {
        F_Id: '',
        F_OrderList: '', //合并订单
        F_Type: '', //合并类型
        F_Gift: '', //赠送商品
        F_Money: '', //减免金额
        F_Remark: '', //销售备注
      },
    }
  },
  computed: {
  },
  created() {
    if (this.rowid) {
      this.getDetail(this.rowid)
    }
  },
  methods: {
    handleClick(tab, event) {
    },
    // 获取订单详情
    getDetail(orderId) {
      this.loading = true;
      return new Promise(resolve => {
        const params = {
          F_State: '-2', //订单状态
          f_id: orderId,
        };
        getConsolidateOrderList(params).then(response => {
          this.loading = false;
          if (response.state.toLowerCase() === "success") {
            const res = response.data.Rows[0]
            this.detailData.F_OrderList = res.F_OrderList //合并订单
            this.detailData.F_Type = res.F_Type //合并类型
            this.detailData.F_Gift = res.F_Gift //赠送商品
            this.detailData.F_Money = res.F_Money //减免金额
            this.detailData.F_Remark = res.F_Remark //销售备注
          }
        });
        resolve();
      });
    },
    // edit(){
    //   this.$router.push({path:'/edit',query:{id:this.ordercode}})
    // }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
	.order_detail{
    .el-col{
			margin-bottom: 20px;
		}
		.el-icon-time{
			color: #d81e06;
		}
		.order_detail_body{
			margin-bottom: 20px;
			.title{
				font-size: 20px;
				.title_icon{
					color: #d81e06;
					font-size: 16px;
					margin-right: 20px;
				}
			}
			.title_sub{
				font-size: 14px;
				color: #666666;
			}
			.order_detail_content{
				background-color: #F5F5F6;
				padding-top: 20px;
				color: #4c4c4c;
				font-size: 14px;
				.order_detail_item{
					margin-bottom: 10px;
					.order_content{
						margin-top: 10px;
					}
				}
			}
		}
		.green {
			color: #00c1de;
		}
		.done {
			color: #198120;
		}
		.red {
			color: #d81e06;
		}
		.yellow{
			color: #e6a23c;
		}
		.tab_body{
			padding: 0 20px 20px 20px;
		}
	}
</style>
