add-car.vue 33.3 KB
Newer Older
1 2
<template>
  <h-view id="addCar">
3 4 5 6 7 8 9 10 11
    <transition name="trans">
      <div v-show="downNum" class="modal-show">
        <div class="down">
          <div class="top">
            录入产品信息
            <img src="@/assets/intoApproval/close.png" @click="downNum=false" >
          </div>
          <div class="down-content">
            <span>请上传照片</span>
李晓兵's avatar
李晓兵 committed
12
            <div class="photo" @click="ocrShow()">
linxin's avatar
linxin committed
13
              <img v-if="vehicleImg" :src="vehicleImg" alt="">
14 15 16
            </div>
            <list-item :item-height="44">
              <item>
linxin's avatar
linxin committed
17
                <div slot="name" class="required">车架号</div>
linxin's avatar
linxin committed
18
                <input slot="content" v-model="info.frame_number" :readonly="flag" placeholder="自动识别车架号" >
19 20
              </item>
              <item>
linxin's avatar
linxin committed
21
                <div slot="name" class="required">发动机号</div>
linxin's avatar
linxin committed
22
                <input slot="content" v-model="info.engine" :readonly="flag" placeholder="自动识别发动机号" >
23
              </item>
24
              <item>
linxin's avatar
linxin committed
25
                <div slot="name" class="required">车辆型号 </div>
linxin's avatar
linxin committed
26
                <input slot="content" v-model="info.vehicle_model" :readonly="flag" placeholder="自动识别车辆型号" >
27 28
              </item>
              <item>
linxin's avatar
linxin committed
29
                <div slot="name" class="required">合格证编号 </div>
linxin's avatar
linxin committed
30
                <input slot="content" v-model="info.certificate_number" :readonly="flag" placeholder="自动识别合格证编号" >
31
              </item>
linxin's avatar
linxin committed
32
              <item v-if="!flag">
linxin's avatar
linxin committed
33
                <div slot="name" class="required">发车日期</div>
34
                <input
linxin's avatar
linxin committed
35 36
                  slot="content" v-model="info.departure_date" readonly placeholder="请输入发车日期"
                  @click="showTime('YYYY-MM-DD')">
37
              </item>
linxin's avatar
linxin committed
38
              <item v-if="flag">
linxin's avatar
linxin committed
39
                <div slot="name" class="required">发车日期</div>
linxin's avatar
linxin committed
40 41
                <input
                  slot="content" v-model="info.departure_date" readonly placeholder="请输入发车日期"
linxin's avatar
linxin committed
42
                >
linxin's avatar
linxin committed
43
              </item>
linxin's avatar
linxin committed
44
              <item v-if="!flag">
linxin's avatar
linxin committed
45
                <div slot="name" class="required">开票日期</div>
linxin's avatar
linxin committed
46 47 48 49
                <input
                  slot="content" v-model="info.invoice_date" readonly placeholder="请输入开票日期"
                  @click="showTimeInvoice('YYYY-MM-DD')">
              </item>
linxin's avatar
linxin committed
50
              <item v-if="flag">
linxin's avatar
linxin committed
51
                <div slot="name" class="required">开票日期</div>
linxin's avatar
linxin committed
52 53 54 55
                <input
                  slot="content" v-model="info.invoice_date" readonly placeholder="请输入开票日期"
                >
              </item>
56 57 58 59 60
              <!-- <item :showArrow="true" @click.native="showModalValue=true">
                <div slot="name">产品参数</div>
                <input slot="content" v-model="info.bank_branch_name" placeholder="请选择产品参数" @click="changeHeight">
              </item>-->
            </list-item>
61
          </div>
linxin's avatar
linxin committed
62
          <button v-if="!flag" @click="isSave">保存</button>
63
        </div>
64
      </div>
65
    </transition>
66 67 68
    <h-header :proportion="[5,1,1]" class="bar-custom">
      <div slot="left" class="h-header-btn">
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()" >
69
        <span>合同明细</span>
70 71 72 73 74
      </div>
    </h-header>
    <h-content>
      <div class="userInfo">承租人信息</div>
      <list-item :item-height="44">
75
        <item v-if="!read" :showArrow="true">
76
          <div slot="name">合同号</div>
