1 |
- import{d as F,r as _,e as G,u as H,L as Q,Q as J,o as u,c as K,f as t,w as o,n as m,a as e,x as g,v as p,P as v,t as V,F as W,j as X,C as Y,i as Z,G as $,H as tt,I as at,_ as et,__tla as rt}from"./index-e3afde76.js";import{_ as st,__tla as lt}from"./ContentWrap-5f2f4872.js";import{_ as ot,__tla as ct}from"./index-51c17e69.js";import{E as it,__tla as _t}from"./el-link-6cf0ca3c.js";import{g as nt,a as ut,__tla as mt}from"./index-c26ce0f1.js";import{c as pt,d as dt,__tla as ft}from"./index-92925b9b.js";import yt,{__tla as bt}from"./BusinessForm-b13d5e03.js";import{B as R,__tla as ht}from"./index-ba4f72af.js";import{f as It,__tla as gt}from"./formatter-57b94654.js";import vt,{__tla as wt}from"./BusinessListModal-394262fb.js";import{u as zt,__tla as kt}from"./useMessage-0b1b25bd.js";import{__tla as Ct}from"./el-card-6198c22a.js";import{__tla as Nt}from"./index-2d20a7ff.js";import{__tla as xt}from"./Dialog-c20523c4.js";import{__tla as Rt}from"./DictTag-715a7ef1.js";import"./color-6e929987.js";import{__tla as St}from"./dict-a141296d.js";import{__tla as Tt}from"./index-45292096.js";import{__tla as Bt}from"./index-f22d75b3.js";let S,qt=Promise.all([(()=>{try{return rt}catch{}})(),(()=>{try{return lt}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return _t}catch{}})(),(()=>{try{return mt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return bt}catch{}})(),(()=>{try{return ht}catch{}})(),(()=>{try{return gt}catch{}})(),(()=>{try{return wt}catch{}})(),(()=>{try{return kt}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return Nt}catch{}})(),(()=>{try{return xt}catch{}})(),(()=>{try{return Rt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return Tt}catch{}})(),(()=>{try{return Bt}catch{}})()]).then(async()=>{S=et(F({name:"CrmBusinessList",__name:"BusinessList",props:{bizType:{type:Number,required:!0},bizId:{type:Number,required:!0},customerId:{type:Number,required:!1}},setup(T){const d=zt(),l=T,f=_(!0),w=_(0),z=_([]),a=G({pageNo:1,pageSize:10,customerId:void 0,contactId:void 0}),y=async()=>{f.value=!0;try{a.customerId=void 0,a.contactId=void 0;let r={list:[],total:0};switch(l.bizType){case R.CRM_CUSTOMER:a.customerId=l.bizId,r=await ut(a);break;case R.CRM_CONTACT:a.contactId=l.bizId,r=await nt(a);break;default:return}z.value=r.list,w.value=r.total}finally{f.value=!1}},b=()=>{a.pageNo=1,y()},k=_(),B=()=>{k.value.open("create")},{push:q}=H(),C=_(),L=()=>{C.value.open()},M=async r=>{const s={contactId:l.bizId,businessIds:r};h.value.getSelectionRows().forEach(n=>{s.businessIds.push(n.id)}),await pt(s),d.success("\u5173\u8054\u5546\u673A\u6210\u529F"),b()},h=_(),P=async()=>{const r={contactId:l.bizId,businessIds:h.value.getSelectionRows().map(s=>s.id)};if(r.businessIds.length===0)return d.error("\u672A\u9009\u62E9\u5546\u673A");await dt(r),d.success("\u53D6\u5173\u5546\u673A\u6210\u529F"),b()};return Q(()=>[l.bizId,l.bizType],()=>{b()},{immediate:!0,deep:!0}),(r,s)=>{const n=X,I=Y,D=Z,c=$,E=it,U=tt,j=ot,O=st,N=J("hasPermi"),A=at;return u(),K(W,null,[t(D,{justify:"end"},{default:o(()=>[t(I,{onClick:B},{default:o(()=>[t(n,{class:"mr-5px",icon:"ep:opportunity"}),m(" \u521B\u5EFA\u5546\u673A ")]),_:1}),e(a).contactId?g((u(),p(I,{key:0,onClick:L},{default:o(()=>[t(n,{class:"mr-5px",icon:"ep:circle-plus"}),m("\u5173\u8054 ")]),_:1})),[[N,["crm:contact:create-business"]]]):v("",!0),e(a).contactId?g((u(),p(I,{key:1,onClick:P},{default:o(()=>[t(n,{class:"mr-5px",icon:"ep:remove"}),m("\u89E3\u9664\u5173\u8054 ")]),_:1})),[[N,["crm:contact:delete-business"]]]):v("",!0)]),_:1}),t(O,{class:"mt-10px"},{default:o(()=>[g((u(),p(U,{ref_key:"businessRef",ref:h,data:e(z),stripe:!0,"show-overflow-tooltip":!0},{default:o(()=>[e(a).contactId?(u(),p(c,{key:0,type:"selection",width:"55"})):v("",!0),t(c,{label:"\u5546\u673A\u540D\u79F0",fixed:"left",align:"center",prop:"name"},{default:o(i=>[t(E,{type:"primary",underline:!1,onClick:Lt=>{return x=i.row.id,void q({name:"CrmBusinessDetail",params:{id:x}});var x}},{default:o(()=>[m(V(i.row.name),1)]),_:2},1032,["onClick"])]),_:1}),t(c,{label:"\u5546\u673A\u91D1\u989D",align:"center",prop:"price",formatter:e(It)},null,8,["formatter"]),t(c,{label:"\u5BA2\u6237\u540D\u79F0",align:"center",prop:"customerName"}),t(c,{label:"\u5546\u673A\u7EC4",align:"center",prop:"statusTypeName"}),t(c,{label:"\u5546\u673A\u9636\u6BB5",align:"center",prop:"statusName"})]),_:1},8,["data"])),[[A,e(f)]]),t(j,{total:e(w),page:e(a).pageNo,"onUpdate:page":s[0]||(s[0]=i=>e(a).pageNo=i),limit:e(a).pageSize,"onUpdate:limit":s[1]||(s[1]=i=>e(a).pageSize=i),onPagination:y},null,8,["total","page","limit"])]),_:1}),t(yt,{ref_key:"formRef",ref:k,onSuccess:y},null,512),t(vt,{ref_key:"businessModalRef",ref:C,"customer-id":l.customerId,onSuccess:M},null,8,["customer-id"])],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/crm/business/components/BusinessList.vue"]])});export{qt as __tla,S as default};
|