index.6eb2f4.js 8.1 KB

1
  1. import{bb as N,am as v,aR as L,ae as x,aS as Y,_ as Z,d as q,x as D,aM as G,bd as W,p as H,ai as J,W as $,r as K,o as d,c as Q,l as c,D as i,h as X,m as a,bE as uu,bF as eu,G as F,J as g,M as C,a as E,bV as ou,aZ as A}from"./index.js";import au from"./index.58cc7a.js";import tu from"./index.3f9fbc.js";import{a as R}from"./configs.3d0c3d37.js";import{d as nu}from"./index.24943c38.js";import{p as su,t as lu}from"./xls-template.37485a1d.js";import{u as w,w as ru}from"./xlsx.ed122d16.js";import{h as iu}from"./export.fc82d641.js";import"./execl-upload.7c83427b.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:R}]};function pu(t){const l=t.split(",");return v(Y,{src:l[0],previewTeleported:!0,previewSrcList:[l[0]],style:{height:"20px",width:"20px"}})}const du=[{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,...N("supplierNo","supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyName",width:195,...N("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})=>pu(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:"\u91C7\u8D2D\u5F00\u7968\u7C7B\u76EE\u7A0E\u7387",prop:"cgd_inv_tax",width:165,cellRenderer({row:t}){return v("div",{},{default:()=>t.cgd_inv_tax?t.cgd_inv_tax:"--"})}},{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:"\u8D22\u52A1\u5F00\u7968\u7C7B\u76EE\u7A0E\u7387",prop:"inv_tax",width:165,cellRenderer({row:t}){return v("div",{},{default:()=>t.inv_tax?t.inv_tax:"--"})}},{label:"\u72B6\u6001",prop:"status",width:150,cellRenderer:({row:t})=>v(L,{type:t.status==="2"?"success":""},{default:()=>{var l;return(l=R.find(_=>_.value===String(t.status)))==null?void 0:l.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:t})=>x(t).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],cu={title:"\u9500\u552E\u6210\u672C\u7C7B\u76EE\u8BBE\u7F6E",superUserNoPerview:!0,columns:du,apis:{httpList:nu}};const Fu={class:"main role"},Cu={"w-full":""},Eu=q({__name:"index",setup(t){const l=D(null),_=D(null),{permissions:P,hasPermissionWithCode:p}=G("commodityCost"),y=D([]),{pageContentRef:m,handleResetClick:M,handleSearchClick:I}=W(void 0,void 0,S),{push:T}=H(),{isSuperUser:b}=J(),{currentCompany:U}=$();function j(n){T({path:"/InvoiceSaleSettings/commodityCostDetail",query:{id:n}})}const z={1:"\u514D\u7A0E",2:"\u4E0D\u5F81\u7A0E",3:"\u96F6\u7A0E\u7387"},O={1:"\u662F",0:"\u5426"};function k(n=!1){if(y.value.length===0){A.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5546\u54C1");return}const o=n?su:lu,s=n?"\u6279\u91CF\u8BBE\u7F6E\u91C7\u8D2D\u7C7B\u76EE\u6A21\u677F":"\u6279\u91CF\u8BBE\u7F6E\u8D22\u52A1\u7C7B\u76EE\u6A21\u677F",r=[];y.value.forEach(u=>{const e={...o};n?(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?O[u.is_discount]:"",e.\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9=u.addTax),r.push(e)});const B=w.book_new(),h=w.json_to_sheet(r);w.book_append_sheet(B,h,"sheet"),ru(B,`${s}.xlsx`,{bookType:"xlsx"})}const f=D(!1);async function V(){const n=m.value.getBasicParams();if(!n.start||!n.end){A.warning("\u8BF7\u9009\u62E9\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4");return}const o=x(n.start),s=x(n.end),r=o.diff(s,"days"),B=o.daysInMonth(),h=s.daysInMonth();if(Math.abs(r)>B+h){A.warning("\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7\u4E24\u4E2A\u6708");return}await iu({url:"/admin/good/export",name:"\u9500\u552E\u6210\u672C\u7C7B\u76EE",onStart:()=>f.value=!0,onSuccess:()=>f.value=!1,onFail:()=>f.value=!1,params:{isZx:0,...n,companyNo:U.value.companyNo,isChild:0},admin:!1})}return(n,o)=>{const s=K("ElButton");return d(),Q("div",Fu,[c(ou,{"is-show":a(p)("001")},{default:i(()=>[X("div",Cu,[c(a(uu),{"form-config":a(S),onSearchBtnClick:a(I),onResetBtnClick:a(M)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),c(a(eu),{ref_key:"pageContentRef",ref:m,powers:a(P),"content-config":a(cu),onPreviewBtnClick:o[4]||(o[4]=({spuCode:r})=>j(r)),onSelectionChange:o[5]||(o[5]=r=>y.value=r)},{header:i(()=>[a(p)("041")?(d(),F(s,{key:0,size:"small",icon:a(g)("arrow-down-line"),onClick:o[0]||(o[0]=()=>k(!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(b)?(d(),F(s,{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(s,{key:2,size:"small",icon:a(g)("arrow-down-line"),onClick:o[2]||(o[2]=()=>k())},{default:i(()=>[C("\u4E0B\u8F7D\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F")]),_:1},8,["icon"])):E("v-if",!0),a(p)("037")&&!a(b)?(d(),F(s,{key:3,size:"small",type:"primary",icon:a(g)("arrow-up-line"),onClick:o[3]||(o[3]=()=>l.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(s,{key:4,type:"primary",onClick:V,size:"small",loading:f.value},{default:i(()=>[C("\u5BFC\u51FA ")]),_:1},8,["loading"])):E("v-if",!0)]),_:1},8,["powers","content-config"]),c(au,{isZx:"0",ref_key:"execlUploadModalRef",ref:l,onOnSuccess:o[6]||(o[6]=()=>a(m).onSearch())},null,512),c(tu,{isZx:"0",ref_key:"procureUploadModalRef",ref:_,onOnSuccess:o[7]||(o[7]=()=>a(m).onSearch())},null,512)])]),_:1},8,["is-show"])])}}});var wu=Z(Eu,[["__scopeId","data-v-0fa4429b"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSaleSettings/commodityCost/index.vue"]]);export{wu as default};