index.96bb6dbf.js 7.8 KB

1
  1. import{al as N,aS as Y,ae as A,aT as j,_ as V,d as q,w as D,aL as G,n as H,ah as W,r as J,o as d,c as Z,l as c,C as i,b as $,u as a,bt as K,bu as Q,G as F,J as g,M as C,a as E,by as X,aY as h}from"./index.88f7d256.js";import{u as uu}from"./use-page-search.63ad89ed.js";import eu from"./index.15ecc51f.js";import ou from"./index.30fdc920.js";import{a as P}from"./configs.785e9bce.js";import{e as au}from"./index.03a8eb58.js";import{r as k}from"./columnRenderHelper.1232bcd4.js";import{p as tu,t as nu}from"./xls-template.37485a1d.js";import{u as w,w as su}from"./xlsx.ed122d16.js";import{h as ru}from"./export.0b02da0f.js";import"./execl-upload.b7ac7feb.js";import"./tootip.514b092e.js";import"./verification.611d3025.js";const S={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:"creater",label:"\u521B\u5EFA\u4EBA"}]}},{field:"timer",type:"date_picker",trigger:"change",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u5F00\u59CB\u65E5\u671F",endPlaceholder:"\u7ED3\u675F\u65E5\u671F"}},{field:"supplierNo",type:"supplier-query"},{field:"status",type:"select",placeholder:"\u72B6\u6001",options:P}]};function lu(s){const r=s.split(",");return N(j,{src:r[0],previewTeleported:!0,previewSrcList:[r[0]],style:{height:"20px",width:"20px"}})}const iu=[{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,...k("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:195,...k("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:s})=>lu(s.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:s})=>N(Y,{type:s.status==="2"?"success":""},{default:()=>{var r;return(r=P.find(_=>_.value===String(s.status)))==null?void 0:r.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:s})=>A(s).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],pu={title:"\u9500\u552E\u6210\u672C\u7C7B\u76EE\u8BBE\u7F6E",superUserNoPerview:!0,columns:iu,apis:{httpList:au}};const du={class:"main role"},cu={"w-full":""},Fu=q({__name:"index",setup(s){const r=D(null),_=D(null),{permissions:R,hasPermissionWithCode:p}=G("commodityCost"),v=D([]),{pageContentRef:f,handleResetClick:I,handleSearchClick:M}=uu(void 0,void 0,S),{push:T}=H(),{isSuperUser:x}=W();function U(t){T({path:"/InvoiceSaleSettings/commodityCostDetail",query:{id:t}})}const z={1:"\u514D\u7A0E",2:"\u4E0D\u5F81\u7A0E",3:"\u96F6\u7A0E\u7387"},L={1:"\u662F",0:"\u5426"};function b(t=!1){if(v.value.length===0){h.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5546\u54C1");return}const o=t?tu:nu,n=t?"\u6279\u91CF\u8BBE\u7F6E\u91C7\u8D2D\u7C7B\u76EE\u6A21\u677F":"\u6279\u91CF\u8BBE\u7F6E\u8D22\u52A1\u7C7B\u76EE\u6A21\u677F",l=[];v.value.forEach(u=>{const e={...o};t?(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\u7C7B\u76EE\u540D\u79F0=u.cgd_inv_cat_name,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\u7C7B\u76EE\u540D\u79F0=u.inv_cat_name,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"?z[u.inv_tag]:"",e.\u662F\u5426\u6709\u4F18\u60E0\u653F\u7B56=Number(u.status)>=2?L[u.is_discount]:"",e.\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9=u.addTax),l.push(e)});const B=w.book_new(),y=w.json_to_sheet(l);w.book_append_sheet(B,y,"sheet"),su(B,`${n}.xlsx`,{bookType:"xlsx"})}const m=D(!1);async function O(){const t=f.value.getBasicParams();if(!t.start||!t.end){h.warning("\u8BF7\u9009\u62E9\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4");return}const o=A(t.start),n=A(t.end),l=o.diff(n,"days"),B=o.daysInMonth(),y=n.daysInMonth();if(Math.abs(l)>B+y){h.warning("\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7\u4E24\u4E2A\u6708");return}await ru({url:"/admin/good/export",name:"\u9500\u552E\u6210\u672C\u7C7B\u76EE",onStart:()=>m.value=!0,onSuccess:()=>m.value=!1,onFail:()=>m.value=!1,params:{isZx:0,...t},admin:!1})}return(t,o)=>{const n=J("ElButton");return d(),Z("div",du,[c(X,{"is-show":a(p)("001")},{default:i(()=>[$("div",cu,[c(a(K),{"form-config":a(S),onSearchBtnClick:a(M),onResetBtnClick:a(I)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),c(a(Q),{ref_key:"pageContentRef",ref:f,powers:a(R),"content-config":a(pu),onPreviewBtnClick:o[4]||(o[4]=({spuCode:l})=>U(l)),onSelectionChange:o[5]||(o[5]=l=>v.value=l)},{header:i(()=>[a(p)("041")?(d(),F(n,{key:0,size:"small",icon:a(g)("arrow-down-line"),onClick:o[0]||(o[0]=()=>b(!0))},{default:i(()=>[C("\u4E0B\u8F7D\u91C7\u8D2D\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):E("v-if",!0),a(p)("042")&&!a(x)?(d(),F(n,{key:1,size:"small",type:"primary",icon:a(g)("arrow-up-line"),onClick:o[1]||(o[1]=()=>_.value.onDisplay())},{default:i(()=>[C("\u6279\u91CF\u5BFC\u5165\u91C7\u8D2D\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C ")]),_:1},8,["icon"])):E("v-if",!0),a(p)("036")?(d(),F(n,{key:2,size:"small",icon:a(g)("arrow-down-line"),onClick:o[2]||(o[2]=()=>b())},{default:i(()=>[C("\u4E0B\u8F7D\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):E("v-if",!0),a(p)("037")&&!a(x)?(d(),F(n,{key:3,size:"small",type:"primary",icon:a(g)("arrow-up-line"),onClick:o[3]||(o[3]=()=>r.value.onDisplay())},{default:i(()=>[C("\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C ")]),_:1},8,["icon"])):E("v-if",!0),a(p)("048")?(d(),F(n,{key:4,type:"primary",onClick:O,size:"small",loading:m.value},{default:i(()=>[C("\u5BFC\u51FA ")]),_:1},8,["loading"])):E("v-if",!0)]),_:1},8,["powers","content-config"]),c(eu,{ref_key:"execlUploadModalRef",ref:r,onOnSuccess:o[6]||(o[6]=()=>a(f).onSearch())},null,512),c(ou,{ref_key:"procureUploadModalRef",ref:_,onOnSuccess:o[7]||(o[7]=()=>a(f).onSearch())},null,512)])]),_:1},8,["is-show"])])}}});var xu=V(Fu,[["__scopeId","data-v-0fa4429b"],["__file","D:/work/accout-vue3-ui2/settle-vue3/src/views/InvoiceSaleSettings/commodityCost/index.vue"]]);export{xu as default};