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

2 lines
11 KiB
JavaScript

import{G as he,H as be,J as Ve,y as ve,A as Ee,I as ye,w as ge,K as Ue,B as xe,C as ke,L as Fe,M as Ce,D as De,F as je,k as Be}from"./element-plus.258bf9e7.js";import{P as Ae}from"./index.9492d03b.js";import{a as Ne,b as Ye,c as we}from"./cost_budget_adjust.966e7ad6.js";import{d as G,a0 as h,r as v,s as $,e as Oe,o as b,c as E,V as l,M as a,u as T,a as y,W as B,a8 as A,T as N,L as P,U as Se,b7 as Re,b6 as Ie}from"./@vue.ab566ce7.js";import"./lodash.1d82ee7c.js";import{r as Me}from"./index.9cd3be2e.js";import{_ as $e}from"./index.vue_vue_type_script_setup_true_lang.c7120e3a.js";import{d as z}from"./department.1c914e1a.js";import{g as Te}from"./organization.f0387125.js";import{u as Pe,c as L,_ as ze}from"./index.ec401e3b.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";/* empty css */import"./index.vue_vue_type_script_setup_true_lang.60e89e82.js";import"./usePaging.f6660143.js";import"./cost_subject.bd75356b.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 Le=g=>(Re("data-v-827cb125"),g=g(),Ie(),g),Ge={class:"edit-popup"},He={style:{display:"flex","flex-direction":"row-reverse","justify-content":"flex-start","margin-bottom":"30px"}},Je=N(" \u4E0A\u4F20 "),Ke=["href"],We=["onClick"],qe=Le(()=>y("div",{class:"tit"},"\u9884\u7B97\u660E\u7EC6",-1)),Qe=N("+"),Xe=N("-"),Ze=G({name:"customEdit"}),el=G({...Ze,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(g,{expose:H,emit:Y}){const J=L.baseUrl+L.urlPrefix,K=Pe(),V=h([]),F=v(""),W=(o,t)=>{if(o.code==0){Be.error(o.msg);return}V.push({uri:o.data.uri,name:o.data.name})},q=o=>{V.splice(o,1)},w=h([]),U=h([]),x=v(0),m=h({id:"",dept_id:"",org_id:"",approve_id:0,years:"",document_preparation_time:"",remark:"",annex:[],detail:[]}),Q=(o,t,i)=>{x.value=i,k.value=!0},c=v([{name1:"",name2:"",month1:" ",month2:" ",month3:" ",month4:" ",month5:" ",month6:" ",month7:" ",month8:" ",month9:" ",month10:" ",month11:" ",month12:" "}]),X=o=>{const{columns:t,data:i}=o,d=[];if(t.map((_,r)=>{if(_.label=="\u5E8F\u53F7"){d[r]="\u5408\u8BA1";return}if(_.label=="\u4E00\u7EA7\u79D1\u76EE"){d[r]="";return}if(_.label==="\u4E8C\u7EA7\u79D1\u76EE"){d[r]="";return}const s=i.map(n=>Number(n[_.property]));console.log(s),s.every(n=>Number.isNaN(n))?d[r]="N/A":d[r]=`${s.reduce((n,f)=>{const j=Number(f);return Number.isNaN(j)?n:n+f},0)}`}),d.length>0){const r=d.slice(3,d.length).map(s=>Number(s));F.value=r.reduce((s,n)=>{const f=Number(n);return Number.isNaN(f)?s:s+n},0)}return d},Z=o=>{const t=c.value.indexOf(o);c.value.splice(t+1,0,{name1:"",name2:"",month1:" ",month2:" ",month3:" ",month4:" ",month5:" ",month6:" ",month7:" ",month8:" ",month9:" ",month10:" ",month11:" ",month12:" "})},ee=o=>{const t=c.value.indexOf(o);c.value.splice(t,1)},O=$(),C=$(),D=v("add");v(0);const k=v(!1),le=h([]);h({provinceOptions:[],cityOptions:[],areaOptions:[]});const te=o=>{c.value[x.value].name1=o.subject1,c.value[x.value].name2=o.subject2,c.value[x.value].cost_subject_id=o.id,k.value=!1},oe=Oe(()=>D.value=="edit"?"\u7F16\u8F91\u516C\u53F8\u5E74\u5EA6\u7BA1\u7406\u8D39\u7528\u9884\u7B97\u8C03\u6574":"\u65B0\u589E\u516C\u53F8\u5E74\u5EA6\u7BA1\u7406\u8D39\u7528\u9884\u7B97\u8C03\u6574"),ae=h({}),S=async o=>{if(o.annex&&o.annex.length>0){const t=o.annex.map((i,d)=>({name:`\u6587\u4EF6${d+1}`,uri:i}));Object.assign(V,t)}for(const t in m)o[t]!=null&&o[t]!=null&&(m[t]=o[t]);o.detail&&o.detail.length>0&&(c.value=o.detail.map((t,i)=>(t.subject&&t.subject.subject1&&(t.name1=t.subject.subject1),t.subject&&t.subject.subject2&&(t.name2=t.subject.subject2),t)))},ue=async o=>{const t=await Ne({id:o.id});S(t)},ne=()=>{Te().then(o=>{Object.assign(w,o),o.length>0&&!m.org_id&&(m.org_id=o[0].id,z({org_id:o[0].id}).then(t=>{t.length>0&&(Object.assign(U,t),m.dept_id=t[0].id)}))})},me=o=>{m.dept_id="",de(o)},de=o=>{z({org_id:o}).then(t=>{U.splice(0,U.length,...t)})},se=async()=>{var t,i;if(c.value.length>0){const d=c.value.map(({name1:_,name2:r,...s})=>s);Object.assign(m.detail,d)}V.length>0&&(m.annex=V.map(d=>d.uri)),await((t=O.value)==null?void 0:t.validate());const o={...m};D.value=="edit"?await Ye(o):await we(o),(i=C.value)==null||i.close(),Y("success")},pe=(o="add")=>{var t;D.value=o,(t=C.value)==null||t.open(),ne()},re=()=>{Y("close")};return H({open:pe,setFormData:S,getDetail:ue}),(o,t)=>{const i=he,d=be,_=Ve,r=ve,s=Ee,n=ye,f=ge,j=Ue,ie=xe,R=ke,p=Fe,ce=Ce,_e=De,fe=je;return b(),E("div",Ge,[l(Ae,{ref_key:"popupRef",ref:C,title:T(oe),async:!0,width:"90%",onConfirm:se,onClose:re},{default:a(()=>[l(_e,{ref_key:"formRef",ref:O,model:m,"label-width":"90px",rules:ae},{default:a(()=>[y("div",He,[l(d,{class:"w-[180px]",modelValue:m.dept_id,"onUpdate:modelValue":t[0]||(t[0]=e=>m.dept_id=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u90E8\u95E8"},{default:a(()=>[(b(!0),E(B,null,A(U,(e,u)=>(b(),P(i,{key:u,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l(d,{class:"w-[180px]",modelValue:m.org_id,"onUpdate:modelValue":t[1]||(t[1]=e=>m.org_id=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u7EC4\u7EC7",onChange:me},{default:a(()=>[(b(!0),E(B,null,A(w,(e,u)=>(b(),P(i,{key:u,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),l(R,{class:"mb-2"},{default:a(()=>[l(ie,null,{default:a(()=>[l(s,{span:8},{default:a(()=>[l(r,{label:"\u5E74\u4EFD",prop:"years"},{default:a(()=>[l(_,{class:"flex-1 !flex",modelValue:m.years,"onUpdate:modelValue":t[2]||(t[2]=e=>m.years=e),clearable:"",type:"year","value-format":"YYYY",placeholder:"\u9009\u62E9\u5E74\u4EFD"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:a(()=>[l(r,{label:"\u5236\u5355\u65F6\u95F4",prop:"document_preparation_time"},{default:a(()=>[l(_,{class:"flex-1 !flex",modelValue:m.document_preparation_time,"onUpdate:modelValue":t[3]||(t[3]=e=>m.document_preparation_time=e),clearable:"",type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u5236\u5355\u65F6\u95F4"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:a(()=>[l(r,{label:"\u603B\u5408\u8BA1",prop:"date"},{default:a(()=>[l(n,{modelValue:F.value,"onUpdate:modelValue":t[4]||(t[4]=e=>F.value=e),readonly:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u5408\u8BA1"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:24},{default:a(()=>[l(r,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[l(n,{modelValue:m.remark,"onUpdate:modelValue":t[5]||(t[5]=e=>m.remark=e),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",autosize:{minRows:4,maxRows:4},style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:24},{default:a(()=>[l(r,{label:"\u9644\u4EF6",prop:"field127"},{default:a(()=>[l(j,{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:T(K).token},action:J+"/upload/file","on-success":W,ref:"upload"},{default:a(()=>[l(f,{type:"primary"},{default:a(()=>[Je]),_:1})]),_:1},8,["headers","action"]),y("div",null,[(b(!0),E(B,null,A(V,(e,u)=>(b(),E("div",{key:u,style:{"margin-left":"5px",display:"block"}},[y("a",{style:{"margin-left":"10px",color:"#4a5dff","align-self":"flex-start"},href:e.uri,target:"_blank"},Se(e.name),9,Ke),y("span",{style:{cursor:"pointer","margin-left":"5px"},onClick:I=>q(u)},"x",8,We)]))),128))])]),_:1})]),_:1})]),_:1})]),_:1}),l(R,{class:"mb-2"},{default:a(()=>[qe,l(ce,{data:c.value,"summary-method":X,"show-summary":""},{default:a(()=>[l(p,{label:"\u5E8F\u53F7",width:"105px"},{default:a(({row:e})=>[l(f,{onClick:u=>Z(e),size:"small"},{default:a(()=>[Qe]),_:2},1032,["onClick"]),l(f,{onClick:u=>ee(e),size:"small"},{default:a(()=>[Xe]),_:2},1032,["onClick"])]),_:1}),l(p,{label:"\u4E00\u7EA7\u79D1\u76EE",prop:"name1"},{default:a(({row:e,column:u,$index:I})=>[l(n,{modelValue:e.name1,"onUpdate:modelValue":M=>e.name1=M,onClick:M=>Q(e,u,I)},null,8,["modelValue","onUpdate:modelValue","onClick"])]),_:1}),l(p,{label:"\u4E8C\u7EA7\u79D1\u76EE",prop:"name2"},{default:a(({row:e})=>[l(n,{modelValue:e.name2,"onUpdate:modelValue":u=>e.name2=u},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"1\u6708",prop:"month1"},{default:a(({row:e})=>[l(n,{modelValue:e.month1,"onUpdate:modelValue":u=>e.month1=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"2\u6708",prop:"month2"},{default:a(({row:e})=>[l(n,{modelValue:e.month2,"onUpdate:modelValue":u=>e.month2=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"3\u6708",prop:"month3"},{default:a(({row:e})=>[l(n,{modelValue:e.month3,"onUpdate:modelValue":u=>e.month3=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"4\u6708",prop:"month4"},{default:a(({row:e})=>[l(n,{modelValue:e.month4,"onUpdate:modelValue":u=>e.month4=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"5\u6708",prop:"month5"},{default:a(({row:e})=>[l(n,{modelValue:e.month5,"onUpdate:modelValue":u=>e.month5=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"6\u6708",prop:"month6"},{default:a(({row:e})=>[l(n,{modelValue:e.month6,"onUpdate:modelValue":u=>e.month6=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"7\u6708",prop:"month7"},{default:a(({row:e})=>[l(n,{modelValue:e.month7,"onUpdate:modelValue":u=>e.month7=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"8\u6708",prop:"month8"},{default:a(({row:e})=>[l(n,{modelValue:e.month8,"onUpdate:modelValue":u=>e.month8=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"9\u6708",prop:"month9"},{default:a(({row:e})=>[l(n,{modelValue:e.month9,"onUpdate:modelValue":u=>e.month9=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"10\u6708",prop:"month10"},{default:a(({row:e})=>[l(n,{modelValue:e.month10,"onUpdate:modelValue":u=>e.month10=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"11\u6708",prop:"month11"},{default:a(({row:e})=>[l(n,{modelValue:e.month11,"onUpdate:modelValue":u=>e.month11=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{label:"12\u6708",prop:"month12"},{default:a(({row:e})=>[l(n,{modelValue:e.month12,"onUpdate:modelValue":u=>e.month12=u,type:"number"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["model","rules"]),l(Me,{list:le},null,8,["list"])]),_:1},8,["title"]),l(fe,{modelValue:k.value,"onUpdate:modelValue":t[6]||(t[6]=e=>k.value=e),title:"\u9009\u62E9\u79D1\u76EE",width:"70%"},{default:a(()=>[l($e,{onCustomEvent:te})]),_:1},8,["modelValue"])])}}});const Ll=ze(el,[["__scopeId","data-v-827cb125"]]);export{Ll as default};