"use strict";const e=require("../../common/vendor.js"),l=require("./model.js"),o=require("../../common/libraries/apiLoading.js"),d=require("../../gen/Apis.js"),n=require("../../common/libraries/day.js"),i=e=>{o.getApiLoading(d.Apis.WorkOrder.HouseWorkOrders.Show,{id:e}).then((e=>{l.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=>{l.useModel.logsData.value=null==e?void 0:e.data}))},u={getShow:i,handleEvaluate(){l.useModel.showEvaluate.value=!0},handleClosed(){var u,t,s;if(n.specificTime(null==(s=null==(t=null==(u=l.useModel)?void 0:u.dataShow)?void 0:t.value)?void 0:s.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 n,u,t;e.confirm?(o.getApiLoading(d.Apis.WorkOrder.HouseWorkOrders.Close,{id:null==(t=null==(u=null==(n=l.useModel)?void 0:n.dataShow)?void 0:u.value)?void 0:t.id}).then((e=>{var o,d,n,u,t,s;i(null==(n=null==(d=null==(o=l.useModel)?void 0:o.dataShow)?void 0:d.value)?void 0:n.id),a(null==(s=null==(t=null==(u=l.useModel)?void 0:u.dataShow)?void 0:t.value)?void 0:s.id)})),console.log("用户点击确定")):e.cancel&&console.log("用户点击取消")}})},handlepopupClose(){l.useModel.showEvaluate.value=!1,e.index.showToast({title:"评价已提交",icon:"none"})},getHouseWorkLogs:a,handleAcceptance(){var o,d,n,i,a,u,t,s,v,r,c,h,w,p,g;return"PendingAcceptance"===(null==(n=null==(d=null==(o=l.useModel)?void 0:o.dataShow)?void 0:d.value)?void 0:n.status)?(e.index.navigateTo({url:`/WORKORDER/acceptance/index?id=${null==(u=null==(a=null==(i=l.useModel)?void 0:i.dataShow)?void 0:a.value)?void 0:u.id}`}),!1):"PendingPayment"===(null==(v=null==(s=null==(t=l.useModel)?void 0:t.dataShow)?void 0:s.value)?void 0:v.status)?(e.index.navigateTo({url:`/WORKORDER/pay/index?id=${null==(h=null==(c=null==(r=l.useModel)?void 0:r.dataShow)?void 0:c.value)?void 0:h.id}`}),!1):"Completed"===(null==(g=null==(p=null==(w=l.useModel)?void 0:w.dataShow)?void 0:p.value)?void 0:g.status)?(l.useModel.showEvaluate.value=!0,!1):void 0},handlePhoneCall(){var o,d,n,i,a,u,t,s;(null==(i=null==(n=null==(d=null==(o=l.useModel)?void 0:o.dataShow)?void 0:d.value)?void 0:n.assign_employee)?void 0:i.phone)?e.index.makePhoneCall({phoneNumber:null==(s=null==(t=null==(u=null==(a=l.useModel)?void 0:a.dataShow)?void 0:u.value)?void 0:t.assign_employee)?void 0:s.phone}):e.index.showToast({title:"暂无电话号码",icon:"none"})},hadnleUpdateTime(){var o,d,i,a,u,t,s,v,r;if(n.specificTime(null==(i=null==(d=null==(o=l.useModel)?void 0:o.dataShow)?void 0:d.value)?void 0:i.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.navigateTo({url:`/WORKORDER/update_work_time/index?id=${null==(t=null==(u=null==(a=l.useModel)?void 0:a.dataShow)?void 0:u.value)?void 0:t.id}&day=${null==(r=null==(v=null==(s=l.useModel)?void 0:s.dataShow)?void 0:v.value)?void 0:r.expect_start_time}`})},handleRework(){var o,d,n;e.index.navigateTo({url:`/WORKORDER/update_work_rework/index?id=${null==(n=null==(d=null==(o=l.useModel)?void 0:o.dataShow)?void 0:d.value)?void 0:n.id}`})}};exports.method=u;
