import{ae as Y,_ as I,d as L,n as M,w as g,aL as W,b3 as j,r as p,o as c,G as d,C as a,l as v,u as o,M as N,a as B,J as k,aY as F}from"./index.1d1a5ecb.js";import{u as y,w as H}from"./xlsx.ed122d16.js";import{e as U,f as V,h as $}from"./index.3b07317f.js";import{a as q,r as w}from"./columnRenderHelper.0fb69d06.js";import{y as b}from"./status.d6b2a53d.js";import{u as G}from"./use-page-search.f4c305e2.js";import{h as z}from"./export.07022066.js";const J={\u5356\u65B9\u516C\u53F8\u7F16\u7801:"",\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(\u7535\u5B50\u7968\u5FC5\u586B,\u5168\u7535\u7968\u4E0D\u9700\u8981)":""},K=[{type:"selection",width:40,align:"center"},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:s})=>!s.includes("\u5E8F\u53F7\u5217")},{label:"\u5BF9\u8D26\u7F16\u7801",prop:"payNo",width:150,align:"left"},{label:"\u603B\u989D\u6B3E",prop:"total_fee",width:110,align:"total_fee"},{label:"\u72B6\u6001",prop:"status",width:140,...q(b)},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",minWidth:180,align:"left",...w("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyNo",minWidth:180,align:"left",...w("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8:")},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:70,align:"left"},{label:"\u7533\u8BF7\u65F6\u95F4",width:140,prop:"addtime",formatter:({addtime:s})=>Y(s).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],Q={title:"\u8BA2\u5355\u5BF9\u8D26",columns:K,deleteProp:"payNo",apis:{httpList:U,httpDelete:V,httpAdd:!0},companyProp:"supplierNo",superUserNoAction:!0,listNoRelation:!0,showDelete:({status:s})=>!1},A={formItems:[{field:"timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"startTime",endProp:"endTime",startPlaceholder:"\u5F00\u59CB\u65E5\u671F",endPlaceholder:"\u7ED3\u675F\u65E5\u671F"}},{field:"companyNo",type:"business-query"},{field:"status",type:"select",placeholder:"\u5BA1\u6838\u72B6\u6001",options:b},{field:"group",type_field:"group_type",type:"input_group",otherOptions:{inputGroupOptions:[{value:"payNo",label:"\u5BF9\u8D26\u7F16\u7801"}]}}]},X=L({__name:"index",setup(s){const C="supplyOrderRecord",_="/supply/supplyOrderRecordDetail",{push:D}=M(),n=g([]),l=g(!1),{hasPermissionWithCode:f}=W(C),x={pageSearchHook:()=>G(void 0,void 0,A)},P={content:{preview:({payNo:u})=>D(`${_}?id=${u}`),create:()=>D(_)}},E=g(null),{run:S}=j({success:()=>E.value.onSearch()});function R(){if(n.value.length===0){F.error("\u81F3\u5C11\u52FE\u9009\u4E00\u6761\u5BF9\u8D26\u5355");return}const u=[];for(const{status:m,payNo:i,supplierNo:h}of n.value)if(String(m)!=="2"){F.error(`\u5BF9\u8D26\u5355 ${i},\u672A\u901A\u8FC7\u5BA1\u6838`);return}else u.push({...J,\u5356\u65B9\u516C\u53F8\u7F16\u7801:h,\u5BF9\u8D26\u7F16\u7801:i});const e=y.book_new(),r=y.json_to_sheet(u);y.book_append_sheet(e,r,"sheet"),H(e,"\u6279\u91CF\u5F00\u7968\u7533\u8BF7\u6A21\u677F.xlsx",{bookType:"xlsx"})}async function T(){if(n.value.length===0){F.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}if(n.value.length>1){F.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}await z({url:"paycgdexport",name:"\u5BF9\u8D26\u5355\u660E\u7EC6\u8868",onStart:()=>l.value=!0,onSuccess:()=>l.value=!1,onFail:()=>l.value=!1,params:{payNo:n.value[0].payNo}})}const O=u=>{S($({payNo:u,status:"4"}))};return(u,e)=>{const r=p("ElButton"),m=p("ElTooltip"),i=p("PageContainer"),h=p("PageAuth");return c(),d(h,{pageName:C},{default:a(()=>[v(i,{hooks:x,events:P,contentConfig:o(Q),"search-config":o(A),"get-content-ref":t=>E.value=t,onContentSelectChange:e[2]||(e[2]=t=>n.value=t)},{content_header:a(()=>[o(f)("038")?(c(),d(r,{key:0,type:"small",loading:l.value,onClick:e[0]||(e[0]=()=>T())},{default:a(()=>[N(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")]),_:1},8,["loading"])):B("v-if",!0),o(f)("031")?(c(),d(r,{key:1,size:"small",icon:o(k)("arrow-down-line"),onClick:e[1]||(e[1]=()=>R())},{default:a(()=>[N("\u4E0B\u8F7D\u6279\u91CF\u5F00\u7968\u6A21\u677F")]),_:1},8,["icon"])):B("v-if",!0)]),content_action:a(t=>[v(m,{placement:"top",content:"\u64A4\u9500\u5BF9\u8D26\u7533\u8BF7"},{default:a(()=>[(String(t.status)==="1"||String(t.status)==="2")&&o(f)("006")?(c(),d(r,{key:0,type:"primary",link:"",text:"",icon:o(k)("refresh-right"),onClick:()=>O(t.payNo)},null,8,["icon","onClick"])):B("v-if",!0)]),_:2},1024)]),_:1},8,["contentConfig","search-config","get-content-ref"])]),_:1})}}});var se=I(X,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/supply/orderRecord/index.vue"]]);export{se as default};
