优化代码

This commit is contained in:
java110 2021-10-07 20:14:51 +08:00
parent a875e2e5dc
commit 27ea4a4b49
2 changed files with 24 additions and 7 deletions

View File

@ -19,8 +19,8 @@
<select class="custom-select" v-model="meterWaterManageInfo.conditions.meterType">
<option selected value="">请选择表类型</option>
<option v-for="(item,index) in meterWaterManageInfo.meterTypes" :key="index"
v-bind:value="item.statusCd">
{{item.name}}
v-bind:value="item.typeId">
{{item.typeName}}
</option>
</select>
</div>
@ -80,7 +80,7 @@
<tbody>
<tr v-for="meterWater in meterWaterManageInfo.meterWaters">
<td class="text-center">{{meterWater.waterId}}</td>
<td class="text-center">{{_getMeteTypeName(meterWater.meterType)}}</td>
<td class="text-center">{{meterWater.meterTypeName}}</td>
<td class="text-center">{{meterWater.objName}}</td>
<td class="text-center">{{meterWater.preDegrees}}</td>
<td class="text-center">{{meterWater.curDegrees}}</td>

View File

@ -21,9 +21,7 @@
}
},
_initMethod: function () {
vc.getDict('meter_water', "meter_type", function (_data) {
vc.component.meterWaterManageInfo.meterTypes = _data;
});
$that.listMeterTypes();
vc.component._listMeterWaters(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
@ -102,7 +100,26 @@
return "水表";
}
return "煤气费";
}
},
listMeterTypes: function () {
let param = {
params: {
page:1,
row:100,
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('meterType.listMeterType',
param,
function (json, res) {
let _meterTypeManageInfo = JSON.parse(json);
$that.meterWaterManageInfo.meterTypes = _meterTypeManageInfo.data;
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
}
});
})(window.vc);