| | |
| | | if (response.code == 1) { |
| | | // 运输线路去重 |
| | | this.transportList = [...new Set(response.data.map(item => item.运输路线名称))] |
| | | // this.$nextTick(()=>{ |
| | | |
| | | // 运输类型去重 |
| | | this.transTypeList = [...new Set(response.data.map(item => item.运输类型))] |
| | | // }) |
| | | this.getTransCost('line') |
| | | this.getTransCost('type') |
| | | this.getTransCost('car') |
| | | |
| | | // 车型去重 |
| | | const carTypeMap = new Map() |
| | | response.data.forEach(item => { |
| | | const key = item.运输方式名称 |
| | | if (!carTypeMap.has(key)) { |
| | | carTypeMap.set(key, { value: item.运输方式名称, id: item.运输方式 }) |
| | | } |
| | | }) |
| | | this.HCarTypeNameList = Array.from(carTypeMap.values()) |
| | | |
| | | // // 运输类型去重 |
| | | // this.transTypeList = [...new Set(response.data.map(item => item.运输类型))] |
| | | |
| | | // // 车型去重 |
| | | // const carTypeMap = new Map() |
| | | // response.data.forEach(item => { |
| | | // const key = item.运输方式名称 |
| | | // if (!carTypeMap.has(key)) { |
| | | // carTypeMap.set(key, { value: item.运输方式名称, id: item.运输方式 }) |
| | | // } |
| | | // }) |
| | | // this.HCarTypeNameList = Array.from(carTypeMap.values()) |
| | | } else { |
| | | this.$modal.msgError("错误:" + response.data.code + response.data.Message); |
| | | } |
| | |
| | | this.getTransCost('type') |
| | | }, |
| | | transHCarChange(val) { |
| | | let item = this.HCarTypeNameList.find(item => item.id === val); |
| | | let item = this.HCarTypeNameList.find(item => item.id === val); |
| | | this.form.HCarTypeName = item.value |
| | | this.form.HCarTypeID = val |
| | | this.getTransCost('car') |
| | |
| | | }) |
| | | this.HCarTypeNameList = Array.from(carTypeMap.values()) |
| | | } else if (val == 'car') { |
| | | console.log(response.data[0]) |
| | | this.form.HContractTransportEntryID = response.data[0].HEntryID |
| | | |
| | | this.form.HBeginAddrName = response.data[0].始发地名称 |
| | | this.form.HBeginAddr = response.data[0].始发地 |
| | | this.form.HEndAddrName = response.data[0].目的地名称 |