高速报送人接口联调

main
张群 2 years ago
parent e397be61c5
commit 97f73a09e0
  1. 136
      pages/highWay/runData/form.vue

@ -9,8 +9,8 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">管理单位名称</view> <view class="form_item_label">管理单位名称</view>
<view class="form_item_input picker"> <view class="form_item_input picker">
<picker v-if="pageType == 'add' && deptNameList.length > 1" :value="form.organizationNameIndex" :range="deptNameList" <picker v-if="pageType == 'add' && deptNameList.length > 1" :value="form.organizationNameIndex"
range-key="deptName" @change="bindDeptChange"> :range="deptNameList" range-key="deptName" @change="bindDeptChange">
<text class="picker_select" <text class="picker_select"
:style="form.organizationName?'color:#333;':''">{{form.organizationName?form.organizationName:'请选择'}}</text> :style="form.organizationName?'color:#333;':''">{{form.organizationName?form.organizationName:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -31,7 +31,7 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">统计时段</view> <view class="form_item_label">统计时段</view>
<view class="form_item_input picker"> <view class="form_item_input picker">
<picker :value="index" :range="array" range-key="dictLabel" @change="queryYoYMom"> <picker :value="index" :range="array" range-key="dictLabel" @change="changeStatPeriod">
<text class="picker_select" <text class="picker_select"
:style="index>-1?'color:#333;':''">{{index>-1?array[index].dictLabel:'请选择时段'}}</text> :style="index>-1?'color:#333;':''">{{index>-1?array[index].dictLabel:'请选择时段'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -215,8 +215,8 @@
<view class="form_item_label">备注</view> <view class="form_item_label">备注</view>
<view class="form_item_input"> <view class="form_item_input">
<uni-easyinput v-model="form.highwaySubDataList[stationIndex].mark" <uni-easyinput v-model="form.highwaySubDataList[stationIndex].mark"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea"
autoHeight></uni-easyinput> maxlength="200" autoHeight></uni-easyinput>
</view> </view>
</view> </view>
</view> </view>
@ -245,9 +245,7 @@
exitVehicleCount: '', exitVehicleCount: '',
exitVehicleCountMom: '', exitVehicleCountMom: '',
exitVehicleCountYoy: '', exitVehicleCountYoy: '',
highwaySubDataList: [ highwaySubDataList: [{}],
{}
],
}, //form }, //form
highwaySubDataList: [], // highwaySubDataList: [], //
stationIndex: 0, // stationIndex: 0, //
@ -287,7 +285,8 @@
}, },
// //
formatDigit(data) { formatDigit(data) {
return !checkNotEmpty(data) ? '--' : (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; return !checkNotEmpty(data) ? '--' : (data + '').indexOf('.') > -1 && (data + '').substring((data + '')
.indexOf('.')).length > 2 ? data.toFixed(2) : data;
}, },
//id //id
queryDetailInfo(id) { queryDetailInfo(id) {
@ -318,11 +317,11 @@
} }
}) })
} }
}, },
// //
bindDeptChange(e) { bindDeptChange(e) {
this.form.organizationNameIndex = e.detail.value; this.form.organizationNameIndex = e.detail.value;
this.form.organizationName = this.deptNameList[e.detail.value].deptName; this.form.organizationName = this.deptNameList[e.detail.value].deptName;
}, },
// //
// queryPerson() { // queryPerson() {
@ -334,18 +333,19 @@
// }) // })
// this.submitPerson = arr; // this.submitPerson = arr;
// }) // })
// }, // },
queryPerson() { queryPerson() {
this.$request(getApp().globalData.baseUrl + '/api/user/getByDeptId/' + this.deptNameList[this.form.organizationNameIndex].deptId, {}, "GET").then(res => { this.$request(getApp().globalData.baseUrl + '/api/user/getAllUserInDept', {}, "GET").then(res => {
let arr = []; let arr = [];
res.data.map(item => { res.data.map(item => {
arr.push(item.username+(item.mobile?','+item.mobile:'')); arr.push(item.username + (item.mobile ? ',' + item.mobile : ''));
}) })
this.submitPerson = arr; this.submitPerson = arr;
}) })
}, },
changeSubmitPerson(e, index) { changeSubmitPerson(e, index) {
this.form.highwaySubDataList[index].submitPersonnelContact = this.submitPerson[e.detail.value]; this.form.highwaySubDataList[index].submitPersonnelContact = this.submitPerson[e.detail.value];
console.log(this.form.highwaySubDataList[index])
}, },
// //
changeStationIndex(index) { changeStationIndex(index) {
@ -365,8 +365,9 @@
let entranceVehicleCount = 0, let entranceVehicleCount = 0,
exitVehicleCount = 0; exitVehicleCount = 0;
this.form.highwaySubDataList.map(item => { this.form.highwaySubDataList.map(item => {
entranceVehicleCount = entranceVehicleCount + (checkNotEmpty(item.entranceVehicleCount) ? parseInt(item entranceVehicleCount = entranceVehicleCount + (checkNotEmpty(item.entranceVehicleCount) ?
.entranceVehicleCount) : 0); parseInt(item
.entranceVehicleCount) : 0);
exitVehicleCount = exitVehicleCount + (checkNotEmpty(item.exitVehicleCount) ? parseInt(item exitVehicleCount = exitVehicleCount + (checkNotEmpty(item.exitVehicleCount) ? parseInt(item
.exitVehicleCount) : 0); .exitVehicleCount) : 0);
}) })
@ -374,35 +375,14 @@
this.form.exitVehicleCount = exitVehicleCount; this.form.exitVehicleCount = exitVehicleCount;
// ifelseifelseif===0===00esleif00100,else(-)/*100 // ifelseifelseif===0===00esleif00100,else(-)/*100
// //
this.form.entranceVehicleCountMom = !checkNotEmpty(this.form.entranceVehicleCount) ? '' : !checkNotEmpty(this this.form.entranceVehicleCountMom = this.$calcMom(this.form.entranceVehicleCount,this.yoyMom.minusDaysEntranceVehicleSum);
.form.minusDaysEntranceVehicleSum) ? '' : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this this.form.entranceVehicleCountYoy = this.$calcYoy(this.form.entranceVehicleCount, this.yoyMom.minusYearsEntranceVehicleSum);
.form.entranceVehicleCount) === 0 ? 0 : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this
.form.entranceVehicleCount) > 0 ? 100 : (parseInt(this
.form.entranceVehicleCount) - this.yoyMom.minusDaysEntranceVehicleSum) / this.yoyMom
.minusDaysEntranceVehicleSum * 100;
this.form.entranceVehicleCountYoy = !checkNotEmpty(this.form
.entranceVehicleCount) ? '' : !checkNotEmpty(this
.form.minusYearsEntranceVehicleSum) ? '' : this.form.minusYearsEntranceVehicleSum === 0 && parseInt(
this.form.entranceVehicleCount) === 0 ? 0 : this.form.minusYearsEntranceVehicleSum === 0 && parseInt(
this.form.entranceVehicleCount) > 0 ? 100 : (parseInt(
this.form.entranceVehicleCount) - this.yoyMom.minusYearsEntranceVehicleSum) / this.yoyMom
.minusYearsEntranceVehicleSum * 100;
// //
this.form.exitVehicleCountMom = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty(this this.form.exitVehicleCountMom = this.$calcMom(this.form.exitVehicleCount, this.yoyMom.minusDaysExitVehicleSum);
.form
.minusDaysExitVehicleSum) ? '' : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form this.form.exitVehicleCountYoy = this.$calcYoy(this.form.exitVehicleCount, this.yoyMom.minusYearsExitVehicleSum);
.exitVehicleCount) === 0 ? 0 : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) > 0 ? 100 : (parseInt(this.form
.exitVehicleCount) - this.yoyMom.minusDaysExitVehicleSum) / this.yoyMom.minusDaysExitVehicleSum *
100;
this.form.exitVehicleCountYoy = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty(
this.form
.minusYearsExitVehicleSum) ? '' : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) === 0 ? 0 : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) > 0 ? 100 : (parseInt(this.form
.exitVehicleCount) - this.yoyMom.minusYearsExitVehicleSum) / this.yoyMom.minusYearsExitVehicleSum *
100;
// //
// if(this.form.highwaySubDataList[index].entranceVehicleCount != '' || this.form.highwaySubDataList[index].exitVehicleCount != ''){ // if(this.form.highwaySubDataList[index].entranceVehicleCount != '' || this.form.highwaySubDataList[index].exitVehicleCount != ''){
@ -417,16 +397,10 @@
// //
let obj = this.yoyMom.minusDaysList[idx]; let obj = this.yoyMom.minusDaysList[idx];
// console.log(obj) // console.log(obj)
this.form.highwaySubDataList[index].entranceVehicleCountMom = !checkNotEmpty(this.form this.form.highwaySubDataList[index].entranceVehicleCountMom = this.$calcMom(this.form
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj .highwaySubDataList[index].entranceVehicleCount, obj.entranceVehicleCount);
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form this.form.highwaySubDataList[index].exitVehicleCountMom = this.$calcMom(this.form.highwaySubDataList[index].exitVehicleCount,obj.exitVehicleCount);
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj
.entranceVehicleCount * 100;
this.form.highwaySubDataList[index].exitVehicleCountMom = !checkNotEmpty(this.form
.highwaySubDataList[
index].exitVehicleCount) ? '' : !checkNotEmpty(obj.exitVehicleCount) ? '' : obj
.exitVehicleCount === 0 ? 100 : (parseInt(this.form.highwaySubDataList[index].exitVehicleCount) -
obj.exitVehicleCount) / obj.exitVehicleCount * 100;
} else { } else {
this.form.highwaySubDataList[index].entranceVehicleCountMom = ''; this.form.highwaySubDataList[index].entranceVehicleCountMom = '';
this.form.highwaySubDataList[index].exitVehicleCountMom = ''; this.form.highwaySubDataList[index].exitVehicleCountMom = '';
@ -435,17 +409,11 @@
// //
let obj = this.yoyMom.minusYearsList[idx2]; let obj = this.yoyMom.minusYearsList[idx2];
console.log(obj) console.log(obj)
this.form.highwaySubDataList[index].entranceVehicleCountYoy = !checkNotEmpty(this.form this.form.highwaySubDataList[index].entranceVehicleCountYoy = this.$calcYoy(this.form
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj .highwaySubDataList[index].entranceVehicleCount,obj.entranceVehicleCount);
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj this.form.highwaySubDataList[index].exitVehicleCountYoy = this.$calcYoy(this.form
.entranceVehicleCount * 100; .highwaySubDataList[index].exitVehicleCount, obj.exitVehicleCount);
this.form.highwaySubDataList[index].exitVehicleCountYoy = !checkNotEmpty(this.form
.highwaySubDataList[
index].exitVehicleCount) ? '' : !
checkNotEmpty(obj.exitVehicleCount) ? '' : obj.exitVehicleCount === 0 ? 100 : (parseInt(this.form
.highwaySubDataList[index].exitVehicleCount) - obj.exitVehicleCount) / obj.exitVehicleCount *
100;
} else { } else {
this.form.highwaySubDataList[index].entranceVehicleCountYoy = ''; this.form.highwaySubDataList[index].entranceVehicleCountYoy = '';
this.form.highwaySubDataList[index].exitVehicleCountYoy = ''; this.form.highwaySubDataList[index].exitVehicleCountYoy = '';
@ -457,7 +425,8 @@
this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date
.parse( .parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.highwaySubDataList = res.data; this.highwaySubDataList = res.data;
this.form.highwaySubDataList = [];
if (type == 'add') { if (type == 'add') {
this.highwaySubDataList.map(item => { this.highwaySubDataList.map(item => {
item.isFinish = false; item.isFinish = false;
@ -471,8 +440,9 @@
"exitVehicleCountYoy": '', "exitVehicleCountYoy": '',
"highwayId": "", "highwayId": "",
"highwayName": item.managementUnitName, "highwayName": item.managementUnitName,
"submitPersonnelContact": this.userInfo.realName + ',' + this "submitPersonnelContact": this.userInfo.username + (this
.userInfo.mobile, .userInfo.mobile ? ',' + this
.userInfo.mobile : ''),
"tollExemptAmount": 0.0, "tollExemptAmount": 0.0,
"tollExemptVehicleCount": 0, "tollExemptVehicleCount": 0,
"tollExemptVehicleCountMom": 0.0, "tollExemptVehicleCountMom": 0.0,
@ -505,8 +475,9 @@
"exitVehicleCountYoy": '', "exitVehicleCountYoy": '',
"highwayId": "", "highwayId": "",
"highwayName": item.managementUnitName, "highwayName": item.managementUnitName,
"submitPersonnelContact": this.userInfo.realName + ',' + this "submitPersonnelContact": this.userInfo.username + (this
.userInfo.mobile, .userInfo.mobile ? ',' + this
.userInfo.mobile : ''),
"tollExemptAmount": 0.0, "tollExemptAmount": 0.0,
"tollExemptVehicleCount": 0, "tollExemptVehicleCount": 0,
"tollExemptVehicleCountMom": 0.0, "tollExemptVehicleCountMom": 0.0,
@ -527,6 +498,13 @@
bindDateChange(e) { bindDateChange(e) {
this.form.statDate = e.detail.value; this.form.statDate = e.detail.value;
this.queryYoYMom(); this.queryYoYMom();
},
//
changeStatPeriod(e) {
this.index = e.detail.value;
this.form.statPeriod = this.array[e.detail.value].dictValue;
console.log('change 时段')
this.queryYoYMom();
}, },
// //
queryTime() { queryTime() {
@ -862,4 +840,4 @@
background-color: #007aff; background-color: #007aff;
color: #ffffff; color: #ffffff;
} }
</style> </style>

Loading…
Cancel
Save