confirm-detail.vue 11.9 KB
Newer Older
1 2
<template>
  <h-view id="addCar">
3 4 5 6 7
    <transition name="trans">
      <div v-show="downNum" class="modal-show">
        <div class="down">
          <div class="top">
            录入产品信息
linxin's avatar
linxin committed
8 9
            <!-- <img src="@/assets/intoApproval/close.png"  > -->
            <span @click="downNum=false">x</span>
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
          </div>
          <div class="down-content">
            <span>请上传照片</span>
            <div class="photo">
              <!-- <img src=""> -->
            </div>
            <list-item :item-height="44">
              <item>
                <div slot="name">车架号</div>
                <input
                  slot="content"
                  v-model="rentInfo.frame_number"
                  readonly
                  placeholder="自动识别车架号"
                >
              </item>
              <item>
                <div slot="name">发动机号</div>
                <input slot="content" v-model="rentInfo.engine" readonly placeholder="自动识别发动机号" >
              </item>
linxin's avatar
linxin committed
30 31
              <item>
                <div slot="name">车辆型号 </div>
linxin's avatar
linxin committed
32
                <input slot="content" v-model="rentInfo.vehicle_model" readonly placeholder="自动识别车辆型号" >
linxin's avatar
linxin committed
33 34 35
              </item>
              <item>
                <div slot="name">合格证编号 </div>
linxin's avatar
linxin committed
36
                <input slot="content" v-model="rentInfo.certificate_number" readonly placeholder="自动识别合格证编号" >
linxin's avatar
linxin committed
37
              </item>
linxin's avatar
linxin committed
38 39 40 41
              <item>
                <div slot="name">发车日期</div>
                <input
                  slot="content"
42
                  v-model="rentInfo.departure_date"
linxin's avatar
linxin committed
43
                  readonly
linxin's avatar
linxin committed
44 45 46 47 48 49 50 51 52 53
                  placeholder="暂无数据"
                >
              </item>
              <item>
                <div slot="name">开票日期</div>
                <input
                  slot="content"
                  v-model="rentInfo.invoice_date"
                  readonly
                  placeholder="暂无数据"
linxin's avatar
linxin committed
54 55
                >
              </item>
56
            </list-item>
57
          </div>
58
        </div>
59
      </div>
60
    </transition>
61 62 63
    <h-header :proportion="[5,1,1]" class="bar-custom">
      <div slot="left" class="h-header-btn">
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()" >
64
        <span>合同明细</span>
65 66 67 68 69
      </div>
    </h-header>
    <h-content>
      <div class="userInfo">承租人信息</div>
      <list-item :item-height="44">
70
        <item>
71
          <div slot="name">合同号</div>
linxin's avatar
linxin committed
72
          <input slot="content" v-model="info.project_number" readonly placeholder="暂无数据" >
73
        </item>
74
        <item>
75
          <div slot="name">经销商</div>
linxin's avatar
linxin committed
76
          <input slot="content" v-model="info.bp_agent_name" readonly placeholder="暂无数据" >
77 78 79
        </item>
        <item>
          <div slot="name">承租人</div>
linxin's avatar
linxin committed
80
          <input slot="content" v-model="info.bp_name" readonly placeholder="暂无数据" >
81
        </item>
82
        <item>
83
          <div slot="name">产品线</div>
linxin's avatar
linxin committed
84
          <input slot="content" v-model="info.division_n" readonly placeholder="暂无数据" >
85 86 87
        </item>
        <item>
          <div slot="name">合同金额</div>
linxin's avatar
linxin committed
88
          <input slot="content" v-model="info.total_price" readonly placeholder="暂无数据" >
89
        </item>
90
        <item>
91
          <div slot="name">商务政策</div>
linxin's avatar
linxin committed
92
          <input slot="content" v-model="info.product_plan_id_n" readonly placeholder="暂无数据" >
93 94 95
        </item>
        <item>
          <div slot="name">租赁物数量</div>
96
          <input slot="content" v-model="info.product_num" readonly placeholder="请输入租赁物数量" >
97 98 99
        </item>
      </list-item>
      <div class="userInfo">设备清单</div>
100
      <div
linxin's avatar
linxin committed
101
        v-for="(item,index) in equip"
102 103
        :key="index"
        class="equipment"
linxin's avatar
linxin committed
104
        @click="downNum=true;getRent(item.contract_id)"
