"use strict";const l=require("../../common/vendor.js"),e=require("../../gen/Apis.js"),o=require("./model.js"),a=require("../../common/libraries/apiLoading.js"),i=require("../../common/libraries/naviHelper.js"),u={getList(){var l,i;let u=0;a.getApiLoading(e.Apis.Bill.HouseBills.MyBillYearList,null==(i=null==(l=o.useModel)?void 0:l.formData)?void 0:i.value).then((l=>{var e,a;(null==(e=null==l?void 0:l.data)?void 0:e.length)&&(null==(a=null==l?void 0:l.data)||a.map((l=>{var e;null==(e=null==l?void 0:l.bills)||e.map((l=>{u+=parseFloat(null==l?void 0:l.amount)}))})),o.useModel.total_amount.value=u),o.useModel.listData.value=null==l?void 0:l.data,o.useModel.metaData.value=null==l?void 0:l.meta,console.log("onPay",null==l?void 0:l.data)}))},handleSubmitOrder(){var u,d,n,t,r,s,v,m,p;if(!(null==(d=null==(u=o.useModel)?void 0:u.total_amount)?void 0:d.value))return i.showToast("没有可支付金额！");a.getApiLoading(e.Apis.HouseOrder.HouseOrders.Store,{bill_ids:null==(r=null==(t=null==(n=o.useModel)?void 0:n.formData)?void 0:t.value)?void 0:r.bill_ids,amount:null==(v=null==(s=o.useModel)?void 0:s.total_amount)?void 0:v.value,total_payable_amount:null==(p=null==(m=o.useModel)?void 0:m.total_amount)?void 0:p.value}).then((e=>{var o;l.index.redirectTo({url:`/INDEX/pay/index?id=${null==(o=null==e?void 0:e.data)?void 0:o.id}`})}))}};exports.method=u;
