import{r as e,e as t,b as a,a9 as s,Q as i,h as o,w as n,z as d,o as r,i as u,a as l,x as c,a0 as _,m as p}from"./index-B3cqKsI_.js";import{o as m,s as f}from"./index.B8Oks8V3.js";import{d as j}from"./index.CL60Q41z.js";import{a1 as v,a2 as x,c as y,a3 as b,a4 as h}from"./customer.Crnb53sL.js";import{_ as g}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 k=g({__name:"addContract",setup(g){e("color: #C0C4CC;font-size: 30rpx"),t({color:"#303133",disableColor:"#ffffff"});const k=e(null),C=t({defaultTitle:"添加合同",cid:"",eid:0,jumpUrl:"",name:"",list:[],buildData:{}});a(),s((e=>{e.name&&(C.name=e.name),C.eid=e.eid,e.cid&&(C.defaultTitle="编辑合同",C.cid=e.cid),L()})),i((()=>{C.cid?$():E()}));const D=e([]),E=()=>{v().then((e=>{C.eid&&e.data.forEach((e=>{e.data.forEach((e=>{e.text="","contract_customer"==e.key&&(e.text1=C.name,e.options_level=1,e.value=C.eid)}))})),D.value=e.data}))},$=()=>{x(C.cid).then((e=>{C.eid&&e.data.forEach((e=>{e.data.forEach((e=>{e.text="","contract_customer"==e.key&&(e.text1=C.name,e.options_level=1,e.value=C.eid)}))})),D.value=e.data}))},w=()=>{k.value.submit()},R=e=>{if(e.types=C.types,C.cid){let t=C.cid;T(t,e)}else z(e)},T=(e,t)=>{b(e,t).then((t=>{c.success(t.message),_(`/pages/customer/contract/details?id=${e}`)})).catch((e=>{c.error(e.message)}))},z=e=>{h(e).then((e=>{c.success(e.message),O.value.popupOpen(e.data.id)})).catch((e=>{c.error(e.message)}))},L=()=>{y().then((e=>{C.buildData=e.data}))};e(!1);const O=e(null),P=(e,t)=>{if(1===e){const e=(e=>{1===e&&_("/pages/customer/contract/index")})();_(e)}else C.buildData.contract_refund_switch&&p(`/pages/users/examine/default?id=${C.buildData.contract_refund_switch}&eid=${C.eid}&cid=${t}`)};return(e,t)=>{const a=d;return r(),o(a,{class:"content"},{default:n((()=>[u(a,{class:"cr-position-header"},{default:n((()=>[u(a,{class:"status_bar"}),u(l(j),{"is-jump-bar":!1,"is-right":!0,"default-title":C.defaultTitle,"right-text":"提交",onHandleClickRight:w},null,8,["default-title"])])),_:1}),u(a,{class:"examine-content m10"},{default:n((()=>[u(l(m),{ref_key:"oaFormRef",ref:k,listData:D.value,onSubmitOk:R},null,8,["listData"])])),_:1}),u(f,{ref_key:"successPopupRef",ref:O,type:1,title:"合同","button-title":"添加付款",onChange:P},null,512)])),_:1})}}},[["__scopeId","data-v-8a79dc3b"]]);export{k as default};
