import{a9 as S,$,aa as T,a3 as N,C as j,D as q,F as W}from"./element-plus.ae09c4a0.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang.70acbe43.js";import{a as J}from"./useDictOptions.b75da5b0.js";import{P as K}from"./index.e64ff1d1.js";import{a as L,f as V}from"./property_order.a6a29d0b.js";import{d as D,s as A,r as M,a0 as f,b as Q,o as X,c as Y,W as l,O as s,u as t,T as n,U as p}from"./@vue.a7a54728.js";import"./lodash.fc1b942f.js";import{_ as Z}from"./good_list.vue_vue_type_script_setup_true_lang.31ce8e71.js";const ee={class:"order-popup"},oe=D({name:"propertyOrderOrder"}),me=D({...oe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close","successGoodId"],setup(te,{expose:h,emit:w}){const F=w,y=A(),i=A(),c=M("order"),{dictData:C}=J("show_status,event_status,pay_type"),_=f({show:!1}),v=async()=>{_.show=!0},b=u=>{console.log("getGoodId",u),e.goods_id=u==null?void 0:u.good_id,e.goods_name=u==null?void 0:u.good_name},U=Q(()=>(c.value=="order","\u7269\u4E1A\u4E0B\u5355")),e=f({id:"",propertyHead:{id:"",property_name:"",village_name:"",head_name:"",address:""},propertyUser:{id:"",householder_name:"",householder_mobile:"",address:""},address:"",appointment_time:"",pay_way:"2",goods_id:"",goods_name:"",contact_number:"",contact_people:""}),g=f({property_head_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u4E1A\u8D1F\u8D23\u4EBAID",trigger:["blur"]}]}),E=async u=>{for(const o in e)u[o]!=null&&u[o]!=null&&(e[o]=u[o]);console.log(e),e.address=e.address?e.address:e.propertyHead.address+e.propertyUser.address,e.contact_number=e.contact_number?e.contact_number:e.propertyUser.householder_mobile,e.contact_people=e.contact_people?e.contact_people:e.propertyUser.householder_name},I=async u=>{const o=await L({id:u.id});E(o)},k=async()=>{var o,r;await((o=y.value)==null?void 0:o.validate());const u={...e};c.value=="order"?await V(u):await V(u),(r=i.value)==null||r.close(),F("success")},x=(u="order")=>{var o;c.value=u,(o=i.value)==null||o.open()},O=()=>{F("close")};return h({open:x,setFormData:E,getDetail:I,getGoodId:b}),(u,o)=>{const r=j,d=S,B=$,R=T,H=N,m=q,G=z,P=W;return X(),Y("div",ee,[l(K,{ref_key:"popupRef",ref:i,title:t(U),async:!0,width:"550px",onConfirm:k,onClose:O},{default:s(()=>[l(P,{ref_key:"formRef",ref:y,model:t(e),"label-width":"90px",rules:t(g)},{default:s(()=>[l(r,{modelValue:t(e).id,"onUpdate:modelValue":o[0]||(o[0]=a=>t(e).id=a),clearable:"",placeholder:"ID",type:"hidden",disabled:!!t(e).id},null,8,["modelValue","disabled"]),l(R,null,{default:s(()=>[l(d,{label:"\u7269\u4E1A\u540D\u79F0\uFF1A"},{default:s(()=>[n(p(t(e).propertyHead.property_name),1)]),_:1}),l(d,{label:"\u5C0F\u533A\u540D\u79F0\uFF1A"},{default:s(()=>[n(p(t(e).propertyHead.village_name),1)]),_:1}),l(d,{label:"\u7269\u4E1A\u8D1F\u8D23\u4EBA\uFF1A"},{default:s(()=>[n(p(t(e).propertyHead.head_name),1)]),_:1}),l(B,null,{default:s(()=>[l(d,{label:"\u5C0F\u533A\u5730\u5740\uFF1A"},{default:s(()=>[n(p(t(e).propertyHead.address),1)]),_:1})]),_:1}),l(d,{label:"\u6237\u4E3B\u540D\u79F0\uFF1A"},{default:s(()=>[n(p(t(e).propertyUser.householder_name),1)]),_:1}),l(B,null,{default:s(()=>[l(d,{label:"\u6237\u4E3B\u5730\u5740\uFF1A"},{default:s(()=>[n(p(t(e).propertyUser.address),1)]),_:1})]),_:1})]),_:1}),l(H),l(m,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"address"},{default:s(()=>[l(r,{modelValue:t(e).address,"onUpdate:modelValue":o[1]||(o[1]=a=>t(e).address=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1}),l(m,{label:"\u9884\u7EA6\u65F6\u95F4",prop:"appointment_time"},{default:s(()=>[l(G,{modelValue:t(e).appointment_time,"onUpdate:modelValue":o[2]||(o[2]=a=>t(e).appointment_time=a),type:"datetime",placeholder:"\u9009\u62E9\u65E5\u671F\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),l(m,{label:"\u5546\u54C1",prop:"goods_id"},{default:s(()=>[l(r,{modelValue:t(e).goods_name,"onUpdate:modelValue":o[3]||(o[3]=a=>t(e).goods_name=a),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1",onClick:o[4]||(o[4]=a=>v())},null,8,["modelValue"]),l(r,{type:"hidden",modelValue:t(e).goods_id,"onUpdate:modelValue":o[5]||(o[5]=a=>t(e).goods_id=a)},null,8,["modelValue"])]),_:1}),l(m,{label:"\u8054\u7CFB\u4EBA",prop:"contact_people"},{default:s(()=>[l(r,{modelValue:t(e).contact_people,"onUpdate:modelValue":o[6]||(o[6]=a=>t(e).contact_people=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"},null,8,["modelValue"])]),_:1}),l(m,{label:"\u8054\u7CFB\u4EBA\u624B\u673A\u53F7",prop:"contact_number"},{default:s(()=>[l(r,{modelValue:t(e).contact_number,"onUpdate:modelValue":o[7]||(o[7]=a=>t(e).contact_number=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"]),l(Z,{show:t(_).show,"onUpdate:show":o[8]||(o[8]=a=>t(_).show=a),"dict-data":t(C),onSuccessGoodId:b},null,8,["show","dict-data"])])}}});export{me as _};
