pages-ib-subsList.Bff46JNF.js 6.3 KB

1
  1. import{d as e,a,_ as l}from"./cwg-page-wrapper.BFOixv7j.js";import{R as t,bh as o,aO as i,aL as s,x as n,aA as r,B as u,bp as c,aW as m,aV as p,aG as d,N as b,bc as v,a8 as f,al as g,M as h,b8 as y,au as C,r as I}from"./index-F6_4Jyh4.js";import{_}from"./liveChat.GIhP_1Cc.js";import{_ as w}from"./cwg-complex-search.DF9Xw24z.js";import{c as j}from"./uni-row.zq2qDVVW.js";import{a as x}from"./cwg-tabel.CMOAYluz.js";import{a as L}from"./cwg-combox.CWJXmSox.js";import{a as A,_ as T}from"./uni-forms.BtDaWeGs.js";import{c as k}from"./index.2vaGpUrt.js";import{i as N}from"./cwg-right-drawer.DxUcCL7k.js";import{A as P}from"./applyIbDialog.D4FirH90.js";import"./logo-full-white.BpiOcQwV.js";import"./useRouter.UV7jRAqd.js";import"./user.Cktg3SZn.js";import"./useLeftSidebarCollapse.BPFK9IFl.js";import"./openExternalUrl.DIEuSLrw.js";import"./useMenuSplit.CWEX60oa.js";import"./cwg-popup.vue_vue_type_style_index_0_scoped_b0faaf66_lang.CpVDMDmX.js";import"./uni-easyinput.B3QBO_js.js";import"./uni-datetime-picker.DBovkksY.js";import"./uni-load-more.DfDVL4Cs.js";import"./uni-loading.CiYBWvZ_.js";import"./cwg-label-line-value.Bqk_BoTX.js";const V=I(t({__name:"subsList",setup(t){const{t:I,locale:V}=o(),{Code:O}=k,R=i({}),D=s({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=i(null),U=i(null),B=i(!1),M=i(""),q=i(),z=i(!1),E=i(!1),H=i(null),W=i({agentId:"",selectedPoint:"",pointOptions:[]});i(null);const G=n(()=>[{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=>Y({type:"vietnamDistribution",row:e}),show:!0},{label:I("Ib.Custom.Commit5"),type:"exclusiveCommission",btnClick:e=>Y({type:"exclusiveCommission",row:e}),show:e=>{var a;return(null==(a=e.exclusiveCommissionOptions)?void 0:a.length)>0}}]}]),K=n(()=>[{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"}]),X=i(N.IbSubs),J=e=>{console.log(e);const a={...e};Object.assign(D,a),C(()=>{F.value.refreshTable()})},Q=e=>{Object.assign(D,e),C(()=>{F.value.refreshTable()})};r(()=>{});const Y=e=>{if("vietnamDistribution"==e.type){const{agentId:a,id:l}=e.row;q.value={id:l||a},z.value=!1,M.value="vietnam",B.value=!0}else"exclusiveCommission"==e.type&&ae(e.row)},Z=()=>{z.value=!0,B.value=!0},$=()=>{q.value={},B.value=!1},ee=e=>{F.value.refreshTable()},ae=async e=>{var a;W.value.agentId=e.id,W.value.selectedPoint="",W.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})):[]),E.value=!0},le=()=>{E.value=!1,W.value.selectedPoint="",W.value.pointOptions=[]},te=async()=>{var e,a;try{(await N.agentHiddenPointAdd({agentId:W.value.agentId,point:[{value:W.value.selectedPoint}]})).code==O.StatusOK&&(le(),null==(a=null==(e=F.value)?void 0:e.refreshTable)||a.call(e))}catch(l){}};return(t,o)=>{const i=m(p("cwg-header"),a),s=m(p("cwg-icon"),_),n=g,r=f,C=m(p("cwg-complex-search"),w),k=m(p("cwg-match-media"),j),N=m(p("cwg-tabel"),x),V=m(p("cwg-combox"),L),O=m(p("uni-forms-item"),A),Y=m(p("uni-forms"),T),ae=m(p("cwg-popup"),l),oe=m(p("cwg-page-wrapper"),e);return d(),u(oe,{class:"create-page",isHeaderFixed:!0},{default:c(()=>[b(i,{title:v(I)("Ib.Custom.Manage2")},null,8,["title"]),b(r,{class:"account-content"},{default:c(()=>[b(k,{"max-width":991},{default:c(()=>[b(r,{class:"search-content mobile-search-content"},{default:c(()=>[b(r,{class:"search-bar mobile-add-btn-wrap"},{default:c(()=>[b(n,{type:"primary",class:"search-button",onClick:Z},{default:c(()=>[b(s,{name:"icon_add",size:18,color:"#fff"}),h(" "+y(v(I)("Ib.Report.Title5")),1)]),_:1})]),_:1}),b(r,{class:"search-bar"},{default:c(()=>[b(C,{fields:S,modelValue:R.value,"onUpdate:modelValue":o[0]||(o[0]=e=>R.value=e),onSearch:J,onReset:Q},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),b(k,{"min-width":991},{default:c(()=>[b(r,{class:"search-content pc-search-content"},{default:c(()=>[b(r,{class:"search-bar"},{default:c(()=>[b(C,{fields:S,modelValue:R.value,"onUpdate:modelValue":o[1]||(o[1]=e=>R.value=e),onSearch:J,onReset:Q,noData:""},null,8,["modelValue"])]),_:1}),b(r,{class:"search-bar"},{default:c(()=>[b(n,{type:"primary",class:"search-button",onClick:Z},{default:c(()=>[b(s,{name:"icon_add",size:18,color:"#fff"}),h(" "+y(v(I)("Ib.Report.Title5")),1)]),_:1})]),_:1})]),_:1})]),_:1}),b(N,{ref_key:"tableRef",ref:F,columns:G.value,mobilePrimaryFields:K.value,queryParams:D,api:X.value,"show-operation":!0,showPagination:!0},null,8,["columns","mobilePrimaryFields","queryParams","api"])]),_:1}),b(P,{ref_key:"applyIbDialogRef",ref:U,visible:B.value,onClose:$,onConfirm:ee,title:z.value?"Ib.Report.Title5":"Ib.Custom.Commit3",isFormApplyIb:z.value,paramsType:M.value,detail:q.value},null,8,["visible","title","isFormApplyIb","paramsType","detail"]),b(ae,{visible:E.value,title:v(I)("Ib.Custom.Commit5"),cancelText:v(I)("Btn.Cancel"),confirmText:v(I)("Btn.Confirm"),onClose:le,onConfirm:te},{default:c(()=>[b(r,{class:"dia-content"},{default:c(()=>[b(Y,{ref_key:"exclusiveCommissionFormRef",ref:H,labelWidth:"240"},{default:c(()=>[b(O,{label:v(I)("Ib.Custom.Commit5"),prop:"selectedPoint"},{default:c(()=>[b(V,{value:W.value.selectedPoint,"onUpdate:value":o[2]||(o[2]=e=>W.value.selectedPoint=e),options:W.value.pointOptions,placeholder:v(I)("placeholder.choose")},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},512)]),_:1})]),_:1},8,["visible","title","cancelText","confirmText"])]),_:1})}}}),[["__scopeId","data-v-eae6f216"]]);export{V as default};