start-list.vue 6.52 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<template>
  <h-view id="startList">
    <h-header :proportion="[5,1,1]" class="bar-custom">
      <div slot="left" class="h-header-btn">
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()" >
        <span>合同发车</span>
      </div>
    </h-header>
    <Tab @getTabNum="getTabNum" />
    <div class="search">
      <input placeholder="请输入合同号/产品线/承租人名称" >
    </div>
    <h-content class="my-content">
14 15 16 17 18 19 20
      <scroll ref="scroll" :updateData="[contructs]" :pullUp="true">
        <div
          v-for="(item,index) in showList"
          :key="index"
          class="item"
          @click="changePage(item.project_id)"
        >
21 22 23 24
          <div class="left">
            <span>
              <img src="@/assets/contractStart/icon.png" >
            </span>
25
          </div>
26 27 28
          <div class="right">
            <div class="right-top">
              <span>合同号</span>
linxin's avatar
linxin committed
29
              <span>{{ item.project_number }}</span>
30 31 32 33 34
            </div>
            <div class="right-bottom">
              <ul>
                <li>
                  承租人
linxin's avatar
linxin committed
35
                  <span>{{ item.bp_name }}</span>
36 37 38
                </li>
                <li>
                  产品线
linxin's avatar
linxin committed
39
                  <span>{{ item.division_n }}</span>
40 41 42
                </li>
                <li>
                  合同金额
linxin's avatar
linxin committed
43
                  <span class="number">{{ item.total_price|currency }}</span>
44 45 46
                </li>
              </ul>
            </div>
47 48
          </div>
        </div>
49 50
      </scroll>
    </h-content>
51
    <bottom-tab>
52
      <tab-button class="add" @click.native="goAdd">新增发车</tab-button>
53 54 55 56 57 58 59 60 61
    </bottom-tab>
  </h-view>
</template>
<script>
import Tab from '@/pages/contractStart/tab'
export default {
  components: {
    Tab,
  },
62 63
  data () {
    return {
linxin's avatar
linxin committed
64
      tabNum: 0,
65
      contructs: [],
linxin's avatar
linxin committed
66
      lists: [],
linxin's avatar
linxin committed
67 68 69
      showList: [],
      undo: [],
      done: [],
70 71
    }
  },
linxin's avatar
linxin committed
72 73
  beforeRouteEnter (to, from, next) {
    next(vm => {
linxin's avatar
linxin committed
74 75 76
      if (from.name === 'MyInfo') {
        vm.getList()
      }
linxin's avatar
linxin committed
77 78
    })
  },
linxin's avatar
linxin committed
79
  watch: {
80
    tabNum: {
linxin's avatar
linxin committed
81 82 83 84 85 86 87 88 89 90 91 92
      handler () {
        if (this.tabNum === 0) {
          this.showList = this.undo
        } else if (this.tabNum === 1) {
          this.showList = this.done
        }
      },
      immediate: true,
    },
  },
  created () {
  },
93
  methods: {
linxin's avatar
linxin committed
94 95 96 97 98 99 100 101 102 103
    selectShowList () {
      let vm = this
      this.lists.forEach(item => {
        if (item.leases_status === 'Y') {
          vm.undo.push(item)
        } else if (item.leases_status === 'N') {
          vm.done.push(item)
        }
      })
    },
104
    getTabNum (i) {
linxin's avatar
linxin committed
105
      this.tabNum = i
106 107
    },
    goAdd () {
linxin's avatar
linxin committed
108 109 110 111 112
      hlsPopup.showLongCenter('暂不支持无关联进件的车辆发送')

      // this.$router.push({
      //   name: 'AddCar',
      // })
113
    },
linxin's avatar
linxin committed
114
    changePage (e) {
115 116
      this.$router.push({
        name: 'AddCar',
linxin's avatar
linxin committed
117 118 119
        params: {
          project_id: e,
        },
120 121
      })
    },
linxin's avatar
linxin committed
122 123
    getList () {
      let vm = this
linxin's avatar
linxin committed
124
      let url = process.env.basePath + 'car_apply_list_query'
linxin's avatar
linxin committed
125
      let param = {
126
        user_phone: window.localStorage.getItem('user_phone'),
linxin's avatar
linxin committed
127 128 129 130 131 132
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.lists = res.lists
linxin's avatar
linxin committed
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
          // vm.lists = [
          //   {
          //     project_id: '48812',
          //     project_number: '',
          //     bp_name: '李四',
          //     total_price: '51',
          //     division_n: 'PDJ',
          //     leases_status: 'Y',
          //   },
          //   {
          //     project_id: '48800',
          //     project_number: '',
          //     bp_name: '张三',
          //     total_price: '51',
          //     division_n: 'PDJ',
          //     leases_status: 'N',
          //   },
          // ]
          vm.selectShowList()
linxin's avatar
linxin committed
152 153 154 155 156
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
  },
}
</script>
<style lang="less" scoped>
#startList {
  .search {
    height: 52px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    input {
      width: 351px;
      height: 36px;
      line-height: 36px;
      text-indent: 16px;
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #21254c;
      letter-spacing: 0;
      border-radius: 4px;
      background: url("../../assets/contractStart/search1.png") 320px no-repeat;
      background-size: 16px 16px;
      background-color: rgba(239, 239, 239, 0.55);
    }
    input::placeholder {
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #888c8f;
      letter-spacing: 0;
    }
    input:focus {
      background: url("../../assets/contractStart/search2.png") 320px no-repeat;
      background-size: 16px 16px;
      background-color: rgba(239, 239, 239, 0.55);
      border: 2px solid #bcc6ff;
    }
  }
  .my-content {
    .item {
      width: 359px;
      height: 148px;
      background-color: #fff;
      border-radius: 2px;
      margin: 0 auto;
      margin-top: 9px;
      .left {
        width: 15%;
        height: 100%;
        float: left;
        span {
          display: block;
          width: 30px;
          height: 30px;
          background-color: #e8e9ed;
          border-radius: 8px;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-left: 10px;
          margin-top: 8px;
          img {
            width: 11px;
            height: 14px;
          }
        }
      }
      .right {
        height: 100%;
        width: 85%;
        float: right;
        .right-top {
          width: 285px;
          height: 45px;
          font-family: PingFangSC-Semibold;
          font-size: 15px;
          color: #4b4a4b;
          letter-spacing: 0;
          line-height: 45px;
          border-bottom: 1px solid #f3f3f7;
          span:last-child {
            float: right;
          }
        }
        .right-bottom {
          width: 285px;
          margin-top: 10px;
          .number {
245 246 247 248 249 250
            font-family: Verdana-Bold;
            font-size: 14px;
            color: #4b4a4b;
            letter-spacing: 0;
            font-weight: bold;
          }
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
          li {
            font-family: PingFangSC-Regular;
            font-size: 14px;
            color: #4b4a4b;
            letter-spacing: 0;
            height: 30px;
            width: 100%;
            span {
              float: right;
            }
          }
        }
      }
    }
  }
266 267 268
  .add {
    color: #fff;
    background-color: #0041c4;
269 270 271
  }
}
</style>