"use strict";const e=require("../../common/vendor.js"),o=require("../../common/libraries/apiLoading.js"),l=require("../../common/libraries/day.js"),d=require("../../gen/Apis.js"),i=require("./model.js"),n=e=>{o.getApiLoading(d.Apis.WorkOrder.HouseWorkOrders.Show,{id:e}).then(e=>{i.useModel.dataShow.value=null==e?void 0:e.data})},a=e=>{o.getApiLoading(d.Apis.WorkOrder.HouseWorkLogs.List,{house_work_orders_id:e}).then(e=>{i.useModel.logsData.value=null==e?void 0:e.data})},u={getShow:n,getHouseWorkLogs:a,toPageAddLogs(){var o,l,d,n,a,u;"PendingAcceptance"===(null==(d=null==(l=null==(o=i.useModel)?void 0:o.dataShow)?void 0:l.value)?void 0:d.status)&&e.index.navigateTo({url:`/WORKORDER/acceptance/index?id=${null==(u=null==(a=null==(n=i.useModel)?void 0:n.dataShow)?void 0:a.value)?void 0:u.id}`})},handleClosed(){var u,s,t,r,v,c;if((null==(t=null==(s=null==(u=i.useModel)?void 0:u.dataShow)?void 0:s.value)?void 0:t.expect_start_time)&&l.specificTime(null==(c=null==(v=null==(r=i.useModel)?void 0:r.dataShow)?void 0:v.value)?void 0:c.expect_start_time))return e.index.showModal({title:"提示",content:"距离工单开始时间小于2小时，无法关闭工单！若需取消，请联系处理人员操作。",cancelText:"点错了",success:function(e){e.confirm?console.log("用户点击确定"):e.cancel&&console.log("用户点击取消")}}),!1;e.index.showModal({title:"提示",content:"关闭工单后无法继续操作，如需继续需要重新提交，您是否确认关闭",cancelText:"点错了",success:function(e){var l,u,s;e.confirm?(o.getApiLoading(d.Apis.WorkOrder.HouseWorkOrders.Close,{id:null==(s=null==(u=null==(l=i.useModel)?void 0:l.dataShow)?void 0:u.value)?void 0:s.id}).then(e=>{var o,l,d,u,s,t;n(null==(d=null==(l=null==(o=i.useModel)?void 0:o.dataShow)?void 0:l.value)?void 0:d.id),a(null==(t=null==(s=null==(u=i.useModel)?void 0:u.dataShow)?void 0:s.value)?void 0:t.id)}),console.log("用户点击确定")):e.cancel&&console.log("用户点击取消")}})},handlePendingPaymentQrCode(e){},handleCopyPhone(o){o&&e.index.makePhoneCall({phoneNumber:o})}};exports.method=u;
