index-9decd3a0.js 7.7 KB

1
  1. import{d as j,h as Q,r as d,e as W,q as Z,M as $,o as s,c as N,f as t,w as l,a as e,F as V,v as A,x as p,y as f,z as b,g as aa,t as ta,R as ea,C as la,A as ra,B as oa,D as ua,j as na,G as sa,H as _a,I as pa,cJ as ma,J as ca,K as ia,_ as da,__tla as fa}from"./index-8dc1e40a.js";import{_ as ya,__tla as ha}from"./index-64aeaa78.js";import{_ as wa,__tla as va}from"./DictTag-85aade2b.js";import{_ as ba,__tla as Ta}from"./ContentWrap-0aca5216.js";import{g as ga,b as Ca,d as Oa,__tla as ka}from"./couponTemplate-5f26189c.js";import{C as T}from"./constants-a1da293a.js";import{a as Y,D as y,__tla as xa}from"./dict-f13a3c8f.js";import{d as Na,__tla as Va}from"./formatTime-8a155b2e.js";import Pa,{__tla as Ua}from"./CouponTemplateForm-9932f181.js";import{d as Ea,v as Sa,r as Da,t as Ma,__tla as Ra}from"./formatter-0ba22dee.js";import{u as Ia,__tla as Aa}from"./useMessage-7a27dd80.js";import{__tla as Ya}from"./index-803dbf9a.js";import"./color-6e929987.js";import{__tla as za}from"./el-card-18df90f0.js";import{__tla as Ba}from"./Dialog-41802231.js";import{__tla as La}from"./SpuShowcase-5e70bdf0.js";import{__tla as Ha}from"./el-image-6a48e9f1.js";import{__tla as Ka}from"./el-image-viewer-3b8905e6.js";import{__tla as Fa}from"./spu-559f5d98.js";import{__tla as Ja}from"./SpuTableSelect-573b2ba6.js";import{__tla as qa}from"./el-tree-select-d82790d8.js";import"./tree-0af4953a.js";import{__tla as Ga}from"./category-e7433506.js";import{__tla as Xa}from"./ProductCategorySelect-94eeee28.js";let z,ja=Promise.all([(()=>{try{return fa}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Xa}catch{}})()]).then(async()=>{z=da(j({name:"PromotionCouponTemplate",__name:"index",setup(Qa){const h=Ia(),{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()},L=()=>{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,c=la,D=ra,M=oa,K=ua,O=na,i=sa,F=_a,R=ba,u=pa,k=wa,J=ma,q=ca,G=ya,x=$("hasPermi"),X=ia;return s(),N(V,null,[t(R,null,{default:l(()=>[t(F,{ref_key:"queryFormRef",ref:w,inline:!0,model:e(o),class:"-mb-15px","label-width":"82px"},{default:l(()=>[t(c,{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(c,{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),N(V,null,A(e(Y)(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(c,{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),N(V,null,A(e(Y)(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(c,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:l(()=>[t(K,{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(c,null,{default:l(()=>[t(i,{onClick:C},{default:l(()=>[t(O,{class:"mr-5px",icon:"ep:search"}),f(" \u641C\u7D22 ")]),_:1}),t(i,{onClick:L},{default:l(()=>[t(O,{class:"mr-5px",icon:"ep:refresh"}),f(" \u91CD\u7F6E ")]),_:1}),b((s(),p(i,{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})),[[x,["promotion:coupon-template:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),t(R,null,{default:l(()=>[b((s(),p(q,{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(J,{modelValue:a.row.status,"onUpdate:modelValue":v=>a.row.status=v,"active-value":0,"inactive-value":1,onChange:v=>(async n=>{let I=n.status===T.ENABLE?"\u542F\u7528":"\u505C\u7528";try{await h.confirm('\u786E\u8BA4\u8981"'+I+'""'+n.name+'"\u4F18\u60E0\u52B5\u5417?'),await Ca(n.id,n.status),h.success(I+"\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(Na),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(i,{link:"",type:"primary",onClick:v=>S("update",a.row.id)},{default:l(()=>[f(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[x,["promotion:coupon-template:update"]]]),b((s(),p(i,{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"])),[[x,["promotion:coupon-template:delete"]]])]),_:1})]),_:1},8,["data"])),[[X,e(g)]]),t(G,{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{ja as __tla,z as default};