"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("../../common/libraries/apiLoading.js"),s=require("../../common/libraries/naviHelper.js"),l=require("../../gen/Apis.js"),u=require("./model.js");e.useWeAppAuthStore();const a={init(e){u.useModel.HouseWorkOrdersStatusItemEnum.value={Processing:{text:"仍在处理",value:"Processing"},Completed:{text:"我已完工",value:"Completed"}},u.useModel.HouseWorkOrdersCostEnum.value={Processing2:{text:"是",value:"1"},Processing1:{text:"否",value:"0"}},u.useModel.formData.value={...e,house_work_orders_id:null==e?void 0:e.id}},handleSubmit(){var e,a,t,r,i,d,n,m,v,c,p,f,M,h,D,g;return console.log("handleSubmit",u.useModel.formData.value),u.useModel.formData.value.status?u.useModel.formData.value.description?"Completed"!==u.useModel.formData.value.status||(null==(e=u.useModel.formData.value.attachments)?void 0:e.length)?"Completed"!==(null==(r=null==(t=null==(a=u.useModel)?void 0:a.formData)?void 0:t.value)?void 0:r.status)||"MyHome"!==(null==(n=null==(d=null==(i=u.useModel)?void 0:i.formData)?void 0:d.value)?void 0:n.location)||(null==(c=null==(v=null==(m=u.useModel)?void 0:m.formData)?void 0:v.value)?void 0:c.is_fee)?"1"!==u.useModel.formData.value.is_fee||(null==(M=null==(f=null==(p=u.useModel)?void 0:p.formData)?void 0:f.value)?void 0:M.amount)?"1"!==u.useModel.formData.value.is_fee||(null==(g=null==(D=null==(h=u.useModel)?void 0:h.formData)?void 0:D.value)?void 0:g.company_project_receipt_accounts_id)?void o.getApiLoading(l.Apis.WorkOrder.HouseWorkLogs.Store,{...u.useModel.formData.value}).then(e=>{s.showToastBack("提交成功！",1,!0),console.log(e)}):s.showToast("请选择收款账号！"):s.showToast("请输入费用金额！"):s.showToast("请上选择是否产生费用！"):s.showToast("请上传完工图片！"):s.showToast("请输入备注说明/进度说明！"):s.showToast("请先选择状态！")}};exports.method=a;
