import{I as z}from"./Imgs-fee891de-1779868775780v=1.0.0.js";import{b as h}from"./addOrganize-08c738d9-1779868775780v=1.0.0.js";import{C as W}from"./Cascader-42286393-1779868775780v=1.0.0.js";import{c as j}from"./common-e1875f9b-1779868775780v=1.0.0.js";import{c as J,f as M}from"./index-0f3e2c06-1779868775780v=1.0.0.js";import{u as R}from"./useFormEdit-42a9503c-1779868775780v=1.0.0.js";import{f as T}from"./index-f89521bb-1779868775780v=1.0.0.js";import{l as q,a as f,e as b,d as $,ah as i,m as _,M as y,O as s,q as g,U as o,u as l,p as G,F as H,a7 as K,S as p}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as P}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import"./upload-a2386bf9-1779868775780v=1.0.0.js";import"./eleValidate-dfbd5aa5-1779868775780v=1.0.0.js";import"./tabs-e9b8af2b-1779868775780v=1.0.0.js";const Q={class:"form\u2014container"},X={class:"el-dialog__footer"},Y={class:"dialog-footer"},Z=q({__name:"organizeForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(V,{emit:A}){J();const F=f();let E=V;const{BaseCompanyAreaId:I}=R(),m=A,a=b({get(){return D(E.value)},set(u){m("update:value",u)}}),L=b({get(){return E.loading},set(u){m("update:loading",u)}}),U=async u=>{u.validate(async(e,n)=>{if(e){let r=N();m("submit",r)}})},x=()=>{m("cancel")},S=f(T("level")),v=f([]),k=async()=>{let u=await j();v.value=u.data};$(()=>{k()});const D=u=>{let e=u,n=[];return e.img&&(n=e.img.split(",").map((r,c)=>({name:String(c),url:r}))),e.imagesList=n,e.cities=[],e.areaId&&(e.cities=M(String(e.areaId),I.value)),e},N=()=>{let u=JSON.parse(JSON.stringify(a.value)),e=u.imagesList.map(n=>n.url);return u.img=e.join(","),u.img&&delete u.imagesList,u.areaId=u.cities[u.cities.length-1],u.cities&&delete u.cities,u};return(u,e)=>{const n=i("el-form-item"),r=i("el-option"),c=i("el-select"),d=i("el-input"),C=i("el-radio"),O=i("el-radio-group"),B=i("el-button"),w=i("el-form");return _(),y(w,{model:l(a),rules:l(h),ref_key:"ruleFormRef",ref:F,"label-position":"right","scroll-to-error":!0,"label-width":"140px"},{default:s(()=>[g("div",Q,[o(n,{label:"\u5F52\u5C5E\u533A\u57DF",prop:"cities"},{default:s(()=>[o(W,{placeholder:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u533A\u57DF",options:l(v),multiple:!1,checkStrictly:!0,value:l(a).cities,"onUpdate:value":e[0]||(e[0]=t=>l(a).cities=t)},null,8,["options","value"])]),_:1}),o(n,{label:"\u7EA7\u522B",prop:"levelId"},{default:s(()=>[o(c,{modelValue:l(a).levelId,"onUpdate:modelValue":e[1]||(e[1]=t=>l(a).levelId=t),placeholder:"\u8BF7\u9009\u62E9\u7EA7\u522B",disabled:l(a).organUnitId},{default:s(()=>[(_(!0),G(H,null,K(l(S),t=>(_(),y(r,{key:t.value,label:t.label,value:+t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),o(n,{label:"\u673A\u6784\u540D\u79F0",prop:"name"},{default:s(()=>[o(d,{modelValue:l(a).name,"onUpdate:modelValue":e[2]||(e[2]=t=>l(a).name=t),placeholder:"\u8BF7\u8F93\u5165\u673A\u6784\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(n,{label:"\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801",prop:"socialCreditCode"},{default:s(()=>[o(d,{modelValue:l(a).socialCreditCode,"onUpdate:modelValue":e[3]||(e[3]=t=>l(a).socialCreditCode=t),placeholder:"\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801"},null,8,["modelValue"])]),_:1}),o(n,{label:"\u8054\u7CFB\u4EBA",prop:"contactName"},{default:s(()=>[o(d,{modelValue:l(a).contactName,"onUpdate:modelValue":e[4]||(e[4]=t=>l(a).contactName=t),placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"},null,8,["modelValue"])]),_:1}),o(n,{label:"\u624B\u673A\u53F7",prop:"contactWay"},{default:s(()=>[o(d,{modelValue:l(a).contactWay,"onUpdate:modelValue":e[5]||(e[5]=t=>l(a).contactWay=t),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1}),o(n,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"address"},{default:s(()=>[o(d,{modelValue:l(a).address,"onUpdate:modelValue":e[6]||(e[6]=t=>l(a).address=t),placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1}),o(n,{label:"\u56FE\u6807",prop:"imagesList"},{default:s(()=>[o(z,{fileList:l(a).imagesList,"onUpdate:fileList":e[7]||(e[7]=t=>l(a).imagesList=t),width:"100px",height:"100px",fileSize:5,limit:1,showTip:""},null,8,["fileList"])]),_:1}),o(n,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[o(O,{modelValue:l(a).status,"onUpdate:modelValue":e[8]||(e[8]=t=>l(a).status=t)},{default:s(()=>[o(C,{value:1},{default:s(()=>[p("\u6709\u6548")]),_:1}),o(C,{value:0},{default:s(()=>[p("\u65E0\u6548")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),g("div",X,[g("span",Y,[o(B,{onClick:x},{default:s(()=>[p("\u53D6\u6D88")]),_:1}),o(B,{type:"primary",loading:l(L),onClick:e[9]||(e[9]=t=>U(l(F)))},{default:s(()=>[p(" \u786E\u8BA4 ")]),_:1},8,["loading"])])])]),_:1},8,["model","rules"])}}});const ce=P(Z,[["__scopeId","data-v-bcc2f08a"]]);export{ce as default};
