<style>
  .invalidDialogBox.add-box .add-tit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 20px;
  }

  .invalidDialogBox.add-box .add-tit p {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: rgba(17, 17, 17, 1);
    font-size: 14px;
  }

  .invalidDialogBox.add-box .add-tit p span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #409efe;
    border-radius: 50%;
    margin-right: 10px;
  }

  .invalidDialogBox.add-box .el-dialog__header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 1);
  }

  .invalidDialogBox.add-box .dialog-footer {
    text-align: center;
    background-color: rgba(248, 250, 251, 1);
    padding-bottom: 20px;
  }

  .invalidDialogBox.add-box .el-dialog__footer {
    padding: 0;
  }

  .invalidDialogBox.add-box .el-dialog__body {
    background-color: rgba(248, 250, 251, 1);
    padding-top: 20px;
    max-height: 400px;
    overflow: auto;
  }

  .invalidDialogBox .add-box-btn.el-button {
    border-radius: 0;
    background-color: #409efecc;
    border-color: #409efecc;
    color: white;
    padding: 12px 43px;
  }

  .invalidDialogBox .add-box-btn.el-button:hover {
    background-color: #409efe;
    border-color: #409efe;
    color: white;
  }

  .invalidDialogBox .add-box-btn.el-button.add-box-cancel {
    color: #409efecc;
    background-color: white;
  }

  .invalidDialogBox .add-box-btn.el-button.add-box-cancel:hover {
    color: #409efe;
    background-color: white;
  }

  .invalidDialogBox .el-input .el-input-group__append {
    background-color: #409efe;
    border-color: #409efe;
    color: #fff;
  }

  .invalidDialogBox .form-box .form-box-tit {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }

  .invalidDialogBox .form-box .radius {
    display: flex;
    width: 4px;
    height: 4px;
    background: rgba(255, 164, 117, 1);
    border-radius: 50%;
    margin-right: 10px;
  }

  .invalidDialogBox .up-img-box .uib-item {
    margin-right: 30px;
    width: 130px;
    height: 130px;
    background-color: white;
    position: relative;
    margin-bottom: 30px;
  }

  .invalidDialogBox .up-img-box .uib-item p {
    position: absolute;
    bottom: -30px;
    font-size: 12px;
    text-align: center;
    width: 100%;
  }

  .invalidDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
    opacity: 1;
  }

  .invalidDialogBox .imgzhe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
  }

  .invalidDialogBox .imgzhe .imgzhe-btn {
    background: rgba(0, 0, 0, 0.6);
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 120px;
    position: absolute;
    top: 0;
    opacity: 1;
    transition: all linear 0.5s;
  }

  .invalidDialogBox .imgzhe .imgzhe-btn i {
    font-size: 22px;
    margin-right: 5px;
    color: white;
    cursor: pointer;
  }

  .invalidDialogBox .up-ctrl {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }

  .invalidDialogBox .up-ctrl>div {
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 140px;
  }
</style>
<template>
  <el-dialog :visible.sync="dialogTableVisible" @closed="closedDialog" class="add-box add-box1 invalidDialogBox"
    width="450px" append-to-body>
    <div class="add-tit" slot="title">
      <p><span></span>无效线索标记</p>
      <span icon="el-icon-close"></span>
    </div>
    <div class="form-box">
      <el-form ref="form" class="MyEditForm">
        <p class="form-box-tit"><span class="radius"></span>
          <template v-if="guestInfo">
            你正在把线索【{{guestInfo.ClueName}}】，标记为无效
          </template>
          <template v-else-if="customerInfo">
            你正在把线索【{{customerInfo.CustomerName}}】，标记为无效
          </template>
        </p>
        <el-row>
          <el-col :span="24">
            <div class="MyEditForm-item label-pad-left">
              <el-form-item label="无效说明">
                <el-input type="textarea" placeholder="无效说明" v-model="saveMsg.Remark"></el-input>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" class="add-box-btn" @click="SaveInvalid()">确 定</el-button>
      <el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false">关 闭
      </el-button>
    </div>
  </el-dialog>
</template>
<script>
  export default {
    props: {
      guestInfo: {
        type: Object,
        default: null,
      },
      customerInfo: {
        type: Object,
        default: null,
      },
    },
    data() {
      return {
        dialogTableVisible: false,
        saveMsg: {
          CustomerId: 0,
          GueustId: 0,
          Remark: "",
          ClueState: 2,
          ClueName: "", //线索名称
        }
      };
    },
    watch: {

    },
    mounted() {
      let $this = this;
      setTimeout(() => {
        $this.dialogTableVisible = true;
      }, 50);
    },
    methods: {
      closedDialog() {
        this.MsgBus.$emit("closeInvalidDialogBox");
      },
      //保存无效线索
      SaveInvalid() {
        if (this.guestInfo) {
          this.saveMsg.GueustId = this.guestInfo.Id;
          this.saveMsg.ClueName = this.guestInfo.ClueName;
        }
        if (this.customerInfo) {
          this.saveMsg.CustomerId = this.customerInfo.CustomerId;
          this.saveMsg.ClueName = this.customerInfo.CustomerName;
        }
        this.apipost('/api/Customer/UpdateClueState', this.saveMsg, res => {
          if (res.data.resultCode == 1) {
            this.$emit("success");
            this.dialogTableVisible = false;
            this.Success(res.data.message);
          } else {
            this.Error(res.data.message);
          }
        })
      },
    },
  };
</script>