<style>
.modal-content{
  border-radius:10px;
}
.modal-header{
  border-radius:10px;
  height: 40px;;
  background-color:rgb(234, 239, 244);
}
</style>
<template>
  <modal :show.sync="$parent.showModal" width="60%" class="modal-all"  v-ref:modal :backdrop="false">
    <div slot="modal-header" class="modal-header">
      <button type="button" class="close" @click="cancel()"><span>&times;</span></button>
      <h5 class="modal-title text-left">
        信息审核>({{info.f_approved}})
      </h5>
    </div>
    <div slot="modal-body" class="modal-body">
      <div class="row auto form-horizontal">
        <!--<div class="form-group">
          <div class="col-sm-6">
         <label class="col-sm-4">用户编号：</label>
         <div class="col-sm-6"><input type="text" class="form-control" v-model="info.f_userinfo_code" readonly="true"></div>
         </div>
       </div>
         <hr>-->
        <div class="row">
          <div class="col-sm-12" v-if="info.f_modify_type == '用户档案'">
            <div :class="'col-sm-6'" style="float:left">
              <div class="row"><label class="col-sm-5"><img src="../../assets/档案信息.png" style="width: 20px;margin-bottom: 5px;margin-right: 10px" alt="">档案信息(最新)：</label></div>
              <userinfo-modify  :content.sync="nomodify"></userinfo-modify>
            </div>
            <div :class="'col-sm-6'">

              <div class="row"> <label class="col-sm-5"><img src="../../assets/安检信息.png" style="width: 20px;margin-bottom: 5px;margin-right: 10px" alt="">安检变更信息：</label></div>
              <userinfo-modify  :content.sync="info"></userinfo-modify>
            </div>
            <!--<div class="col-sm-4" style="float:right" v-if="info.f_approved == '已审核'">

              <label class="col-sm-4"><img src="../../assets/档案信息.png" style="width: 20px;margin-bottom: 5px;margin-right: 10px" alt="">现档案信息：</label>
              <userinfo-modify  :content.sync="nomodify"></userinfo-modify>
            </div>-->
          </div>
          <div class="col-sm-12" v-if="info.f_modify_type == '表档案'">
            <div class="col-sm-6" style="float:left">
              档案信息：
              <meter-modify :content.sync="nomodify"></meter-modify>
            </div>
            <div class="col-sm-6" style="float:right">
              安检信息：
              <meter-modify :content.sync="content"></meter-modify>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div slot="modal-footer" class="modal-footer" >
      <button type="button" class="btn btn-primary" style="border-radius: 3px" @click="$parent.todo(info)" v-if="info.f_approved == '未审核'">通过</button>
      <button type="button" class="btn" style="background-color: #5bc0de;border-radius: 3px" @click="$parent.undo(info)" v-if="info.f_approved == '未审核'">不通过</button>
      <button type="button" class="btn" style="background-color: #5bc0de;border-radius: 3px" @click="cancel()" v-if="info.f_approved != '未审核'">关闭</button>
    </div>
  </modal>
</template>

<script>
import { PagedList,HttpResetClass} from 'vue-client'
import Vue from 'vue'
import * as Util from '../Util'
import UserinfoModify from  './UserinfoModify'
import MeterModify from  '../../../components/userfile/MeterModify'

export default {
  components: {
    'userinfo-modify': UserinfoModify,
    'meter-modify':MeterModify
  },
  title:'信息审核',
  props:['info','userinfome'],
  data(){
    return {
      nomodify:{},
      content:{},
      history:{}
    }
  },
  methods:{
    cancel(){
      this.$parent.showModal = false
    }
  },
  watch:{
    'info'() {
      //tag
      if (JSON.stringify(this.info) != '{}') {
        //tag)
        this.nomodify={
          f_userinfo_code:this.userinfome.baseinfo.base.f_userinfo_code,
          f_user_name:this.userinfome.baseinfo.base.f_user_name,
          f_user_phone:this.userinfome.baseinfo.base.f_user_phone,
          f_remark:this.userinfome.baseinfo.base.f_remark,
          f_used_name:this.userinfome.baseinfo.base.f_used_name,
          f_rent_phone:this.userinfome.baseinfo.base.f_rent_phone,
          f_pcd:this.userinfome.addressinfo.f_pcd,
          f_street:this.userinfome.addressinfo.f_street,
          f_residential_area:this.userinfome.addressinfo.f_residential_area,
          f_building:this.userinfome.addressinfo.f_building,
          f_unit:this.userinfome.addressinfo.f_unit,
          f_floor:this.userinfome.addressinfo.f_floor,
          f_room:this.userinfome.addressinfo.f_room,
          f_address:this.userinfome.addressinfo.f_address,
          f_iscity:this.userinfome.addressinfo.f_iscity,
          f_special:this.userinfome.addressinfo.f_special,
          f_slice_area:this.userinfome.addressinfo.f_slice_area,
          f_meternumber:this.userinfome.meterinfo[0].f_meternumber,
          f_card_id:this.userinfome.meterinfo[0].f_card_id
        }
      }
    }
  }
}
</script>

