<template>
  <div class="result" showPage='false'>
    
    <div class="type">
      <div class="left">
        <span>*</span>
        <span v-if="checkType == 1">处理意见</span>
        <span v-if="checkType == 2">处理结果</span>
      </div>
      <div class="right">
        <AiSelect v-model="operation" dict="fpRiskPersonOperation1" v-if="checkType == 1" />
        <AiSelect v-model="operation" dict="fpRiskPersonOperation2" v-if="checkType == 2" />
      </div>
    </div>

    <div class="remark">
      <div class="top">
        <span>*</span><span>备注说明</span>
      </div>
      <div class="bottom">
        <u-input type="textarea" v-model="opinion" placeholder="请简要说明情况" maxlength="500" height="200"/>
      </div>
    </div>

    <div class="picture">
      <div class="top">
        <span style="margin-right: 8px"></span><span>图片<span style="color: #999;font-size:14px;">最多9张</span></span>
      </div>
      <div class="bottom">
        <AiUploader :def.sync="files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
      </div>
    </div>

    <div class="btn" @click="submit">提交</div>

  </div>
</template>

<script>
export default {
  data() {
    return {
      operation: '',
      opinion: '',
      checkType: '',
      files: [],
      showPage: false,
      id:''
    }
  },
  onLoad(o) {
    this.$dict.load('fpRiskPersonOperation1','fpRiskPersonOperation2','fpRiskType').then(()=>{
      this.checkType = o.checkType
      this.id = o.id
      this.showPage = true
    })
  },
  methods: {
    submit() {
      if(!this.operation) {
        return this.$u.toast('请选择处理意见')
      }
      if(!this.opinion) {
        return this.$u.toast('请输入备注说明')
      }
      let ids = [];
      ids.push(this.id);
      this.$http.post('/app/apppreventionreturntopovertyriskperson/monitor',{
        operation: this.operation,
        opinion: this.opinion,
        files: this.files,
        ids: ids,
      }).then(res => {
        if (res.code == 0) {
          this.$u.toast('提交成功')
          uni.$emit('update')
          setTimeout(() => {
            uni.navigateBack({delta: 2})
          },600)
        }
      })
    }
  },
  onShow() {
    document.title = this.checkType == 1? "处理意见":this.checkType == 2? "处理结果": ''
  }
}
</script>

<style lang="scss" scoped>
.result {
  .type {
    height: 112px;
    line-height: 112px;
    background: #FFF;
    font-size: 32px;
    display: flex;
    justify-content: space-between;
    padding: 0 32px;
    box-sizing: border-box;
    .left {
      span:first-child {
        color: #FF4466;
      }
      span:last-child {
        color: #333333;
      }
    }
  }
  .remark,
  .picture {
    box-sizing: border-box;
    margin-top: 16px;
    background: #FFF;
    padding: 0 32px;
    font-size: 32px;
    .top {
      padding-top: 20px;
      span:first-child {
        color: #FF4466;
      }
      span:last-child {
        color: #333333;
      }
    }
    .bottom {
      padding: 30px 0;
    }
  }

  .btn {
    height: 112px;
    line-height: 112px;
    text-align: center;
    background: #3192F4;
    color: #FFF;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 32px;
  }
}
</style>