<style>
  .freight .form-box{
    background: #fff;
    padding: 10px 0px 0px;
    margin-top: 10px;
  }
  .freight .table-body{
    padding: 20px;
    background-color: #fff;
    margin-bottom: 20px;
  }
  .freight .input-item{
    width: 250px;
    margin: 0 0 20px;
  }
  .freight .imgstyle{
    width: 32px;
    height: 32px;
    margin: 0 5px;
  }
</style>
<template>
  <div class="freight">
    <div id="pane-first">
      <div class="form-box">
        <div class='table-body'>
          <div style="justify-content: space-between; display: flex;">

            <div class="input-item">
              <el-input placeholder="请输入内容" v-model="msg.RulesName" >
                <el-button slot="append" icon="el-icon-search"></el-button>
              </el-input>
            </div>
            <el-button type="primary" style="margin: -5px 0px; width: 80px; height: 32px; padding: 0" @click="addRule">添加规则</el-button>

          </div>

          <el-table
            :data="list"
            border
            style="width: 1699px">
            <el-table-column
              fixed
              prop="RulesName"
              label="规则名称"
              width="1339">
            </el-table-column>
            <el-table-column
              label="是否默认"
              width="180">
              <template slot-scope="scope">
                <el-radio v-model="radio" :label="scope.row.ID" @change="radioChange">
                  <span class="el-radio__label">默认</span>
                </el-radio>
              </template>
            </el-table-column>

            <el-table-column
              fixed="right"
              label="操作"
              width="180">
              <template slot-scope="scope">
                <el-tooltip class="item" effect="dark" content="编辑" placement="top" >
                  <img src="../../../assets/img/setup/edit.png" alt="" class="imgstyle">
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="删除" placement="top">
                  <img src="../../../assets/img/setup/del.png" alt="" class="imgstyle">
                </el-tooltip>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
                         layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="total">
          </el-pagination>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
    export default {
        name: "freight",
        data(){
          return{
            list:[],
            msg:{
              pageIndex:1,
              pageSize:20,
              RulesName:'',
            },
            radio:'',//单选按钮绑定值
            total:0,//是否有数据
            currentPage:1,//当前第几页
          }
        },
      methods:{
        GetLogisticsRulesPage(){
          this.apipost("/api/MallBase/GetLogisticsRulesPage", this.msg, res => {
            if (res.data.resultCode == 1) {
              this.list = res.data.data.pageData;
            } else {
              this.Info(res.data.message);
            }
          })
        },
        radioChange(){

        },
        handleCurrentChange(){

        },
        addRule(){
          this.$emit("AddRule",);
        }
      },
      mounted(){
          this.GetLogisticsRulesPage()
      }

    }
</script>

<style scoped>

</style>
