| 1 |
- import{_ as e,a}from"./cwg-page-wrapper.Em0oD8Gp.js";import{d as l,u as t,r as o,aq as i,c as s,o as n,f as r,g as u,i as c,j as m,k as p,l as d,m as b,n as v,t as f,P as g,z as h,x as C,a2 as y,_ as I}from"./index-cgJbsk9Q.js";import{_}from"./liveChat.BUvaIfgQ.js";import{_ as w}from"./cwg-complex-search.7WhV6Xqy.js";import{_ as j}from"./cwg-link.lANmZlwR.js";import{_ as x}from"./cwg-tabel.D8rTO_-r.js";import{_ as L}from"./cwg-combox.BkQ7-dcX.js";import{_ as T,a as A}from"./uni-forms.Dhln0KHN.js";import{a as k}from"./user.BtyQGfSG.js";import{i as P}from"./cwg-right-drawer.DV6KhR1m.js";import{A as N}from"./applyIbDialog.CoYI3INZ.js";import"./logo-full-white.B1je6nNN.js";import"./useRouter.9Te-FnFv.js";import"./useLeftSidebarCollapse.DcXanZiP.js";import"./openExternalUrl.DIEuSLrw.js";import"./useMenuSplit.COJ5VtSh.js";import"./uni-easyinput.DsosIYn9.js";import"./uni-datetime-picker.CnmNB7rh.js";import"./uni-load-more.B2nuQMH0.js";import"./uni-loading.CpAW2iQN.js";import"./cwg-label-line-value.CvkmiB4B.js";const V=I(l({__name:"subsList",setup(l){const{t:I,locale:V}=t(),{Code:O}=y,R=o({}),D=i({ibNo:"",name:"",cId:""}),S=[{key:"ibNo",type:"input",label:I("Label.IbAccount"),placeholder:I("Label.IbAccount"),defaultValue:""},{key:"name",type:"input",label:I("Ib.Custom.NameLabel"),placeholder:I("Ib.Custom.NameLabel"),defaultValue:""},{key:"cId",type:"input",label:"CID",placeholder:"CID",defaultValue:""},{key:"date",label:I("placeholder.Start")+" - "+I("placeholder.End"),type:"daterange",defaultValue:["",""]}],F=o(null),U=o(null),q=o(!1),z=o(""),B=o(),E=o(!1),H=o(!1),M=o(null),K=o({agentId:"",selectedPoint:"",pointOptions:[]});o(null);const W=s(()=>[{prop:"cId",label:I("Label.CidAccount"),align:"center"},{prop:"ibNo",label:I("Label.IbAccount"),align:"center"},{prop:"name",label:I("Ib.Custom.NameLabel"),align:"center"},{prop:"agentNum",label:I("Ib.Custom.AgentNum"),align:"center"},{prop:"customNum",label:I("Ib.Custom.CustomerNum"),align:"center"},{prop:"addTime",label:I("Label.ApplyTime"),align:"center"},{prop:"lastTime",label:I("Ib.Custom.LastActiveTime"),align:"center"},{prop:"action",label:I("Label.Action"),type:"action",align:"center",menuList:[{label:I("Ib.Custom.Commit3"),type:"vietnamDistribution",btnClick:e=>X({type:"vietnamDistribution",row:e}),show:!0},{label:I("Ib.Custom.Commit5"),type:"exclusiveCommission",btnClick:e=>X({type:"exclusiveCommission",row:e}),show:e=>{var a;return(null==(a=e.exclusiveCommissionOptions)?void 0:a.length)>0}}]}]),Y=s(()=>[{prop:"cId",label:I("Label.CidAccount"),align:"center"},{prop:"ibNo",label:I("Label.IbAccount"),align:"center"},{prop:"name",label:I("Ib.Custom.NameLabel"),align:"center"},{prop:"more",type:"more",width:20,align:"right"}]),G=o(P.IbSubs),J=e=>{console.log(e);const a={...e};Object.assign(D,a),g(()=>{F.value.refreshTable()})},Q=e=>{Object.assign(D,e),g(()=>{F.value.refreshTable()})};n(()=>{});const X=e=>{if("vietnamDistribution"==e.type){const{agentId:a,id:l}=e.row;B.value={id:l||a},E.value=!1,z.value="vietnam",q.value=!0}else"exclusiveCommission"==e.type&&ae(e.row)},Z=()=>{E.value=!0,q.value=!0},$=()=>{B.value={},q.value=!1},ee=e=>{F.value.refreshTable()},ae=async e=>{var a;K.value.agentId=e.id,K.value.selectedPoint="",K.value.pointOptions=(a=(null==e?void 0:e.exclusiveCommissionOptions)||[],Array.isArray(a)?a.map(e=>({text:e.label??e.text??e.name??String(e.value??""),value:e.value})):[]),H.value=!0},le=()=>{H.value=!1,K.value.selectedPoint="",K.value.pointOptions=[]},te=async()=>{var e,a;try{(await P.agentHiddenPointAdd({agentId:K.value.agentId,point:[{value:K.value.selectedPoint}]})).code==O.StatusOK&&(le(),null==(a=null==(e=F.value)?void 0:e.refreshTable)||a.call(e))}catch(l){}};return(l,t)=>{const o=r(u("cwg-header"),e),i=r(u("cwg-icon"),_),s=h,n=C,g=r(u("cwg-complex-search"),w),y=r(u("cwg-match-media"),j),P=r(u("cwg-tabel"),x),V=r(u("cwg-combox"),L),O=r(u("uni-forms-item"),T),X=r(u("uni-forms"),A),ae=r(u("cwg-popup"),k),oe=r(u("cwg-page-wrapper"),a);return c(),m(oe,{class:"create-page",isHeaderFixed:!0},{default:p(()=>[d(o,{title:b(I)("Ib.Custom.Manage2")},null,8,["title"]),d(n,{class:"account-content"},{default:p(()=>[d(y,{"max-width":991},{default:p(()=>[d(n,{class:"search-content mobile-search-content"},{default:p(()=>[d(n,{class:"search-bar mobile-add-btn-wrap"},{default:p(()=>[d(s,{type:"primary",class:"search-button",onClick:Z},{default:p(()=>[d(i,{name:"icon_add",size:18,color:"#fff"}),v(" "+f(b(I)("Ib.Report.Title5")),1)]),_:1})]),_:1}),d(n,{class:"search-bar"},{default:p(()=>[d(g,{fields:S,modelValue:R.value,"onUpdate:modelValue":t[0]||(t[0]=e=>R.value=e),onSearch:J,onReset:Q},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),d(y,{"min-width":991},{default:p(()=>[d(n,{class:"search-content pc-search-content"},{default:p(()=>[d(n,{class:"search-bar"},{default:p(()=>[d(g,{fields:S,modelValue:R.value,"onUpdate:modelValue":t[1]||(t[1]=e=>R.value=e),onSearch:J,onReset:Q,noData:""},null,8,["modelValue"])]),_:1}),d(n,{class:"search-bar"},{default:p(()=>[d(s,{type:"primary",class:"search-button",onClick:Z},{default:p(()=>[d(i,{name:"icon_add",size:18,color:"#fff"}),v(" "+f(b(I)("Ib.Report.Title5")),1)]),_:1})]),_:1})]),_:1})]),_:1}),d(P,{ref_key:"tableRef",ref:F,columns:W.value,mobilePrimaryFields:Y.value,queryParams:D,api:G.value,"show-operation":!0,showPagination:!0},null,8,["columns","mobilePrimaryFields","queryParams","api"])]),_:1}),d(N,{ref_key:"applyIbDialogRef",ref:U,visible:q.value,onClose:$,onConfirm:ee,title:E.value?"Ib.Report.Title5":"Ib.Custom.Commit3",isFormApplyIb:E.value,paramsType:z.value,detail:B.value},null,8,["visible","title","isFormApplyIb","paramsType","detail"]),d(ae,{visible:H.value,title:b(I)("Ib.Custom.Commit5"),cancelText:b(I)("Btn.Cancel"),confirmText:b(I)("Btn.Confirm"),onClose:le,onConfirm:te},{default:p(()=>[d(n,{class:"dia-content"},{default:p(()=>[d(X,{ref_key:"exclusiveCommissionFormRef",ref:M,labelWidth:"240"},{default:p(()=>[d(O,{label:b(I)("Ib.Custom.Commit5"),prop:"selectedPoint"},{default:p(()=>[d(V,{value:K.value.selectedPoint,"onUpdate:value":t[2]||(t[2]=e=>K.value.selectedPoint=e),options:K.value.pointOptions,placeholder:b(I)("placeholder.choose")},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},512)]),_:1})]),_:1},8,["visible","title","cancelText","confirmText"])]),_:1})}}}),[["__scopeId","data-v-548a88d7"]]);export{V as default};
|