index.4afe8f67.js 4.2 KB

1
  1. import{a8 as P,d as k,m as x,v as y,aX as S,r as c,o as F,E as m,B as s,j as R,u as a,M as C,L as E,I as O,aQ as i}from"./index.b2b87cd1.js";import{u as f,w as T}from"./xlsx.ed122d16.js";import{e as I,f as M}from"./index.20e50fbb.js";import{r as W}from"./columnRenderHelper.75250d33.js";import{y as w}from"./status.7cff7b18.js";import{u as Y}from"./use-page-search.33590006.js";import{h as j}from"./export.90180929.js";const H={\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)":""},V=[{type:"selection",width:40,align:"center"},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:e})=>!e.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,...W(w)},{label:"\u5356\u65B9\u516C\u53F8\u7F16\u7801",prop:"supplierNo",width:150,align:"left"},{label:"\u5356\u65B9\u516C\u53F8\u540D\u79F0",prop:"supplierName",minWidth:180,align:"left"},{label:"\u4E70\u65B9\u516C\u53F8\u7F16\u7801",prop:"companyNo",width:150,align:"left"},{label:"\u4E70\u65B9\u516C\u53F8\u540D\u79F0",prop:"companyName",minWidth:180,align:"left"},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:70,align:"left"},{label:"\u7533\u8BF7\u65F6\u95F4",width:140,prop:"addtime",formatter:({addtime:e})=>P(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],$={title:"\u8BA2\u5355\u5BF9\u8D26",columns:V,deleteProp:"payNo",apis:{httpList:I,httpDelete:M,httpAdd:!0},companyProp:"supplierNo",superUserNoAction:!0,delTooltip:"\u662F\u5426\u64A4\u56DE\u8BA2\u5355\u5BF9\u8D26\u7533\u8BF7?",listNoRelation:!0,showDelete:({status:e})=>Number(e)!==3},_={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:w},{field:"group",type_field:"group_type",type:"input_group",otherOptions:{inputGroupOptions:[{value:"payNo",label:"\u5BF9\u8D26\u7F16\u7801"}]}}]},J=k({__name:"index",setup(e){const B="supplyOrderRecord",h="/supply/supplyOrderRecordDetail",{push:g}=x(),t=y([]),n=y(!1),{hasPermissionWithCode:D}=S(B),N={pageSearchHook:()=>Y(void 0,void 0,_)},b={content:{preview:({payNo:o})=>g(`${h}?id=${o}`),create:()=>g(h)}};function A(){if(t.value.length===0){i.error("\u81F3\u5C11\u52FE\u9009\u4E00\u6761\u5BF9\u8D26\u5355");return}const o=[];for(const{status:p,payNo:l,supplierNo:d}of t.value)if(String(p)!=="2"){i.error(`\u5BF9\u8D26\u5355 ${l},\u672A\u901A\u8FC7\u5BA1\u6838`);return}else o.push({...H,\u5356\u65B9\u516C\u53F8\u7F16\u7801:d,\u5BF9\u8D26\u7F16\u7801:l});const u=f.book_new(),r=f.json_to_sheet(o);f.book_append_sheet(u,r,"sheet"),T(u,"\u6279\u91CF\u5F00\u7968\u7533\u8BF7\u6A21\u677F.xlsx",{bookType:"xlsx"})}async function v(){if(t.value.length===0){i.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}if(t.value.length>1){i.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u5BF9\u8D26\u5355");return}await j({url:"paycgdexport",name:"\u5BF9\u8D26\u5355\u660E\u7EC6\u8868",onStart:()=>n.value=!0,onSuccess:()=>n.value=!1,onFail:()=>n.value=!1,params:{payNo:t.value[0].payNo}})}return(o,u)=>{const r=c("ElButton"),p=c("PageContainer"),l=c("PageAuth");return F(),m(l,{pageName:B},{default:s(()=>[R(p,{hooks:N,events:b,contentConfig:a($),"search-config":a(_),onContentSelectChange:u[2]||(u[2]=d=>t.value=d)},{content_header:s(()=>[a(D)("038")?(F(),m(r,{key:0,type:"small",loading:n.value,onClick:u[0]||(u[0]=()=>v())},{default:s(()=>[C(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")]),_:1},8,["loading"])):E("",!0),a(D)("031")?(F(),m(r,{key:1,size:"small",icon:a(O)("arrow-down-line"),onClick:u[1]||(u[1]=()=>A())},{default:s(()=>[C("\u4E0B\u8F7D\u6279\u91CF\u5F00\u7968\u6A21\u677F")]),_:1},8,["icon"])):E("",!0)]),_:1},8,["contentConfig","search-config"])]),_:1})}}});export{J as default};