import{r as e,e as s,a9 as t,h as i,w as a,z as o,o as n,i as _,a as d,x as r,a0 as u}from"./index-B3cqKsI_.js";import{o as l}from"./index.B8Oks8V3.js";import{d as p}from"./index.CL60Q41z.js";import{l as m,g as c,h as f,i as j}from"./customer.Crnb53sL.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-easyinput.CqN2D7tl.js";import"./uni-icons.EqO7jntL.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.BnHLrfH7.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-data-checkbox.DLupg48p.js";import"./uni-cloud.es.C4k_QYTB.js";import"./uni-load-more.BsVPJN03.js";import"./uni-data-picker.Bclt-QBV.js";/* empty css                                                                        */import"./selectedLabel.YO1dCWGg.js";import"./uni-popup.CmxZKYwY.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.CCBXdA0U.js";import"./editor.C2c4obl7.js";import"./index.CRonDE9r.js";import"./file.D3W-3X-4.js";import"./uni-nav-bar.xE5Um1Eb.js";/* empty css                                                                    *//* empty css                                                              */const g=v({__name:"addLiaison",setup(v){const g=e(null),x=e([]);e(!1);const y=s({defaultTitle:"添加联系人",treeData:[],rangeTypeText:"",type:"",eid:"",liaisonId:0});t((e=>{y.eid=e.eid,e.id?(y.defaultTitle="编辑联系人",y.liaisonId=Number(e.id),h(y.liaisonId)):b()}));const b=()=>{m().then((e=>{x.value=e.data}))},h=e=>{c(e).then((e=>{x.value=e.data}))},k=()=>{g.value.submit()},I=e=>{if(e.eid=y.eid,y.liaisonId){let s=y.liaisonId;D(s,e)}else T(e)},T=e=>{f(e).then((e=>{200==e.status&&(r.success(e.message),u(`/pages/customer/list/liaison?eid=${y.eid}`))})).catch((e=>{r.error(e.message)}))},D=(e,s)=>{j(e,s).then((e=>{200==e.status&&(r.success(e.message),u(`/pages/customer/list/liaison?eid=${y.eid}`))})).catch((e=>{r.error(e.message)}))};return(e,s)=>{const t=o;return n(),i(t,{class:"content"},{default:a((()=>[_(t,{class:"cr-position-header"},{default:a((()=>[_(t,{class:"status_bar"}),_(d(p),{"is-right":!0,"default-title":y.defaultTitle,"right-text":"提交",onHandleClickRight:k},null,8,["default-title"])])),_:1}),_(t,{class:"examine-content m10"},{default:a((()=>[_(d(l),{ref_key:"oaFormRef",ref:g,listData:x.value,onSubmitOk:I},null,8,["listData"])])),_:1})])),_:1})}}},[["__scopeId","data-v-10d9dfe3"]]);export{g as default};
