1 |
- import{d as F,r as i,e as G,u as H,L as Q,Q as J,o as u,c as V,f as t,w as o,n as m,a as e,x as g,v as p,P as v,t as W,F as X,j as $,C as K,i as Y,G as Z,H as tt,I as at,_ as et,__tla as rt}from"./index-7db069d5.js";import{_ as st,__tla as lt}from"./ContentWrap-4a402efa.js";import{_ as ot,__tla as ct}from"./index-ccb080b4.js";import{E as _t,__tla as it}from"./el-link-813cdf9e.js";import{g as nt,a as ut,__tla as mt}from"./index-9a03c93a.js";import{c as pt,d as dt,__tla as ft}from"./index-42b0e067.js";import yt,{__tla as ht}from"./BusinessForm-0ab98627.js";import{B as R,__tla as bt}from"./index-af8b92ea.js";import{f as It,__tla as gt}from"./formatter-1c1a6625.js";import vt,{__tla as wt}from"./BusinessListModal-ae07958b.js";import{u as Ct,__tla as zt}from"./useMessage-146fa796.js";import{__tla as kt}from"./ContentWrap.vue_vue_type_script_setup_true_lang-4f367f62.js";import{__tla as Nt}from"./el-card-52ebe6e4.js";import{__tla as xt}from"./index-24cab227.js";import{__tla as Rt}from"./Dialog-14642b7a.js";import{__tla as St}from"./DictTag-5478680f.js";import"./color-6e929987.js";import{__tla as Tt}from"./dict-62516d0e.js";import{__tla as Bt}from"./index-9ae5e753.js";import{__tla as Lt}from"./index-58667b97.js";let S,qt=Promise.all([(()=>{try{return rt}catch{}})(),(()=>{try{return lt}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return it}catch{}})(),(()=>{try{return mt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return ht}catch{}})(),(()=>{try{return bt}catch{}})(),(()=>{try{return gt}catch{}})(),(()=>{try{return wt}catch{}})(),(()=>{try{return zt}catch{}})(),(()=>{try{return kt}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{}})(),(()=>{try{return Lt}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=Ct(),l=T,f=i(!0),w=i(0),C=i([]),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}C.value=r.list,w.value=r.total}finally{f.value=!1}},h=()=>{a.pageNo=1,y()},z=i(),B=()=>{z.value.open("create")},{push:L}=H(),k=i(),q=()=>{k.value.open()},M=async r=>{const s={contactId:l.bizId,businessIds:r};b.value.getSelectionRows().forEach(n=>{s.businessIds.push(n.id)}),await pt(s),d.success("\u5173\u8054\u5546\u673A\u6210\u529F"),h()},b=i(),P=async()=>{const r={contactId:l.bizId,businessIds:b.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"),h()};return Q(()=>[l.bizId,l.bizType],()=>{h()},{immediate:!0,deep:!0}),(r,s)=>{const n=$,I=K,E=Y,c=Z,U=_t,j=tt,D=ot,O=st,N=J("hasPermi"),A=at;return u(),V(X,null,[t(E,{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:q},{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(j,{ref_key:"businessRef",ref:b,data:e(C),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(_=>[t(U,{type:"primary",underline:!1,onClick:Mt=>{return x=_.row.id,void L({name:"CrmBusinessDetail",params:{id:x}});var x}},{default:o(()=>[m(W(_.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(D,{total:e(w),page:e(a).pageNo,"onUpdate:page":s[0]||(s[0]=_=>e(a).pageNo=_),limit:e(a).pageSize,"onUpdate:limit":s[1]||(s[1]=_=>e(a).pageSize=_),onPagination:y},null,8,["total","page","limit"])]),_:1}),t(yt,{ref_key:"formRef",ref:z,onSuccess:y},null,512),t(vt,{ref_key:"businessModalRef",ref:k,"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};
|