"use strict";require("../../common/libraries/request.js"),require("../../common/store/useWatermarkStore.js");const e=require("../../common/store/useWeAppAuthStore.js");require("../../common/store/useWorkStore.js");const o=require("./model.js"),l=require("../../gen/Apis.js"),u=require("../../common/libraries/apiLoading.js"),s=require("../../common/libraries/naviHelper.js");e.useWeAppAuthStore();const r={init(e){o.useModel.HouseWorkOrdersStatusItemEnum.value={Processing0:{text:"不合格",value:"0"},Processing1:{text:"合格",value:"1"}},o.useModel.formData.value={...e,house_work_orders_id:null==e?void 0:e.id}},handleSubmit(){var e,r,t,a,i,n,d,v,m,c,p,f,h,g,M,D,q,j,A,S;if(console.log("handleSubmit",o.useModel.formData.value),"RenovationInspection"===(null==(t=null==(r=null==(e=o.useModel)?void 0:e.formData)?void 0:r.value)?void 0:t.type)&&!(null==(d=null==(n=null==(i=null==(a=o.useModel)?void 0:a.formData)?void 0:i.value)?void 0:n.attachments)?void 0:d.length))return s.showToast("请上传巡检图片！");if("RenovationAcceptance"===(null==(c=null==(m=null==(v=o.useModel)?void 0:v.formData)?void 0:m.value)?void 0:c.type)){if(!(null==(h=null==(f=null==(p=o.useModel)?void 0:p.formData)?void 0:f.value)?void 0:h.is_passed))return s.showToast("请选择验收结果！");if(!(null==(D=null==(M=null==(g=o.useModel)?void 0:g.formData)?void 0:M.value)?void 0:D.description))return s.showToast("请输入验收说明！");if(!(null==(S=null==(A=null==(j=null==(q=o.useModel)?void 0:q.formData)?void 0:j.value)?void 0:A.attachments)?void 0:S.length))return s.showToast("请上传验收图片！")}console.log("useModel.formData.value",o.useModel.formData.value),u.getApiLoading(l.Apis.WorkOrder.HouseWorkLogs.Store,{...o.useModel.formData.value,status:"Completed"}).then(e=>{s.showToastBack("提交成功！",1,!0),console.log(e)})}};exports.method=r;
