import{I as ae,y as ue,A as te,w as ne,K as ie,B as de,L as pe,M as re,F as me,D as se,k as ce}from"./element-plus.517d4382.js";import{P as _e}from"./index.b17dae19.js";import{u as fe,t as ve,c as T}from"./index.8b1962e9.js";import{_ as Ve}from"./index.vue_vue_type_script_setup_true_lang.ed719f67.js";import{a as Fe,b as be,c as Ce}from"./InvoicingRequests.194880ba.js";import{g as Ee}from"./projecttype.80aa89f5.js";import{d as N,a0 as f,r,s as $,e as ge,o as x,c as k,V as e,M as a,u as S,a as V,W as Be,a8 as ye,T as F,U as xe}from"./@vue.ab566ce7.js";import"./@vueuse.8fcae4c2.js";import"./@element-plus.b89f1627.js";import"./lodash-es.49f4af13.js";import"./dayjs.4afe12d3.js";import"./axios.37fc980d.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.1d82ee7c.js";import"./vue-router.87ebc608.js";import"./pinia.b6700c26.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.d0bec2c9.js";import"./color.ea90db3f.js";import"./clone.cbd692e6.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.ad6bc3c0.js";import"./ms.a9ae1d6d.js";import"./nprogress.bcdf1f46.js";import"./vue-clipboard3.c45111bf.js";import"./clipboard.1cb79a0d.js";import"./echarts.b30ab882.js";import"./tslib.60310f1a.js";import"./zrender.3760070d.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.62ff6725.js";import"./index.vue_vue_type_script_setup_true_lang.5ae95555.js";import"./usePaging.f6660143.js";import"./useDictOptions.b5854a9e.js";import"./project.a81dff6c.js";const ke={class:"edit-popup"},Ue=F(),De=F(" \u4E0A\u4F20 "),he={style:{"margin-left":"5px",display:"block"}},je=["href"],we=["onClick"],Ae=V("div",{style:{margin:"20px 0"}},"\u76D8\u70B9\u6750\u6599\u6E05\u5355",-1),Re=F("+"),Te=F("-"),$e=N({name:"projectEdit"}),yl=N({...$e,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Se,{expose:O,emit:U}){const D=f([]),P=T.baseUrl+T.urlPrefix,z=fe();r(0);const s=f([]),h=r(""),v=r(""),c=r(""),j=r(""),w=r(""),I=r(""),_=f([{}]),M=(u,o)=>{if(u.code==0){ce.error(u.msg);return}s.push({uri:u.data.uri,name:u.data.name})},L=u=>{const o=_.indexOf(u);_.splice(o+1,0,{})},K=u=>{const o=_.indexOf(u);_.splice(o,1)},W=u=>{s.splice(u,1)},b=$(),C=$(),E=r("add");r(!1);const g=r(!1),q=u=>{t.contract_id=u.id,v.value=u.project_name,c.value=u.project_code,h.value=u.contract_name,w.value=u.contract_code,j.value=u.amount,g.value=!1},G=ge(()=>E.value=="edit"?"\u7F16\u8F91\u81EA\u8D2D\u6750\u6599\u8868":"\u65B0\u589E\u81EA\u8D2D\u6750\u6599\u8868"),t=f({id:"",customer_id:"",contract_id:"",approve_id:"",invoicing_date:"",period:"",accumulate_amount:"",accumulated_payments_received:"",tax_rate:"",invoice_type:"",invoicing_amount:"",invoicing_amount_daxie:"",tax:"",amount_including_tax:"",content:"",invoice_no:"",remark:"",annex:[],invoicing_company_name:"",taxpayer_identification_number:"",deposit_bank:"",bank_accnout:"",address_phone:"",receiving_address:"",contacts:"",phone:"",mailing_time:"",mailing_type:"",mailing_no:""}),H=f({}),A=async u=>{if(u.annex&&u.annex.length>0){const o=u.annex.map((n,i)=>({name:`\u6587\u4EF6${i+1}`,uri:n}));Object.assign(s,o)}for(const o in t)u[o]!=null&&u[o]!=null&&(t[o]=u[o]);t.invoicing_amount&&ve(t.invoicing_amount),I.value=u.custom.name,v.value=u.contract_name,c.value=u.contract_code,j.value=u.contract.amount,h.value=u.contract.contract_name,w.value=u.contract.contract_code},J=async u=>{const o=await Fe({id:u.id});A(o)},Q=async()=>{var o,n,i;s.length>0&&(t.annex=s.map(d=>d.uri)),console.log((o=b.value)==null?void 0:o.validate(),"22222222"),await((n=b.value)==null?void 0:n.validate());const u={...t};E.value=="edit"?await be(u):await Ce(u),(i=C.value)==null||i.close(),U("success")},X=(u="add")=>{var o;E.value=u,(o=C.value)==null||o.open(),Ee().then(n=>{D.splice(0,D.length,...n)})},Y=()=>{U("close")};return O({open:X,setFormData:A,getDetail:J}),(u,o)=>{const n=ae,i=ue,d=te,B=ne,Z=ie,R=de,m=pe,ee=re,le=me,oe=se;return x(),k("div",ke,[e(_e,{ref_key:"popupRef",ref:C,title:S(G),async:!0,width:"80%",onConfirm:Q,onClose:Y},{default:a(()=>[e(oe,{ref_key:"formRef",ref:b,model:t,"label-width":"auto",rules:H},{default:a(()=>[e(R,{gutter:10},{default:a(()=>[e(d,{span:8},{default:a(()=>[e(i,{label:"\u6750\u6599\u5927\u7C7B",prop:"contract_id"},{default:a(()=>[e(n,{modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=l=>v.value=l),clearable:"",placeholder:"\u6750\u6599\u5927\u7C7B"},null,8,["modelValue"])]),_:1})]),_:1}),Ue,e(d,{span:8},{default:a(()=>[e(i,{label:"\u6750\u6599\u4E2D\u7C7B",prop:"contract_id"},{default:a(()=>[e(n,{modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=l=>c.value=l),clearable:"",placeholder:"\u6750\u6599\u4E2D\u7C7B"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u6750\u6599\u5C0F\u7C7B",prop:"contract_id"},{default:a(()=>[e(n,{modelValue:c.value,"onUpdate:modelValue":o[2]||(o[2]=l=>c.value=l),clearable:"",placeholder:"\u6750\u6599\u5C0F\u7C7B"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u6750\u6599\u7F16\u7801",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[3]||(o[3]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6750\u6599\u7F16\u7801"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u54C1\u724C",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[4]||(o[4]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u6750\u6599\u540D\u79F0",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[5]||(o[5]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6750\u6599\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u89C4\u683C\u578B\u53F7",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[6]||(o[6]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C\u578B\u53F7"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u5355\u4F4D",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[7]||(o[7]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u53C2\u6570\u8BF4\u660E",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[8]||(o[8]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u8BF4\u660E"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u5B89\u5168\u5E93\u5B58\u91CF",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[9]||(o[9]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5B89\u5168\u5E93\u5B58\u91CF"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u9500\u552E\u6307\u5BFC\u4EF7",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[10]||(o[10]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9500\u552E\u6307\u5BFC\u4EF7"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:8},{default:a(()=>[e(i,{label:"\u9884\u7B97\u6210\u672C\u4EF7",prop:"invoice_no"},{default:a(()=>[e(n,{modelValue:t.invoice_no,"onUpdate:modelValue":o[11]||(o[11]=l=>t.invoice_no=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9884\u7B97\u6210\u672C\u4EF7"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:12},{default:a(()=>[e(i,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[e(n,{modelValue:t.remark,"onUpdate:modelValue":o[12]||(o[12]=l=>t.remark=l),type:"textarea",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{span:24},{default:a(()=>[e(i,{label:"\u9644\u4EF6",prop:"field127"},{default:a(()=>[e(Z,{accept:"doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv",class:"upload-demo","show-file-list":!1,"aria-hidden":"true",headers:{Token:S(z).token},action:P+"/upload/file","on-success":M,ref:"upload"},{default:a(()=>[e(B,{type:"primary"},{default:a(()=>[De]),_:1})]),_:1},8,["headers","action"]),V("div",null,[(x(!0),k(Be,null,ye(s,(l,p)=>(x(),k("div",he,[V("a",{style:{"margin-left":"10px",color:"#4a5dff","align-self":"flex-start"},href:l.uri,target:"_blank"},xe(l.name),9,je),V("span",{style:{cursor:"pointer","margin-left":"5px"},onClick:y=>W(p)},"x",8,we)]))),256))])]),_:1})]),_:1})]),_:1}),Ae,e(R,null,{default:a(()=>[e(ee,{data:_},{default:a(()=>[e(m,{label:"\u5E8F\u53F7"},{default:a(({row:l})=>[e(B,{onClick:p=>L(l),size:"small"},{default:a(()=>[Re]),_:2},1032,["onClick"]),e(B,{onClick:p=>K(l),size:"small"},{default:a(()=>[Te]),_:2},1032,["onClick"])]),_:1}),e(m,{label:" \u4ED3\u5E93\u540D\u79F0",prop:"name1"},{default:a(({row:l,$index:p})=>[e(n,{modelValue:l.name1,"onUpdate:modelValue":y=>l.name1=y,readonly:"",onClick:y=>u.subjectmu(l,p)},null,8,["modelValue","onUpdate:modelValue","onClick"])]),_:1}),e(m,{label:"\u6750\u6599\u7F16\u7801",prop:"name2"},{default:a(({row:l})=>[e(n,{modelValue:l.name2,"onUpdate:modelValue":p=>l.name2=p,readonly:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u6750\u6599\u540D\u79F0",prop:"use_to"},{default:a(({row:l})=>[e(n,{modelValue:l.use_to,"onUpdate:modelValue":p=>l.use_to=p},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u89C4\u683C\u578B\u53F7",prop:"amount"},{default:a(({row:l})=>[e(n,{modelValue:l.amount,"onUpdate:modelValue":p=>l.amount=p,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u54C1\u724C",prop:"remark"},{default:a(({row:l})=>[e(n,{modelValue:l.remark,"onUpdate:modelValue":p=>l.remark=p},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u5355\u4F4D",prop:"remark"},{default:a(({row:l})=>[e(n,{modelValue:l.remark,"onUpdate:modelValue":p=>l.remark=p},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])]),_:1}),e(le,{modelValue:g.value,"onUpdate:modelValue":o[13]||(o[13]=l=>g.value=l),title:"\u9009\u62E9\u9879\u76EE",width:"70%"},{default:a(()=>[e(Ve,{onCustomEvent:q,contract_type:"2"})]),_:1},8,["modelValue"])]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{yl as default};