"use strict";const e=require("../../../common/vendor.js"),l=require("../../../common/libraries/sendWxWork.js"),a=require("../../../gen/Apis.js"),t=require("./model.js");require("../../../common/libraries/request.js"),require("../../../common/store/useWatermarkStore.js");const o=require("../../../common/store/useWeAppAuthStore.js");require("../../../common/store/useWorkStore.js");const s=o.useWeAppAuthStore(),u=()=>{var e,l;a.Apis.Bill.HouseBills.HouseList(null==(l=null==(e=t.useModel)?void 0:e.formData)?void 0:l.value).then(e=>{var l;null==(l=null==e?void 0:e.data)||l.map(e=>{e.is_select=t.useModel.allSelectStatus.value}),t.useModel.dataList.value=[...t.useModel.dataList.value,...null==e?void 0:e.data],t.useModel.meta.value=null==e?void 0:e.meta,console.log("登录",null==e?void 0:e.data)})},i={init(){t.useModel.headTabsList.value=[{name:"全部欠费",value:[]},{name:"欠费1个月以内",value:[0,1]},{name:"欠费1-3个月",value:[1,3]},{name:"欠费4-6个月",value:[4,6]},{name:"欠费6-9个月",value:[6,9]},{name:"欠费9个月以上",value:[9,30]}]},getList:u,handleSearch(){t.useModel.formData.value.page=1,t.useModel.dataList.value=[],u()},handleLoad(e){t.useModel.formData.value.page=e,u()},handleListTabsChange(e){var l,a,o;t.useModel.formData.value.page=1,t.useModel.formData.value.overdue_months_range=(null==e?void 0:e.index)?null==(o=null==(a=null==(l=t.useModel)?void 0:l.headTabsList)?void 0:a.value[null==e?void 0:e.index])?void 0:o.value:void 0,t.useModel.dataList.value=[],u(),console.log("e",e)},handleSelect(e){var l;let a=!0,o=t.useModel.dataList.value[e].is_select;t.useModel.dataList.value[e].is_select=!o,null==(l=t.useModel.dataList.value)||l.map(e=>{e.is_select||(a=!1)}),t.useModel.allSelectStatus.value=a},handleAllSelect(){var e,l,a;t.useModel.allSelectStatus.value=!(null==(l=null==(e=t.useModel)?void 0:e.allSelectStatus)?void 0:l.value),null==(a=t.useModel.dataList.value)||a.map(e=>{e.is_select=t.useModel.allSelectStatus.value})},toInformationTemplate(){var l,a,o;let s=[];null==(o=null==(a=null==(l=t.useModel)?void 0:l.dataList)?void 0:a.value)||o.map(e=>{(null==e?void 0:e.is_select)&&s.push({asset_houses_id:null==e?void 0:e.id,total_unpaid_amount:parseFloat((null==e?void 0:e.total_overdue_amount)||0)})}),(null==s?void 0:s.length)?e.index.navigateTo({url:`/BILL/information_template/index?data=${JSON.stringify(s)}`}):e.index.showToast({title:"请至少选择一个！",icon:"none"})},toDetail(l){e.index.navigateTo({url:`/BILL/outstanding_fee/show/index?id=${null==l?void 0:l.id}`})},toMassSending(){var e;"wxwork"===(null==(e=null==s?void 0:s.data)?void 0:e.environment)?l.shareToExternalContact({externalUserIds:[],page:"/INDEX/bill/list/index",title:"分享给您物业账单",imgUrl:"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01K5B5RY2TQQAJ1GT2RZSK426V.jpg"}):l.navigateToMiniProgram({path:"/pages/forward/index?source=OutstandingFeeList",envVersion:"develop",extraData:{source:"OutstandingFeeList"}})}};exports.method=i;
