"use strict";const e=require("../../../common/vendor.js"),o=require("./model.js");require("../../../common/libraries/request.js"),require("../../../common/store/useWatermarkStore.js"),require("../../../common/store/useWeAppAuthStore.js");const l=require("../../../common/store/useWorkStore.js"),r=require("../../../common/libraries/apiLoading.js"),i=require("../../../gen/Apis.js"),t=require("../../../common/libraries/naviHelper.js"),n=l.useWorkStore(),s={getList:()=>{var e,l;r.getApiLoading(i.Apis.WorkOrder.HouseWorkOrders.List,null==(l=null==(e=o.useModel)?void 0:e.formData)?void 0:l.value).then(e=>{o.useModel.listData.value=[...o.useModel.listData.value,...null==e?void 0:e.data],o.useModel.metaData.value=null==e?void 0:e.meta})},init(){var e,l,r,i,t;console.log("init",null==n?void 0:n.selectWorkProject),(null==(e=null==n?void 0:n.selectWorkProject)?void 0:e.id)&&(o.useModel.formData.value={...null==(r=null==(l=o.useModel)?void 0:l.formData)?void 0:r.value,project_name:null==(i=null==n?void 0:n.selectWorkProject)?void 0:i.name,asset_projects_id:null==(t=null==n?void 0:n.selectWorkProject)?void 0:t.id})},handleSubmit(){var l,n,s,u,a,d,v,c,m,g;let p=null==(n=null==(l=o.useModel)?void 0:l.formData)?void 0:n.value;if("申请关闭"===(null==(a=null==(u=null==(s=o.useModel)?void 0:s.formData)?void 0:u.value)?void 0:a.type)){if(!(null==p?void 0:p.handled_result))return t.showToast("请输入处理结果！");e.index.showModal({title:"提示",content:"确定要申请关闭？",success:function(e){var l,n;e.confirm?(r.getApiLoading(i.Apis.Emergency.EmergencyEvents.ApplyClose,null==(n=null==(l=o.useModel)?void 0:l.formData)?void 0:n.value).then(e=>{t.showToastBack("提交成功！",1,!0),console.log(e)}),console.log("用户点击确定")):e.cancel&&console.log("用户点击取消")}})}if("更新进度"===(null==(c=null==(v=null==(d=o.useModel)?void 0:d.formData)?void 0:v.value)?void 0:c.type)){if(!(null==p?void 0:p.content))return t.showToast("请输入跟进内容！");r.getApiLoading(i.Apis.Emergency.EmergencyEventFollows.Store,null==(g=null==(m=o.useModel)?void 0:m.formData)?void 0:g.value).then(e=>{t.showToastBack("提交成功！",1,!0),console.log(e)})}}};exports.method=s;
