<template>
  <div>
    <div class="ls-btn-row" style="padding: 20px 0px 15px;font-weight: bold;">
      <span class="c77FA">审批意见</span>
    </div>

    <div>
      <div>
          <div class="demo-ruleForm" style="margin-bottom: 0;margin-bottom: 10px;">
            <span style="padding-right: 20px;" v-show="handle">请处理：</span>
            <el-radio-group class="cl" v-model="param.result" style="margin-right: 30px;"
              v-for="(item,index) in processStatus" :key="index">
              <el-radio :label="item.vaule">{{item.key}}</el-radio>
            </el-radio-group>
          </div>
      </div>


      <div v-show="param.result==='change'&&param.moduleId==='3104'"
        style="display: flex;align-items: center; padding: 10px 0px 10px 0px">
        <div style="margin-right: 10px;">转办人：</div>
        <div style="width: 270px;">
            <aws-org :ismuti="false" v-model="taskUserdata" :isDialog="true" :sid="sid"
              :editable="openType == 'view' ? false : true" ref="awsorgRefTwo" @submit="responsible"></aws-org>
            </el-col>
        </div>
      </div>
    </div>

    <el-form ref="information" label-width="0px">
      <el-form-item label="">
        <el-input type="textarea" placeholder="请输入处理说明" maxlength="300" show-word-limit v-model="param.content"
          :autosize="{ minRows: 2, maxRows: 4 }"></el-input>
      </el-form-item>
    </el-form>



  </div>
</template>

<script>
  import commonSelectList from '../common/commonSelectList.js';
  export default {
    name: 'operation-reviewer',
    props: {
      operateParam: {
        type: Object,
        default: () => [],
        required: true
      }
    },

  computed: {
    sid() {
      return this.$common.getUrlParams('sid');
    },
    uid(){
      return this.$common.getUrlParams('uid');
    }
  },
      watch:{
          operateParam: {
            handler: function(val) {
              debugger;
              this.param.busId = val.busId;
              this.param.uid=this.uid;
              this.param.moduleId = val.moduleId;
              if (val != null) {
                if (val.busId != null && val.moduleId != null) {
                  this.getOperReviewer();
                }
              }
            },
            deep: true
          },
        },

        data() {
          return {
            baseInfo: {},
            detailStatus: {},
            processStatus: [],
            taskUserdata: [],
            typestatus: "",
            openType:"",
            informationtxt: "",
            handle:1,
            submitStatus: [],
            param: {
              uid:'',
              handle:false,
              buttion: false,
              busId: "",
              moduleId: "",
              busStatus: "",
              content: "",
              createTime: "",
              creater: "",
              result: "",
              reviewerType: "",
              status: "Y",
            },
          }
        },
      mounted() {},
      methods: {
        // 根据业务ID及模块ID获取操作动作及是否显示等信息
        getOperReviewer(vaule) {
          var that = this
          this.$ajax.post({
            domain: 'crmUrl',
            url: 'reviewer.getOperReviewer',
            data: that.param,
            requestType: 'body',
            showLoad: true,
            success: function(res) {
              that.baseInfo = res.data || {};
              if (res.data.dictList==""||res.data.dictList==undefined) {
                  this.handle=0
                  that.param.handle=this.handle
              }
                that.processStatus = that.baseInfo.dictList;
                that.param.buttion = that.baseInfo.buttion //要根据这个状态传递到父组件去判断
                that.$emit('send', that.param)
              console.log("processStatus================>", that.processStatus)
            }.bind(that),
            error: function(res) {
              that.$message({
                type: 'error',
                message: res.body.msg || res.msg
              })
            }.bind(that)
          })
        },
        //获取负责人名字以及id
        responsible(data) {
          this.param.taskUserName = data[0].name;
          this.param.taskUserId = data[0].id;
          console.log("this.param===========>", this.param)
        },
        resetAws(taskUserList, personList) {
          this.$refs.awsorgRef.reset(personList);
          this.$refs.awsorgRefTwo.reset(taskUserList);
        }
      }
    };
</script>

<style lang="scss">
  .demo-ruleForm {
    .el-radio-group {
      margin-right: 16px;
    }

    .el-radio__label {
      font-size: 13px;
    }
  }
</style>
