input-num.vue 4.21 KB
Newer Older
linxin's avatar
linxin committed
1 2 3 4 5 6 7 8 9
/**
* @Author Sean
* @Date 2019/11/27
*/
<template>
  <transition name="role">
    <div v-show="showFlag" class="role-switch-wrap">
      <div class="role-switch-content">
        <div class="content-header">
linxin's avatar
linxin committed
10
          <span>请输入业务经办代码</span>
linxin's avatar
linxin committed
11 12 13
          <img src="@/assets/myInfo/modalClose.png" @click="roleCancle">
        </div>
        <div class="content-wrap">
linxin's avatar
linxin committed
14 15
          <div class="input-text">
            <input v-model="business_num" type="text" placeholder="请输入业务经办代码">
linxin's avatar
linxin committed
16
          </div>
linxin's avatar
linxin committed
17
          <div class="content-btn-active content-btn" @click="roleConfirm"><span>确定</span></div>
linxin's avatar
linxin committed
18 19 20 21 22 23 24 25 26 27 28
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  data () {
    return {
      showFlag: false,
linxin's avatar
linxin committed
29
      business_num: '',
linxin's avatar
linxin committed
30 31 32 33 34 35 36 37 38 39
    }
  },
  created: function () {
  },
  mounted: function () {
  },
  updated: function () {
  },
  methods: {
    roleConfirm () {
linxin's avatar
linxin committed
40 41 42 43 44
      let vm = this
      let url = process.env.basePath + 'bp_relation_insert'
      let param = {
        bp_id: window.localStorage.getItem('bp_id'),
        business_num: vm.business_num,
linxin's avatar
linxin committed
45
      }
linxin's avatar
linxin committed
46 47 48 49 50 51 52 53 54 55 56 57 58
      vm.hlsPopup.showLoading('正在添加')
      vm.hlsHttp.post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        vm.hlsPopup.showLongCenter('添加成功')
        if (res.result === 'S') {
          vm.showFlag = false
          vm.$emit('roleConfirm', vm.business_num)
          vm.business_num = ''
        } else {
          hlsPopup.showError(res.message)
          vm.business_num = ''
        }
      })
linxin's avatar
linxin committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
    },
    roleCancle () {
      this.showFlag = false
      this.$emit('roleCancle')
    },
  },
}
</script>

<style scoped lang="less">
  .role-enter-active, .role-leave-active {
    transition: opacity .5s;
  }

  .role-enter, .role-leave-to /* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
  }

  .role-switch-wrap {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    z-index: 999;
    background: rgba(56, 63, 69, 0.30);
    display: flex;
    justify-content: center;
    align-items: center;

    .role-switch-content {
      width: 80%;
      margin: 0 auto;

      .content-header {
        width: 100%;
        height: 44px;
        background-color: @headerColor;
        font-family: PingFangSC-Semibold;
        font-size: 16px;
        color: #FFFFFF;
        letter-spacing: 0;
        text-align: center;
        line-height: 44px;
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
        img {
          width: 26px;
          float: right;
        }
      }

      .content-wrap {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: #FFF;
        padding: 10px 0;
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
linxin's avatar
linxin committed
120 121 122 123 124 125 126 127 128 129
        .input-text{
          border: 1px solid @headerColor;
          margin:30px auto;
          height:40px;
          line-height: 40px;
          border-radius: 5px;
          input{
            text-indent: 5px;
          }
        }
linxin's avatar
linxin committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
        .role-item {
          width: 90%;
          height: 44px;
          background: #FFFFFF;
          border: 1px solid #CFCFCF;
          border-radius: 4px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin: 4px 0;

          span {
            font-family: PingFangSC-Regular;
            font-size: 14px;
            color: #656464;
            letter-spacing: 0;
            line-height: 18px;
          }
        }
        .item-active{
          background: rgba(29,63,255,0.10);
          border: 1px solid #1D3FFF;
          border-radius: 4px;
        }
      }

      .content-btn {
        margin-top: 10px;
        width: 84%;
        height: 40px;
        background: rgba(56, 63, 69, 0.50);
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;

        span {
          font-family: PingFangSC-Semibold;
          font-size: 15px;
          color: #FAFAFA;
          line-height: 20px;
        }
      }
      .content-btn-active{
        background: #1D3FFF;
        border-radius: 4px;
      }
    }
  }
</style>