import{dS as _,dT as U,cA as y,_ as V,d as j,n as B,k as q,ab as z,c9 as H,cB as $,r as p,o as l,A as c,y as a,h as x,i as t,H as A,a as h,D as v,dx as M,cC as W,cm as d}from"./index.js";import{s as w}from"./constants.42afb0d7.js";import{e as G}from"./index.f78c594b.js";import{u as C,w as J}from"./xlsx.ed122d16.js";import{h as K}from"./export.97c4d705.js";const Q=[{type:"selection",width:40,align:"center",fixed:"left"},{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",..._(w)},{"min-width":"80px",label:"\u4F9B\u5E94\u5546\u7AEF",..._(U,"has_account")},{prop:"supplierName","min-width":"150px",label:"\u7269\u6D41\u4F9B\u5E94\u5546",...y("supplierNo","supplierName","\u7269\u6D41\u4F9B\u5E94\u5546\u7F16\u53F7:")},{label:"\u4E1A\u52A1\u516C\u53F8","min-width":"150px",...y("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"}],X={columns:Q,superUserNoAction:!0,apis:{httpList:(D={})=>G({...D,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:"post_supplier_code",type:"supplier-query",placeholder:"\u7269\u6D41\u4F9B\u5E94\u5546\u516C\u53F8"},{field:"status",type:"select",placeholder:"\u72B6\u6001",options:w},{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="sendOrderRecord",uu=j({__name:"index",setup(D){const E=B(null),{push:g}=q(),n=B([]),{isSuperUser:N}=z(),{hasPermissionWithCode:F}=H("sendOrderRecord"),S={content:{preview:o=>g(`/postSupplierOrder/sendOrderRecordDetail?id=${o.payNo}`),create:()=>g("/postSupplierOrder/sendOrderRecordDetail")}},b=o=>{P(M({payNo:o,status:"4"}))},{run:P}=$({success:()=>E.value.onSearch()}),O={pageSearchHook:()=>W(void 0,void 0,k)};function R(){if(n.value.length===0){d.error("\u81F3\u5C11\u52FE\u9009\u4E00\u6761\u5BF9\u8D26\u5355");return}const o=[];for(const{status:m,payNo:i,supplierNo:f,supplierName:e,companyNo:I,companyName:L}of n.value)if(String(m)!=="2"){d.error(`\u5BF9\u8D26\u5355 ${i},\u672A\u901A\u8FC7\u5BA1\u6838`);return}else o.push({...Y,\u5BF9\u8D26\u7F16\u53F7:i,\u4E70\u65B9\u516C\u53F8\u7F16\u7801:I,\u5356\u65B9\u516C\u53F8\u7F16\u7801:f,\u4E70\u65B9\u516C\u53F8\u540D\u79F0:L,\u5356\u65B9\u516C\u53F8\u540D\u79F0:e});const u=C.book_new(),s=C.json_to_sheet(o);C.book_append_sheet(u,s,"sheet"),J(u,"\u6279\u91CF\u7533\u8BF7\u5F00\u7968\u6A21\u677F.xlsx",{bookType:"xlsx"})}const r=B(!1);async function T(){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 K({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}})}return(o,u)=>{const s=p("ElButton"),m=p("ElTooltip"),i=p("PageContainer"),f=p("PageAuth");return l(),c(f,{pageName:Z},{default:a(()=>[x(i,{onContentSelectChange:u[2]||(u[2]=e=>n.value=e),hooks:O,events:S,"content-config":t(X),searchConfig:t(k),"get-content-ref":e=>E.value=e},{content_header:a(()=>[t(F)("038")?(l(),c(s,{key:0,loading:r.value,onClick:u[0]||(u[0]=()=>T()),size:"small"},{default:a(()=>u[3]||(u[3]=[A(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")])),_:1},8,["loading"])):h("v-if",!0),t(F)("031")?(l(),c(s,{key:1,size:"small",icon:t(v)("arrow-down-line"),onClick:u[1]||(u[1]=()=>R())},{default:a(()=>u[4]||(u[4]=[A(" \u6279\u91CF\u4E0B\u8F7D\u5F00\u7968\u6A21\u677F ")])),_:1},8,["icon"])):h("v-if",!0)]),content_action:a(e=>[x(m,{placement:"top",content:"\u64A4\u9500\u5BF9\u8D26\u7533\u8BF7"},{default:a(()=>[(String(e.status)==="1"||String(e.status)==="2")&&t(F)("006")&&String(e.is_comon)==="0"&&!t(N)?(l(),c(s,{key:0,type:"primary",link:"",text:"",icon:t(v)("refresh-right"),onClick:()=>b(e.payNo)},null,8,["icon","onClick"])):h("v-if",!0)]),_:2},1024)]),_:1},8,["content-config","searchConfig","get-content-ref"])]),_:1})}}});var su=V(uu,[["__file","D:/work/jiesuan/settle-vue3/src/views/postSupplierOrder/sendOrderRecord/index.vue"]]);export{su as default};
