"use strict";require("../../common/libraries/request.js"),require("../../common/store/useWatermarkStore.js");const o=require("../../common/store/useWeAppAuthStore.js"),e=require("../../common/store/useWorkStore.js"),l=require("../../common/libraries/apiLoading.js"),u=require("../../common/libraries/naviHelper.js"),a=require("../../gen/Apis.js"),s=require("./model.js");o.useWeAppAuthStore();const r=e.useWorkStore(),i={init(){var o,e,l,u,a,i,t,d,n,v,m,c;console.log("init",null==r?void 0:r.selectWorkProject),s.useModel.formData.value={...null==(e=null==(o=s.useModel)?void 0:o.formData)?void 0:e.value},(null==(l=null==r?void 0:r.selectWorkHouse)?void 0:l.value)&&(s.useModel.formData.value={...null==(a=null==(u=s.useModel)?void 0:u.formData)?void 0:a.value,asset_houses_id:null==(i=null==r?void 0:r.selectWorkHouse)?void 0:i.value,full_name:null==(t=null==r?void 0:r.selectWorkHouse)?void 0:t.label}),(null==(d=null==r?void 0:r.selectWorkProject)?void 0:d.id)&&(s.useModel.formData.value={...null==(v=null==(n=s.useModel)?void 0:n.formData)?void 0:v.value,project_name:null==(m=null==r?void 0:r.selectWorkProject)?void 0:m.name,asset_projects_id:null==(c=null==r?void 0:r.selectWorkProject)?void 0:c.id})},handleSubmit(){var o,e,r,i,t,d,n,v,m,c,M,f,h,D,p,j,W,_,k,g;return console.log("handleSubmit",s.useModel.formData.value),(null==(r=null==(e=null==(o=s.useModel)?void 0:o.formData)?void 0:e.value)?void 0:r.type)?"MyHome"===(null==(d=null==(t=null==(i=s.useModel)?void 0:i.formData)?void 0:t.value)?void 0:d.location)||s.useModel.formData.value.asset_projects_id?"MyHome"!==(null==(m=null==(v=null==(n=s.useModel)?void 0:n.formData)?void 0:v.value)?void 0:m.location)||s.useModel.formData.value.asset_houses_id?"MyHome"!==(null==(f=null==(M=null==(c=s.useModel)?void 0:c.formData)?void 0:M.value)?void 0:f.location)||(null==(D=null==(h=s.useModel)?void 0:h.formData.value)?void 0:D.reporter_phone)?(null==(W=null==(j=null==(p=s.useModel)?void 0:p.formData)?void 0:j.value)?void 0:W.content)?"MyHome"!==(null==(g=null==(k=null==(_=s.useModel)?void 0:_.formData)?void 0:k.value)?void 0:g.location)||s.useModel.formData.value.expect_start_time?void l.getApiLoading(a.Apis.WorkOrder.HouseWorkOrders.Store,s.useModel.formData.value).then((o=>{u.showToastBack("提交成功！",1,!0),console.log(o)})):u.showToast("请选择上门时间！"):u.showToast("请输入问题描述！"):u.showToast("请输入联系人电话！"):u.showToast("请选择房屋！"):u.showToast("请选择项目！"):u.showToast("请选择工单类型！")},handleSwitchChange(o){var e;s.useModel.formData.value.is_anonymous=null==(e=null==o?void 0:o.detail)?void 0:e.value,console.log(o,"e")}};exports.method=i;
