import{am as x,bP as W,aR as A,bS as se,bT as re,bb as ie,_ as pe,d as ce,x as c,W as de,ah as fe,bU as me,aM as _e,bc as Be,ai as he,p as Fe,r,aD as ve,o as v,c as De,l,D as t,m as p,bZ as xe,G as y,M as C,a as S,J as Ae,h as o,L as N,H as ye,bd as Ce,aZ as g}from"./index.js";import{g as ge,i as be}from"./index.216a9729.js";import Ee from"./index.db8841.js";import we from"./capital-modal.165f1c.js";import{b as ke}from"./index.f2e8eb08.js";import{a as M}from"./tragelog.68e13113.js";import{h as Se}from"./export.081d0878.js";import{u as R,w as Ne}from"./xlsx.ed122d16.js";import"./execl-upload.400e16a4.js";import"./sale.861ec842.js";const Pe={\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801:"",\u6536\u6B3E\u65B9\u516C\u53F8\u540D\u79F0:"",\u8D44\u91D1\u7F16\u7801:"",\u8BA2\u5355\u7F16\u7801:"",\u8BA4\u9886\u8D44\u91D1:""},Te=[{value:"0",label:"\u624B\u52A8\u521B\u5EFA"},{value:"1",label:"\u7CFB\u7EDF\u521B\u5EFA"}],Re=[{type:"selection",align:"center",width:40,fixed:"left"},{label:"\u8D44\u91D1\u8BA4\u9886\u7F16\u7801",prop:"logNo",fixed:"left",width:"150px"},{label:"\u8D44\u91D1\u6279\u6B21\u53F7",prop:"pcCode",width:"150px"},{label:"\u5E73\u53F0\u91C7\u8D2DPO",prop:"palt_po",width:"150px"},{label:"\u8D44\u91D1\u7F16\u7801",prop:"tradNo",width:"150px"},{label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801",prop:"orderCode",width:"150px"},{label:"\u9500\u552E\u4E3B\u5355\u53F7",prop:"cxCode",width:"160px"},{label:"\u8BA4\u9886\u91D1\u989D",prop:"total_fee",width:"110px"},{label:"\u5E73\u53F0\u7C7B\u578B",prop:"platform",width:"120px",cellRenderer({row:i}){return x(A,null,{default:()=>{var a;return((a=W.find(n=>n.value==i.platform_type))==null?void 0:a.label)||"--"}})}},{label:"\u8D44\u91D1\u8BA4\u9886\u72B6\u6001",prop:"status",width:100,cellRenderer:({row:i})=>x(A,null,{default:()=>{var a;return((a=M.find(n=>n.value==i.status))==null?void 0:a.label)||"--"}})},{label:"\u64CD\u4F5C\u6765\u6E90",width:100,cellRenderer:({row:i})=>x(A,{type:i.tag_type=="0"?"info":""},{default:()=>{var a;return((a=Te.find(n=>n.value==i.tag_type))==null?void 0:a.label)||"--"}})},{label:"\u5173\u8054\u8D44\u91D1\u7F16\u53F7",width:120,prop:"relaNo"},{label:"\u8BA2\u5355\u6765\u6E90",prop:"qrdSource",width:"100px",cellRenderer({row:i}){return x(A,null,{default:()=>{var a;return(a=se.find(n=>n.value==i.qrdSource))==null?void 0:a.label}})}},{label:"\u5546\u54C1\u7C7B\u578B",prop:"qrdType",width:"100px",cellRenderer({row:i}){return x(A,null,{default:()=>{var a;return(a=re.find(n=>n.value==i.qrdType))==null?void 0:a.label}})}},{label:"\u5E73\u53F0\u540D\u79F0",prop:"platName",width:"120px"},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",nimWidth:"160px",...ie("goodNo","goodName","\u5546\u54C1\u7F16\u7801:")},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:"70px"},{label:"\u8BA4\u9886\u65F6\u95F4",prop:"addtime",width:"140px"},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],Ie={title:"",showTitle:!0,columns:Re,superUserNoAction:!0,apis:{httpList:ke,httpAdd:!0}},q={formItems:[{field:"timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u8D44\u91D1\u8BA4\u9886\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u8D44\u91D1\u8BA4\u9886\u7ED3\u675F\u65F6\u95F4"}},{field:"status",type:"select",placeholder:"\u8D44\u91D1\u8BA4\u9886\u72B6\u6001",options:M},{field:"platform_type",type:"select",placeholder:"\u5E73\u53F0\u7C7B\u578B",options:W},{field:"logNo",type:"input",placeholder:"\u8D44\u91D1\u8BA4\u9886\u7F16\u7801"},{field:"tradNo",type:"input",placeholder:"\u8D44\u91D1\u7F16\u7801"},{field:"orderCode",type:"input",placeholder:"\u9500\u552E\u8BA2\u5355\u7F16\u7801"},{field:"relaNo",type:"input",placeholder:"\u5173\u8054\u8D44\u91D1\u8BA4\u9886\u7F16\u53F7"},{field:"cxCode",type:"input",placeholder:"\u9500\u552E\u4E3B\u5355\u53F7"},{field:"pcCode",type:"input",placeholder:"\u8D44\u91D1\u6279\u6B21\u53F7"}]},Ve={class:"flex mb-[10px]"},Ue={class:"flex flex-col border-r-1 border-[#dcdfe6] justify-center pr-[10px]"},Oe=o("span",{class:"text-center font-bold",style:{"font-size":"14px"}},"\u6279\u6B21\u53F7\u603B\u91D1\u989D",-1),ze={class:"text-center text-[12px]",style:{"font-size":"14px"}},qe={class:"flex flex-col ml-[10px]"},We={class:"flex"},Me={class:"flex flex-col mr-[25px]"},Le=o("span",{class:"text-center font-bold",style:{"font-size":"14px"}},"\u8BA2\u5355\u5DF2\u8BA4\u9886",-1),je={class:"text-center",style:{"font-size":"14px"}},He={class:"flex flex-col mr-[25px]"},Ze=o("span",{class:"text-center font-bold",style:{"font-size":"14px"}},"\u8BA2\u5355\u8BA4\u9886\u4E2D",-1),$e={class:"text-center",style:{"font-size":"14px"}},Ge={class:"flex flex-col"},Je=o("span",{class:"text-center font-bold",style:{"font-size":"14px"}},"\u8BA2\u5355\u672A\u8BA4\u9886",-1),Ke={class:"text-center",style:{"font-size":"14px"}},Qe={class:"w-full flex justify-end"},Xe=ce({__name:"index",setup(i){const a="capitalPool",n=c([]),b=c(!1),I=c(null),E=c(!1),{currentCompany:L}=de(),d=c({status:"",remark:""}),j=c(Ie),H=fe(()=>({status:[{required:!0,message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001",trigger:"change"}],remark:[{required:d.value.status=="3",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001",trigger:"change"}]})),V=me({success:()=>{D.value.onSearch(),b.value=!1}}),Z=c(null),{hasPermissionWithCode:w}=_e("capitalPool"),D=c(null),U=c(null),{run:$}=Be({success:()=>D.value.onSearch()}),G=u=>$(ge(u)),{isSuperUser:P}=he(),O=Fe(),J={pageSearchHook:()=>Ce(void 0,void 0,q)},m=c(null),K={content:{preview:({logNo:u})=>O.push("/InvoiceSales/capitalPoolDetail?id="+u),create:()=>O.push("/InvoiceSales/capitalPoolDetail"),result(u={},e={}){const{pcData:B={}}=u,{balancePrce:f,totalPrice:k,tradPrice:_,usedPrice:h}=B,F=Number(f)+Number(_)+Number(h);F!=0?m.value={batchTotal:F,aTotal:h,total:_,wTotal:f}:m.value=null}}};function Q(){const u=R.book_new(),e=R.json_to_sheet([Pe]);R.book_append_sheet(u,e,"sheet"),Ne(u,"\u8BA2\u5355\u8BA4\u6B3E\u5BFC\u5165\u6A21\u677F.xlsx",{bookType:"xlsx"})}function X(){if(n.value.length===0){g.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u6761\u72B6\u6001\u4E3A`\u5F85\u5BA1\u6279`\u7684\u6570\u636E");return}if(n.value.some(e=>e.status!=="1")){g.warning("\u8BF7\u9009\u62E9\u72B6\u6001\u4E3A`\u5F85\u5BA1\u6279`\u7684\u6570\u636E");return}b.value=!0}async function Y(){const u=D.value.getBasicParams();if(!u.start||!u.end){g.warning("\u8BF7\u9009\u62E9\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4");return}if(u.status!=2){g.warning("\u8BF7\u7B5B\u9009\u8D44\u91D1\u8BA4\u9886\u72B6\u6001\u4E3A`\u5BA1\u6838\u901A\u8FC7`\u7684\u6570\u636E");return}const{start:e,end:B,...f}=u,k={create_start:e,create_end:B,...f},_=24*60*60*1e3,h=new Date(u.start).valueOf();if((new Date(u.end).valueOf()+_-h)/_>31)return g.warning("\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC731\u5929\uFF01"),!1;await Se({url:"ope",name:"\u8D44\u91D1\u8BA4\u9886\u6570\u636E\u8868",onSuccess:()=>E.value=!1,onStart:()=>E.value=!0,onFail:()=>E.value=!1,params:{...k,company:L.value.companyNo}})}async function ee(){var u;try{await((u=I.value)==null?void 0:u.validate()),V.run(be({idArr:n.value.map(({id:e})=>e),status:d.value.status,remark:d.value.remark}))}catch{}}function ue(){var u;(u=U.value)==null||u.onDisplay()}return(u,e)=>{const B=r("ElButton"),f=r("el-button"),k=r("el-popconfirm"),_=r("el-button-group"),h=r("PageContainer"),F=r("ElOption"),z=r("ElSelect"),T=r("ElFormItem"),te=r("ElInput"),ae=r("ElForm"),le=r("ElDialog"),oe=r("PageAuth"),ne=ve("loading");return v(),De("div",null,[l(oe,{pageName:a,class:"capital-claim"},{default:t(()=>[l(h,{hooks:J,events:K,"search-config":p(q),"content-config":j.value,"get-content-ref":s=>D.value=s,onContentSelectChange:e[1]||(e[1]=s=>n.value=s)},xe({content_header:t(()=>[p(w)("040")&&!p(P)?(v(),y(B,{key:0,onClick:X,type:"primary",size:"small"},{default:t(()=>[C(" \u6279\u91CF\u5BA1\u6279 ")]),_:1})):S("v-if",!0)]),content_action:t(s=>[p(w)("009")&&String(s.status)==="1"?(v(),y(k,{key:0,placement:"top",title:"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u8D44\u91D1\u8BA4\u9886?",onConfirm:()=>G({logNo:s.logNo})},{reference:t(()=>[l(f,{icon:p(Ae)("refresh-right"),type:"primary",link:""},null,8,["icon"])]),_:2},1032,["onConfirm"])):S("v-if",!0)]),search_action:t(()=>[l(_,null,{default:t(()=>[!p(P)&&p(w)("034")?(v(),y(f,{key:0,type:"warning",plain:"",onClick:Q},{default:t(()=>[C(" 1.\u4E0B\u8F7D\u8BA2\u5355\u8BA4\u6B3E\u5BFC\u5165\u6A21\u677F ")]),_:1})):S("v-if",!0),!p(P)&&p(w)("035")?(v(),y(f,{key:1,type:"primary",plain:"",onClick:ue},{default:t(()=>[C(" 2.\u5BFC\u5165\u8BA2\u5355\u8BA4\u6B3E\u6570\u636E(\u6279\u91CF) ")]),_:1})):S("v-if",!0),l(f,{type:"success",plain:"",loading:E.value,onClick:e[0]||(e[0]=()=>Y())},{default:t(()=>[C(" 3.\u5BFC\u51FA\u8D44\u91D1\u8BA4\u9886\u6570\u636E ")]),_:1},8,["loading"])]),_:1})]),_:2},[m.value?{name:"content_title",fn:t(()=>[o("div",Ve,[o("div",Ue,[Oe,o("span",ze,N(m.value.batchTotal),1)]),o("div",qe,[o("div",We,[o("div",Me,[Le,o("span",je,N(m.value.aTotal),1)]),o("div",He,[Ze,o("span",$e,N(m.value.total),1)]),o("div",Ge,[Je,o("span",Ke,N(m.value.wTotal),1)])])])])]),key:"0"}:void 0]),1032,["search-config","content-config","get-content-ref"]),l(we,{ref_key:"capitalModalRef",ref:Z},null,512),l(le,{modelValue:b.value,"onUpdate:modelValue":e[4]||(e[4]=s=>b.value=s),title:"\u6279\u91CF\u5BA1\u6279",center:"",onClose:e[5]||(e[5]=s=>d.value={status:"",remark:""})},{default:t(()=>[ye((v(),y(ae,{model:d.value,rules:p(H),ref_key:"formRef",ref:I},{default:t(()=>[l(T,{prop:"status",label:"\u5BA1\u6838\u72B6\u6001"},{default:t(()=>[l(z,{placeholder:"\u5BA1\u6838\u72B6\u6001",modelValue:d.value.status,"onUpdate:modelValue":e[2]||(e[2]=s=>d.value.status=s),style:{width:"100%"}},{default:t(()=>[l(F,{value:"2",label:"\u901A\u8FC7"}),l(F,{value:"3",label:"\u9A73\u56DE"})]),_:1},8,["modelValue"])]),_:1}),l(T,{prop:"remark",label:"\u5BA1\u6838\u5907\u6CE8"},{default:t(()=>[l(te,{modelValue:d.value.remark,"onUpdate:modelValue":e[3]||(e[3]=s=>d.value.remark=s),placeholder:"\u5BA1\u6838\u5907\u6CE8",type:"textarea"},null,8,["modelValue"])]),_:1}),l(T,null,{default:t(()=>[o("div",Qe,[l(B,{type:"primary",onClick:ee},{default:t(()=>[C(" \u4FDD\u5B58 ")]),_:1})])]),_:1})]),_:1},8,["model","rules"])),[[ne,p(V).loading]])]),_:1},8,["modelValue"])]),_:1}),l(Ee,{ref_key:"execlCapitalUploadRef",ref:U,onOnSuccess:e[6]||(e[6]=s=>D.value.onSearch())},null,512)])}}});var iu=pe(Xe,[["__file","C:/Users/63107/Desktop/mine/settle-vue3/src/views/InvoiceSales/capitalPool/index.vue"]]);export{iu as default};