<template>
    <div class="confirm">
      <CommonInfo :tradeData="tradeData"/>
      <div style="margin: 11px 30px;color: #1890ff;">部门长审核</div>
      <el-row style="margin-left:95px">
        <el-col :span="8">
          <div >
            <span style="color: #d0d0d0">买方经办人</span> {{tradeData.tradeTransactorName}}
          </div>
        </el-col>
        <el-col :span="8">
          <div >
            <span style="color: #d0d0d0">评分</span> {{tradeData.tradeScore}}
          </div>
        </el-col>
        <el-col :span="8">
          <div >
            <span style="color: #d0d0d0">交易成交价</span> {{tradeData.dealPrice}}
          </div>
        </el-col>
      </el-row>
      <el-row style="margin-left:95px;padding-top: 15px">
        <el-col :span="24">
          <span style="color: #d0d0d0">说明</span> {{tradeData.dealRemark}}
        </el-col>
      </el-row>

      <el-row style="margin-left:95px; padding-top: 10px">
        <el-col :span="10" style="margin-top: 15px">
<!--          <el-checkbox v-model="checked">我已知晓</el-checkbox>-->
          <el-row>
            <el-col :span="6">
              <el-radio v-model="radio" label="1">通过</el-radio>
            </el-col>
            <el-col :span="6">
              <el-radio v-model="radio" label="2">不通过</el-radio>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="10" style="margin-top: 5px">
          <span style="margin: 0px 5px;">审批人</span>
          <el-input :value="$store.state.user.nickName" style="width: 130px" disabled/>
        </el-col>
      </el-row>
      <el-row style="margin-left:90px; padding-top: 5px">
        <el-col :span="24">
          <span style="margin: 0px 5px; line-height: 60px">审核意见</span>
          <el-input v-model="confirmRemark" type="textarea" style="width: 590px"/>
        </el-col>
      </el-row>
      <el-divider></el-divider>
    </div>
</template>

<script>
  import CommonInfo from "./CommonInfo";
  import moment from "moment";
  export default {
    name: "confirm",
    props:{
      tradeData: {
        type: Object
      }
    },
    components:{
      CommonInfo
    },
    data(){
      return{
        // checked: false
        radio: "1",
        tradeStatus: "2",
        confirmRemark: null,
      }
    },
    watch:{
      radio(newVal,oldVal){
        if(newVal== "1"){
          this.tradeStatus = "2";
          this.confirmRemark = "";
        }
        if(newVal== "2"){
          this.tradeStatus = "6";
        }
      }
    },
    methods:{
      resetSuggestion(){
        // this.checked = false;
        this.radio = "1";
      },
      checkParam(){
        // if(!this.checked){
        //   this.$message.error("请勾选须知!");
        //   return true;
        // }
        return false;
      },
      submitSuggestion(){
        return {tradeId:this.tradeData.tradeId,tradeStatus:this.tradeStatus,confirmRemark:this.confirmRemark,tradeDeptManagerId:this.$store.state.user.userId,confirmTime:moment().format('YYYY-MM-DD HH:mm:ss')};
      }
    }
  }
</script>

<style scoped lang="scss">

  .confirm{
    height: 460px;
    overflow-y: auto;
    &::-webkit-scrollbar {
      /* 设置滚动条宽度 */
      width: 4px;
      /* 设置滚动条背景色 */
      //background: black;
    }

    //滚动条轨道
    &::-webkit-scrollbar-track {
      background-color:transparent;
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }

    //滚动条滑块
    &::-webkit-scrollbar-thumb {
      background-color: rgb(147,147,153,0.5);
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }

  }
</style>
