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