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 c,x as l,a0 as _,m as p}from"./index-DXvjTqMr.js";import{o as m,s as f}from"./index.GsZC4Lse.js";import{d as j}from"./index.D3kEQn5y.js";import{a1 as v,a2 as x,c as y,a3 as b,a4 as h}from"./customer.BB8HSfBC.js";import{_ as g}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-easyinput.D7PPGXPC.js";import"./uni-icons.Dxt3pfrw.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.GA6sNr68.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-data-checkbox.BmJ84AWk.js";import"./uni-cloud.es.Rn_2-D_g.js";import"./uni-load-more.CT32PUQ_.js";import"./uni-data-picker.CB6THmJK.js";/* empty css                                                                        */import"./selectedLabel.CZ1xYUNt.js";import"./uni-popup.BpvJsdxE.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BoqUbMLw.js";import"./editor.BVcG9oP9.js";import"./index.0WtUV6MF.js";import"./file.u5oGG8Vo.js";import"./uni-nav-bar.BZJJc0Hh.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=>{l.success(t.message),_(`/pages/customer/contract/details?id=${e}`)})).catch((e=>{l.error(e.message)}))},z=e=>{h(e).then((e=>{l.success(e.message),O.value.popupOpen(e.data.id)})).catch((e=>{l.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(c(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(c(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};
