index-60608d18.js 6.5 KB

1
  1. var Y=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var M=(a,o,e)=>o in a?Y(a,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[o]=e,D=(a,o)=>{for(var e in o||(o={}))oe.call(o,e)&&M(a,e,o[e]);if(R)for(var e of R(o))ae.call(o,e)&&M(a,e,o[e]);return a},x=(a,o)=>ee(a,te(o));var p=(a,o,e)=>new Promise((w,l)=>{var g=i=>{try{s(e.next(i))}catch(m){l(m)}},v=i=>{try{s(e.throw(i))}catch(m){l(m)}},s=i=>i.done?w(i.value):Promise.resolve(i.value).then(g,v);s((e=e.apply(a,o)).next())});import{d as ne,Z as B,r as A,aa as ie,aZ as ce,o as _,m as F,af as y,g as r,f as n,ao as V,q as E,y as z,v as N,dh as U,F as re,w as le,bf as se,t as j,bz as me,j as de}from"./index-610a1d46.js";import{X as pe}from"./XTForm-6038013b.js";import{u as ue,B as fe}from"./useTable-867c4776.js";import{T as be}from"./TableAction-5a56375b.js";import"./TableImg.vue_vue_type_style_index_0_lang-5ef0e11d.js";import{b as he}from"./data-f553955e.js";import{k as _e,l as L,m as P,c as ye}from"./customerApi-b54bb82e.js";import{I as we}from"./ImportModal-17006f21.js";import{u as X}from"./index-985aa6f5.js";/* empty css */import{_ as ge}from"./formModal.vue_vue_type_script_setup_true_lang-036b3161.js";import ve from"./formDrawer-a0496a56.js";import Ce from"./formClientSatisfactionDrawer-d1e559d6.js";import{u as Z}from"./index-c98ef572.js";import{l as De}from"./index-981858ed.js";/* empty css */import"./useForm-c19ef35c.js";import"./index-b6d11df2.js";import"./index-72381a11.js";import"./index-4ed0dc84.js";import"./uuid-98bbe2a6.js";import"./download-a90dd227.js";import"./XTUpload.vue_vue_type_style_index_0_scoped_61a00cd1_lang-bad913d6.js";import"./uniqBy-2b2a500d.js";import"./index-ee1a65fd.js";import"./useWindowSizeFn-1829b247.js";import"./useContentViewHeight-20fe3432.js";import"./componentMap-5f77da43.js";import"./clickOutside-a1389e7b.js";import"./sortable.esm-4ae27e0b.js";import"./SettingOutlined-56eda530.js";import"./RedoOutlined-bc502432.js";import"./index-74f93929.js";import"./validate-122b42a7.js";const xe=[{code:"11",name:"北京市"},{code:"12",name:"天津市"},{code:"13",name:"河北省"},{code:"14",name:"山西省"},{code:"15",name:"内蒙古自治区"},{code:"21",name:"辽宁省"},{code:"22",name:"吉林省"},{code:"23",name:"黑龙江省"},{code:"31",name:"上海市"},{code:"32",name:"江苏省"},{code:"33",name:"浙江省"},{code:"34",name:"安徽省"},{code:"35",name:"福建省"},{code:"36",name:"江西省"},{code:"37",name:"山东省"},{code:"41",name:"河南省"},{code:"42",name:"湖北省"},{code:"43",name:"湖南省"},{code:"44",name:"广东省"},{code:"45",name:"广西壮族自治区"},{code:"46",name:"海南省"},{code:"50",name:"重庆市"},{code:"51",name:"四川省"},{code:"52",name:"贵州省"},{code:"53",name:"云南省"},{code:"54",name:"西藏自治区"},{code:"61",name:"陕西省"},{code:"62",name:"甘肃省"},{code:"63",name:"青海省"},{code:"64",name:"宁夏回族自治区"},{code:"65",name:"新疆维吾尔自治区"}],ke={class:"bg-white"},Se={class:"flex justify-between header"},Te={class:"mt-4 content"},Ie=ne({__name:"index",setup(a){const[o,{openModal:e}]=X(),[w,{openModal:l}]=X(),[g,{openDrawer:v}]=Z(),[s,{openDrawer:i}]=Z(),{createMessage:m}=me(),k=B({}),S=[{key:"clientType",dictCode:"client_type"}],T=A([]),u=B({blurry:"",complaint:null,area:""}),I=A([{field:"create_time",direction:"DESC"}]);ie(()=>p(this,null,function*(){const t=yield De(S.map(c=>c.dictCode));for(const c in t){const b=S.filter(h=>h.dictCode==c)[0];k[b.key]=t[c]}T.value=[{name:"blurry",componentType:"Input",placeholder:"请输入样品名称/客户名称",prefix:"icon-xt-search",width:280},{name:"complaint",componentType:"Select",placeholder:"请选择",defaultValue:null,dicts:[{label:"全部",value:null},{label:"有投诉",value:!0},{label:"无投诉",value:!1}],width:150},{name:"area",componentType:"Select",placeholder:"请选择省份",defaultValue:null,dicts:xe.map(c=>({label:c.name,value:c.code})),width:150}]}));const[q,{reload:C}]=ue({rowKey:"id",api:ye,columns:he,bordered:!1,showIndexColumn:!0,pagination:!0,striped:!1,rowSelection:{type:"checkbox"},clickToRowSelect:!1,batchDelApi:P,batchExportApi:L,exportAuthList:["lab:client:export"],delAuthList:["lab:client:remove"],actionColumn:{width:260,title:"操作",dataIndex:"action"},beforeFetch:K});function K(t){return x(D({},t),{orders:I.value}),x(D({},t),{orders:I.value,blurry:u.blurry,complaint:u.complaint})}function O(){e(!0,{title:"导入客户资料",importUrl:_e,exportUrl:L})}function Q(){l(!0,{isUpdate:!1})}function $(t){l(!0,{isUpdate:!0,record:t})}function G(t){return p(this,null,function*(){yield P([t.id]),m.success("删除成功"),yield C()})}function H(t){v(!0,{record:t})}function J(t){i(!0,{record:t})}function f(){return p(this,null,function*(){yield C()})}function W(t){return p(this,null,function*(){u.blurry=t.blurry||"",u.complaint=t.complaint||"",yield C()})}return(t,c)=>{const b=ce("auth");return _(),F("div",ke,[y("div",Se,[y("div",null,[r(n(pe),{"form-data":T.value,onChange:W},null,8,["form-data"])]),y("div",null,[V((_(),E(n(U),{type:"primary",onClick:Q,preIcon:"icon-plus|iconfont",class:"mr-2 btn-text"},{default:z(()=>[N("新增客户")]),_:1})),[[b,["lab:client:add"]]]),V(r(n(U),{onClick:O,preIcon:"icon-xt-import_default|iconfont",class:"btn-icon","icon-size":18},null,512),[[b,[" lab:client:import"]]])])]),y("div",Te,[r(n(fe),{onRegister:n(q)},{bodyCell:z(({column:h,record:d})=>[h.key==="type"?(_(),F(re,{key:0},[N(le(n(se)(k.clientType,d.type)),1)],64)):j("",!0),h.key==="action"?(_(),E(n(be),{key:1,actions:[{auth:"lab:client:edit",label:"满意度",tooltip:"满意度",onClick:J.bind(null,d)},{auth:"lab:client:edit",label:"投诉",tooltip:"投诉",onClick:H.bind(null,d)}],dropDownActions:[{auth:"lab:client:edit",label:"编辑",tooltip:"编辑",onClick:$.bind(null,d)},{auth:"lab:client:remove",label:"删除",tooltip:"删除",popConfirm:{title:"是否确认删除",placement:"left",confirm:G.bind(null,d)}}]},null,8,["actions","dropDownActions"])):j("",!0)]),_:1},8,["onRegister"])]),r(n(we),{onRegister:n(o),onSuccess:f},null,8,["onRegister"]),r(ge,{onRegister:n(w),onSuccess:f},null,8,["onRegister"]),r(ve,{onRegister:n(g),onSuccess:f},null,8,["onRegister"]),r(Ce,{onRegister:n(s),onSuccess:f},null,8,["onRegister"])])}}});const mt=de(Ie,[["__scopeId","data-v-eebfcd25"]]);export{mt as default};