import{dS as y,dT as V,cA as _,_ as j,d as q,n as f,k as z,ab as H,c9 as U,cB as $,r as p,o as l,A as c,y as a,h as A,i as o,H as v,a as B,D as x,cC as M,cm as d,dX as W}from"./index.js";import{s as N}from"./constants.59c8f8ef.js";import{e as X}from"./index.f78c594b.js";import{u as h,w as G}from"./xlsx.ed122d16.js";import{h as J}from"./export.97c4d705.js";const K=[{type:"selection",width:40,align:"center"},{prop:"payNo","min-width":"150px",label:"\u5BF9\u8D26\u7F16\u53F7"},{prop:"total_fee","min-width":"100px",label:"\u5BF9\u8D26\u603B\u91D1\u989D"},{"min-width":"140px",label:"\u72B6\u6001",...y(N)},{"min-width":"80px",label:"\u4F9B\u5E94\u5546\u7AEF",...y(V,"has_account")},{prop:"supplierName","min-width":"150px",label:"\u7269\u6D41\u4F9B\u5E94\u5546",..._("supplierNo","supplierName","\u7269\u6D41\u4F9B\u5E94\u5546\u7F16\u53F7:")},{label:"\u4E1A\u52A1\u516C\u53F8","min-width":"150px",..._("companyNo","companyName","\u4E1A\u52A1\u516C\u53F8\u7F16\u53F7:")},{prop:"apply_name",label:"\u521B\u5EFA\u4EBA","min-width":"80px"},{prop:"addtime",label:"\u7533\u8BF7\u65F6\u95F4","min-width":"120px"},{label:"\u64CD\u4F5C","min-width":"100px",fixed:"right",slot:"operation"}],Q={columns:K,companyProp:"supplierNo",apis:{httpList:(C={})=>X({...C,pay_type:"2"}),httpAdd:!0}},k={formItems:[{field:"create_time",type:"date_picker",otherOptions:{type:"daterange",startProp:"create_start",endProp:"create_end",startPlaceholder:"\u521B\u5EFA\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u521B\u5EFA\u7ED3\u675F\u65F6\u95F4"}},{field:"companyNo",type:"business-query",placeholder:"\u4E1A\u52A1\u516C\u53F8"},{field:"status",type:"select",placeholder:"\u72B6\u6001",options:N},{type:"input",field:"payNo",placeholder:"\u5BF9\u8D26\u7F16\u53F7"}]},Y={\u4E70\u65B9\u516C\u53F8\u7F16\u7801:"",\u4E70\u65B9\u516C\u53F8\u540D\u79F0:"",\u5356\u65B9\u516C\u53F8\u7F16\u7801:"",\u5356\u65B9\u516C\u53F8\u540D\u79F0:"",\u5BF9\u8D26\u7F16\u7801:"",\u53D1\u7968\u7C7B\u578B:"",\u53D1\u7968\u4EE3\u7801:"",\u53D1\u7968\u53F7\u7801:"",\u53D1\u7968\u7A0E\u524D\u91D1\u989D:"",\u5F00\u7968\u65E5\u671F:"",\u6821\u9A8C\u7801:""},Z="supSendOrderRecord",uu=q({__name:"index",setup(C){const D=f(null),{push:E}=z(),n=f([]),{isSuperUser:w}=H(),{hasPermissionWithCode:g}=U("supSendOrderRecord"),S={content:{preview:t=>E(`/supplierOrder/supSendOrderRecordDetail?id=${t.payNo}`),create:()=>E("/supplierOrder/supSendOrderRecordDetail")}},b={pageSearchHook:()=>M(void 0,void 0,k)},{run:P}=$({success:()=>D.value.onSearch()});function O(){if(n.value.length===0){d.error("\u81F3\u5C11\u52FE\u9009\u4E00\u6761\u5BF9\u8D26\u5355");return}const t=[];for(const{status:F,payNo:i,supplierNo:m,supplierName:e,companyNo:I,companyName:L}of n.value)if(String(F)!=="2"){d.error(`\u5BF9\u8D26\u5355 ${i},\u672A\u901A\u8FC7\u5BA1\u6838`);return}else t.push({...Y,\u5BF9\u8D26\u7F16\u53F7:i,\u4E70\u65B9\u516C\u53F8\u7F16\u7801:I,\u5356\u65B9\u516C\u53F8\u7F16\u7801:m,\u4E70\u65B9\u516C\u53F8\u540D\u79F0:L,\u5356\u65B9\u516C\u53F8\u540D\u79F0:e});const u=h.book_new(),s=h.json_to_sheet(t);h.book_append_sheet(u,s,"sheet"),G(u,"\u6279\u91CF\u7533\u8BF7\u5F00\u7968\u6A21\u677F.xlsx",{bookType:"xlsx"})}const r=f(!1);async function R(){if(n.value.length===0){d.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}if(n.value.length>1){d.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}await J({url:"paytrackxport",name:"\u5BF9\u8D26\u5355\u660E\u7EC6\u8868",onStart:()=>r.value=!0,onSuccess:()=>r.value=!1,onFail:()=>r.value=!1,params:{payNo:n.value[0].payNo}})}const T=t=>{P(W({payNo:t,status:"4"}))};return(t,u)=>{const s=p("ElButton"),F=p("ElTooltip"),i=p("PageContainer"),m=p("PageAuth");return l(),c(m,{pageName:Z},{default:a(()=>[A(i,{onContentSelectChange:u[2]||(u[2]=e=>n.value=e),hooks:b,events:S,"content-config":o(Q),searchConfig:o(k),"get-content-ref":e=>D.value=e},{content_header:a(()=>[o(g)("038")?(l(),c(s,{key:0,loading:r.value,onClick:u[0]||(u[0]=()=>R()),size:"small"},{default:a(()=>u[3]||(u[3]=[v(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")])),_:1},8,["loading"])):B("v-if",!0),o(g)("031")?(l(),c(s,{key:1,size:"small",icon:o(x)("arrow-down-line"),onClick:u[1]||(u[1]=()=>O())},{default:a(()=>u[4]||(u[4]=[v(" \u6279\u91CF\u4E0B\u8F7D\u5F00\u7968\u6A21\u677F ")])),_:1},8,["icon"])):B("v-if",!0)]),content_action:a(e=>[A(F,{placement:"top",content:"\u64A4\u9500\u5BF9\u8D26\u7533\u8BF7"},{default:a(()=>[(String(e.status)==="1"||String(e.status)==="2")&&String(e.is_comon)==="0"&&!o(w)&&String(e.has_account)==="1"?(l(),c(s,{key:0,type:"primary",link:"",text:"",icon:o(x)("refresh-right"),onClick:()=>T(e.payNo)},null,8,["icon","onClick"])):B("v-if",!0)]),_:2},1024)]),_:1},8,["content-config","searchConfig","get-content-ref"])]),_:1})}}});var su=j(uu,[["__file","D:/work/jiesuan/settle-vue3/src/views/supplierOrder/sendOrderRecord/index.vue"]]);export{su as default};