77 78 79 80 81 82 83 84 85 86
          <input
            slot="content"
            v-model="detail.project_number"
            placeholder="请选择合同号"
            @click="selectContruct"
          >
        </item>
        <item v-if="read">
          <div slot="name">合同号</div>
          <input slot="content" v-model="detail.project_number" readonly placeholder="暂无数据" >
87
        </item>
88
        <item v-if="!read" :showArrow="true">
89
          <div slot="name">经销商</div>
90 91 92 93 94 95 96 97 98 99
          <input
            slot="content"
            v-model="detail.bp_agent_name"
            placeholder="请选择经销商"
            @click="selectAgent"
          >
        </item>
        <item v-if="read">
          <div slot="name">经销商</div>
          <input slot="content" v-model="detail.bp_agent_name" readonly placeholder="暂无数据" >
100 101 102
        </item>
        <item>
          <div slot="name">承租人</div>
103 104 105 106 107 108
          <input
            slot="content"
            v-model="detail.bp_name"
            :placeholder="read?'暂无数据':'请输入承租人姓名'"
            readonly="read"
          >
109
        </item>
110
        <item v-if="!read" :showArrow="true">
786817560's avatar
786817560 committed
111
          <div slot="name">产品名称</div>
linxin's avatar
linxin committed
112
          <input
113 114
            slot="content"
            v-model="detail.division_n"
786817560's avatar
786817560 committed
115
            placeholder="请选择产品名称"
116 117 118 119
            @click="selectProductLine"
          >
        </item>
        <item v-if="read">
786817560's avatar
786817560 committed
120
          <div slot="name">产品名称</div>
121
          <input slot="content" v-model="detail.division_n" readonly placeholder="暂无数据" >
122
        </item>
linxin's avatar
linxin committed
123 124 125 126
        <item v-if="read">
          <div slot="name">设备识别号</div>
          <input slot="content" v-model="detail.product_code" readonly placeholder="暂无数据" >
        </item>
127 128
        <item>
          <div slot="name">合同金额</div>
129 130 131 132
          <input
            slot="content"
            v-model="detail.total_price"
            :placeholder="read?'暂无数据':'请输入合同金额'"
linxin's avatar
linxin committed
133
            :readonly="read"
134
          >
135
        </item>
136
        <item v-if="!read" :showArrow="true">
137
          <div slot="name">商务政策</div>
linxin's avatar
linxin committed
138
          <input
139
            slot="content"
linxin's avatar
linxin committed
140
            v-model="detail.product_plan_id_n"
141 142 143 144 145 146
            placeholder="请选择合同政策"
            @click="selectProductPlan"
          >
        </item>
        <item v-if="read">
          <div slot="name">商务政策</div>
linxin's avatar
linxin committed
147
          <input slot="content" v-model="detail.product_plan_id_n" readonly placeholder="暂无数据" >
148 149 150
        </item>
        <item>
          <div slot="name">租赁物数量</div>
linxin's avatar
linxin committed
151
          <input slot="content" v-model="detail.product_num " :readonly="read" placeholder="请输入租赁物数量" >
152 153 154
        </item>
      </list-item>
      <div class="userInfo">设备清单</div>
155 156 157 158
      <div
        v-for="(item,index) in equip"
        :key="index"
        class="equipment"
linxin's avatar
linxin committed
159
        @click="downNum = true;getRent(item.contract_id,item.contract_lease_item_id)"
160
      >
161 162 163 164 165 166 167
        <div class="left">
          <span>
            <img src="@/assets/contractStart/list.png" >
          </span>
        </div>
        <div class="center">
          <span>租赁物信息</span>
linxin's avatar
linxin committed
168
          <span :class="['status',item.lease_status === 'Y'?'unMantain':'mantain']">{{ item.lease_status === 'Y'?'已维护':'待维护' }}</span>
169
          <p>
linxin's avatar
linxin committed
170 171
            设备识别号
            <span>{{ item.product_code }}-{{ index+1|lengthCheck }}</span>
172 173
          </p>
        </div>
174
        <div class="right">
175 176 177 178
          <img src="@/assets/contractStart/into.png" >
        </div>
      </div>
    </h-content>
linxin's avatar
linxin committed
179
    <bottom-tab v-if="!flag">
