<!--
 * @Descripttion:
 * @version:
 * @Author: 王三华
 * @Date: 2023-05-04 20:20:52
-->
<template>
  <div class="">

    <div class="tit">{{ '复购券均分' }} </div>
    <div class="xian"></div>
    <div class="table">
      <el-table :data="allData"
                border
                style="width: 60%;">
        <el-table-column align="center"
                         prop="actName"
                         :label="'订单类型'">
          <template slot-scope="scope">
            <el-select v-model="scope.row.orderTypeList"
                       size="medium"
                       multiple
                       :placeholder="'订单类型'">
              <el-option v-for="item in orderList"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value">
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column align="center"
                         prop="actStartDate"
                         label="满足金额(￥)">
          <template slot-scope="scope">
            <el-input v-model="scope.row.orderAmount"
                      size="medium"
                      placeholder="请输入满足金额(￥)"></el-input>
          </template>
        </el-table-column>
        <el-table-column align="center"
                         prop="actEndDate"
                         :label="'满足业绩'+`(${isLocals()})`">
          <template slot-scope="scope">
            <el-input v-model="scope.row.orderAchieve"
                      size="medium"
                      :placeholder="'请输入满足业绩'+`(${isLocals()})`"></el-input>
          </template>
        </el-table-column>
        <el-table-column align="center"
                         prop="status"
                         :label="'比例'">
          <template slot-scope="scope">
            <el-input v-model="scope.row.ratioValue"
                      size="medium"
                      :placeholder="'请输入'"></el-input>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import * as api from '@/api/giftGoods.js'
import {isLocals} from "@/utils/numberToCurrency";
export default {
  components: {},
  data() {
    return {
      allData: [
        {
          orderTypeList: [],
          orderAmount: '',
          orderAchieve: '',
          ratioValue: '',
        },
      ],
      orderList: [],
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    isLocals,
    getPage(allData) {
      if (allData != '') {
        this.allData = [allData]
      }
    },
    getData() {
      api.getOrderType().then((res) => {
        this.orderList = res.data
      })
    },
    // tableRowClassName({ row, rowIndex }) {
    //   if (rowIndex % 2 == 1) {
    //     return 'warning-row'
    //   } else if (rowIndex % 2 == 0) {
    //     return 'success-row'
    //   }
    //   return ''
    // },
  },
}
</script>

<style lang="scss" scoped>
// .page {
//   padding: 20px;
//   background: #f9f9f9;
//   font-size: 14px;
.main_a {
  // height: calc(100vh - 124px);
  // display: flex;
  // flex-direction: column;
  // height: calc(100vh - 164px);
  // height: 100%;
}
.main {
  background: #ffffff;
  border-radius: 8px;
  height: calc(100vh - 164px);
  padding-bottom: 20px;
  box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
::v-deep .el-select {
  width: 100%;
}
// }
.footer {
  height: 68px;
  background: #ffffff;
  box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
  // margin: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  .thebtn1 {
    background: #3181e5;
    color: #ffffff;
    padding: 9px 45px;
  }
  .thebtn2 {
    background: #cccccc;
    color: #ffffff;
    padding: 9px 45px;
  }
}
.tit {
  font-size: 14px;
  font-weight: bold;
  color: #333333;
  padding: 0 20px;
  border-left: 5px solid #c8161d;
  margin: 20px 0 10px 0;
}
.xian {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}
.demo-ruleForm {
  padding: 20px 0;
}
::v-deep .el-date-editor--datetimerange {
  width: auto !important;
}
.flexed {
  display: flex;
}
.flexed_l {
  margin-right: 20px;
}
.table {
  padding: 0 20px;
  margin-top: 20px;
}

table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  border: 1px solid #cccccc;
  border-spacing: 0;
  table-layout: fixed;
  border-collapse: collapse;
  //   合并内外边距
  // (去除表格单元格默认的2个像素内外边距*/
}
.table_b {
  border-top: 0;
}
th {
  padding: 10px 10px;
  text-align: center;
  border: 1px solid #cccccc;
  overflow: hidden;
  border-top: 0;
}
td {
  padding: 10px 10px;
  text-align: center;
  border: 1px solid #cccccc;
  border-top: 0;
  overflow: hidden;
}
.tableFlex {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  .tableFlex_i {
    flex: 1;
    ::v-deep .el-input__inner {
      width: 90%;
    }
    ::v-deep .el-input__suffix {
      right: 15px;
    }
  }
}
.tableAdd {
  width: 50px;
  img {
    width: 19px;
    height: 19px;
  }
}
.tableAddPro {
  display: flex;
  align-items: center;
  justify-content: center;
  img {
    width: 19px;
    height: 19px;
    margin-left: 10px;
  }
}
.tableLeft {
  text-align: left;
}
.tabList {
  display: flex;
  align-items: center;
  padding: 20px 0px 0 20px;
  .tabList_i {
    padding: 10px;
    font-size: 14px;
    font-weight: 400;
    color: #999999;
    cursor: pointer;
  }
  .tabAct {
    background: #108ee9;
    color: #fff;
  }
}
.clearBtm {
  border-bottom: 0;
}
.cpHeight {
  height: 50vh;
  overflow-y: auto;
}
.blueCor {
  color: #589ff8;
  cursor: pointer;
}
</style>
