"use strict";const e=require("../../../common/vendor.js"),o=require("../../../common/libraries/apiLoading.js"),a=require("../../../common/libraries/day.js"),i=require("../../../common/libraries/naviHelper.js"),l=require("../../../gen/Apis.js"),s=require("./model.js"),r={init(e){s.useModel.formData.value={house_meters_id:null==e?void 0:e.id}},handleSubmit(){var e,r,n;if(console.log("handleSubmit",s.useModel.formData.value),!(null==(n=null==(r=null==(e=s.useModel)?void 0:e.formData)?void 0:r.value)?void 0:n.current_reading))return i.showToast("请设置本次读数！");o.getApiLoading(l.Apis.Meter.HouseMeterReadings.Store,{...s.useModel.formData.value,reading_time:a.getTime()}).then(e=>{i.showToastBack("提交成功！",1,!0),console.log(e)})},handleToSelectHouse(){e.index.navigateTo({url:"/pages/public/asset_houses/index?type=work_add"})},handleSwitchChange(e){var o;s.useModel.formData.value.is_anonymous=null==(o=null==e?void 0:e.detail)?void 0:o.value,console.log(e,"e")},getShow(e){o.getApiLoading(l.Apis.Meter.HouseMeters.Show,e).then(e=>{s.useModel.showData.value=null==e?void 0:e.data,console.log(e)})}};exports.method=r;
