index-a041c61a.js 7.7 KB

1
  1. import{d as X,n as Q,r as d,f as W,B as Z,P as $,o as s,c as V,i as t,w as l,a as e,F as x,k as Y,l as p,j as f,C as b,g as aa,t as ta,U as ea,H as la,D as ra,G as oa,I as ua,v as na,J as sa,K as _a,L as pa,b$ as ma,M as ia,N as ca,_ as da,__tla as fa}from"./index-afaf388d.js";import{_ as ya,__tla as ha}from"./index-89d02e79.js";import{_ as wa,__tla as va}from"./DictTag-3a1a976c.js";import{_ as ba,__tla as Ta}from"./ContentWrap-abe0694e.js";import{g as ga,b as Ca,d as Oa,__tla as ka}from"./couponTemplate-756fba8b.js";import{C as T}from"./constants-a1da293a.js";import{a as A,D as y,__tla as Na}from"./dict-0449a0a1.js";import{d as Va,__tla as xa}from"./formatTime-42952e7f.js";import Pa,{__tla as Ua}from"./CouponTemplateForm-2bc592cc.js";import{d as Ea,v as Sa,r as Da,t as Ma,__tla as Ia}from"./formatter-f16139a0.js";import{u as Ra,__tla as Ya}from"./useMessage-a290df31.js";import{__tla as Aa}from"./index-0eed91e1.js";import"./color-6e929987.js";import{__tla as La}from"./el-card-9c18d881.js";import{__tla as Ba}from"./Dialog-82c2009c.js";import{__tla as za}from"./SpuShowcase-317f7a05.js";import{__tla as Ha}from"./el-image-caa301d0.js";import{__tla as Fa}from"./el-image-viewer-9330e340.js";import{__tla as Ka}from"./spu-4d82f8bd.js";import{__tla as qa}from"./SpuTableSelect-5d181451.js";import{__tla as Ja}from"./el-tree-select-190eecb6.js";import"./tree-0af4953a.js";import{__tla as ja}from"./category-f4ef186a.js";import{__tla as Ga}from"./ProductCategorySelect-fc853cb8.js";let L,Xa=Promise.all([(()=>{try{return fa}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ga}catch{}})()]).then(async()=>{L=da(X({name:"PromotionCouponTemplate",__name:"index",setup(Qa){const h=Ra(),{t:B}=Q(),g=d(!0),P=d(0),U=d([]),o=W({pageNo:1,pageSize:10,name:null,status:null,discountType:null,type:null,createTime:[]}),w=d(),m=async()=>{g.value=!0;try{const _=await ga(o);U.value=_.list,P.value=_.total}finally{g.value=!1}},C=()=>{o.pageNo=1,m()},z=()=>{var _;(_=w==null?void 0:w.value)==null||_.resetFields(),C()},E=d(),S=(_,r)=>{E.value.open(_,r)};return Z(()=>{m()}),(_,r)=>{const H=ea,i=la,D=ra,M=oa,F=ua,O=na,c=sa,K=_a,I=ba,u=pa,k=wa,q=ma,J=ia,j=ya,N=$("hasPermi"),G=ca;return s(),V(x,null,[t(I,null,{default:l(()=>[t(K,{ref_key:"queryFormRef",ref:w,inline:!0,model:e(o),class:"-mb-15px","label-width":"82px"},{default:l(()=>[t(i,{label:"\u4F18\u60E0\u5238\u540D\u79F0",prop:"name"},{default:l(()=>[t(H,{modelValue:e(o).name,"onUpdate:modelValue":r[0]||(r[0]=a=>e(o).name=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u52B5\u540D",onKeyup:C},null,8,["modelValue"])]),_:1}),t(i,{label:"\u4F18\u60E0\u7C7B\u578B",prop:"discountType"},{default:l(()=>[t(M,{modelValue:e(o).discountType,"onUpdate:modelValue":r[1]||(r[1]=a=>e(o).discountType=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238\u7C7B\u578B"},{default:l(()=>[(s(!0),V(x,null,Y(e(A)(e(y).PROMOTION_DISCOUNT_TYPE),a=>(s(),p(D,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"\u4F18\u60E0\u5238\u72B6\u6001",prop:"status"},{default:l(()=>[t(M,{modelValue:e(o).status,"onUpdate:modelValue":r[2]||(r[2]=a=>e(o).status=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238\u72B6\u6001"},{default:l(()=>[(s(!0),V(x,null,Y(e(A)(e(y).COMMON_STATUS),a=>(s(),p(D,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:l(()=>[t(F,{modelValue:e(o).createTime,"onUpdate:modelValue":r[3]||(r[3]=a=>e(o).createTime=a),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),t(i,null,{default:l(()=>[t(c,{onClick:C},{default:l(()=>[t(O,{class:"mr-5px",icon:"ep:search"}),f(" \u641C\u7D22 ")]),_:1}),t(c,{onClick:z},{default:l(()=>[t(O,{class:"mr-5px",icon:"ep:refresh"}),f(" \u91CD\u7F6E ")]),_:1}),b((s(),p(c,{plain:"",type:"primary",onClick:r[4]||(r[4]=a=>S("create"))},{default:l(()=>[t(O,{class:"mr-5px",icon:"ep:plus"}),f(" \u65B0\u589E ")]),_:1})),[[N,["promotion:coupon-template:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),t(I,null,{default:l(()=>[b((s(),p(J,{data:e(U)},{default:l(()=>[t(u,{label:"\u4F18\u60E0\u5238\u540D\u79F0","min-width":"140",prop:"name"}),t(u,{label:"\u7C7B\u578B","min-width":"130",prop:"productScope"},{default:l(a=>[t(k,{type:e(y).PROMOTION_PRODUCT_SCOPE,value:a.row.productScope},null,8,["type","value"])]),_:1}),t(u,{label:"\u4F18\u60E0","min-width":"110",prop:"discount"},{default:l(a=>[t(k,{type:e(y).PROMOTION_DISCOUNT_TYPE,value:a.row.discountType},null,8,["type","value"]),aa("div",null,ta(e(Ea)(a.row)),1)]),_:1}),t(u,{label:"\u9886\u53D6\u65B9\u5F0F","min-width":"100",prop:"takeType"},{default:l(a=>[t(k,{type:e(y).PROMOTION_COUPON_TAKE_TYPE,value:a.row.takeType},null,8,["type","value"])]),_:1}),t(u,{formatter:e(Sa),align:"center",label:"\u4F7F\u7528\u65F6\u95F4",prop:"validityType",width:"185"},null,8,["formatter"]),t(u,{align:"center",label:"\u53D1\u653E\u6570\u91CF",prop:"totalCount"}),t(u,{formatter:e(Da),align:"center",label:"\u5269\u4F59\u6570\u91CF",prop:"totalCount"},null,8,["formatter"]),t(u,{formatter:e(Ma),align:"center",label:"\u9886\u53D6\u4E0A\u9650",prop:"takeLimitCount"},null,8,["formatter"]),t(u,{align:"center",label:"\u72B6\u6001",prop:"status"},{default:l(a=>[t(q,{modelValue:a.row.status,"onUpdate:modelValue":v=>a.row.status=v,"active-value":0,"inactive-value":1,onChange:v=>(async n=>{let R=n.status===T.ENABLE?"\u542F\u7528":"\u505C\u7528";try{await h.confirm('\u786E\u8BA4\u8981"'+R+'""'+n.name+'"\u4F18\u60E0\u52B5\u5417?'),await Ca(n.id,n.status),h.success(R+"\u6210\u529F")}catch{n.status=n.status===T.ENABLE?T.DISABLE:T.ENABLE}})(a.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(u,{formatter:e(Va),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"]),t(u,{align:"center","class-name":"small-padding fixed-width",fixed:"right",label:"\u64CD\u4F5C",width:"120"},{default:l(a=>[b((s(),p(c,{link:"",type:"primary",onClick:v=>S("update",a.row.id)},{default:l(()=>[f(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[N,["promotion:coupon-template:update"]]]),b((s(),p(c,{link:"",type:"danger",onClick:v=>(async n=>{try{await h.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u4F18\u60E0\u52B5\u7F16\u53F7\u4E3A"'+n+'"\u7684\u6570\u636E\u9879?'),await Oa(n),h.success(B("common.delSuccess")),await m()}catch{}})(a.row.id)},{default:l(()=>[f(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[N,["promotion:coupon-template:delete"]]])]),_:1})]),_:1},8,["data"])),[[G,e(g)]]),t(j,{limit:e(o).pageSize,"onUpdate:limit":r[5]||(r[5]=a=>e(o).pageSize=a),page:e(o).pageNo,"onUpdate:page":r[6]||(r[6]=a=>e(o).pageNo=a),total:e(P),onPagination:m},null,8,["limit","page","total"])]),_:1}),t(Pa,{ref_key:"formRef",ref:E,onSuccess:m},null,512)],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/promotion/coupon/template/index.vue"]])});export{Xa as __tla,L as default};