<template>
  <div  class="caret-wrapper">
    <div >
      <el-dialog title="卡诊断" center :visible.sync="visible" width="500px">
        <div v-loading="loading" >
          <el-form v-model="resData">
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="IMEI:">
              {{ resData.imei }}
            </el-form-item>
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="IMSI:">
              {{ resData.imsi }}
            </el-form-item>
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="上下线时间:">
              {{ resData.eventTimestamp }}
            </el-form-item>
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="是否在线:">
              <div v-if="resData.isNetwork=='0'">是</div>
              <div v-if="resData.isNetwork=='1'">否</div>
              <div v-if="resData.isNetwork=='01'">是</div>
              <div v-if="resData.isNetwork=='00'">否</div>
            </el-form-item>
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="接入号:">
              {{ resData.msisdn }}
            </el-form-item>
            <el-form-item style="background-color: #e8eaec;border-radius:2px" label="最后一次上线时间:">
              {{ resData.startTime }}
            </el-form-item>
            <!--        <el-form-item style="background-color: #e8eaec;border-radius:2px" label="下线原因:">-->
            <!--          {{resData.terminateCause}}-->
            <!--        </el-form-item>-->
          </el-form>
        </div>

      </el-dialog>
    </div>
  </div>
</template>
<script>
import tools from "@/utils/yunze/tools";
import {cardDia} from "@/api/yunze/flowcard/card/card";

export default {
  name: "cardSynDia",
  props: ['params'],
  data() {
    return {
      visible: false,
      loading:false,
      sel: {
        iccid: "",
      },
      resData: {}
    }
  },
  created() {
    this.refData(va);
  },
  methods: {
    refData(va) {
      this.loading=true
      this.visible = true;
      this.sel.iccid = va;
      let Pwd_Str = tools.encrypt(JSON.stringify(this.sel))
      cardDia(Pwd_Str).then(res => {
        let jsonobj = JSON.parse(tools.Decrypt(res))
        if (jsonobj.code == 200) {
          this.resData = jsonobj.Data;
          this.loading=false;
          this.$message.success("卡信息获取成功 !")
        } else {
          this.visible = false;
          this.loading=false;
          this.$message.error("卡信息获取失败 !")
        }
      })
    }
  }
}
</script>


<style scoped>

</style>
