import{cs as g,bb as y,ct as M,_ as V,d as j,x as h,p as q,ai as z,aM as $,bc as G,r as p,o as l,G as c,D as a,l as x,m as t,M as v,a as B,J as A,c8 as H,bd as J,aZ as d}from"./index.js";import{s as w}from"./constants.42afb0d7.js";import{e as W}from"./index.a7de6b05.js";import{u as C,w as Z}from"./xlsx.ed122d16.js";import{h as K}from"./export.cd930632.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",...g(w)},{"min-width":"80px",label:"\u4F9B\u5E94\u5546\u7AEF",...g(M,"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={})=>W({...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:""},uu=j({__name:"index",setup(D){const N="sendOrderRecord",_=h(null),{push:E}=q(),n=h([]),{isSuperUser:b}=z(),{hasPermissionWithCode:F}=$("sendOrderRecord"),S={content:{preview:o=>E(`/postSupplierOrder/sendOrderRecordDetail?id=${o.payNo}`),create:()=>E("/postSupplierOrder/sendOrderRecordDetail")}},P=o=>{O(H({payNo:o,status:"4"}))},{run:O}=G({success:()=>_.value.onSearch()}),R={pageSearchHook:()=>J(void 0,void 0,k)};function I(){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:u,companyNo:L,companyName:U}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:L,\u5356\u65B9\u516C\u53F8\u7F16\u7801:f,\u4E70\u65B9\u516C\u53F8\u540D\u79F0:U,\u5356\u65B9\u516C\u53F8\u540D\u79F0:u});const e=C.book_new(),s=C.json_to_sheet(o);C.book_append_sheet(e,s,"sheet"),Z(e,"\u6279\u91CF\u7533\u8BF7\u5F00\u7968\u6A21\u677F.xlsx",{bookType:"xlsx"})}const r=h(!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,e)=>{const s=p("ElButton"),m=p("ElTooltip"),i=p("PageContainer"),f=p("PageAuth");return l(),c(f,{pageName:N},{default:a(()=>[x(i,{onContentSelectChange:e[2]||(e[2]=u=>n.value=u),hooks:R,events:S,"content-config":t(X),searchConfig:t(k),"get-content-ref":u=>_.value=u},{content_header:a(()=>[t(F)("038")?(l(),c(s,{key:0,loading:r.value,onClick:e[0]||(e[0]=()=>T()),size:"small"},{default:a(()=>[v(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")]),_:1},8,["loading"])):B("v-if",!0),t(F)("031")?(l(),c(s,{key:1,size:"small",icon:t(A)("arrow-down-line"),onClick:e[1]||(e[1]=()=>I())},{default:a(()=>[v(" \u6279\u91CF\u4E0B\u8F7D\u5F00\u7968\u6A21\u677F ")]),_:1},8,["icon"])):B("v-if",!0)]),content_action:a(u=>[x(m,{placement:"top",content:"\u64A4\u9500\u5BF9\u8D26\u7533\u8BF7"},{default:a(()=>[(String(u.status)==="1"||String(u.status)==="2")&&t(F)("006")&&String(u.is_comon)==="0"&&!t(b)?(l(),c(s,{key:0,type:"primary",link:"",text:"",icon:t(A)("refresh-right"),onClick:()=>P(u.payNo)},null,8,["icon","onClick"])):B("v-if",!0)]),_:2},1024)]),_:1},8,["content-config","searchConfig","get-content-ref"])]),_:1})}}});var su=V(uu,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/postSupplierOrder/sendOrderRecord/index.vue"]]);export{su as default};
