1 |
- import{al as v,aO as R,ae as P,aP as I,_ as M,d as T,w as B,bs as U,n as L,ah as O,r as V,o as m,c as Y,l,C as r,b as j,u as e,bt as G,bu as z,G as _,J as E,M as F,a as h,by as H,aW as W}from"./index.3f1ca816.js";import{u as q}from"./use-page-search.fa6a742a.js";import{a as b}from"./configs.8dac211e.js";import{c as J}from"./index.ef4412b8.js";import{r as g}from"./columnRenderHelper.c7097252.js";import K from"./index.9445c9d9.js";import{t as Q}from"./xls-template.d023294d.js";import{u as f,w as X}from"./xlsx.ed122d16.js";import"./tootip.1805b3e1.js";import"./verification.611d3025.js";import"./execl-upload.23e3fe1e.js";const w={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:"\u5173\u8054\u72B6\u6001",options:b}]};function Z(o){const t=o.split(",");return v(I,{src:t[0],previewTeleported:!0,previewSrcList:[t[0]],style:{height:"20px",width:"20px"}})}const $=[{type:"selection",width:40,align:"center",fixed:"left"},{label:"\u5546\u54C1\u7F16\u7801",prop:"spuCode",width:150},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierName",width:175,...g("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:195,...g("companyNo","companyName","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name",width:195},{label:"\u4E3B\u56FE",prop:"good_img",width:55,cellRenderer:({row:o})=>Z(o.good_img)},{label:"\u7C7B\u76EE\u540D\u79F0",width:120,prop:"inv_cat_name"},{label:"\u5F00\u7968\u5546\u54C1\u540D\u79F0",prop:"inv_good_name",width:165},{label:"\u72B6\u6001",prop:"status",width:85,cellRenderer:({row:o})=>v(R,null,{default:()=>{var t;return(t=b.find(i=>i.value===String(o.status)))==null?void 0:t.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:o})=>P(o).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],ee={title:"\u9500\u552E\u6210\u672C\u7C7B\u76EE\u8BBE\u7F6E",superUserNoPerview:!0,columns:$,apis:{httpList:J}};const ue={class:"main role"},oe={"w-full":""},te=T({__name:"index",setup(o){const t=B(null),{permissions:i,hasPermissionWithCode:p}=U("commodityCost"),c=B([]),{pageContentRef:C,handleResetClick:y,handleSearchClick:k}=q(void 0,void 0,w),{push:x}=L(),{isSuperUser:S}=O();function D(a){x({path:"/InvoiceSaleSettings/commodityCostDetail",query:{id:a}})}function A(){if(c.value.length===0){W.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5546\u54C1");return}const a=[];c.value.forEach(({spuCode:s,good_name:N})=>{const d={...Q};d.\u5546\u54C1\u7F16\u7801=s,d.\u5F00\u7968\u5546\u54C1\u540D\u79F0=N,a.push(d)});const u=f.book_new(),n=f.json_to_sheet(a);f.book_append_sheet(u,n,"sheet"),X(u,"\u6279\u91CF\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F.xlsx",{bookType:"xlsx"})}return(a,u)=>{const n=V("ElButton");return m(),Y("div",ue,[l(H,{"is-show":e(p)("001")},{default:r(()=>[j("div",oe,[l(e(G),{"form-config":e(w),onSearchBtnClick:e(k),onResetBtnClick:e(y)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),l(e(z),{ref_key:"pageContentRef",ref:C,powers:e(i),"content-config":e(ee),onPreviewBtnClick:u[2]||(u[2]=({spuCode:s})=>D(s)),onSelectionChange:u[3]||(u[3]=s=>c.value=s)},{header:r(()=>[e(p)("036")?(m(),_(n,{key:0,size:"small",icon:e(E)("arrow-down-line"),onClick:u[0]||(u[0]=()=>A())},{default:r(()=>[F("\u4E0B\u8F7D\u6279\u91CF\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):h("v-if",!0),e(p)("037")&&!e(S)?(m(),_(n,{key:1,size:"small",icon:e(E)("arrow-up-line"),onClick:u[1]||(u[1]=()=>t.value.onDisplay())},{default:r(()=>[F("\u6279\u91CF\u5BFC\u5165\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C")]),_:1},8,["icon"])):h("v-if",!0)]),_:1},8,["powers","content-config"]),l(K,{ref_key:"execlUploadModalRef",ref:t,onOnSuccess:u[4]||(u[4]=()=>e(C).onSearch())},null,512)])]),_:1},8,["is-show"])])}}});var Ce=M(te,[["__scopeId","data-v-0fa4429b"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSaleSettings/commodityCost/index.vue"]]);export{Ce as default};
|