index.8df52f.js 6.6 KB

12345678910
  1. import{bb as F,am as c,aR as W,ae as f,aS as L,_ as z,d as O,x as d,aM as V,bd as Y,p as q,ai as G,W as j,r as H,o as v,c as Z,l as s,D as E,h as J,m as t,bE as K,bF as Q,a as D,G as X,M as $,bV as ee,aZ as y,dg as ue}from"./index.js";import{a as x}from"./configs.f61a0dda.js";import{h as te}from"./index.e27c52c8.js";import oe from"./index.58cc7a.js";import ae from"./index.3f9fbc.js";import{h as ne}from"./export.fc82d641.js";import"./index.24943c38.js";import"./execl-upload.7c83427b.js";import"./xlsx.ed122d16.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:"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:x}]};function re(e){const o=e.split(",");return c(L,{src:o[0],previewTeleported:!0,previewSrcList:[o[0]],style:{height:"20px",width:"20px"}})}const se=[{type:"selection",width:40,align:"center",fixed:"left"},{label:"\u5546\u54C1\u7F16\u7801",prop:"spuCode",width:150},{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"cgd_supplierName",width:175,...F("cgd_supplierNo","cgd_supplierName","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801:")},{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"supplierName",width:195,...F("supplierNo","supplierName","\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:e})=>re(e.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:e}){return c("div",{},{default:()=>e.cgd_inv_tax?e.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:e}){return c("div",{},{default:()=>e.inv_tax?e.inv_tax:"--"})}},{label:"\u72B6\u6001",prop:"status",width:150,cellRenderer:({row:e})=>c(W,{type:e.status==="2"?"success":""},{default:()=>{var o;return(o=x.find(n=>n.value===String(e.status)))==null?void 0:o.label}})},{label:"\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9",prop:"addTax",width:"140px"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:140,formatter:({addtime:e})=>f(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u521B\u5EFA\u4EBA",width:80,prop:"creater"},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],ie={title:"\u9500\u552E\u6210\u672C\u7C7B\u76EE\u8BBE\u7F6E",superUserNoPerview:!0,columns:se,transformField:"origin_supplierNo",apis:{httpList:(e={})=>{const{supplierNo:o,origin_supplierNo:n,...m}=e;return te({...m,isChild:1,supplierNo:n,cgd_supplierNo:o,noRela:!0})}}};const le={class:"main role"},pe={"w-full":""},de=O({__name:"index",setup(e){const o=d(null),n=d(null),{permissions:m,hasPermissionWithCode:h}=V("consultingChildCost"),b=d([]),{pageContentRef:i,handleResetClick:A,handleSearchClick:R}=Y(void 0,void 0,w),{push:S}=q();G();const{currentCompany:C}=j();function k(a){S({path:"/InvoiceSaleSettings/consultingChildCostDetail",query:{id:a}})}const l=d(!1);async function N(){var _,B;const a=i.value.getBasicParams();if(!a.start||!a.end){y.warning("\u8BF7\u9009\u62E9\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4");return}const u=f(a.start),p=f(a.end),r=u.diff(p,"days"),P=u.daysInMonth(),I=p.daysInMonth(),{data:M}=await ue({name:(_=C.value)==null?void 0:_.companyName}),U=((B=C.value)!=null&&B.companyName?M.list.find(T=>{var g;return T.name===((g=C.value)==null?void 0:g.companyName)})||{}:{}).code;if(Math.abs(r)>P+I){y.warning("\u5BFC\u51FA\u7684\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7\u4E24\u4E2A\u6708");return}await ne({url:"/admin/good/export",name:"\u54A8\u8BE2\u6210\u4EA4\u7C7B\u76EE",onStart:()=>l.value=!0,onSuccess:()=>l.value=!1,onFail:()=>l.value=!1,params:{isZx:1,...a,supplierNo:U,isChild:1,noRela:!0},admin:!1})}return(a,u)=>{const p=H("ElButton");return v(),Z("div",le,[s(ee,{"is-show":t(h)("001")},{default:E(()=>[J("div",pe,[s(t(K),{"form-config":t(w),onSearchBtnClick:t(R),onResetBtnClick:t(A)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),s(t(Q),{ref_key:"pageContentRef",ref:i,powers:t(m),"content-config":t(ie),onPreviewBtnClick:u[0]||(u[0]=({spuCode:r})=>k(r)),onSelectionChange:u[1]||(u[1]=r=>b.value=r)},{header:E(()=>[D(` <ElButton size="small" v-if="hasPermissionWithCode('041')" :icon="useRenderIcon('arrow-down-line')"\r
  2. @click="() => onDownloadTemplate(true)">\u4E0B\u8F7D\u91C7\u8D2D\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F</ElButton>\r
  3. <ElButton size="small" type="primary" v-if="hasPermissionWithCode('042') && !isSuperUser"\r
  4. :icon="useRenderIcon('arrow-up-line')" @click="() => procureUploadModalRef.onDisplay()">\u6279\u91CF\u5BFC\u5165\u91C7\u8D2D\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C\r
  5. </ElButton>\r
  6. <ElButton size="small" v-if="hasPermissionWithCode('036')" :icon="useRenderIcon('arrow-down-line')"\r
  7. @click="() => onDownloadTemplate()">\u4E0B\u8F7D\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u6A21\u677F</ElButton>\r
  8. <ElButton size="small" type="primary" :icon="useRenderIcon('arrow-up-line') "\r
  9. v-if="hasPermissionWithCode('037') && !isSuperUser" @click="() => execlUploadModalRef.onDisplay()">\r
  10. \u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C</ElButton> `),t(h)("048")?(v(),X(p,{key:0,type:"primary",onClick:N,size:"small",loading:l.value},{default:E(()=>[$("\u5BFC\u51FA ")]),_:1},8,["loading"])):D("v-if",!0)]),_:1},8,["powers","content-config"]),s(oe,{ref_key:"execlUploadModalRef",ref:o,onOnSuccess:u[2]||(u[2]=()=>t(i).onSearch())},null,512),s(ae,{ref_key:"procureUploadModalRef",ref:n,onOnSuccess:u[3]||(u[3]=()=>t(i).onSearch())},null,512)])]),_:1},8,["is-show"])])}}});var ve=z(de,[["__scopeId","data-v-0c6a0174"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSaleSettings/consultingChildCost/index.vue"]]);export{ve as default};