105
      >
106 107 108 109 110 111 112
        <div class="left">
          <span>
            <img src="@/assets/contractStart/list.png" >
          </span>
        </div>
        <div class="center">
          <span>租赁物信息</span>
linxin's avatar
linxin committed
113
          <span :class="['status',item.lease_status === 'Y'?'unMantain':'mantain']">{{ item.lease_status === 'Y'?'已维护':'待维护' }}</span>
114 115
          <p>
            参数项
linxin's avatar
linxin committed
116
            <span>{{ item.product_code }}</span>
117 118
          </p>
        </div>
119
        <div class="right">
120 121 122 123
          <img src="@/assets/contractStart/into.png" >
        </div>
      </div>
    </h-content>
linxin's avatar
linxin committed
124
    <bottom-tab v-if="!flag">
125
      <tab-button class="approve" @click.native="isConfirm">确定</tab-button>
126 127 128 129 130 131 132 133 134
    </bottom-tab>
  </h-view>
</template>
<script>
export default {
  data () {
    return {
      num: null,
      downNum: false,
135
      show: false,
linxin's avatar
linxin committed
136
      flag: false, // 判断是否为已确认
linxin's avatar
linxin committed
137
      info: {
linxin's avatar
linxin committed
138 139 140 141 142 143 144 145 146
        product_plan_id: '',
        product_num: '',
        first_pay: '',
        division_n: '',
        gps_fee: '',
        bp_name: '',
        project_number: '',
        bp_agent_name: ' ',
        product_plan_id_n: '',
linxin's avatar
linxin committed
147
      },
linxin's avatar
linxin committed
148
      rentInfo: {
149 150 151 152
        frame_number: '',
        engine: '',
        manufacturer: '',
        license_plate_number: '',
153 154 155
        vehicle_model: '',
        certificate_number: '',
        departure_date: '',
linxin's avatar
linxin committed
156
        invoice_date: '',
linxin's avatar
linxin committed
157
      },
158
      products: [],
159 160 161 162 163 164 165
      equip: [
        {
          product_id: '3',
          product_code: 'GTC389',
          contract_id: '231',
        },
      ],
166 167 168 169
    }
  },
  computed: {
  },
linxin's avatar
linxin committed
170 171
  beforeRouteEnter (to, from, next) {
    next(vm => {
linxin's avatar
linxin committed
172 173
      vm.getDetail()
      vm.getEquipment()
linxin's avatar
linxin committed
174 175 176 177 178
      if (vm.$route.params.confirm_status === 'SUBMIT') {
        vm.flag = false
      } else if (vm.$route.params.confirm_status === 'APPROVED') {
        vm.flag = true
      }
linxin's avatar
linxin committed
179 180
    })
  },
181
  methods: {
182 183 184 185 186 187 188 189 190 191 192
    isConfirm () {
      this.hlsPopup.showConfirm({
        title: '提示',
        content: '您确定同意发车吗?',
        onConfirm: data => {
          if (data === 1) {
            this.confirm()
          }
        },
      })
    },
linxin's avatar
linxin committed
193 194 195 196
    confirm () {
      let vm = this
      let url = process.env.basePath + 'do_car_confirm'
      let param = {
197
        master: {
linxin's avatar
linxin committed
198
          project_id: this.$route.params.project_id,
199 200 201
          confirm_status: 'APPROVED',
        },
      }
linxin's avatar
linxin committed
202 203 204 205 206
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.equip = res.lists
207
          vm.hlsPopup.showSuccess('发车成功')
208 209 210 211 212
          setTimeout(() => {
            vm.$router.push({
              name: 'ConfirmList',
            })
          }, 2000)
linxin's avatar
linxin committed
213 214 215 216 217
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
    getEquipment () {
      let vm = this
      let url = process.env.basePath + 'car_equip_list_query'
      let param = {
        project_id: this.$route.params.project_id,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.equip = res.lists
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
234
    getRent (e) {
linxin's avatar
linxin committed
235 236 237
      let vm = this
      let url = process.env.basePath + 'leases_info_query'
      let param = {
linxin's avatar
linxin committed
238
        contract_id: e,
linxin's avatar
linxin committed
239 240 241 242 243 244 245 246 247 248 249 250
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          Object.assign(vm.rentInfo, res.info)
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },

linxin's avatar
linxin committed
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
    getDetail () {
      let vm = this
      let url = process.env.basePath + 'con_contract_detial'
      let param = {
        project_id: this.$route.params.project_id,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.info = res.info
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
267
  },
268 269 270 271 272 273 274
}
</script>
<style lang="less" scoped>
#addCar {
  input::placeholder {
    color: #888c8f;
  }
275 276 277 278 279 280 281 282 283
  .trans-enter-active,
  .trans-leave-active {
    transition: opacity 0.5s;
  }
  .trans-enter,
  .trans-leave-active {
    opacity: 0;
  }
  .hide {
284 285 286
    display: flex;
    justify-content: flex-start;
    align-items: center;
287 288 289 290
    img {
      width: 30px;
      height: 30px;
      margin-left: 65%;
291 292
    }
  }
293 294
  .wrap {
    padding-top: 92px;
295
  }
296 297 298 299
  .modal-show {
    width: 100%;
    height: 100%;
    position: absolute;
300
    z-index: 900;
301 302 303 304 305 306 307
    background-color: rgba(56, 63, 69, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    .down {
      position: relative;
      width: 314px;
linxin's avatar
linxin committed
308
      height: 526px;
309 310 311 312 313 314 315 316 317 318 319 320 321
      background-size: 301px 24.7px;
      background-color: #fff;
    }
    .top {
      width: 100%;
      height: 44px;
      font-family: PingFangSC-Semibold;
      font-size: 16px;
      letter-spacing: 0;
      text-align: center;
      line-height: 44px;
      color: #fff;
      background: #0041c4;
linxin's avatar
linxin committed
322 323
      span{
        font-size:24px;
324
        float: right;
linxin's avatar
linxin committed
325 326 327
        margin-right:10px;
        font-family: YouYuan;
        // margin-left:100px;
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
      }
    }
    .down-content {
      margin-top: 8px;
      span:first-child {
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: #656464;
        letter-spacing: 0;
        margin-left: 15px;
      }
      .photo {
        width: 172px;
        height: 120px;
        border: 1px solid #dcdcdd;
        border-radius: 2px;
        margin: 0 auto;
        margin-top: 12px;
346 347 348 349 350
        background: url("../../assets/contractStart/photo.png") 70px no-repeat;
        background-size: 24px 20px;
        img {
          width: 100%;
          height: 100%;
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
        }
      }
    }
  }
  .userInfo {
    height: 45px;
    line-height: 45px;
    color: #0041c4;
    font-size: 15px;
    margin-left: 16px;
    position: relative;
  }
  .userInfo::before {
    content: "";
    display: block;
    width: 4px;
    height: 20px;
    background-color: #0041c4;
    position: absolute;
    left: -15px;
    top: 12px;
  }
  .equipment:not(:first-child) {
    margin-top: 2px;
  }
  .equipment {
    width: 359px;
    height: 72px;
    background-color: #fff;
    margin: 0 auto;
    display: flex;
    .left {
      flex: 1;
      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;
        }
      }
    }
    .center {
      flex: 6;
      span:first-child {
        font-family: PingFangSC-Regular;
        font-size: 14px;
        color: #383f45;
        letter-spacing: 0.43px;
        margin-left: 10px;
        margin-top: 12px;
      }
linxin's avatar
linxin committed
411
     .status {
412 413 414 415 416 417 418 419 420 421 422 423
        display: inline-block;
        width: 46px;
        height: 16px;
        text-align: center;
        line-height: 16px;
        font-family: PingFangSC-Medium;
        font-size: 12px;
        color: #ffffff;
        letter-spacing: 0;
        margin-left: 21px;
        margin-top: 12px;
      }
linxin's avatar
linxin committed
424 425 426 427 428 429 430 431
      .unMantain{
        background-color: #1d3fff;
      }
      .mantain{
        background-color: #FFF;
        border:1px solid #1d3fff;
        color: #1d3fff;
      }
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
      p {
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: rgba(56, 63, 69, 0.6);
        letter-spacing: 0.4px;
        margin-left: 10px;
        margin-top: 10px;
        span {
          font-family: Helvetica;
          font-size: 13px;
          color: rgba(56, 63, 69, 0.6);
        }
      }
    }
    .right {
      flex: 1;
      display: flex;
      align-items: center;
      img {
        width: 13px;
        height: 13px;
      }
    }
  }
  .approve {
    color: #fff;
    background-color: #0041c4;
  }
}
</style>