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-Dnh6GPlT.js";import{o as l}from"./index.Cm0chJO5.js";import{d as p}from"./index.C9RyZqIW.js";import{l as m,g as c,h as f,i as j}from"./customer.C_xRWtM3.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-easyinput.B9QjCcys.js";import"./uni-icons.C_vWVLAq.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.DIiVZ_NN.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-data-checkbox.4zUb6sl7.js";import"./uni-cloud.es.DSosgDdw.js";import"./uni-load-more.B5n23r4C.js";import"./uni-data-picker.BjFZBbcj.js";/* empty css                                                                        */import"./selectedLabel.AvbBth4Y.js";import"./uni-popup.LDlA9brl.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.B5-y41yX.js";import"./editor.DzkysLA3.js";import"./index.kVcrBEbP.js";import"./file.Clzwct6P.js";import"./uni-nav-bar.Bf2crVgQ.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),b(y.liaisonId)):h()}));const h=()=>{m().then((e=>{x.value=e.data}))},b=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};
