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-Dnh6GPlT.js";import{o as l,s as m}from"./index.Cm0chJO5.js";import{d as c}from"./index.C9RyZqIW.js";import{j as f,k as j,m as y,n as v}from"./customer.C_xRWtM3.js";import{_ as g}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 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};
