"use strict";const l=require("../../common/vendor.js"),o=require("../../common/libraries/apiLoading.js"),e=require("../../gen/Apis.js"),d=require("./model.js"),u={getShow(l){o.getApiLoading(e.Apis.WorkOrder.HouseWorkOrders.Show,{id:l}).then(l=>{d.useModel.dataShow.value=null==l?void 0:l.data})},getHouseWorkLogs(l){o.getApiLoading(e.Apis.WorkOrder.HouseWorkLogs.List,{house_work_orders_id:l}).then(l=>{d.useModel.logsData.value=null==l?void 0:l.data})},toPageAddLogs(){var o,e,u,n,i,a,v,t,s,r,h,p,w,c,S,g,M,m,_,R,x,O,P,k,y,W,$,A,L,j,D,T,q,C,E,I,K,b,f,H,N,Q,z;if("SecurityInspection"!==(null==(u=null==(e=null==(o=d.useModel)?void 0:o.dataShow)?void 0:e.value)?void 0:u.type))return"RenovationInspection"===(null==(s=null==(t=null==(v=d.useModel)?void 0:v.dataShow)?void 0:t.value)?void 0:s.type)||"RenovationAcceptance"===(null==(p=null==(h=null==(r=d.useModel)?void 0:r.dataShow)?void 0:h.value)?void 0:p.type)?(l.index.navigateTo({url:`/WORKORDER/patrol_update/index?id=${null==(S=null==(c=null==(w=d.useModel)?void 0:w.dataShow)?void 0:c.value)?void 0:S.id}&type=${null==(m=null==(M=null==(g=d.useModel)?void 0:g.dataShow)?void 0:M.value)?void 0:m.type}`}),!1):void("PendingPayment"!==(null==(x=null==(R=null==(_=d.useModel)?void 0:_.dataShow)?void 0:R.value)?void 0:x.status)?"Processing"===(null==(C=null==(q=null==(T=d.useModel)?void 0:T.dataShow)?void 0:q.value)?void 0:C.status)&&l.index.navigateTo({url:`/WORKORDER/update/index?id=${null==(K=null==(I=null==(E=d.useModel)?void 0:E.dataShow)?void 0:I.value)?void 0:K.id}&projects_id=${null==(H=null==(f=null==(b=d.useModel)?void 0:b.dataShow)?void 0:f.value)?void 0:H.asset_projects_id}&location=${null==(z=null==(Q=null==(N=d.useModel)?void 0:N.dataShow)?void 0:Q.value)?void 0:z.location}`}):l.index.navigateTo({url:`/WORKORDER/poster/index?id=${null==(k=null==(P=null==(O=d.useModel)?void 0:O.dataShow)?void 0:P.value)?void 0:k.id}&full_name=${null==(A=null==($=null==(W=null==(y=d.useModel)?void 0:y.dataShow)?void 0:W.value)?void 0:$.asset_house)?void 0:A.full_name}&amount=${null==(D=null==(j=null==(L=d.useModel)?void 0:L.dataShow)?void 0:j.value)?void 0:D.amount}`}));l.index.navigateTo({url:`/WORKORDER/show_patrol_task_locations/index?id=${null==(a=null==(i=null==(n=d.useModel)?void 0:n.dataShow)?void 0:i.value)?void 0:a.id}`})},handlePreviewImage(o){var e,u,n,i;let a=(null==(i=null==(n=null==(u=null==(e=d.useModel)?void 0:e.dataShow)?void 0:u.value)?void 0:n.attachments)?void 0:i.map(l=>null==l?void 0:l.url))||[];l.index.previewImage({urls:a,current:o})},handlePendingPaymentQrCode(l){},handleCopyPhone(){var o,e,u,n,i,a,v,t,s,r,h,p;(null==(u=null==(e=null==(o=d.useModel)?void 0:o.dataShow)?void 0:e.value)?void 0:u.contact_phone)?l.index.makePhoneCall({phoneNumber:null==(a=null==(i=null==(n=d.useModel)?void 0:n.dataShow)?void 0:i.value)?void 0:a.contact_phone}):(null==(s=null==(t=null==(v=d.useModel)?void 0:v.dataShow)?void 0:t.value)?void 0:s.reporter_phone)?l.index.makePhoneCall({phoneNumber:null==(p=null==(h=null==(r=d.useModel)?void 0:r.dataShow)?void 0:h.value)?void 0:p.reporter_phone}):l.index.showToast({title:"暂无电话号码",icon:"none"})}};exports.method=u;