linxin's avatar
linxin committed
180
      <!-- <tab-button class="save" @click.native="handSave">同步电子签</tab-button> -->
linxin's avatar
linxin committed
181
      <tab-button class="approve" @click.native="checkStatus">发车申请</tab-button>
182
    </bottom-tab>
183 184 185 186
    <div class="bottom-pop">
      <div class="bottom-content">
        <div class="box">
          <div class="fix">
187 188 189 190
            <div class="hide">
              <div class="userInfo">产品查询</div>
              <img src="@/assets/contractStart/delete.png" @click="hideBox" >
            </div>
191
            <div class="bottom-top">
786817560's avatar
786817560 committed
192
              <input placeholder="请输入产品名称" >
193
              <img src="@/assets/contractStart/delete.png" >
linxin's avatar
linxin committed
194
              <input placeholder="请输入设备识别号" >
195 196 197 198 199 200 201 202 203 204 205 206 207 208
              <img src="@/assets/contractStart/delete.png" >
              <span />
            </div>
          </div>
          <div class="wrap">
            <div v-for="(item,index) in 8" :key="index" class="bottom-item">
              <div class="left">
                <p>
                  <img src="@/assets/contractStart/product.png" >
                </p>
              </div>
              <div class="right">
                <ul>
                  <li>
786817560's avatar
786817560 committed
209
                    <span class="name">产品名称</span>&ensp; &ensp; 挖掘机
210 211 212
                    <span class="to-right">
                      <span class="name">产品种类</span>&ensp; &ensp; *****
                    </span>
213 214
                  </li>
                  <li>
linxin's avatar
linxin committed
215
                    <span class="name">设备识别号</span>&ensp; &ensp; GTZ226
216 217 218
                    <span class="to-right">
                      <span class="name">产品名称</span>&ensp; &ensp; *****
                    </span>
219 220 221 222 223 224 225 226
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
227 228 229 230
  </h-view>
