<style>
</style>
<template>
    <div class="Business">
      <div class="add-Enclosure">
        <el-button plain icon="el-icon-plus" type="primary" size="mini" class="margin-right0" @click="addBusiness">创建订单</el-button>
      </div>
      <el-table
        v-loading="loading"
        stripe
        ref="multipleTable"
        :data="dataList"
        tooltip-effect="dark"
        style="width: 100%"
        row-class-name="font-size-12">
        <el-table-column 
            prop="BusinessName"
            label="订单号"
            show-overflow-tooltip>
            <template slot-scope="scope">
              <p @click="openDetails(scope)" class="font-color-link cp">{{scope.row.BusinessName}}</p>
            </template>
        </el-table-column>
        <el-table-column 
            prop="BudgetPrice"
            label="订单金额"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            prop="CustomerName"
            label="实收"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            prop="BusinessStatusStr"
            label="退款"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="手续费"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="待收"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="成本"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="出票状态"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="客户需求"
            show-overflow-tooltip>
        </el-table-column>
        <el-table-column 
            label="操作"
            show-overflow-tooltip>
        </el-table-column>
      </el-table>
    </div>
</template>
<script>
export default {
  props: ["ID", "BusinessType"],
  data() {
    return {
      dataList: [],
      loading: false,
    };
  },
  watch: {},
  mounted() {
    this.GetBusinessList();
  },
  methods: {
    openDetails(scope) {
      console.log(scope.row.ID);
      this.MsgBus.$emit("busnessDrawerShow", scope.row.ID, 1);
    },
    GetBusinessList() {
      this.apipost(
        "/api/Customer/GetBusinessList",
        { CustomerId: this.ID, CustomerType: 1 },
        (res) => {
          if (res.data.resultCode == 1) {
            console.log(res.data.data);
            this.dataList = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        }
      );
    },
    addBusiness() {
      let $this = this;
      this.MsgBus.$emit("addBusinessBoxOpen", $this.ID, 0, true);
    },
    guanlian() {},
    jiechuguanlian() {},
  },
};
</script>
