import{r as e,e as s,a9 as t,b as a,h as i,w as o,z as n,o as r,i as u,x as _,a0 as p,m as d}from"./index-WeUkftbp.js";import{o as l,s as m}from"./index.DxpQg1bl.js";import{d as c}from"./index.BcUDVLb2.js";import{j as f,k as j,m as y,n as v}from"./customer.C_v9K5hM.js";import{_ as g}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 x=g({__name:"addCustomer",setup(g){const x=e(null),h=e([]);s({color:"#303133",disableColor:"#ffffff"});const b=s({eid:"",types:0,is_show:!1,name:"",defaultTitle:"添加客户",isShowTitle:!1});t((e=>{e.types&&(b.types=e.types),e.eid?(b.defaultTitle="编辑客户",b.eid=e.eid,C()):k()}));const k=()=>{f().then((e=>{h.value=e.data}))},C=()=>{j(b.eid).then((e=>{h.value=e.data}))};a();const T=e(null),w=()=>{x.value.submit()},R=e=>{if(b.name=e.customer_name,e.types=b.types,b.eid){let s=b.eid;$(s,e)}else D(e)},$=(e,s)=>{y(e,s).then((s=>{_.success(s.message),p(`/pages/customer/list/details?id=${e}`)})).catch((e=>{_.error(e.message)}))},D=e=>{v(e).then((s=>{e.eid=s.data.id,_.success(s.message),T.value.popupOpen(s.data.id)})).catch((e=>{_.error(e.message)}))},L=(e,s)=>{1===e?p("/pages/customer/list/index"):d(`/pages/customer/contract/addContract?eid=${s}&name=${b.name}`)};return(e,s)=>{const t=n;return r(),i(t,{class:"content"},{default:o((()=>[u(t,{class:"cr-position-header"},{default:o((()=>[u(t,{class:"status_bar"}),u(c,{"is-right":!0,"default-title":b.defaultTitle,"right-data":[],"right-text":"提交",onHandleClickRight:w},null,8,["default-title"])])),_:1}),u(t,{class:"examine-content m10"},{default:o((()=>[u(l,{ref_key:"oaFormRef",ref:x,listData:h.value,onSubmitOk:R},null,8,["listData"])])),_:1}),u(m,{ref_key:"successPopupRef",ref:T,type:0,title:"客户","button-title":"添加合同",onChange:L},null,512)])),_:1})}}},[["__scopeId","data-v-373ea771"]]);export{x as default};