</template>
<script>
export default {
linxin's avatar
linxin committed
231 232 233 234 235 236 237 238 239
  filters: {
    lengthCheck: function (value) {
      if ((value.toString()).length === 1) {
        return `0${value}`
      } else {
        return value
      }
    },
  },
linxin's avatar
linxin committed
240

241 242 243 244
  data () {
    return {
      num: null,
      downNum: false,
245
      show: false,
linxin's avatar
linxin committed
246 247
      read: false, // 表示只读
      showDate: '',
linxin's avatar
linxin committed
248
      flag: false,
linxin's avatar
linxin committed
249
      isUpload: false, // 是否上传
linxin's avatar
linxin committed
250
      contract_lease_item_id: '',
linxin's avatar
linxin committed
251
      upload_list: [], // 上传列表
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
      productLine: [
        {
          code: '5',
          code_name: '测试3',
        },
        {
          code: '9',
          code_name: 'PDJ',
        },
        {
          code: '6',
          code_name: '测试1',
        },
      ],
      productPlan: [
        {
          code: '5',
          code_name: '测试3',
        },
        {
          code: '9',
          code_name: 'PDJ',
        },
        {
          code: '6',
          code_name: '测试1',
        },
      ],
      contract: [
        {
          code: '5',
          code_name: 'PRJ2019003',
        },
        {
          code: '9',
          code_name: 'PRJ2019025',
        },
        {
          code: '6',
          code_name: 'PRJ2019067',
        },
      ],
linxin's avatar
linxin committed
294 295
      agent: [
        {
296 297 298 299 300 301 302 303 304 305
          code: '7475',
          code_name: '北京去楼下科技有限公司',
        },
        {
          code: '7709',
          code_name: '主机厂法人',
        },
        {
          code: '7436',
          code_name: '北京雪族科技有限公司',
linxin's avatar
linxin committed
306 307
        },
      ],
linxin's avatar
linxin committed
308
      info: {
309
        contract_id: '',
310 311 312 313
        frame_number: '',
        engine: '',
        manufacturer: '',
        license_plate_number: '',
314 315 316
        vehicle_model: '',
        certificate_number: '',
        departure_date: '',
linxin's avatar
linxin committed
317
        invoice_date: '',
linxin's avatar
linxin committed
318
      },
linxin's avatar
linxin committed
319
      detail: {
linxin's avatar
linxin committed
320
        product_num: '',
321 322 323 324 325 326 327 328 329 330 331
        first_pay: '',
        gps_fee: '',
        bp_name: '',
        project_number: '',
        bp_agent_name: '',
        product_plan_id_n: '',
        division: '',
        division_n: '',
        product_plan_id: '',
        project_id: '',
        bp_id: '',
linxin's avatar
linxin committed
332
        product_code: '',
linxin's avatar
linxin committed
333
      },
linxin's avatar
linxin committed
334
      equip: [],
李晓兵's avatar
李晓兵 committed
335
      vehicleImg: '',
336 337 338
    }
  },
  computed: {
linxin's avatar
linxin committed
339
    numInt () { // 添加设备的时候处理值为空或者nul的情况
linxin's avatar
linxin committed
340 341
      if (this.detail.product_num !== null && this.detail.product_num !== '') {
        return parseInt(this.detail.product_num)
342 343 344 345
      } else {
        return 0
      }
    },
linxin's avatar
linxin committed
346 347 348 349 350 351 352 353 354 355 356 357 358
    carDate () {
      let date = new Date()
      let y = date.getFullYear()
      let m = date.getMonth() + 1
      let d = date.getDate()
      if ((m.toString()).length < 2) {
        m = `0${m}`
      } else if ((d.toString()).length < 2) {
        d = `0${d}`
      }
      return `${y}-${m}-${d}`
    },
  },
linxin's avatar
linxin committed
359 360 361 362 363 364 365
  watch: {
    'downNum' (newVal, oldVal) {
      if (!newVal) {
        this.vehicleImg = ''
      }
    },
  },
linxin's avatar
linxin committed
366
  created () {
367
    // this.showDate = this.carDate
368
  },
linxin's avatar
linxin committed
369 370
  beforeRouteEnter (to, from, next) {
    next(vm => {
371 372 373 374 375
      // if (from.name === 'StartList') {
      //   vm.getProductLine()
      //   vm.getProductPlan()
      //   vm.getContractNum()
      // }
linxin's avatar
linxin committed
376
      if (vm.$route.params.project_id) {
377
        vm.read = true
linxin's avatar
linxin committed
378 379
        vm.getDetail()
        vm.getEquipment()
linxin's avatar
linxin committed
380 381 382 383 384
        if (vm.$route.params.car_start_status === 'REJECTED' || vm.$route.params.car_start_status === 'NEW') {
          vm.flag = false
        } else {
          vm.flag = true
        }
linxin's avatar
linxin committed
385 386 387
      }
    })
  },
388
  methods: {
linxin's avatar
linxin committed
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
    // 同步电子签
    handSave () {
      // hlsPopup.showLongCenter('保存成功!')
      let vm = this
      let url = process.env.basePath + 'syn_content_app'
      let param = {
        project_id: vm.$route.params.project_id,
      }
      vm.hlsPopup.showLoading('请稍候')
      vm.hlsHttp.post(url, param).then(function (res) {
        if (res.result === 'S') {
          vm.hlsPopup.hideLoading()
          vm.hlsPopup.showSuccess('同步成功')
        } else {
          vm.hlsPopup.hideLoading()
          vm.hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431
    getImg (id) { // 获取合格证
      let vm = this
      let randomString = Math.floor(Math.random() * 21)
      let url =
        process.env.basePath +
        'app_attment_query' +
        '&index' +
        `'${randomString}'`
      let param = {
        'master': {
          'source_type': 'CON_CONTRACT_LEASE_ITEM',
          'pkvalue': id,
        },
      }
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
          if (res.info) {
            vm.vehicleImg = process.env.filePath + 'attachment_id=' + res.info.attachment_id + '&access_token=' + window.localStorage.access_token
          }
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
李晓兵's avatar
李晓兵 committed
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
    // ocr识别入口
    ocrShow () {
      let vm = this
      hlsPopup.showActionSheet({
        titleText: '请选择照片',
        buttonArray: ['拍照', '从相册取'],
        callback: index => {
          if (index === 0) {
            vm.openCamera()
          } else {
            vm.takePicture()
          }
        },
      })
    },
    openCamera () {
      let vm = this
      let cameraoptions = {
        quality: 60,
        width: 1843,
        height: 1382,
      }
      let success = function (imgdata) {
        if (!imgdata) {
          hlsPopup.showLongCenter('请拍照')
        } else {
linxin's avatar
linxin committed
458
          vm.isUpload = true
李晓兵's avatar
李晓兵 committed
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
          vm.vehicleImg = imgdata
          vm.vehicleIdentify(imgdata)
        }
      }
      let error = function () {
        hlsPopup.showLongCenter(error)
      }
      hlsUtil.openCamera(cameraoptions, success, error)
    },
    takePicture () {
      let vm = this
      var cameraoptions = {
        quality: 70,
        width: 1843,
        height: 1382,
        maxCount: 1,
      }
      let success = function (imgUrl) {
        if (imgUrl.length === 0) {
          hlsPopup.showLongCenter('请选择一张图片')
        } else {
linxin's avatar
linxin committed
480
          vm.isUpload = true
李晓兵's avatar
李晓兵 committed
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
          vm.vehicleImg = imgUrl[0]
          vm.vehicleIdentify(imgUrl[0])
        }
      }
      let error = function () {
        hlsPopup.showLongCenter(error)
      }
      vm.hlsUtil.takePicture(cameraoptions, success, error)
    },
    // 合格证识别
    vehicleIdentify (fileUrl) {
      let vm = this
      hlsPopup.showLoading('正在识别')
      let url = process.env.ocrPath + '/baidu/ocr/vehicle_certificate'
      hlsUtil.baiduOcr(fileUrl, url, function (res) {
        hlsPopup.hideLoading()
786817560's avatar
786817560 committed
497
        console.log('$$$$$$$$$$$$$$$' + JSON.stringify(res))
李晓兵's avatar
李晓兵 committed
498
        let result = res.result.words_result
李晓兵's avatar
李晓兵 committed
499 500
        vm.info.frame_number = result.VinNo // 车架号
        vm.info.engine = result.EngineNo // 发动机号
linxin's avatar
linxin committed
501
        vm.vehicle_model = result.VinNo // 车辆型号
李晓兵's avatar
李晓兵 committed
502
        vm.info.certificate_number = result.CertificationNo // 合格证编号
李晓兵's avatar
李晓兵 committed
503 504
      })
    },
linxin's avatar
linxin committed
505 506 507 508 509 510 511 512 513 514
    // 图片保存
    save_picture (list) {
      let vm = this
      if (list.length) {
        // hlsPopup.showLoading('图片上传请稍候')
        var alreadyUploadNum = 0
        var attLength = 0
        var recordUploadInterval = setInterval(function () {
          if (alreadyUploadNum === attLength) {
            clearInterval(recordUploadInterval)
linxin's avatar
linxin committed
515 516
            hlsPopup.hideLoading()
            // hlsPopup.showLongCenter('图片上传成功')
linxin's avatar
linxin committed
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
          }
        }, 500)
        for (var i = 0; i < list.length; i++) {
          let uploadSuccess = function (res) {
            if (res.result === 'S') {
              alreadyUploadNum++
              for (var j = 0; j < list.length; j++) {
                if (list[j].filePath === res.response.filePath) {
                  list[j].attachment_id = res.response.attachment_id
                  vm.upload_list.push(list[j])
                  break
                }
              }
            } else {
              hlsPopup.hideLoading()
            }
          }
          if (!list[i].attachment_id) {
            attLength++
            hlsUtil.fileUploadSvc(list[i], uploadSuccess)
          }
        }
      } else {
        hlsPopup.hideLoading()
      }
    },
linxin's avatar
linxin committed
543 544 545 546 547
    showTime (format) {
      this.hlsPopup.showTime({
        nowDate: `${this.carDate}`,
        format: format,
        callback: (date) => {
linxin's avatar
linxin committed
548
          this.info.departure_date = date
linxin's avatar
linxin committed
549 550 551
        },
      })
    },
linxin's avatar
linxin committed
552 553 554 555 556 557 558 559 560
    showTimeInvoice (format) {
      this.hlsPopup.showTime({
        nowDate: `${this.carDate}`,
        format: format,
        callback: (date) => {
          this.info.invoice_date = date
        },
      })
    },
linxin's avatar
linxin committed
561 562 563 564 565 566 567 568 569
    save () {
      let vm = this
      let url = process.env.basePath + 'leases_info_save'
      let param = {
        master: this.info,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
linxin's avatar
linxin committed
570
        if (res.result === 'S') {
571
          vm.hlsPopup.showSuccess('保存成功')
linxin's avatar
linxin committed
572 573 574 575
          vm.getEquipment()
          setTimeout(() => {
            vm.downNum = false
          }, 2000)
linxin's avatar
linxin committed
576
          vm.savePicture()
577 578 579 580 581
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
582 583 584 585
    savePicture () {
      let vm = this
      let list = []
      let obj = {
linxin's avatar
linxin committed
586
        pkvalue: vm.contract_lease_item_id,
linxin's avatar
linxin committed
587 588
        source_type: 'CON_CONTRACT_LEASE_ITEM',
        picture: '',
linxin's avatar
linxin committed
589
        check_id: vm.contract_lease_item_id,
linxin's avatar
linxin committed
590 591 592 593 594 595 596 597
        filePath: vm.vehicleImg,
        attachment_id: '',
        user_id: 1,
        fileName: '合格证',
      }
      list.push(obj)
      vm.save_picture(list)
    },
598
    isSave () {
linxin's avatar
linxin committed
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
      if (!this.info.frame_number) {
        hlsPopup.showLongCenter('请输入车架号')
      } else if (!this.info.engine) {
        hlsPopup.showLongCenter('请输入发动机号')
      } else if (!this.info.vehicle_model) {
        hlsPopup.showLongCenter('请输入车辆型号')
      } else if (!this.info.certificate_number) {
        hlsPopup.showLongCenter('请输入合格证编号')
      } else if (!this.info.departure_date) {
        hlsPopup.showLongCenter('请输入发车日期')
      } else if (!this.info.invoice_date) {
        hlsPopup.showLongCenter('请输入开票日期')
      } else {
        this.hlsPopup.showConfirm({
          title: '提示',
          content: '您确定保存吗?',
          onConfirm: data => {
            if (data === 1) {
              this.save()
            }
          },
        })
      }
622
    },
linxin's avatar
linxin committed
623 624 625 626 627 628 629 630 631 632
    checkStatus () {
      let mantained = this.equip.filter(i => {
        return i.lease_status === 'N'
      })
      if (mantained.length > 0) {
        hlsPopup.showLongCenter('您有待维护的设备项,请完善信息后再申请发车!')
      } else {
        this.isApprove()
      }
    },
633 634 635 636 637 638 639 640 641 642 643
    isApprove () {
      this.hlsPopup.showConfirm({
        title: '提示',
        content: '您确定申请发车吗?',
        onConfirm: data => {
          if (data === 1) {
            this.approve()
          }
        },
      })
    },
linxin's avatar
linxin committed
644
    getRent (e, id) {
645
      let vm = this
linxin's avatar
linxin committed
646 647 648
      for (let i in vm.info) {
        vm.info[i] = ''
      }
linxin's avatar
linxin committed
649
      vm.info.contract_id = e
650 651
      let url = process.env.basePath + 'leases_info_query'
      let param = {
linxin's avatar
linxin committed
652
        contract_id: e,
653 654 655 656 657 658
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          Object.assign(vm.info, res.info)
linxin's avatar
linxin committed
659 660
          vm.getImg(id)
          vm.contract_lease_item_id = id
661 662 663 664 665
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
666

667 668 669 670 671 672 673 674 675 676 677 678 679
    approve () {
      let vm = this
      let url = process.env.basePath + 'car_apply_submit'
      let param = {
        master: {
          project_id: this.$route.params.project_id,
        },
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.hlsPopup.showSuccess('申请成功')
linxin's avatar
linxin committed
680 681
          setTimeout(() => {
            vm.$router.push({
linxin's avatar
linxin committed
682
              name: 'MyInfo',
linxin's avatar
linxin committed
683 684
            })
          }, 2000)
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    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
linxin's avatar
linxin committed
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    getContractNum () {
      let vm = this
      let url = process.env.basePath + 'linked_contract_query'
      let param = {
        user_phone: window.localStorage.getItem('user_phone'),
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.contract = res.lists.map(item => {
            return {
              code: item.project_id,
              code_name: item.project_number,
            }
          })
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    selectContruct () {
      let vm = this
      vm.hlsPopup.selectList({
        list: vm.contract,
        code: 'bp_type',
        object: {},
        returnItem: function (index, obj) {
          vm.detail.project_id = obj.bp_type
          vm.detail.project_number = obj.bp_type_n
        },
      })
    },
    getAgent () {
      let vm = this
      let url = process.env.basePath + 'vendor_list_query'
      let param = {}
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.agent = res.lists.map(item => {
            return {
              code: item.factory_bp_id,
              code_name: item.bp_name,
            }
          })
linxin's avatar
linxin committed
753 754 755 756 757
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
758 759 760 761 762 763 764 765 766 767 768 769 770
    selectAgent () {
      let vm = this
      vm.hlsPopup.selectList({
        list: vm.agent,
        code: 'bp_type',
        object: {},
        returnItem: function (index, obj) {
          vm.detail.bp_id = obj.bp_type
          vm.detail.bp_agent_name = obj.bp_type_n
        },
      })
    },
    getDetail () {
linxin's avatar
linxin committed
771 772 773 774 775 776 777 778 779 780 781
      // let obj = {
      //   product_plan_id: '29',
      //   product_num: '1',
      //   first_pay: '102500',
      //   division_n: '平地机',
      //   gps_fee: '500',
      //   bp_name: '黄冲',
      //   project_number: 'PJ2019050043',
      //   bp_agent_name: '上海汉得信息技术股份有限公司 ',
      //   product_plan_id_n: 'PDJ',
      //   total_price: '1111111111',
linxin's avatar
linxin committed
782
      // }
linxin's avatar
linxin committed
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797
      // Object.assign(this.detail, obj)
      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') {
          Object.assign(vm.detail, res.info)
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
linxin's avatar
linxin committed
798
    },
799 800 801 802 803 804
    changeHeight () {
      let popClient = document.querySelector('.bottom-content')
      let bottomPop = document.querySelector('.bottom-pop')
      bottomPop.style.height = '100%'
      popClient.style.height = '500px'
    },
linxin's avatar
linxin committed
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
    getProductLine () {
      let vm = this
      let url = process.env.basePath + 'division_query'
      let param = {}
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.productLine = res.lists.map(item => {
            return {
              code: item.division,
              code_name: item.division_n,
            }
          })
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    selectProductLine () {
      let vm = this
      vm.hlsPopup.selectList({
        list: vm.productLine,
        code: 'bp_type',
        object: {},
        returnItem: function (index, obj) {
          vm.detail.division = obj.bp_type
          vm.detail.division_n = obj.bp_type_n
        },
      })
    },
    getProductPlan () {
      let vm = this
      let url = process.env.basePath + 'prd_plan_defintion'
      let param = {}
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.productPlan = res.lists.map(item => {
            return {
              code: item.product_plan_id,
              code_name: item.product_plan_name,
            }
          })
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    selectProductPlan () {
      let vm = this
      vm.hlsPopup.selectList({
        list: vm.productPlan,
        code: 'bp_type',
        object: {},
        returnItem: function (index, obj) {
          vm.detail.product_plan_id = obj.bp_type
linxin's avatar
linxin committed
863
          vm.detail.product_plan_id_n = obj.bp_type_n
linxin's avatar
linxin committed
864 865 866
        },
      })
    },
867 868 869 870 871 872 873
    hideBox () {
      let popClient = document.querySelector('.bottom-content')
      let bottomPop = document.querySelector('.bottom-pop')
      bottomPop.style.height = '0'
      popClient.style.height = '0'
    },
  },
874 875 876 877 878 879 880
}
</script>
<style lang="less" scoped>
#addCar {
  input::placeholder {
    color: #888c8f;
  }
881 882 883 884 885 886 887 888 889
  .trans-enter-active,
  .trans-leave-active {
    transition: opacity 0.5s;
  }
  .trans-enter,
  .trans-leave-active {
    opacity: 0;
  }
  .hide {
890 891 892
    display: flex;
    justify-content: flex-start;
    align-items: center;
893 894 895 896
    img {
      width: 30px;
      height: 30px;
      margin-left: 65%;
897 898
    }
  }
899 900
  .wrap {
    padding-top: 92px;
901
  }
902 903 904 905
  .modal-show {
    width: 100%;
    height: 100%;
    position: absolute;
906
    display: flex;
907
    z-index: 900;
908 909 910 911 912 913
    background-color: rgba(56, 63, 69, 0.3);
    justify-content: center;
    align-items: center;
    .down {
      position: relative;
      width: 314px;
linxin's avatar
linxin committed
914
      height: 516px;
linxin's avatar
linxin committed
915
      z-index: 999;
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
      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;
      img {
        width: 16px;
        height: 16px;
        float: right;
        margin-top: 13px;
        margin-right: 20px;
      }
    }
    .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;
953 954 955 956 957
        background: url("../../assets/contractStart/photo.png") 70px no-repeat;
        background-size: 24px 20px;
        img {
          width: 100%;
          height: 100%;
958 959 960 961 962 963 964 965
        }
      }
    }
    button {
      width: 240px;
      height: 40px;
      position: absolute;
      color: #fff;
李晓兵's avatar
李晓兵 committed
966
      bottom: 10px;
967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040
      left: 30.5px;
      background-color: #0041c4;
      border-radius: 4px;
    }
  }
  .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;
      }
      .status {
        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
1041 1042 1043 1044 1045 1046 1047 1048
      .unMantain{
        background-color: #1d3fff;
      }
      .mantain{
        background-color: #FFF;
        border:1px solid #1d3fff;
        color: #1d3fff;
      }
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
      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;
  }
linxin's avatar
linxin committed
1077 1078 1079 1080 1081
  .save{
 border: 1px solid #fdb62f;
      border-radius: 4px;
      color: #fdb62f;
  }
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094
  .bottom-pop {
    width: 100%;
    height: 0;
    position: absolute;
    bottom: 0px;
    z-index: 999;
    background-color: rgba(56, 63, 69, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    .bottom-content {
      width: 100%;
      height: 0px;
1095
      transition: 0.3s linear;
1096 1097 1098 1099 1100 1101 1102 1103
      border-radius: 20px 20px 0 0;
      position: absolute;
      bottom: 0px;
      background-color: #fff;
      overflow-y: scroll;
      .box {
        width: 359px;
        margin: 0 auto;
1104 1105
        .fix {
          position: fixed;
1106 1107
          background-color: #fff;
          border-radius: 20px;
1108
          z-index: 999;
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189
        }
        .bottom-top {
          width: 100%;
          display: flex;
          justify-content: flex-start;
          padding-bottom: 10px;
          border-bottom: 1px solid #d9dbdf;
          input {
            width: 148px;
            height: 36px;
            background-color: rgba(239, 239, 239, 0.55);
            border-radius: 4px;
            text-indent: 14px;
          }
          input:last-of-type {
            margin-left: -5px;
          }
          img {
            width: 15px;
            height: 15px;
            position: relative;
            top: 10px;
            left: -26px;
          }
          span {
            display: inline-block;
            width: 40px;
            height: 36px;
            border-radius: 4px;
            background: url("../../assets/contractStart/select.png") 10px
              no-repeat #1d3fff;
            background-size: 16px 16px;
          }
        }
        .bottom-item {
          width: 100%;
          height: 80px;
          background: #f7f7f7;
          border-radius: 4px;
          margin-top: 10px;
          display: flex;
          justify-content: flex-start;
          .left {
            width: 17%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            p {
              width: 30px;
              height: 30px;
              background: #e0e1e5;
              border-radius: 8px;
              display: flex;
              justify-content: center;
              align-items: center;
              img {
                width: 14px;
                height: 14px;
              }
            }
          }
          .right {
            width: 83%;
            height: 100%;
            ul {
              height: 100%;
              li {
                width: 100%;
                height: 50%;
                line-height: 36px;
                font-family: PingFangSC-Regular;
                font-size: 14px;
                color: #383f45;
                .name {
                  font-family: PingFangSC-Regular;
                  font-size: 14px;
                  color: rgba(56, 63, 69, 0.6);
                  letter-spacing: 0.43px;
                }
              }
1190 1191 1192
              .to-right {
                float: right;
                margin-right: 36px;
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
              }
              li:first-child {
                border-bottom: 1px solid #fff;
              }
            }
          }
        }
      }
    }
  }
1203 1204
}
</style>