"use strict";const e=require("../../common/vendor.js"),l=require("./model.js"),a=require("../../common/libraries/apiLoading.js"),o=require("../../gen/Apis.js"),d=()=>{var e,d;a.getApiLoading(o.Apis.WorkOrder.HouseWorkOrders.List,null==(d=null==(e=l.useModel)?void 0:e.formData)?void 0:d.value).then((e=>{var a,o;l.useModel.dataList.value=[...null==(o=null==(a=l.useModel)?void 0:a.dataList)?void 0:o.value,...null==e?void 0:e.data],l.useModel.meta.value=null==e?void 0:e.meta}))},n=()=>{l.useModel.formData.value.page=1,l.useModel.dataList.value=[],d()},i={getList:d,handleToDetail(l){e.index.navigateTo({url:`/WORKORDER/show/index?id=${null==l?void 0:l.id}`})},handleAdd(){e.index.navigateTo({url:"/WORKORDER/add/index"})},handleChangeTabs(e,a){l.useModel.currentTabs.value=e,l.useModel.formData.value.type=null==a?void 0:a.value,n()},handlepopupClose(d){var i,u,s;a.getApiLoading(o.Apis.WorkOrder.HouseWorkOrders.Evaluation,{id:null==(s=null==(u=null==(i=l.useModel)?void 0:i.evaluateParams)?void 0:u.value)?void 0:s.id,evaluation_score:null==d?void 0:d.rating}).then((()=>{l.useModel.showEvaluate.value=!1,e.index.showToast({title:"评价已提交",icon:"none"}),n()})),console.log(d,"eee")},handleAssignEmployee(a){var o,d;return"PendingAcceptance"===(null==a?void 0:a.status)?(e.index.navigateTo({url:`/WORKORDER/acceptance/index?id=${null==a?void 0:a.id}`}),!1):"PendingPayment"===(null==a?void 0:a.status)?(e.index.navigateTo({url:`/WORKORDER/pay/index?id=${null==a?void 0:a.id}`}),!1):"Completed"===(null==a?void 0:a.status)?(l.useModel.evaluateParams.value=a,l.useModel.showEvaluate.value=!0,!1):("Processing"===(null==a?void 0:a.status)&&((null==(o=null==a?void 0:a.assign_employee)?void 0:o.phone)?e.index.makePhoneCall({phoneNumber:null==(d=null==a?void 0:a.assign_employee)?void 0:d.phone}):e.index.showToast({title:"暂无电话号码",icon:"none"})),void console.log(a,"eee"))},handleChangeStatus(e){l.useModel.formData.value.status=null==e?void 0:e.value,n()},handleLoad(e){l.useModel.formData.value.page=e,d()}};exports.method=i;
