engineering/public/admin/assets/edit.a1b59a64.js
2024-03-04 15:04:21 +08:00

2 lines
13 KiB
JavaScript

import{G as De,H as Ae,y as ke,A as Be,I as ye,J as xe,P as Ue,Q as we,w as je,K as qe,B as Re,F as $e,D as Ie,k as Ye}from"./element-plus.258bf9e7.js";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang.b97ad17d.js";import{_ as Se}from"./index.vue_vue_type_script_setup_true_lang.291052e3.js";import{P as Pe}from"./index.9492d03b.js";import{_ as Ne}from"./index.vue_vue_type_script_setup_true_lang.5a5f706a.js";import{_ as Oe}from"./index.vue_vue_type_script_setup_true_lang.511787a8.js";import{a as Te,b as he,c as Ge}from"./acceptance.6d88bded.js";import{u as Le,t as L,c as z}from"./index.ec401e3b.js";import{d as ze}from"./department.1c914e1a.js";import{g as He}from"./organization.f0387125.js";import{d as Q,r as d,a0 as E,s as H,e as Je,o as p,c as _,V as e,M as t,u as J,W as b,a8 as v,a as M,T as W,L as U,U as K}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"./index.vue_vue_type_script_setup_true_lang.60e89e82.js";import"./usePaging.f6660143.js";import"./useDictOptions.c644f395.js";import"./contract.4f8a540d.js";import"./index.vue_vue_type_script_setup_true_lang.e1e5e943.js";import"./custom.13e75d58.js";import"./project.bccf4059.js";import"./lodash.1d82ee7c.js";import"./bank_account.f2682814.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.50cbfcc9.js";import"./tslib.60310f1a.js";import"./zrender.a255a587.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.62ff6725.js";const Ke={class:"edit-popup"},Qe=W(" \u4E0A\u4F20 "),We={style:{"margin-left":"5px",display:"block"}},Xe=["href"],Ze=["onClick"],eu=Q({name:"projectEdit"}),Wu=Q({...eu,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(S,{expose:X,emit:P}){const Z=z.baseUrl+z.urlPrefix,N=Le();d(0);const f=E([]),F=d(""),g=d(""),V=d(""),C=d(""),D=d(""),A=d(""),w=d(""),j=d(""),O=E([]),q=E([]),ee=N.userInfo;console.log(ee,"222222");const ue=(a,u)=>{if(a.code==0){Ye.error(a.msg);return}f.push({uri:a.data.uri,name:a.data.name})},le=a=>{f.splice(a,1)},R=H(),$=H(),I=d("add");d("");const k=d(!1),B=d(!1),y=d(!1),Y=d(!1),ae=a=>{o.customer_id=a.id,V.value=a.name,k.value=!1},te=a=>{o.contract_id=a.id,C.value=a.name,D.value=a.project_code,B.value=!1},oe=a=>{o.project_id=a.id,F.value=a.contract_name,g.value=a.contract_code,A.value=a.contract_type,y.value=!1},re=a=>{Y.value=!1},ne=()=>{He().then(a=>{Object.assign(O,a)})},de=a=>{o.dept_id="",T(a)},T=a=>{ze({org_id:a}).then(u=>{q.splice(0,q.length,...u)})},se=a=>{a&&a>0&&(o.receipt_amount_daxie=L(a))},pe=Je(()=>I.value=="edit"?"\u7F16\u8F91\u627F\u5151\u6C47\u7968\u62A5\u9500\u8868":"\u65B0\u589E\u627F\u5151\u6C47\u7968\u8868"),o=E({id:"",org_id:"",dept_id:"",customer_id:0,project_id:0,contract_id:0,receipt_date:"",bill_sn:"",bank_account_id:0,bill_type:0,draft_acceptance_bank:"",bill_due_date:"",receipt_amount:"",receipt_amount_daxie:"",remark:"",annex:[]}),ie=E({}),h=async a=>{if(a.annex&&a.annex.length>0){const u=a.annex.map((m,c)=>({name:`\u6587\u4EF6${c+1}`,uri:m}));Object.assign(f,u)}for(const u in o)a[u]!=null&&a[u]!=null&&(o[u]=a[u]);a.dept_id&&T(a.org_id),F.value=a.contract.contract_name,g.value=a.contract.contract_code,C.value=a.project.name,D.value=a.project.project_code,A.value=a.contract.contract_type,V.value=a.custom.name,w.value=a.bankAccount.account_sn,j.value=a.bankAccount.deposit_bank,a.reimbursement_amount&&L(a.reimbursement_amount)},me=async a=>{const u=await Te({id:a.id});h(u)},ce=async()=>{var u,m,c;f.length>0&&(o.annex=f.map(r=>r.uri)),console.log((u=R.value)==null?void 0:u.validate(),"22222222"),await((m=R.value)==null?void 0:m.validate());const a={...o};I.value=="edit"?await he(a):await Ge(a),(c=$.value)==null||c.close(),P("success")},_e=(a="add")=>{var u;I.value=a,(u=$.value)==null||u.open(),ne()},fe=()=>{P("close")};return X({open:_e,setFormData:h,getDetail:me}),(a,u)=>{const m=De,c=Ae,r=ke,n=Be,s=ye,G=xe,Ee=Ue,be=we,ve=je,Fe=qe,ge=Re,x=$e,Ve=Me,Ce=Ie;return p(),_("div",Ke,[e(Pe,{ref_key:"popupRef",ref:$,title:J(pe),async:!0,width:"80%",onConfirm:ce,onClose:fe},{default:t(()=>[e(Ce,{ref_key:"formRef",ref:R,model:o,"label-width":"auto",rules:ie},{default:t(()=>[e(ge,{gutter:10},{default:t(()=>[e(n,{span:8},{default:t(()=>[e(r,{label:"\u7EC4\u7EC7",prop:"org_id",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(c,{modelValue:o.org_id,"onUpdate:modelValue":u[0]||(u[0]=l=>o.org_id=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u7EC4\u7EC7",onChange:de},{default:t(()=>[(p(!0),_(b,null,v(O,(l,i)=>(p(),U(m,{key:i,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u8BF7\u9009\u62E9\u90E8\u95E8",prop:"dept_id",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(c,{modelValue:o.dept_id,"onUpdate:modelValue":u[1]||(u[1]=l=>o.dept_id=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u90E8\u95E8"},{default:t(()=>[(p(!0),_(b,null,v(q,(l,i)=>(p(),U(m,{key:i,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u5BA2\u6237\u540D\u79F0",prop:"customer_id",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}],onClick:u[3]||(u[3]=l=>k.value=!0)},{default:t(()=>[e(s,{modelValue:V.value,"onUpdate:modelValue":u[2]||(u[2]=l=>V.value=l),readonly:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5BA2\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u9879\u76EE\u540D\u79F0",prop:"project_id",onClick:u[5]||(u[5]=l=>B.value=!0)},{default:t(()=>[e(s,{modelValue:C.value,"onUpdate:modelValue":u[4]||(u[4]=l=>C.value=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u9879\u76EE\u7F16\u7801",prop:"project_id"},{default:t(()=>[e(s,{modelValue:D.value,"onUpdate:modelValue":u[6]||(u[6]=l=>D.value=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9879\u76EE\u7F16\u7801"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u5408\u540C\u540D\u79F0",prop:"reimburser",onClick:u[8]||(u[8]=l=>y.value=!0)},{default:t(()=>[e(s,{modelValue:F.value,"onUpdate:modelValue":u[7]||(u[7]=l=>F.value=l),readonly:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5408\u540C\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u5408\u540C\u7F16\u7801",prop:"reimburser"},{default:t(()=>[e(s,{modelValue:g.value,"onUpdate:modelValue":u[9]||(u[9]=l=>g.value=l),readonly:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5408\u540C\u7F16\u7801"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u5408\u540C\u7C7B\u578B",prop:"contract_type"},{default:t(()=>[e(c,{modelValue:A.value,"onUpdate:modelValue":u[10]||(u[10]=l=>A.value=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5408\u540C\u7C7B\u578B"},{default:t(()=>[(p(!0),_(b,null,v(S.dictData.contract_type,(l,i)=>(p(),U(m,{key:i,label:l.name,value:parseInt(l.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6536\u7968\u65E5\u671F",prop:"receipt_date",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(G,{class:"flex-1 !flex",modelValue:o.receipt_date,"onUpdate:modelValue":u[11]||(u[11]=l=>o.receipt_date=l),clearable:"","value-format":"YYYY-MM-DD ",placeholder:"\u9009\u62E9\u6536\u7968\u65E5\u671F"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u7968\u636E\u7F16\u53F7",prop:"bill_sn",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(s,{modelValue:o.bill_sn,"onUpdate:modelValue":u[12]||(u[12]=l=>o.bill_sn=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7968\u636E\u7F16\u53F7"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6536\u7968\u94F6\u884C",prop:"bank_account_id",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(s,{modelValue:j.value,"onUpdate:modelValue":u[13]||(u[13]=l=>j.value=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6536\u7968\u94F6\u884C"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6536\u7968\u8D26\u6237\u7F16\u7801",prop:"bank_account_id"},{default:t(()=>[e(s,{modelValue:w.value,"onUpdate:modelValue":u[14]||(u[14]=l=>w.value=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6536\u7968\u8D26\u6237\u7F16\u7801"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6C47\u7968\u7C7B\u578B",prop:"bill_type",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(be,{modelValue:o.bill_type,"onUpdate:modelValue":u[15]||(u[15]=l=>o.bill_type=l),placeholder:"\u8BF7\u9009\u62E9\u6C47\u7968\u7C7B\u578B"},{default:t(()=>[(p(!0),_(b,null,v(S.dictData.bill_type,(l,i)=>(p(),U(Ee,{key:i,label:parseInt(l.value)},{default:t(()=>[W(K(l.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6C47\u7968\u627F\u5151\u94F6\u884C",prop:"draft_acceptance_bank",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(s,{modelValue:o.draft_acceptance_bank,"onUpdate:modelValue":u[16]||(u[16]=l=>o.draft_acceptance_bank=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6C47\u7968\u627F\u5151\u94F6\u884C"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6C47\u7968\u5230\u671F\u65E5\u671F",prop:"bill_due_date",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(G,{class:"flex-1 !flex",modelValue:o.bill_due_date,"onUpdate:modelValue":u[17]||(u[17]=l=>o.bill_due_date=l),clearable:"","value-format":"YYYY-MM-DD ",placeholder:"\u9009\u62E9\u6C47\u7968\u5230\u671F\u65E5\u671F"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6536\u6B3E\u91D1\u989D",prop:"receipt_amount",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(s,{modelValue:o.receipt_amount,"onUpdate:modelValue":u[18]||(u[18]=l=>o.receipt_amount=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6536\u6B3E\u91D1\u989D",onInput:se},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:8},{default:t(()=>[e(r,{label:"\u6536\u6B3E\u91D1\u989D\u5927\u5199",prop:"receipt_amount_daxie",rules:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:"blur"}]},{default:t(()=>[e(s,{modelValue:o.receipt_amount_daxie,"onUpdate:modelValue":u[19]||(u[19]=l=>o.receipt_amount_daxie=l),readonly:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6536\u6B3E\u91D1\u989D\u5927\u5199"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:24},{default:t(()=>[e(r,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[e(s,{modelValue:o.remark,"onUpdate:modelValue":u[20]||(u[20]=l=>o.remark=l),type:"textarea",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:24},{default:t(()=>[e(r,{label:"\u9644\u4EF6",prop:"field87"},{default:t(()=>[e(Fe,{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:J(N).token},action:Z+"/upload/file","on-success":ue,ref:"upload"},{default:t(()=>[e(ve,{type:"primary"},{default:t(()=>[Qe]),_:1})]),_:1},8,["headers","action"]),M("div",null,[(p(!0),_(b,null,v(f,(l,i)=>(p(),_("div",We,[M("a",{style:{"margin-left":"10px",color:"#4a5dff","align-self":"flex-start"},href:l.uri,target:"_blank"},K(l.name),9,Xe),M("span",{style:{cursor:"pointer","margin-left":"5px"},onClick:uu=>le(i)},"x",8,Ze)]))),256))])]),_:1})]),_:1})]),_:1}),e(x,{modelValue:B.value,"onUpdate:modelValue":u[21]||(u[21]=l=>B.value=l),title:"\u9009\u62E9\u9879\u76EE",width:"70%"},{default:t(()=>[e(Ne,{onCustomEvent:te,customer_id:o.customer_id},null,8,["customer_id"])]),_:1},8,["modelValue"]),e(x,{modelValue:y.value,"onUpdate:modelValue":u[22]||(u[22]=l=>y.value=l),title:"\u9009\u62E9\u9500\u552E\u5408\u540C",width:"70%"},{default:t(()=>[e(Ve,{onCustomEvent:oe,contract_type:"2"})]),_:1},8,["modelValue"]),e(x,{modelValue:k.value,"onUpdate:modelValue":u[23]||(u[23]=l=>k.value=l),title:"\u9009\u62E9\u5BA2\u6237",width:"70%"},{default:t(()=>[e(Se,{onCustomEvent:ae})]),_:1},8,["modelValue"]),e(x,{modelValue:Y.value,"onUpdate:modelValue":u[24]||(u[24]=l=>Y.value=l),title:"\u9009\u62E9\u94F6\u884C",width:"70%"},{default:t(()=>[e(Oe,{onCustomEvent:re})]),_:1},8,["modelValue"])]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Wu as default};