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-WeUkftbp.js";import{o as l}from"./index.DxpQg1bl.js";import{d as p}from"./index.BcUDVLb2.js";import{l as m,g as c,h as f,i as j}from"./customer.C_v9K5hM.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-easyinput.D5FSIQIk.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.CCONsUgM.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-data-checkbox.Cd21VmhG.js";import"./uni-cloud.es.Kz_3KA6a.js";import"./uni-load-more.Co1GbmQg.js";import"./uni-data-picker.CVLtfzyO.js";/* empty css                                                                        */import"./selectedLabel.DD5ROojE.js";import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";import"./editor.-kp7yMij.js";import"./index.D0t8aH0F.js";import"./file.BMc01nZQ.js";import"./uni-nav-bar.cBITQXNK.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};
