|
|
|
|
@ -55,9 +55,14 @@ |
|
|
|
|
<!-- <uni-easyinput v-model="roadData.responsiblePersonId" placeholder="请输入" placeholderStyle="color:#d4d4d4;"></uni-easyinput> --> |
|
|
|
|
<picker :value="peopleIndex" :range="peopleList" |
|
|
|
|
range-key="people" @change="bindPeoChange"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="peopleName?'color:#333;':''">{{peopleName ? peopleName : '请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
<view style="display: flex;align-items: center;"> |
|
|
|
|
<view style="display: flex;flex-direction: column;align-items: flex-end;justify-content: center;"> |
|
|
|
|
<text class="picker_select">{{!peopleName && !peopleNumber ? ' 请选择' : ''}}</text> |
|
|
|
|
<text class="picker_select" :style="peopleName?'color:#333;':''">{{peopleName ? peopleName : ''}}</text> |
|
|
|
|
<text class="picker_select" :style="peopleNumber?'color:#333;':''">{{peopleNumber ? peopleNumber : ''}}</text> |
|
|
|
|
</view> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</view> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -490,7 +495,8 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
selectName:'', |
|
|
|
|
selectId1:'', |
|
|
|
|
mobile: getApp().globalData.mobile, |
|
|
|
|
unitName:'' |
|
|
|
|
unitName:'', |
|
|
|
|
peopleNumber:'', |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options){ |
|
|
|
|
@ -516,6 +522,26 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
phoneNumber: tel |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getDataDetail(reportPhase,reportUnit,statisticalDate){ |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/getDetail?reportPhase=' + reportPhase + '&reportUnit=' + reportUnit + '&statisticalDate=' + statisticalDate,{},"GET").then(res =>{ |
|
|
|
|
res.data.reportPhase = this.roadData.reportPhase; |
|
|
|
|
res.data.reportingUnitId = this.roadData.reportingUnitId; |
|
|
|
|
res.data.statisticalDate = this.roadData.statisticalDate; |
|
|
|
|
this.roadData = res.data; |
|
|
|
|
console.log('peopleList =====>',this.peopleList) |
|
|
|
|
this.peopleName = '' |
|
|
|
|
this.peopleNumber = '' |
|
|
|
|
if(this.roadData.responsiblePersonId){ |
|
|
|
|
let tmp = this.peopleList.find(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
this.peopleIndex = this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) <= -1 |
|
|
|
|
? '' : this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
console.log('peopleIndex ===>',this.peopleIndex) |
|
|
|
|
this.peopleName = tmp ? tmp.people.split(',')[0] : '' |
|
|
|
|
this.peopleNumber = tmp ? tmp.people.split(',')[1] : this.roadData.contactNumber |
|
|
|
|
} |
|
|
|
|
this.getRatio(); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 计算包车数 |
|
|
|
|
calcBusNum(){ |
|
|
|
|
let capacityShuttle = checkNotEmpty(this.roadData.capacityShuttle) ? parseInt(this.roadData.capacityShuttle) : 0; |
|
|
|
|
@ -594,10 +620,23 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
if(this.pageType == 'edit'){ |
|
|
|
|
console.log('deptNameList ===>',this.peopleList) |
|
|
|
|
let tmp = this.peopleList.find(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
this.peopleIndex = this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) <= -1 ? '' : this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
this.peopleIndex = this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) <= -1 |
|
|
|
|
? '' : this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
console.log('peopleIndex ===>',this.peopleIndex) |
|
|
|
|
this.peopleName = tmp ? tmp.people : '' + this.roadData.contactNumber |
|
|
|
|
|
|
|
|
|
// this.peopleName = tmp ? tmp.people : '' + this.roadData.contactNumber |
|
|
|
|
this.peopleName = tmp ? tmp.people.split(',')[0] : '' |
|
|
|
|
this.peopleNumber = tmp ? tmp.people.split(',')[1] : this.roadData.contactNumber |
|
|
|
|
}else{ |
|
|
|
|
console.log('responsiblePersonId =====>',this.roadData.responsiblePersonId) |
|
|
|
|
if(this.roadData.responsiblePersonId){ |
|
|
|
|
let tmp = this.peopleList.find(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
this.peopleIndex = this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) <= -1 |
|
|
|
|
? '' : this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) |
|
|
|
|
console.log('peopleIndex ===>',this.peopleIndex) |
|
|
|
|
// this.peopleName = tmp ? tmp.people : '' + this.roadData.contactNumber |
|
|
|
|
this.peopleName = tmp ? tmp.people.split(',')[0] : '' |
|
|
|
|
this.peopleNumber = tmp ? tmp.people.split(',')[1] : this.roadData.contactNumber |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
@ -616,7 +655,6 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
this.roadData.reportingUnitIdIndex = this.deptNameList.length > 0 ? 0 : ''; |
|
|
|
|
this.selectId1 = this.unitId; |
|
|
|
|
this.getRoadTime() |
|
|
|
|
this.getPeople() |
|
|
|
|
}else if(this.pageType == 'edit'){ |
|
|
|
|
console.log('reportingUnitId===>',this.roadData.reportingUnitId) |
|
|
|
|
console.log('treeData ==>',this.treeData) |
|
|
|
|
@ -683,7 +721,9 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
//选择统计日期 |
|
|
|
|
bindDateChange(e) { |
|
|
|
|
this.roadData.statisticalDate = e.detail.value; |
|
|
|
|
this.getRatio() |
|
|
|
|
console.log('统计单位 ======>',this.roadData.reportingUnitId,'统计日期 ======>',this.roadData.statisticalDate,'统计时段=====>',this.roadData.reportPhase) |
|
|
|
|
// this.getRatio() |
|
|
|
|
this.getDataDetail(this.roadData.reportPhase,this.roadData.reportingUnitId,e.detail.value) |
|
|
|
|
}, |
|
|
|
|
// 确定选择人员 |
|
|
|
|
bindPeoChange(e){ |
|
|
|
|
@ -691,8 +731,11 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
let index = e.target.value //取其下标 |
|
|
|
|
var selected = this.peopleList[index] //获取选中的数组 |
|
|
|
|
this.roadData.responsiblePersonId = selected.id; |
|
|
|
|
this.peopleName = selected.people; |
|
|
|
|
this.roadData.contactNumber = this.peopleName.split(',')[1]; |
|
|
|
|
// this.peopleName = selected.people; |
|
|
|
|
console.log('selected =====>',selected) |
|
|
|
|
this.roadData.contactNumber = selected.people.split(',')[1]; |
|
|
|
|
this.peopleName = selected.people.split(',')[0]; |
|
|
|
|
this.peopleNumber = selected.people.split(',')[1]; |
|
|
|
|
}, |
|
|
|
|
// 确认修改道路运输数据 |
|
|
|
|
confirmRoad(){ |
|
|
|
|
@ -715,7 +758,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
success:(res) =>{ |
|
|
|
|
if(res.confirm){ |
|
|
|
|
params.isPassengerCountConvert = 0; |
|
|
|
|
console.log(params) |
|
|
|
|
console.log('params =======>',params) |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/saveOrUpdate',params,'POST').then(res =>{ |
|
|
|
|
if(res.code == 200){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
@ -786,6 +829,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
res.data.reportingUnitId = this.roadData.reportingUnitId; |
|
|
|
|
res.data.statisticalDate = this.roadData.statisticalDate; |
|
|
|
|
this.roadData = res.data; |
|
|
|
|
this.getPeople() |
|
|
|
|
}) |
|
|
|
|
this.getRatio() |
|
|
|
|
} |
|
|
|
|
@ -819,13 +863,15 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 选中时段数据 |
|
|
|
|
// 选中统计时段数据 |
|
|
|
|
bindPickerChange(e){ |
|
|
|
|
let index = e.target.value //取其下标 |
|
|
|
|
var selected = this.roadTime[index] //获取选中的数组 |
|
|
|
|
this.roadData.reportPhase = selected.dictValue; |
|
|
|
|
this.timeName = selected.dictLabel; |
|
|
|
|
this.getRatio() |
|
|
|
|
// this.getRatio() |
|
|
|
|
console.log('统计单位 ======>',this.roadData.reportingUnitId,'统计日期 ======>',this.roadData.statisticalDate,'统计时段=====>',this.roadData.reportPhase) |
|
|
|
|
this.getDataDetail(this.roadData.reportPhase,this.roadData.reportingUnitId,this.roadData.statisticalDate) |
|
|
|
|
}, |
|
|
|
|
formatDigit(data) { |
|
|
|
|
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; |
|
|
|
|
@ -927,7 +973,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
|
|
|
|
|
.left{ |
|
|
|
|
// margin-left: 30rpx; |
|
|
|
|
min-width: 320rpx; |
|
|
|
|
min-width: 300rpx; |
|
|
|
|
color: #666; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
|
|
|
|
|
|