import{d as a,r as e,e as t,a9 as s,x as i,f as l,g as o,o as d,h as n,w as c,i as r,a as u,j as _,t as m,ai as p,a0 as f,z as h,y as g,a1 as v}from"./index-WeUkftbp.js";import{_ as y}from"./uni-easyinput.D5FSIQIk.js";import{_ as b,a as x}from"./uni-forms.CCONsUgM.js";import{_ as j,a as C}from"./uni-row.DLutFlIQ.js";import{d as L}from"./index.BcUDVLb2.js";import{u as w}from"./uploadFromList.BbGpiZUD.js";import{a as T}from"./file.BMc01nZQ.js";import{a9 as k,aa as N,ab as V}from"./customer.C_v9K5hM.js";import{_ as z}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-nav-bar.cBITQXNK.js";/* empty css                                                                    *//* empty css                                                              */const F=z(a({__name:"addFile",setup(a){const z=e("color: #C0C4CC;font-size: 30rpx"),F=t({color:"#303133",disableColor:"#ffffff"}),H=t({type:1,cid:0,id:0,fileList:[],defaultTitle:""}),$=t({content:"",attach_ids:[],cid:0});s((a=>{a.cid&&(H.cid=Number(a.cid)),H.defaultTitle="添加合同记录",a.id&&(H.id=Number(a.id),B(H.id),H.defaultTitle="编辑合同记录")}));const B=a=>{k(a).then((a=>{$.content=a.data.content,$.cid=a.data.cid,H.fileList=a.data.attachs})).catch((a=>{J.value=!1,i.error(a.message)}))},I=()=>{if(!$.content)return i.error("请填写记录描述"),!1;H.fileList.length>0&&H.fileList.map((a=>{$.attach_ids.push(a.id)})),$.cid=H.cid,H.id>0?J.value||M(H.id,$):J.value||K($)},J=e(!1),K=a=>{J.value=!0,N(a).then((a=>{i.success(a.message),f(`/pages/customer/contract/details?id=${H.cid}&tab=4`)})).catch((a=>{J.value=!1,i.error(a.message)}))},M=(a,e)=>{J.value=!0,V(a,e).then((a=>{i.success(a.message),f(`/pages/customer/contract/details?id=${H.cid}&tab=4`)})).catch((a=>{J.value=!1,i.error(a.message)}))},Q=a=>{H.fileList.splice(a,1)},U=t({}),W=()=>{U.relation_type="contract",H.id>0&&(U.relation_id=H.id),T("attach/imgs",U,p).then((a=>{a.data.id=a.data.attach_id,H.fileList.push(a.data)})).catch((a=>{i.error(a)}))};return(a,e)=>{const t=h,s=g,i=l(o("uni-easyinput"),y),f=l(o("uni-forms-item"),b),T=l(o("uni-col"),j),k=l(o("uni-row"),C),N=l(o("uni-forms"),x),V=v;return d(),n(t,{class:"content"},{default:c((()=>[r(t,{class:"cr-position-header"},{default:c((()=>[r(t,{class:"status_bar"}),r(u(L),{"is-right":!0,"default-title":H.defaultTitle},null,8,["default-title"])])),_:1}),r(t,{class:"examine-content m10"},{default:c((()=>[r(N,{border:!1,"label-width":"80px"},{default:c((()=>[r(t,{class:"list-item"},{default:c((()=>[r(f,{class:"is-direction-top p24"},{label:c((()=>[r(t,{class:"uni-forms-item__label mt36"},{default:c((()=>[_(" 记录描述 "),r(s,{class:"iconfont"},{default:c((()=>[_("*")])),_:1})])),_:1})])),default:c((()=>[r(i,{inputBorder:!1,class:"max-height",modelValue:$.content,"onUpdate:modelValue":e[0]||(e[0]=a=>$.content=a),type:"textarea",clearable:!1,styles:F,"placeholder-style":z.value,maxlength:256,autoHeight:!0,placeholder:"请填写记录描述"},null,8,["modelValue","styles","placeholder-style"])])),_:1})])),_:1}),r(t,{class:"list-item mt20 p24"},{default:c((()=>[r(f,{class:"is-direction-top"},{label:c((()=>[r(t,{class:"uni-forms-item-con mt36"},{default:c((()=>[r(k,{class:""},{default:c((()=>[r(T,{span:22},{default:c((()=>[r(t,{class:""},{default:c((()=>[_("添加文件")])),_:1}),r(t,{class:"tips"},{default:c((()=>[_("(建议大小不超过"+m(u(p))+"M，支持图片、附件、文档)",1)])),_:1})])),_:1}),r(T,{span:2,class:"text-right",onClick:W},{default:c((()=>[r(s,{class:"iconfont icon-biaodan-tianjia"})])),_:1})])),_:1})])),_:1}),r(t,{class:"upload"},{default:c((()=>[r(w,{"upload-from-data":H.fileList,"is-clear":!0,onHandleClear:Q},null,8,["upload-from-data"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(t,{class:"examine-button"},{default:c((()=>[r(V,{type:"primary",loading:J.value,onClick:I},{default:c((()=>[_("提交")])),_:1},8,["loading"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-006e0da4"]]);export{F as default};
