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-WeUkftbp.js";import{o as m,s as f}from"./index.DxpQg1bl.js";import{d as j}from"./index.BcUDVLb2.js";import{a1 as v,a2 as x,c as y,a3 as b,a4 as h}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 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};
