index.DIBGYrJK.js 13 KB

123456789101112131415
  1. import{O as e,a as t,t as i,k as o,m as s,g as a,x as n,q as l}from"./element-plus.Coxisi3K.js";import{M as r,aU as p,a_ as d,bL as u,bk as c,aL as m,u as f,v,F as _,aX as y,I as b,bJ as h,H as j,bb as w,s as g,au as k,bM as x,t as C,q as I,aS as z}from"./@vue.DbmRtknU.js";import{t as T,r as L,s as D,y as V,z as S,I as q,_ as F}from"./index.Zdt67uUk.js";import{a as R,P as U}from"./PageContent.JEZkrk7m.js";import{E as A}from"./sql.CxG21rpJ.js";import E from"./InstitutionForm.C-Q3E9cw.js";import P from"./InstitutionDetail.COLk6-4y.js";import{_ as M}from"./ScopeDialog.35Ln-cO1.js";import{u as $}from"./vue-router.yxIMtaxH.js";import"./lodash-es.DaM9m3L-.js";import"./async-validator.j0i5Y79Y.js";import"./@popperjs.DxtSUbXb.js";import"./@ctrl.BEgk5vdO.js";import"./dayjs.DCWbrgJ0.js";import"./memoize-one.BAtLgO95.js";import"./normalize-wheel-es.TzhA1irr.js";import"./@floating-ui.8vigAAFV.js";import"./pinia.BlfmsheH.js";import"./@vueuse.Dnsd2JKX.js";import"./vue-i18n.DXLOBfKS.js";import"./@intlify.DPMNdUn_.js";import"./nprogress.BTjJXJ-u.js";import"./codemirror.CYSLATvI.js";import"./diff-match-patch.DkK4wJpa.js";import"./vue-web-terminal.D-rog7dz.js";import"./vue.MGxsMDTR.js";/* empty css */import"./axios.Da-QW0H8.js";import"./qs.BQjOrGHM.js";import"./side-channel.4q28KFJj.js";import"./es-errors.DTEWvbA_.js";import"./object-inspect.DvQZIv3_.js";import"./side-channel-list.Do0-XmF5.js";import"./side-channel-map.DNHQ53lO.js";import"./get-intrinsic.Bbe5x-9b.js";import"./es-object-atoms.CyiuHMUS.js";import"./math-intrinsics.pM-JTNwN.js";import"./gopd.BudZp56J.js";import"./es-define-property.F0aoeP8o.js";import"./has-symbols.BcO-SUVM.js";import"./get-proto.Cb_fpw-j.js";import"./dunder-proto.WEH3rgQR.js";import"./call-bind-apply-helpers.DJjIjCF_.js";import"./function-bind.DrnB-baK.js";import"./hasown.BXcyoiLU.js";import"./call-bound.22gFUC2Q.js";import"./side-channel-weakmap.DpSeWE6i.js";import"./pinia-plugin-persistedstate.COWkwNh5.js";import"./exceljs.DLSZe_6I.js";import"./RuleList.CFVJS5p9.js";import"./time.onvLnpdf.js";import"./QuotaList.ocbTwgyB.js";const B=["element-loading-text"],G={class:"category-tabs"},H={class:"category-tabs__nav"},J={class:"search-bar"},K={class:"search-bar__scene"},N={class:"scene-card-group"},O={class:"search-bar__right"},Q={class:"data-table__toolbar--right"},X={class:"data-table__content"},Y={class:"dialog-footer"},Z=F(r({name:"Institution",inheritAttrs:!1,__name:"index",setup(r){var F;const Z=$(),W=[
  2. // { key: "meal", label: "餐饮", icon: "UtensilsCrossed", scenes: [{ label: "差旅餐饮", value: "business_meal" }, { label: "员工餐补", value: "staff_meal" }, { label: "团建聚餐", value: "team_dinner" }] },
  3. // { key: "hotel", label: "酒店", icon: "Building2", scenes: [{ label: "商务出差", value: "business_trip" }, { label: "会议住宿", value: "meeting_hotel" }, { label: "培训住宿", value: "training_hotel" }] },
  4. // { key: "flight", label: "机票", icon: "Plane", scenes: [{ label: "国内出差", value: "domestic_flight" }, { label: "国际出差", value: "international_flight" }, { label: "紧急出差", value: "urgent_flight" }] },
  5. // { key: "train", label: "火车票", icon: "Train", scenes: [{ label: "省内出差", value: "provincial_train" }, { label: "跨省出差", value: "interprovincial_train" }, { label: "通勤", value: "commute_train" }] },
  6. // { key: "bus", label: "公交", icon: "Bus", scenes: [{ label: "市内通勤", value: "city_bus" }, { label: "郊区出行", value: "suburb_bus" }] },
  7. // { key: "subway", label: "地铁", icon: "Metro", scenes: [{ label: "日常通勤", value: "daily_subway" }, { label: "加班补贴", value: "overtime_subway" }] },
  8. // { key: "car", label: "用车", icon: "Car", scenes: [{ label: "公务用车", value: "official_car" }, { label: "网约车", value: "ride_hailing" }, { label: "自驾补贴", value: "self_drive" }] },
  9. // { key: "service", label: "服务", icon: "Headphones", scenes: [{ label: "咨询服务", value: "consult_service" }, { label: "外包服务", value: "outsourcing" }] },
  10. // { key: "shopping", label: "商城", icon: "ShoppingCart", scenes: [{ label: "办公用品", value: "office_supplies" }, { label: "劳保用品", value: "labor_protection" }, { label: "员工福利", value: "employee_welfare" }] },
  11. // { key: "express", label: "快递", icon: "Truck", scenes: [{ label: "日常快递", value: "daily_express" }, { label: "大件物流", value: "bulk_logistics" }] },
  12. // { key: "gas", label: "加油", icon: "Fuel", scenes: [{ label: "公务车加油", value: "official_gas" }, { label: "私家车补贴", value: "private_gas" }] },
  13. // { key: "medical", label: "医疗", icon: "Stethoscope", scenes: [{ label: "体检", value: "medical_checkup" }, { label: "门诊报销", value: "outpatient" }, { label: "住院报销", value: "hospitalization" }] },
  14. // { key: "advertising", label: "电商广告充值", icon: "Monitor", scenes: [{ label: "平台推广", value: "platform_promo" }, { label: "品牌广告", value: "brand_ad" }, { label: "促销活动", value: "promotion" }] },
  15. {key:"DEFAULT",label:"默认",icon:"Box",scenes:[{label:"通用",value:"common"}]}],ee=p("DEFAULT"),te=I(()=>{const e=W.find(e=>e.key===ee.value);return(null==e?void 0:e.scenes)||[{label:"通用",value:"common"}]}),ie=p((null==(F=te.value[0])?void 0:F.value)||""),oe=p(""),{contentRef:se,refreshList:ae}=V(),ne=p(),{pageLoading:le,loadingText:re,execute:pe}=S(),de=I(()=>Z.query.enterprise_id),ue=z([{prop:"selection",label:"选择框",show:!1},{prop:"index",label:"序号",show:!0},{prop:"institution_name",label:"制度名称",show:!0},{prop:"valid_period",label:"制度有效期",show:!0},{prop:"expense_type",label:"费用类型",show:!0},{prop:"status",label:"制度状态",show:!0},{prop:"updated_time",label:"修改时间",show:!0},{prop:"operation",label:"操作",show:!0}]),ce=z({permPrefix:"module_payment:institution",pk:"institution_id",cols:ue,hideColumnFilter:!1,toolbar:[],defaultToolbar:["refresh","filter"],pagination:!0,initialParams:I(()=>({enterprise_id:de.value})),indexAction:async e=>{var t,i;const o={page_no:e.page_no,page_size:e.page_size};e.enterprise_id&&(o.enterprise_id=e.enterprise_id);const s=await q.listInstitution(o);return{list:(null==(t=s.data.data)?void 0:t.items)||[],total:(null==(i=s.data.data)?void 0:i.total)||0}}}),me=z({title:"",visible:!1,type:"create"}),fe=p(),ve=p(0),_e=p(!1);function ye(e,t){me.type=e,fe.value=t,me.title="create"===e?"创建费控制度":"update"===e?"编辑费控制度":"费控制度详情","update"===e&&ve.value++,me.visible=!0}async function be(){me.visible=!1}function he(){var e;null==(e=ne.value)||e.submitForm()}function je(){me.visible=!1,ae()}function we(){ae()}return(r,p)=>{const I=t,z=a,V=i,S=n,F=s,$=o,Z=d("hasPerm"),ge=e;return u((m(),f("div",{class:"app-container","element-loading-text":c(re)},[v("div",G,[v("div",H,[(m(),f(_,null,y(W,e=>b(I,{key:e.key,type:ee.value===e.key?"primary":"default",icon:e.icon,onClick:t=>function(e){var t,i;ee.value=e;const o=W.find(t=>t.key===e);ie.value=(null==(i=null==(t=null==o?void 0:o.scenes)?void 0:t[0])?void 0:i.value)||"",ae()}(e.key)},{default:h(()=>[j(w(e.label),1)]),_:2},1032,["type","icon","onClick"])),64))])]),v("div",J,[v("div",K,[p[4]||(p[4]=v("span",{class:"search-bar__label"},"场景:",-1)),v("div",N,[(m(!0),f(_,null,y(te.value,e=>(m(),g(z,{key:e.value,class:k([{"scene-card--active":ie.value===e.value},"scene-card"]),onClick:t=>{return i=e.value,ie.value=i,void ae();var i}},{default:h(()=>[j(w(e.label),1)]),_:2},1032,["class","onClick"]))),128))])]),v("div",O,[b(V,{modelValue:oe.value,"onUpdate:modelValue":p[0]||(p[0]=e=>oe.value=e),placeholder:"制度名称搜索",class:"search-bar__input",onKeyup:x(we,["enter"])},null,8,["modelValue"]),b(I,{type:"primary",onClick:we},{default:h(()=>[...p[5]||(p[5]=[j("搜索",-1)])]),_:1}),b(I,{type:"success",onClick:p[1]||(p[1]=e=>ye("create"))},{default:h(()=>[...p[6]||(p[6]=[j("新增制度",-1)])]),_:1})])]),b(U,{ref_key:"contentRef",ref:se,"content-config":ce},{toolbar:h(({toolbarRight:e,onToolbar:t,removeIds:i,cols:o})=>[v("div",Q,[b(R,{buttons:e,cols:o,"on-toolbar":t},null,8,["buttons","cols","on-toolbar"])])]),table:h(({data:e,loading:t,tableRef:i,onSelectionChange:o})=>[v("div",X,[u((m(),g($,{ref:i,data:e,height:"100%",border:"",onSelectionChange:o},{empty:h(()=>[b(S,{"image-size":80,description:"暂无数据"})]),default:h(()=>{var e,t,i,o,s,a,n;return[(null==(e=ue.find(e=>"selection"===e.prop))?void 0:e.show)?(m(),g(F,{key:0,type:"selection","min-width":"55",align:"center"})):C("",!0),(null==(t=ue.find(e=>"institution_name"===e.prop))?void 0:t.show)?(m(),g(F,{key:"institution_name",label:"制度名称",prop:"institution_name","min-width":"150","show-overflow-tooltip":""})):C("",!0),(null==(i=ue.find(e=>"valid_period"===e.prop))?void 0:i.show)?(m(),g(F,{key:"valid_period",label:"制度有效期","min-width":"150","show-overflow-tooltip":""},{default:h(e=>[j(w((e.row.effective_start_date||"").substring(0,10)||"-")+" ~ "+w((e.row.effective_end_date||"").substring(0,10)||"长期有效"),1)]),_:1})):C("",!0),(null==(o=ue.find(e=>"expense_type"===e.prop))?void 0:o.show)?(m(),g(F,{key:"expense_type",label:"费用类型",prop:"expense_type","min-width":"100"},{default:h(e=>[j(w(c(T)[e.row.expense_type]||e.row.expense_type),1)]),_:1})):C("",!0),(null==(s=ue.find(e=>"status"===e.prop))?void 0:s.show)?(m(),g(F,{key:"status",label:"制度状态",prop:"status","min-width":"100"},{default:h(e=>[b(z,{type:c(L)[e.row.status]},{default:h(()=>[j(w(c(D)[e.row.status]||e.row.status),1)]),_:2},1032,["type"])]),_:1})):C("",!0),(null==(a=ue.find(e=>"updated_time"===e.prop))?void 0:a.show)?(m(),g(F,{key:"updated_time",label:"修改时间",prop:"updated_time","min-width":"160",sortable:""})):C("",!0),(null==(n=ue.find(e=>"operation"===e.prop))?void 0:n.show)?(m(),g(F,{key:6,fixed:"right",label:"操作",align:"center","min-width":"240"},{default:h(e=>[u((m(),g(I,{type:"text",size:"small",onClick:t=>ye("detail",e.row.institution_id)},{default:h(()=>[...p[7]||(p[7]=[j(" 详情 ",-1)])]),_:1},8,["onClick"])),[[Z,["module_payment:expense:institution:detail"]]]),u((m(),g(I,{type:"text",size:"small",onClick:t=>ye("update",e.row.institution_id)},{default:h(()=>[...p[8]||(p[8]=[j(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[Z,["module_payment:expense:institution:modify"]]]),u((m(),g(I,{type:"text",size:"small",onClick:t=>async function(e){const t=e.institution_id,i=e.enterprise_id||de.value;if(!t||!i)return void l.warning("制度ID或企业ID不存在");const o="1"===e.effective?"0":"1",s="1"===o?"启用":"停用";await pe({confirmMessage:`确认${s}该制度?`,confirmTitle:"提示",confirmType:"warning",loadingText:`正在${s}...`,action:()=>q.modifyEffective(t,i,o),onSuccess:()=>{l.success(`${s}成功`),ae()}})}(e.row)},{default:h(()=>[j(w("1"===e.row.effective?"停用":"启用"),1)]),_:2},1032,["onClick"])),[[Z,["module_payment:expense:institution:scope:modify"]]]),u((m(),g(I,{type:"text",size:"small",onClick:t=>{var i;(i=e.row.institution_id)?(fe.value=i,_e.value=!0):l.warning("制度ID不存在")}},{default:h(()=>[...p[9]||(p[9]=[j(" 成员管理 ",-1)])]),_:1},8,["onClick"])),[[Z,["module_payment:expense:institution:scope:modify"]]]),u((m(),g(I,{type:"text",size:"small",onClick:t=>async function(e){const t=e.institution_id,i=e.enterprise_id||de.value;t&&(i?await pe({confirmMessage:"确认删除该费控制度?",confirmTitle:"警告",confirmType:"warning",loadingText:"正在删除...",action:()=>q.deleteInstitution(t,i),onSuccess:()=>{l.success("删除成功"),ae()}}):l.warning("企业ID不存在,无法删除"))}(e.row)},{default:h(()=>[...p[10]||(p[10]=[j(" 删除 ",-1)])]),_:1},8,["onClick"])),[[Z,["module_payment:expense:institution:delete"]]])]),_:1})):C("",!0)]}),_:1},8,["data","onSelectionChange"])),[[ge,t]])])]),_:1},8,["content-config"]),b(A,{modelValue:me.visible,"onUpdate:modelValue":p[2]||(p[2]=e=>me.visible=e),title:me.title,width:"1000px",onClose:be},{footer:h(()=>[v("div",Y,["detail"!==me.type?(m(),g(I,{key:0,type:"primary",onClick:he},{default:h(()=>[...p[11]||(p[11]=[j(" 确定 ",-1)])]),_:1})):(m(),g(I,{key:1,type:"primary",onClick:be},{default:h(()=>[...p[12]||(p[12]=[j("确定",-1)])]),_:1})),b(I,{onClick:be},{default:h(()=>[...p[13]||(p[13]=[j("取消",-1)])]),_:1})])]),default:h(()=>["detail"===me.type?(m(),g(P,{key:0,"institution-id":fe.value},null,8,["institution-id"])):(m(),g(E,{ref_key:"formRef",ref:ne,key:ve.value,type:me.type,"institution-id":fe.value,"enterprise-id":de.value,onSuccess:je},null,8,["type","institution-id","enterprise-id"]))]),_:1},8,["modelValue","title"]),b(M,{modelValue:_e.value,"onUpdate:modelValue":p[3]||(p[3]=e=>_e.value=e),"institution-id":fe.value,"enterprise-id":de.value},null,8,["modelValue","institution-id","enterprise-id"])],8,B)),[[ge,c(le)]])}}}),[["__scopeId","data-v-4651d448"]]);export{Z as default};