优惠券 PC管理端 项目

899.dc348987.js 10KB

1
  1. "use strict";(self["webpackChunkcoupon"]=self["webpackChunkcoupon"]||[]).push([[899],{9466:function(e,a,l){l.r(a),l.d(a,{default:function(){return J}});var t=l(212),o=(l(3163),l(8061)),i=(l(6905),l(5791)),d=(l(6809),l(9007),l(3396)),s=l(4870),c=l(7139),n=l(2710),r=(l(9910),l(9866)),u=(l(172),l(573)),p=(l(3877),l(7960),l(6629)),m=(l(7228),l(1423)),g=l(6573);const v=e=>((0,d.dD)("data-v-ae6e848e"),e=e(),(0,d.Cn)(),e),I={class:"header"},y={class:"title"},w={class:"content"},_={class:"form-item"},b=v((()=>(0,d._)("div",{class:"item-label"},[(0,d._)("i",{class:"required"}),(0,d._)("span",{class:"label-text"},"淘宝账号ID")],-1))),f={class:"form-item"},h=v((()=>(0,d._)("div",{class:"item-label"},[(0,d._)("i",{class:"required"}),(0,d._)("span",{class:"label-text"},"媒体ID")],-1))),W={class:"form-item"},k=v((()=>(0,d._)("div",{class:"item-label"},[(0,d._)("i",{class:"required"}),(0,d._)("span",{class:"label-text"},"推广位名称")],-1))),V={class:"form-item"},D=v((()=>(0,d._)("div",{class:"item-label"},[(0,d._)("i",{class:"required"}),(0,d._)("span",{class:"label-text"},"推广位ID")],-1))),A={class:"form-item"},z=v((()=>(0,d._)("div",{class:"item-label"},[(0,d._)("span",{class:"label-text"},"分组")],-1)));var C=(0,d.aZ)({__name:"promoteDialog",props:{dialogVisible:{type:Boolean,default:()=>!1},promoteInfo:{type:Object,default:()=>({})}},emits:["confirm","cancel"],setup(e,{emit:a}){const l=e,o=(0,d.Fl)((()=>!!l.promoteInfo?.id)),i=(0,d.Fl)((()=>o.value)),v=(0,d.Fl)((()=>o.value)),C=(0,d.Fl)((()=>""+(o.value?"编辑推广位":"添加推广位"))),U=(0,s.iH)(!1),H=(0,s.iH)([]),Z=(0,s.iH)([]),x=(0,s.iH)([]),N=(0,s.qj)({accountId:"",siteId:"",pidName:"",pid:"",groupIds:[]});(0,d.YP)((()=>l.dialogVisible),(e=>{e&&(S(),M(),T())}));const S=()=>{if(o.value){const{accountId:e,siteId:a,pidName:t,pid:o}=l.promoteInfo;N.accountId=e??"",N.siteId=a??"",N.pidName=t??"",N.pid=o??"",N.accountId&&P(),N.groupIds=[],N.pid&&j(N.pid)}else N.accountId="",N.siteId="",N.pidName="",N.pid="",N.groupIds=[]},j=async e=>{try{U.value=!0;const a=g.W.promoteGroup_listPidGroups,l={pid:e},{code:t,data:o,msg:i}=await m.Z.get(a,l);0===t&&Array.isArray(o)?N.groupIds=o.map((e=>e.id)):(N.groupIds=[],p.z8.error(i||"操作失败"))}catch(a){}finally{U.value=!1}},M=async()=>{try{const{code:e,data:a,msg:l}=await m.Z.get(g.W.tbAccount_listTbAccount);0===e&&Array.isArray(a)?H.value=a:(H.value=[],p.z8.error(l||"操作失败"))}catch(e){}},P=async()=>{try{const e={accountId:N.accountId},{code:a,data:l,msg:t}=await m.Z.get(g.W.promoteManage_listSiteInfo,e);0===a&&Array.isArray(l)?Z.value=l:(Z.value=[],p.z8.error(t||"操作失败"))}catch(e){}},T=async()=>{try{const e=g.W.promoteGroup_listAllGroup,a={},{code:l,data:t,msg:o}=await m.Z.get(e,a);0===l&&Array.isArray(t)?x.value=t:(x.value=[],p.z8.error(o||"操作失败"))}catch(e){}},q=e=>{N.accountId=e||"",N.siteId="",Z.value=[],N.accountId&&P()},B=e=>{N.siteId=e||""},Y=e=>{Array.isArray(e)?N.groupIds=e:N.groupIds=[]},G=()=>{a("cancel")},$=async()=>{try{await E(),await F(),a("confirm")}catch(e){}},E=()=>new Promise(((e,a)=>{const{accountId:l,siteId:t,pidName:o,pid:i}=N;""===l?(p.z8.warning("请选择淘宝账号ID"),a("校验未通过")):""===t?(p.z8.warning("请选择媒体ID"),a("校验未通过")):""===o?(p.z8.warning("请输入推广位名称"),a("校验未通过")):""===i?(p.z8.warning("请输入推广位ID"),a("校验未通过")):e("校验通过")})),F=async()=>{try{U.value=!0;let e=g.W.promoteManage_addAdzone;const a={accountId:N.accountId,siteId:N.siteId,pidName:N.pidName,pid:N.pid,groupIds:N.groupIds.join(";")};o.value&&(e=g.W.promoteManage_editAdzone,a.id=l.promoteInfo.id,delete a.accountId,delete a.siteId);const{code:t,data:i,msg:d}=await m.Z.postQuery(e,a);return 0===t?(p.z8.success(d||"操作成功"),Promise.resolve()):(p.z8.error(d||"操作失败"),Promise.reject(d||"操作失败"))}catch(e){return Promise.reject(e)}finally{U.value=!1}};return(e,a)=>{const o=u.BT,p=u.km,m=r.EZ,g=n.d0,S=t.t;return(0,d.wg)(),(0,d.iD)("div",null,[(0,d.Wm)(g,{"model-value":l.dialogVisible,"before-close":G,"show-close":!0,width:"573px","close-on-click-modal":!1},{default:(0,d.w5)((()=>[(0,d._)("div",I,[(0,d._)("span",y,(0,c.zw)((0,s.SU)(C)),1)]),(0,d.wy)(((0,d.wg)(),(0,d.iD)("div",null,[(0,d._)("div",w,[(0,d._)("div",_,[b,(0,d.Wm)(p,{modelValue:N.accountId,"onUpdate:modelValue":a[0]||(a[0]=e=>N.accountId=e),disabled:(0,s.SU)(i),placeholder:"请选择淘宝账号ID",clearable:"",onChange:q},{default:(0,d.w5)((()=>[((0,d.wg)(!0),(0,d.iD)(d.HY,null,(0,d.Ko)(H.value,(e=>((0,d.wg)(),(0,d.j4)(o,{key:e.id,label:`${e.accountId}(${e.tbNickname})`,value:e.accountId},null,8,["label","value"])))),128))])),_:1},8,["modelValue","disabled"])]),(0,d._)("div",f,[h,(0,d.Wm)(p,{modelValue:N.siteId,"onUpdate:modelValue":a[1]||(a[1]=e=>N.siteId=e),disabled:(0,s.SU)(v),placeholder:"请选择媒体ID",clearable:"",onChange:B},{default:(0,d.w5)((()=>[((0,d.wg)(!0),(0,d.iD)(d.HY,null,(0,d.Ko)(Z.value,(e=>((0,d.wg)(),(0,d.j4)(o,{key:e.id,label:`${e.siteId}(${e.siteName})`,value:e.siteId},null,8,["label","value"])))),128))])),_:1},8,["modelValue","disabled"])]),(0,d._)("div",W,[k,(0,d.Wm)(m,{modelValue:N.pidName,"onUpdate:modelValue":a[2]||(a[2]=e=>N.pidName=e),modelModifiers:{trim:!0},placeholder:"请输入推广位名称"},null,8,["modelValue"])]),(0,d._)("div",V,[D,(0,d.Wm)(m,{modelValue:N.pid,"onUpdate:modelValue":a[3]||(a[3]=e=>N.pid=e),modelModifiers:{trim:!0},placeholder:"请输入推广位ID"},null,8,["modelValue"])]),(0,d._)("div",A,[z,(0,d.Wm)(p,{modelValue:N.groupIds,"onUpdate:modelValue":a[4]||(a[4]=e=>N.groupIds=e),placeholder:"请选择分组",multiple:"",clearable:"",onChange:Y},{default:(0,d.w5)((()=>[((0,d.wg)(!0),(0,d.iD)(d.HY,null,(0,d.Ko)(x.value,(e=>((0,d.wg)(),(0,d.j4)(o,{key:e.groupId,label:e.groupName,value:e.groupId},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])]),(0,d._)("div",{class:"footer"},[(0,d._)("div",{class:"btn",onClick:G},"取消"),(0,d._)("div",{class:"btn btn-confirm ml-14",onClick:$},"确定")])])),[[S,U.value]])])),_:1},8,["model-value"])])}}}),U=l(89);const H=(0,U.Z)(C,[["__scopeId","data-v-ae6e848e"]]);var Z=H,x=l(864);const N={class:"header"},S={class:"title"},j={class:"content"};var M=(0,d.aZ)({__name:"groupListDialog",props:{dialogVisible:{type:Boolean,default:()=>!1},pid:{type:[String,Number],default:()=>""}},emits:["close"],setup(e,{emit:a}){const l=e,i=(0,d.Fl)((()=>"")),r=(0,s.iH)(!1),u=(0,s.qj)({pid:""}),v=(0,s.iH)([]);(0,d.YP)((()=>l.dialogVisible),(e=>{e&&(I(),y())}));const I=()=>{v.value=[],u.pid=l.pid},y=async()=>{try{r.value=!0;const e=g.W.promoteGroup_listPidGroups,a={pid:u.pid},{code:l,data:t,msg:o}=await m.Z.get(e,a);0===l&&Array.isArray(t)?v.value=t:(v.value=[],p.z8.error(o||"操作失败"))}catch(e){}finally{r.value=!1}},w=()=>{a("close")};return(e,a)=>{const u=o.$Y,p=o.eI,m=n.d0,g=t.t;return(0,d.wg)(),(0,d.iD)("div",null,[(0,d.Wm)(m,{"model-value":l.dialogVisible,"before-close":w,"show-close":!0,width:"573px","close-on-click-modal":!1},{default:(0,d.w5)((()=>[(0,d._)("div",N,[(0,d._)("span",S,(0,c.zw)((0,s.SU)(i)),1)]),(0,d.wy)(((0,d.wg)(),(0,d.iD)("div",null,[(0,d._)("div",j,[(0,d.Wm)(p,{data:v.value,"max-height":450,"header-cell-style":(0,s.SU)(x.gw),"cell-style":(0,s.SU)(x.HE),"row-style":(0,s.SU)(x.T)},{default:(0,d.w5)((()=>[(0,d.Wm)(u,{prop:"groupName",label:"分组名称",align:"center"}),(0,d.Wm)(u,{prop:"groupManager",label:"负责人",align:"center"})])),_:1},8,["data","header-cell-style","cell-style","row-style"])])])),[[g,r.value]])])),_:1},8,["model-value"])])}}});const P=(0,U.Z)(M,[["__scopeId","data-v-7b032e18"]]);var T=P,q=l(2655),B=(l(3970),l(43)),Y=l(3218);const G={class:"page-wrap"},$={class:"content-wrap"},E={class:"group-count"},F=["onClick"],K=(0,d.Uk)("编辑"),L=(0,d.Uk)("删除");var Q=(0,d.aZ)({__name:"index",setup(e){const a=(0,B.w)(),l=(0,s.qj)({list:[],loading:!1,height:300}),n=()=>{l.height=document.documentElement.clientHeight-100},r=async()=>{try{l.loading=!0;const e={accountId:a.globalTbAccountId},{code:t,data:o,msg:i}=await m.Z.get(g.W.promoteManage_listAllPid,e);0===t&&Array.isArray(o)?l.list=o:(l.list=[],p.z8.error(i||"操作失败"))}catch(e){}finally{l.loading=!1}},u=(0,s.iH)(!1),v=(0,s.iH)({}),I=()=>{v.value={},u.value=!0},y=e=>{v.value={...e},u.value=!0},w=()=>{u.value=!1,r()},_=()=>{u.value=!1},b=async e=>{try{await q.T.confirm("确定删除当前推广位吗","提示",{confirmButtonText:"确定",confirmButtonClass:"promote-ElMessageBox-confirm-cls",cancelButtonText:"取消",type:"warning"}),l.loading=!0;const a=g.W.promoteManage_deleteAdzone,t={id:e.id,pid:e.pid},{code:o,data:i,msg:d}=await m.Z.postQuery(a,t);0===o?p.z8.success(d||"操作成功"):p.z8.error(d||"操作失败"),r()}catch(a){}finally{l.loading=!1}},f=(0,s.iH)(!1),h=(0,s.iH)(""),W=e=>{h.value=e.pid,f.value=!0},k=()=>{h.value="",f.value=!1},{getIsLogin:V}=(0,Y.Z)();return(0,d.bv)((async()=>{try{await V(),r(),n()}catch(e){}})),(e,a)=>{const n=o.$Y,r=i.mi,p=o.eI,m=t.t;return(0,d.wy)(((0,d.wg)(),(0,d.iD)("div",G,[(0,d._)("div",{class:"header-wrap"},[(0,d._)("div",{class:"btn",onClick:I},"添加推广位")]),(0,d._)("div",$,[(0,d.Wm)(p,{data:l.list,"max-height":l.height,"header-cell-style":(0,s.SU)(x.gw),"cell-style":(0,s.SU)(x.HE),"row-style":(0,s.SU)(x.T)},{default:(0,d.w5)((()=>[(0,d.Wm)(n,{prop:"pidName",label:"推广位名称",align:"center"}),(0,d.Wm)(n,{prop:"pid",label:"推广位ID",align:"center"}),(0,d.Wm)(n,{prop:"accountId",label:"淘宝账号ID",align:"center"}),(0,d.Wm)(n,{prop:"siteId",label:"媒体ID",align:"center"}),(0,d.Wm)(n,{label:"分组数量",align:"center"},{default:(0,d.w5)((({row:e})=>[(0,d._)("div",E,[(0,d.Uk)((0,c.zw)(e.groupCount)+" ",1),(0,d._)("span",{onClick:a=>W(e)},"查看",8,F)])])),_:1}),(0,d.Wm)(n,{label:"操作",width:"120",fixed:"right",align:"center"},{default:(0,d.w5)((({row:e})=>[(0,d.Wm)(r,{link:"",type:"primary",onClick:a=>y(e)},{default:(0,d.w5)((()=>[K])),_:2},1032,["onClick"]),(0,d.Wm)(r,{link:"",type:"danger",onClick:a=>b(e)},{default:(0,d.w5)((()=>[L])),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data","max-height","header-cell-style","cell-style","row-style"])]),(0,d.Wm)(Z,{dialogVisible:u.value,promoteInfo:v.value,onConfirm:w,onCancel:_},null,8,["dialogVisible","promoteInfo"]),(0,d.Wm)(T,{dialogVisible:f.value,pid:h.value,onClose:k},null,8,["dialogVisible","pid"])])),[[m,l.loading]])}}});const O=(0,U.Z)(Q,[["__scopeId","data-v-2967823d"]]);var J=O}}]);