mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化代码
This commit is contained in:
parent
f08ec30fb6
commit
59f558ec9a
@ -31,6 +31,36 @@ export function queryFeeTypesItems(_that,_data){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询上期水电缴费信息
|
||||||
|
*/
|
||||||
|
export function listMeterType(_that, _data){
|
||||||
|
return new Promise(function(reslove,reject){
|
||||||
|
_that.context.get({
|
||||||
|
url: url.listMeterType,
|
||||||
|
data:_data,
|
||||||
|
success: function(res) {
|
||||||
|
if(res.statusCode == 200){
|
||||||
|
reslove(res.data);
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
title: "服务器异常了",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "服务器异常了",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询上期水电缴费信息
|
* 查询上期水电缴费信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -139,8 +139,10 @@ export default {
|
|||||||
listRunWorkflowImage: baseUrl + "app/workflow.listRunWorkflowImage",
|
listRunWorkflowImage: baseUrl + "app/workflow.listRunWorkflowImage",
|
||||||
getNextTask: baseUrl + "app/oaWorkflow/getNextTask",
|
getNextTask: baseUrl + "app/oaWorkflow/getNextTask",
|
||||||
auditOaWorkflow: baseUrl + "app/oaWorkflow/auditOaWorkflow",
|
auditOaWorkflow: baseUrl + "app/oaWorkflow/auditOaWorkflow",
|
||||||
|
|
||||||
updateOaWorkflowFormData: baseUrl +"app/oaWorkflow.updateOaWorkflowFormData",
|
updateOaWorkflowFormData: baseUrl +"app/oaWorkflow.updateOaWorkflowFormData",
|
||||||
|
listMeterType: baseUrl +"app/meterType.listMeterType",
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,15 @@
|
|||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">抄表类型</view>
|
||||||
|
<picker @change="meterTypeChange" :value="meterTypeIndex" :range-key="'typeName'" :range="meterTypes">
|
||||||
|
<view class="picker">
|
||||||
|
{{meterTypeIndex>-1?meterTypes[meterTypeIndex].typeName:'请选择'}}
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="cu-form-group arrow" @tap="chooseFloor">
|
<view class="cu-form-group arrow" @tap="chooseFloor">
|
||||||
<view class="title">楼栋</view>
|
<view class="title">楼栋</view>
|
||||||
<input required readonly label="楼栋" v-model="floorNum" placeholder="请选择楼栋" name="floorNum" icon="arrow"></input>
|
<input required readonly label="楼栋" v-model="floorNum" placeholder="请选择楼栋" name="floorNum" icon="arrow"></input>
|
||||||
@ -71,7 +80,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {queryFeeTypesItems,queryPreMeterWater,saveMeterWater} from '../../api/meter/meter.js'
|
import {queryFeeTypesItems,queryPreMeterWater,saveMeterWater,listMeterType} from '../../api/meter/meter.js'
|
||||||
import dateObj from '../../lib/java110/utils/date.js'
|
import dateObj from '../../lib/java110/utils/date.js'
|
||||||
import uniDatetimePicker from '../../components/uni-datetime-picker/uni-datetime-picker.vue'
|
import uniDatetimePicker from '../../components/uni-datetime-picker/uni-datetime-picker.vue'
|
||||||
import {getCurrentCommunity} from '../../api/community/community.js'
|
import {getCurrentCommunity} from '../../api/community/community.js'
|
||||||
@ -94,7 +103,7 @@
|
|||||||
name: '电费'
|
name: '电费'
|
||||||
},{
|
},{
|
||||||
id: '888800010009',
|
id: '888800010009',
|
||||||
name: '电费'
|
name: '煤气费'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
feeConfig_index: -1,
|
feeConfig_index: -1,
|
||||||
@ -105,6 +114,9 @@
|
|||||||
curDegrees: '',
|
curDegrees: '',
|
||||||
curReadingTime: null,
|
curReadingTime: null,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
meterTypes:[],
|
||||||
|
meterType:'',
|
||||||
|
meterTypeIndex:-1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components:{
|
components:{
|
||||||
@ -115,11 +127,13 @@
|
|||||||
this.java110Context.onLoad();
|
this.java110Context.onLoad();
|
||||||
this.preReadingTime = dateObj.getCurrentDateTime();
|
this.preReadingTime = dateObj.getCurrentDateTime();
|
||||||
this.communityId = getCurrentCommunity().communityId;
|
this.communityId = getCurrentCommunity().communityId;
|
||||||
|
this._listMeterTypes();
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow(){
|
onShow(){
|
||||||
// 房屋信息
|
// 房屋信息
|
||||||
let _floor = uni.getStorageSync("_selectFloor");
|
let _floor = uni.getStorageSync("_selectFloor");
|
||||||
|
console.log(_floor)
|
||||||
if (this.util.isNotNull(_floor)) {
|
if (this.util.isNotNull(_floor)) {
|
||||||
this.floorNum = _floor.floorNum + "栋";
|
this.floorNum = _floor.floorNum + "栋";
|
||||||
this.floorId = _floor.floorId;
|
this.floorId = _floor.floorId;
|
||||||
@ -168,25 +182,41 @@
|
|||||||
// 查询上期读数
|
// 查询上期读数
|
||||||
this._queryPreMeterWater();
|
this._queryPreMeterWater();
|
||||||
},
|
},
|
||||||
|
meterTypeChange:function(e){
|
||||||
|
let index = e.detail.value;
|
||||||
|
this.meterTypeIndex = index;
|
||||||
|
let selected = this.meterTypes[index];
|
||||||
|
this.meterType = selected.typeId;
|
||||||
|
},
|
||||||
// 收费项change
|
// 收费项change
|
||||||
feeConfigsChange(e){
|
feeConfigsChange(e){
|
||||||
let index = e.detail.value;
|
let index = e.detail.value;
|
||||||
this.feeConfig_index = index;
|
this.feeConfig_index = index;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_listMeterTypes:function(){
|
||||||
|
let _that =this;
|
||||||
|
listMeterType(this,{
|
||||||
|
page:1,
|
||||||
|
row:50,
|
||||||
|
communityId:this.communityId
|
||||||
|
}).then(_data =>{
|
||||||
|
_that.meterTypes = _data.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 查询上期缴费信息
|
// 查询上期缴费信息
|
||||||
_queryPreMeterWater(){
|
_queryPreMeterWater(){
|
||||||
if(this.feeType_index < 0 || this.roomId == ''){
|
if(this.feeType_index < 0 || this.roomId == ''){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let _meterType = '1010';
|
|
||||||
let _feeTypeCd = this.feeTypes[this.feeType_index].id;
|
let _meterType = this.meterType;
|
||||||
if (_feeTypeCd == '888800010015') {
|
// if (_feeTypeCd == '888800010015') {
|
||||||
_meterType = '2020';
|
// _meterType = '2020';
|
||||||
}else if(_feeTypeCd == '888800010009'){
|
// }else if(_feeTypeCd == '888800010009'){
|
||||||
_meterType = '3030';
|
// _meterType = '3030';
|
||||||
}
|
// }
|
||||||
let _objData = {
|
let _objData = {
|
||||||
communityId: this.communityId,
|
communityId: this.communityId,
|
||||||
objId: this.roomId,
|
objId: this.roomId,
|
||||||
@ -246,7 +276,8 @@
|
|||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
objName: this.floorNum + this.unitNum + this.roomNum,
|
objName: this.floorNum + this.unitNum + this.roomNum,
|
||||||
objType: this.objType,
|
objType: this.objType,
|
||||||
remark: this.remark
|
remark: this.remark,
|
||||||
|
meterType: this.meterType
|
||||||
};
|
};
|
||||||
saveMeterWater(this,_objData)
|
saveMeterWater(this,_objData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user