paybackConfig-85ea1543.js 6.1 KB

1
  1. /* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css */import{d as e,R as a,au as l,m as s,x as o,W as m,f as r,o as t,l as i,w as n,a as p,c as d,F as u,y as _,t as c,e as y,b,aD as f,b5 as v,z as g,a4 as h,a3 as x,J as j,aj as V,ab as k,ac as w,S as U,a2 as I,A as O,B as q,Y as C,$ as R,az as D,aA as J,_ as S}from"./index-f181b510.js";import{o as z,a as A}from"./index-bb645a8b.js";/* empty css *//* empty css */import"./http-fe2c0cad.js";/* empty css *//* empty css */const M=e=>(D("data-v-b1ea3cab"),e=e(),J(),e),N={class:"flex items-center"},$=M((()=>y("span",null,"ROI全量上报用户染色时间范围内的有效订单",-1))),B=M((()=>y("br",null,null,-1))),E=M((()=>y("span",null,"ROI全量上报",-1))),F={key:0},L={class:"flex items-end w-full"},W={class:"flex flex-col"},Y=M((()=>y("div",{style:{width:"150px",margin:"0 5px"}},"最小金额(包含)",-1))),G=M((()=>y("span",null,"—",-1))),H={class:"flex flex-col"},K=M((()=>y("div",{style:{width:"150px",margin:"0 5px"}},"最大金额(不包含)",-1))),P={class:"flex flex-col ml-3 mr-3"},Q=M((()=>y("div",{style:{width:"200px",margin:"0 5px"}},"回传参数",-1))),T={key:0},X={class:"flex justify-end"},Z=S(e({__name:"paybackConfig",props:{primary:null|Object},emits:["close"],setup(e,{emit:D}){const J=e;a(),l();const S=s(!1),M=s(),Z=s({name:"",is_roi:2,charge_type:1,charge_money_map:[{min_money:0,max_money:null,callback_type:1,callback_param:""}]}),ee=s([]),ae=()=>{let e=!0;return Z.value.charge_money_map.forEach(((a,l)=>{null==a.min_money||null==a.max_money?(h.error("请输入金额"),e=!1):a.max_money<=a.min_money&&a.max_money&&(h.error("金额上限小于或等于金额下限,请重新输入"),e=!1)})),e},le=()=>{var e;ae()&&Z.value.charge_money_map.push({min_money:(null==(e=Z.value.charge_money_map.at(-1))?void 0:e.max_money)||0,max_money:null,callback_type:1,callback_param:""})};return J.primary&&(J.primary,J.primary.ids&&(Z.value=JSON.parse(JSON.stringify(J.primary)))),o((()=>{z().then((e=>{ee.value=e.data}))})),(e,a)=>{const l=x,s=j,o=V,z=k,se=w,oe=U,me=I,re=O,te=q,ie=C,ne=R;return m((t(),i(ie,{model:r(Z),"label-width":"120px",ref_key:"form",ref:M,class:"pr-4"},{default:n((()=>[p(l,{label:"回传配置ID",prop:"ids",rules:[{required:!1,message:"巨量账户ID必须填写"}],"label-width":"120px"},{default:n((()=>[(t(!0),d(u,null,_(r(Z).ids,(e=>(t(),d("span",{key:e,class:"account-ids"},c(e),1)))),128))])),_:1}),p(l,{label:"ROI全量上报",prop:"is_roi",rules:[{required:!0,message:"ROI全量上报必须选择"}],"label-width":"120px"},{label:n((()=>[y("div",N,[p(o,{placement:"top"},{content:n((()=>[$,b(),B])),default:n((()=>[p(s,null,{default:n((()=>[p(r(f))])),_:1})])),_:1}),E])])),default:n((()=>[p(se,{modelValue:r(Z).is_roi,"onUpdate:modelValue":a[0]||(a[0]=e=>r(Z).is_roi=e)},{default:n((()=>[p(z,{label:1},{default:n((()=>[b("是")])),_:1}),p(z,{label:2},{default:n((()=>[b("否")])),_:1})])),_:1},8,["modelValue"])])),_:1}),1!=r(Z).is_roi?(t(),d("div",F,[p(l,{label:"充值行为",prop:"charge_type",rules:[{required:!0,message:"充值行为必须选择"}],"label-width":"120px"},{default:n((()=>[p(se,{modelValue:r(Z).charge_type,"onUpdate:modelValue":a[1]||(a[1]=e=>r(Z).charge_type=e)},{default:n((()=>[p(z,{label:1},{default:n((()=>[b("首充")])),_:1}),p(z,{label:0},{default:n((()=>[b("所有充值")])),_:1})])),_:1},8,["modelValue"])])),_:1}),p(l,{label:"金额项",prop:"charge_money_map",rules:[{required:!0,message:"金额项必须填写"}]},{default:n((()=>[y("div",null,[p(oe,{type:"primary",onClick:le},{default:n((()=>[b("添加")])),_:1}),(t(!0),d(u,null,_(r(Z).charge_money_map,((e,a)=>(t(),d("div",{class:"custom-item",key:a},[y("div",L,[y("span",null,[p(s,{onClick:e=>{return l=a,void(Z.value.charge_money_map.length>1&&l===Z.value.charge_money_map.length-1&&Z.value.charge_money_map.splice(l,1));var l},class:"cursor-pointer",color:a===r(Z).charge_money_map.length-1&&r(Z).charge_money_map.length>1?"#000":"#999"},{default:n((()=>[p(r(v))])),_:2},1032,["onClick","color"])]),y("div",W,[Y,p(me,{style:{width:"150px",margin:"0 5px"},disabled:"",min:0,modelValue:e.min_money,"onUpdate:modelValue":a=>e.min_money=a,modelModifiers:{number:!0},type:"number"},{append:n((()=>[b("元")])),_:2},1032,["modelValue","onUpdate:modelValue"])]),G,y("div",H,[K,p(me,{style:{width:"150px",margin:"0 5px"},min:0,modelValue:e.max_money,"onUpdate:modelValue":a=>e.max_money=a,modelModifiers:{number:!0},type:"number"},{append:n((()=>[b("元")])),_:2},1032,["modelValue","onUpdate:modelValue"])]),y("div",P,[Q,p(se,{modelValue:e.callback_type,"onUpdate:modelValue":a=>e.callback_type=a},{default:n((()=>[p(z,{label:1},{default:n((()=>[b("全部回传")])),_:1}),p(z,{label:2},{default:n((()=>[b("全部不回传")])),_:1}),p(z,{label:3},{default:n((()=>[b("自定义")])),_:1})])),_:2},1032,["modelValue","onUpdate:modelValue"])]),3==e.callback_type?(t(),d("div",T,[p(te,{modelValue:e.callback_param,"onUpdate:modelValue":a=>e.callback_param=a,filterable:"",clearable:"",placeholder:"请选择"},{default:n((()=>[(t(!0),d(u,null,_(r(ee),(e=>(t(),i(re,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue"])])):g("",!0)])])))),128))])])),_:1})])):g("",!0),y("div",X,[p(oe,{type:"primary",onClick:a[2]||(a[2]=e=>{var a;(a=r(M))&&(S.value=!0,a&&a.validate((e=>{var a;if(e){if(2==Z.value.is_roi){if(!ae())return void(S.value=!1)}else 1==Z.value.is_roi&&delete Z.value.charge_money_map;(null==(a=null==J?void 0:J.primary)?void 0:a.ids)&&A(Z.value).then((e=>{h.success(e.message),S.value=!1,D("close")})).catch((e=>{S.value=!1}))}else S.value=!1})).then((()=>{})))})},{default:n((()=>[b(c(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[ne,r(S)]])}}}),[["__scopeId","data-v-b1ea3cab"]]);export{Z as default};