import{W as U,X as I,U as j,V as M,k as O,D as P,C as J,F as T,w as q}from"./element-plus.bccb9376.js";import{M as G}from"./picker.24e47292.js";import{P as K}from"./index.8f1b3064.js";import{a as L}from"./supplier.7f753481.js";import{d as D,s as Q,r as F,b as W,Z as m,o as k,c as X,U as e,L as a,u as s,R as n,S as p,K as Z,Q as z,a as H}from"./@vue.18505fe0.js";const Y={class:"edit-popup"},$={style:{width:"100%",display:"flex","justify-content":"flex-end"}},ee=D({name:"brandEdit"}),ne=D({...ee,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(te,{expose:v,emit:B}){const c=B,d=Q(),C=F("add"),g=W(()=>"\u4F9B\u5E94\u5546\u8BE6\u60C5"),l=m({id:"",pid:"",category_id:"",type_id:"",mer_name:"",settle_cycle:"",interest_rate:"",sys_labels:[],sys_labels_text:"",province_id:"510000",city_id:"",city_name:"",area_id:"",area_name:"",street_id:"",street_name:"",village_id:"",village_name:"",mer_address:"",mer_avatar:"",apply_id:"",mark:"",status:"",commission_rate:"",commission_switch:"",long:"",lat:"",service_phone:"",mer_money:"",financial_bank:"",financial_wechat:"",financial_alipay:"",financial_type:"",supplier:{}});m({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0",trigger:["blur"]}]});const _=F({}),V=async o=>{var u;for(const t in l)o[t]!=null&&o[t]!=null&&(l[t]=o[t]);if(l.supplier){for(const t in l.supplier)o[t]!=null&&o[t]!=null&&(l[t]=o[t]);_.value=JSON.parse(((u=o.supplier)==null?void 0:u.data_json)||"{}")}},i=m({status:1,mark:""}),x=()=>{if(i.status==0&&i.mark=="")return O.error("\u8BF7\u8F93\u5165\u62D2\u7EDD\u539F\u56E0");L({id:l.pid,status:i.status,apply_id:l.apply_id,service_phone:l.supplier.service_phone,mark:i.mark}).then(o=>{var u;(u=d.value)==null||u.close(),c("success")})},h=(o="add")=>{var u;C.value=o,(u=d.value)==null||u.open()},f=()=>{c("close")};return v({open:h,setFormData:V}),(o,u)=>{const t=U,w=G,A=I,y=j,N=M,E=P,R=J,S=T,b=q;return k(),X("div",Y,[e(K,{ref_key:"popupRef",ref:d,async:!0,width:"60vw",onClose:f,"bottom-btn":!1},{default:a(()=>[e(A,{class:"margin-top",title:s(g),column:3,border:""},{default:a(()=>[e(t,{label:"\u4F9B\u5E94\u5546\u540D\u79F0"},{default:a(()=>[n(p(s(l).supplier.mer_name),1)]),_:1}),e(t,{label:"\u4F9B\u5E94\u5546\u7535\u8BDD"},{default:a(()=>[n(p(s(l).supplier.service_phone),1)]),_:1}),e(t,{label:"\u4F9B\u5E94\u5546\u5730\u5740"},{default:a(()=>{var r;return[n(p((r=s(l).supplier)==null?void 0:r.mer_address),1)]}),_:1}),e(t,{label:"\u516C\u53F8\u540D\u79F0",span:2},{default:a(()=>[n(p(s(_).company_name),1)]),_:1}),e(t,{label:"\u8425\u4E1A\u6267\u7167"},{default:a(()=>[e(w,{modelValue:s(_).images,"onUpdate:modelValue":u[0]||(u[0]=r=>s(_).images=r),disabled:""},null,8,["modelValue"])]),_:1}),e(t,{label:"\u516C\u53F8\u5730\u5740",span:2},{default:a(()=>[n(p(s(_).company_address),1)]),_:1}),e(t,{label:"\u793E\u4F1A\u4EE3\u7801"},{default:a(()=>[n(p(s(_).social_credit_code),1)]),_:1}),e(t,{label:"\u66F4\u65B0\u65F6\u95F4"},{default:a(()=>[n(p(s(l).supplier.update_time),1)]),_:1})]),_:1},8,["title"]),e(S,{model:s(i),style:{"margin-top":"16px"}},{default:a(()=>[e(E,{label:"\u5BA1\u6838\u72B6\u6001",prop:"status"},{default:a(()=>[e(N,{modelValue:s(i).status,"onUpdate:modelValue":u[1]||(u[1]=r=>s(i).status=r),class:"ml-4"},{default:a(()=>[e(y,{label:1},{default:a(()=>[n("\u901A\u8FC7")]),_:1}),e(y,{label:0},{default:a(()=>[n("\u62D2\u7EDD")]),_:1})]),_:1},8,["modelValue"])]),_:1}),s(i).status==0?(k(),Z(E,{key:0,label:"\u5BA1\u6838\u5907\u6CE8",prop:"mark"},{default:a(()=>[e(R,{modelValue:s(i).mark,"onUpdate:modelValue":u[2]||(u[2]=r=>s(i).mark=r),type:"textarea"},null,8,["modelValue"])]),_:1})):z("",!0)]),_:1},8,["model"]),H("div",$,[e(b,{onClick:f},{default:a(()=>[n("\u53D6\u6D88")]),_:1}),e(b,{onClick:x,type:"primary"},{default:a(()=>[n("\u786E\u8BA4")]),_:1})])]),_:1},512)])}}});export{ne as _};
