import{al as b,aS as P,ae as j,aT as L,_ as Y,d as z,w as g,aL as O,n as V,ah as G,r as H,o as d,c as W,l as c,C as i,b as q,u as o,bt as J,bu as $,G as F,J as E,M as _,a as B,by as K,aY as Q}from"./index.42bf163d.js";import{u as X}from"./use-page-search.d97bdd00.js";import{a as x}from"./configs.c73f4dd4.js";import{h as Z}from"./index.eb3ec781.js";import{r as y}from"./columnRenderHelper.3490fdb2.js";import uu from"./index.e353158e.js";import eu from"./index.26536c74.js";import{p as ou,t as au}from"./xls-template.d4b70796.js";import{u as D,w as tu}from"./xlsx.ed122d16.js";import"./tootip.bb80052f.js";import"./execl-upload.e1817bbd.js";import"./index.a3e78a40.js";const A={formItems:[{field:"group",type_field:"group_type",type:"input_group",otherOptions:{inputGroupOptions:[{value:"spuCode",label:"\u5546\u54C1\u7F16\u7801"},{value:"good_name",label:"\u5546\u54C1\u540D\u79F0"},{value:"supplierNo",label:"\u5356\u65B9\u516C\u53F8\u7F16\u7801"},{value:"creater",label:"\u521B\u5EFA\u4EBA"}]}},{field:"status",type:"select",placeholder:"\u72B6\u6001",options:x}]};function nu(t){const n=t.split(",");return b(L,{src:n[0],previewTeleported:!0,previewSrcList:[n[0]],style:{height:"20px",width:"20px"}})}const su=[{type:"selection",width:40,align:"center"},{label:"\u5546\u54C1\u7F16\u7801",prop:"spuCode",width:150},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",width:175,...y("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:195,...y("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name",minWidth:195},{label:"\u4E3B\u56FE",prop:"good_img",width:55,cellRenderer:({row:t})=>nu(t.good_img)},{label:"\u91C7\u8D2D\u7C7B\u76EE\u7F16\u7801",width:155,prop:"cgd_inv_cat_code"},{label:"\u91C7\u8D2D\u7C7B\u76EE\u540D\u79F0",width:120,prop:"cgd_inv_cat_name"},{label:"\u91C7\u8D2D\u5F00\u7968\u5546\u54C1\u540D\u79F0",prop:"cgd_inv_good_name",width:165},{label:"\u8D22\u52A1\u7C7B\u76EE\u7F16\u7801",width:155,prop:"inv_cat_code"},{label:"\u8D22\u52A1\u7C7B\u76EE\u540D\u79F0",width:120,prop:"inv_cat_name"},{label:"\u8D22\u52A1\u5F00\u7968\u5546\u54C1\u540D\u79F0",prop:"inv_good_name",width:165},{label:"\u72B6\u6001",prop:"status",width:150,cellRenderer:({row:t})=>b(P,{type:t.status==="2"?"success":""},{default:()=>{var n;return(n=x.find(C=>C.value===String(t.status)))==null?void 0:n.label}})},{label:"\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9",prop:"addTax",width:"140px"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:140,formatter:({addtime:t})=>j(t).format("YYYY-MM-DD HH:mm:ss")},{label:"\u521B\u5EFA\u4EBA",width:80,prop:"creater"},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],lu={title:"\u9500\u552E\u6210\u672C\u7C7B\u76EE\u8BBE\u7F6E",superUserNoPerview:!0,columns:su,apis:{httpList:Z}};const ru={class:"main role"},iu={"w-full":""},pu=z({__name:"index",setup(t){const n=g(null),C=g(null),{permissions:k,hasPermissionWithCode:p}=O("consultingCost"),m=g([]),{pageContentRef:f,handleResetClick:N,handleSearchClick:S}=X(void 0,void 0,A),{push:R}=V(),{isSuperUser:v}=G();function T(s){R({path:"/InvoiceSaleSettings/consultingCostDetail",query:{id:s}})}const I={1:"\u514D\u7A0E",2:"\u4E0D\u5F81\u7A0E",3:"\u96F6\u7A0E\u7387"},M={1:"\u662F",0:"\u5426"};function w(s=!1){if(m.value.length===0){Q.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5546\u54C1");return}const a=s?ou:au,l=s?"\u91C7\u8D2D\u6279\u91CF\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F":"\u8D22\u52A1\u6279\u91CF\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F",r=[];m.value.forEach(u=>{const e={...a};s?(e.\u5546\u54C1\u7F16\u7801=u.spuCode,e.\u5546\u54C1\u540D\u79F0=u.good_name,e.\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801=u.companyNo,e.\u4E70\u5165\u65B9\u516C\u53F8\u540D\u79F0=u.companyName,e.\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801=u.supplierNo,e.\u5356\u51FA\u65B9\u516C\u53F8\u540D\u79F0=u.supplierName,e.\u5F00\u7968\u5546\u54C1\u540D\u79F0=u.cgd_inv_good_name):(e.\u5546\u54C1\u7F16\u7801=u.spuCode,e.\u5546\u54C1\u540D\u79F0=u.good_name,e.\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801=u.companyNo,e.\u4E70\u5165\u65B9\u516C\u53F8\u540D\u79F0=u.companyName,e.\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801=u.supplierNo,e.\u5356\u51FA\u65B9\u516C\u53F8\u540D\u79F0=u.supplierName,e.\u91C7\u8D2D\u7C7B\u76EE\u7F16\u7801=u.cgd_inv_cat_code,e.\u91C7\u8D2D\u5F00\u7968\u5546\u54C1\u540D\u79F0=u.cgd_inv_good_name,e.\u91C7\u8D2D\u7A0E\u7387=u.cgd_inv_tax?(u.cgd_inv_tax.split("%")[0]/100).toFixed(2):"",e.\u8D22\u52A1\u7C7B\u76EE\u7F16\u7801=u.inv_cat_code,e.\u8D22\u52A1\u5F00\u7968\u5546\u54C1\u540D\u79F0=u.inv_good_name,e.\u8D22\u52A1\u7A0E\u7387=u.inv_tax?(u.inv_tax.split("%")[0]/100).toFixed(2):"",e.\u7A0E\u7387\u6807\u8BC6=u.inv_tag&&u.inv_tag!=="0"?I[u.inv_tag]:"",e.\u662F\u5426\u6709\u4F18\u60E0\u653F\u7B56=Number(u.status)>=2?M[u.is_discount]:"",e.\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9=u.addTax),r.push(e)});const h=D.book_new(),U=D.json_to_sheet(r);D.book_append_sheet(h,U,"sheet"),tu(h,`${l}.xlsx`,{bookType:"xlsx"})}return(s,a)=>{const l=H("ElButton");return d(),W("div",ru,[c(K,{"is-show":o(p)("001")},{default:i(()=>[q("div",iu,[c(o(J),{"form-config":o(A),onSearchBtnClick:o(S),onResetBtnClick:o(N)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),c(o($),{ref_key:"pageContentRef",ref:f,powers:o(k),"content-config":o(lu),onPreviewBtnClick:a[4]||(a[4]=({spuCode:r})=>T(r)),onSelectionChange:a[5]||(a[5]=r=>m.value=r)},{header:i(()=>[o(p)("041")?(d(),F(l,{key:0,size:"small",icon:o(E)("arrow-down-line"),onClick:a[0]||(a[0]=()=>w(!0))},{default:i(()=>[_("\u4E0B\u8F7D\u91C7\u8D2D\u6279\u91CF\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):B("v-if",!0),o(p)("042")&&!o(v)?(d(),F(l,{key:1,size:"small",type:"primary",icon:o(E)("arrow-up-line"),onClick:a[1]||(a[1]=()=>C.value.onDisplay())},{default:i(()=>[_("\u6279\u91CF\u5BFC\u5165\u91C7\u8D2D\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C")]),_:1},8,["icon"])):B("v-if",!0),o(p)("036")?(d(),F(l,{key:2,size:"small",icon:o(E)("arrow-down-line"),onClick:a[2]||(a[2]=()=>w())},{default:i(()=>[_("\u4E0B\u8F7D\u6279\u91CF\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):B("v-if",!0),o(p)("037")&&!o(v)?(d(),F(l,{key:3,size:"small",type:"primary",icon:o(E)("arrow-up-line"),onClick:a[3]||(a[3]=()=>n.value.onDisplay())},{default:i(()=>[_("\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C")]),_:1},8,["icon"])):B("v-if",!0)]),_:1},8,["powers","content-config"]),c(uu,{ref_key:"execlUploadModalRef",ref:n,onOnSuccess:a[6]||(a[6]=()=>o(f).onSearch())},null,512),c(eu,{ref_key:"procureUploadModalRef",ref:C,onOnSuccess:a[7]||(a[7]=()=>o(f).onSearch())},null,512)])]),_:1},8,["is-show"])])}}});var wu=Y(pu,[["__scopeId","data-v-e8348bd0"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSaleSettings/consultingCost/index.vue"]]);export{wu as default};