index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437
  1. <template>
  2. <div class="pageIndexClass">
  3. <!-- <div style="padding: 20px; background: #fff; margin-bottom: 20px">
  4. <el-button type="primary" style="margin-left: 10px" @click="openModal()">添加客户</el-button>
  5. </div> -->
  6. <div style="display:flex;height:calc(100vh - 120px);">
  7. <div style="width:240px;height:100%;overflow:auto;background:#fff;padding:15px">
  8. <div style="margin-bottom:10px">
  9. <el-button type="primary" style="width:100%" @click="handleSearch()">全部客户</el-button>
  10. </div>
  11. <el-collapse v-model="activeNames">
  12. <el-collapse-item title="客户跟进" name="1">
  13. <template #title>
  14. <div>
  15. <!-- <img src="@/assets/images/custom-1.png" alt="" style="object-fit: contain;width: 20px;height: 20px;vertical-align: middle;" />
  16. 客户跟进 -->
  17. <TitleInfo :content="'客户跟进'"></TitleInfo>
  18. </div>
  19. </template>
  20. <div style="padding:0 10px">
  21. <div style="display:flex;justify-content:space-between;cursor:pointer" :class="{'activeSearch':(4+'follow')==activeSearch}"
  22. @click="handleSearchOne(4)">
  23. <span>近7天有跟进</span> <span>{{leftDataFour[0]}}</span>
  24. </div>
  25. <div style="display:flex;justify-content:space-between;cursor:pointer;margin-top:5px"
  26. :class="{'activeSearch':(1+'follow')==activeSearch}" @click="handleSearchOne(1)">
  27. <span>超7天未跟进</span> <span>{{leftDataFour[7]}}</span>
  28. </div>
  29. <div style="display:flex;justify-content:space-between;cursor:pointer;margin-top:5px"
  30. :class="{'activeSearch':(2+'follow')==activeSearch}" @click="handleSearchOne(2)">
  31. <span>超30天未跟进</span> <span>{{leftDataFour[30]}}</span>
  32. </div>
  33. <div style="display:flex;justify-content:space-between;cursor:pointer;margin-top:5px"
  34. :class="{'activeSearch':(3+'follow')==activeSearch}" @click="handleSearchOne(3)">
  35. <span>超半年未跟进</span> <span>{{leftDataFour[180]}}</span>
  36. </div>
  37. </div>
  38. </el-collapse-item>
  39. <el-collapse-item title="客户来源" name="2">
  40. <template #title>
  41. <div>
  42. <!-- <img src="@/assets/images/custom-2.png" alt="" style="object-fit: contain;width: 20px;height: 20px;vertical-align: middle;" />
  43. 客户来源 -->
  44. <TitleInfo :content="'客户来源'"></TitleInfo>
  45. </div>
  46. </template>
  47. <div style="padding:0 10px">
  48. <div style="display:flex;justify-content:space-between;cursor:pointer" v-for="(item,index) in customerSource" :key="item.value"
  49. :class="{'activeSearch':(item.value+'source')==activeSearch}" :style="{marginTop:index!=0?'15px':'0px'}"
  50. @click="handleSearch(item.value,'source')">
  51. <span>{{item.label}}</span> <span>{{showLeftData(item.value,'source')}}</span>
  52. </div>
  53. </div>
  54. </el-collapse-item>
  55. <el-collapse-item title="客户类型" name="3">
  56. <template #title>
  57. <div>
  58. <!-- <img src="@/assets/images/custom-4.png" alt="" style="object-fit: contain;width: 20px;height: 20px;vertical-align: middle;" />
  59. 客户类型 -->
  60. <TitleInfo :content="'客户类型'"></TitleInfo>
  61. </div>
  62. </template>
  63. <div style="padding:0 10px">
  64. <div style="display:flex;justify-content:space-between;cursor:pointer" v-for="(item,index) in customerStatus" :key="item.value"
  65. :class="{'activeSearch':(item.value+'status')==activeSearch}" :style="{marginTop:index!=0?'15px':'0px'}"
  66. @click="handleSearch(item.value,'status')">
  67. <span>{{item.label}}</span> <span>{{showLeftData(item.value,'status')}}</span>
  68. </div>
  69. </div>
  70. </el-collapse-item>
  71. <el-collapse-item title="客户标签" name="4">
  72. <template #title>
  73. <div>
  74. <!-- <img src="@/assets/images/custom-3.png" alt="" style="object-fit: contain;width: 20px;height: 20px;vertical-align: middle;" />
  75. 客户标签 -->
  76. <TitleInfo :content="'客户标签'"></TitleInfo>
  77. </div>
  78. </template>
  79. <div style="padding:0 10px">
  80. <div style="display:flex;justify-content:space-between;cursor:pointer" v-for="(item,index) in customerTag" :key="item.value"
  81. :class="{'activeSearch':(item.value+'tag')==activeSearch}" :style="{marginTop:index!=0?'15px':'0px'}"
  82. @click="handleSearch(item.value,'tag')">
  83. <span>{{item.label}}</span> <span>{{showLeftData(item.value,'tag')}}</span>
  84. </div>
  85. </div>
  86. </el-collapse-item>
  87. </el-collapse>
  88. </div>
  89. <div style="width:10px"></div>
  90. <div style="width:calc(100% - 250px);height:100%;overflow:auto">
  91. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :statConfig="[]"
  92. :selectConfig="selectConfig" highlight-current-row :action-list="[
  93. {
  94. text: '导出Excel',
  95. action: () => exportExcel(),
  96. disabled: false,
  97. },
  98. {
  99. text: '添加客户',
  100. action: () => openModal(),
  101. },
  102. ]" @moreSearch="moreSearch" @get-list="getList" ref="table">
  103. <template #isTop="{ item }">
  104. <div>
  105. <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/isTop.png'" @click="deleteTop(item)"
  106. v-if="item.isTop === 1" />
  107. <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/noTop.png'" @click="addTop(item)" v-else />
  108. </div>
  109. </template>
  110. <template #address="{ item }">
  111. <span>{{ item.countryName }}</span>
  112. <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
  113. <span v-if="item.cityName"> ,{{ item.cityName }}</span>
  114. </template>
  115. <template #name="{ item }">
  116. <div class="el-click" @click="handleClickName(item)">
  117. {{ item.name }}
  118. </div>
  119. </template>
  120. <template #tags="{ item }">
  121. <div style="width: 100%">
  122. <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.tag" closable :key="index" @close="tagClose(tag, item)">
  123. {{ dictValueLabel(tag, customerTag) }}
  124. </el-tag>
  125. <template v-if="item.tag.length !== customerTag.length">
  126. <el-select v-if="item.addTagShow" v-model="addTag" style="width: 100%" @change="
  127. (val) => {
  128. return changeTag(val, item);
  129. }
  130. ">
  131. <el-option v-for="tag in customerTag" :key="tag.value" :label="tag.label" :value="tag.value"
  132. :disabled="judgeTagSelect(item.tag, tag.value)" />
  133. </el-select>
  134. <el-tag style="cursor: pointer" type="success" @click="showSelect(item)" v-else>
  135. +
  136. </el-tag>
  137. </template>
  138. </div>
  139. </template>
  140. <template #follow="{ item }">
  141. <div :class="'getWidth' + item.id" style="width: 100%">
  142. <div style="width: 100%; display: flex">
  143. <template v-if="
  144. item.customerFollowRecordsList &&
  145. item.customerFollowRecordsList.length > 0
  146. ">
  147. <div :style="
  148. index > 2
  149. ? 'line-height: 32px; margin-right: 8px; padding: 0 8px; background-color: #eeeeee; border-radius: 4px; cursor: pointer; display: none'
  150. : 'line-height: 32px; margin-right: 8px; padding: 0 8px; background-color: #eeeeee; border-radius: 4px; cursor: pointer'
  151. " v-for="(record, index) in item.customerFollowRecordsList" :key="record.id">
  152. <el-popover placement="bottom" :width="300" trigger="hover" @show="recordShow(record)">
  153. <template #reference>
  154. <div>
  155. <span v-if="record.date">{{
  156. record.date.substr(0, 10)
  157. }}</span>
  158. <el-icon style="margin-left: 8px; transform: translateY(2px)" @click="deleteFollow(record)">
  159. <DeleteFilled />
  160. </el-icon>
  161. </div>
  162. </template>
  163. <template #default>
  164. <div style="width: 100%">
  165. <div style="color: #909399; margin: 8px 0">
  166. 跟进时间: {{ record.date }}
  167. </div>
  168. <div style="margin: 8px 0">
  169. 跟进人:
  170. {{ dictValueLabel(record.createUser, userList) }}
  171. </div>
  172. <div v-if="record.type == '30'">
  173. <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
  174. <div v-else>跟进记录:</div>
  175. </div>
  176. <div v-else>
  177. <div style="word-wrap: break-word; margin: 8px 0">
  178. {{ getContent(record) }}
  179. </div>
  180. </div>
  181. <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
  182. <div style="width: 36px">附件:</div>
  183. <div style="width: calc(100% - 36px)">
  184. <div v-for="(file, index) in record.fileList" :key="index">
  185. <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </template>
  191. </el-popover>
  192. </div>
  193. <div style="
  194. line-height: 32px;
  195. margin-right: 8px;
  196. padding: 0 8px;
  197. background-color: #eeeeee;
  198. border-radius: 4px;
  199. cursor: pointer;
  200. " @click="clickMore(item)" v-if="item.customerFollowRecordsList.length >= 3">
  201. 更多
  202. </div>
  203. </template>
  204. </div>
  205. </div>
  206. </template>
  207. </byTable>
  208. </div>
  209. </div>
  210. <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="80%" v-loading="loadingOperation">
  211. <div class="public_height_dialog">
  212. <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isHighseas="true" @refreshList="refreshList"></AddCustomer>
  213. </div>
  214. <template #footer v-if="modalType!='detail'">
  215. <el-button @click="dialogVisible = false" size="default">取 消</el-button>
  216. <el-button type="primary" @click="submitForm()" size="default" :loading="submitLoading">确 定</el-button>
  217. </template>
  218. </el-dialog>
  219. <el-dialog title="添加跟进记录" v-if="openFollow" v-model="openFollow" width="500" destroy-on-close>
  220. <byForm :formConfig="formConfigAFollow" :formOption="formOption" v-model="formFollow.data" :rules="rulesFollow" ref="follow">
  221. <template #fileSlot>
  222. <div style="width: 100%">
  223. <el-upload v-model:fileList="fileList" :action="uploadUrl" :data="uploadData" multiple :before-upload="uploadFile"
  224. :on-preview="onPreviewFile">
  225. <el-button type="primary">文件上传</el-button>
  226. </el-upload>
  227. </div>
  228. </template>
  229. </byForm>
  230. <template #footer>
  231. <el-button @click="openFollow = false" size="default">取 消</el-button>
  232. <el-button type="primary" @click="submitFollow()" size="default">确 定</el-button>
  233. </template>
  234. </el-dialog>
  235. <el-dialog title="跟进记录" v-if="openRecordMore" v-model="openRecordMore" width="800" destroy-on-close>
  236. <div>
  237. <div style="padding: 8px 0">
  238. <el-button type="primary" @click="clickFollowUp(rowData)" plain>添加跟进记录</el-button>
  239. </div>
  240. <div style="padding-top: 16px">
  241. <div v-infinite-scroll="infiniteScroll" class="infinite-scroll" :infinite-scroll-disabled="judgeTotal()">
  242. <el-timeline>
  243. <el-timeline-item v-for="(record, index) in recordList" :key="index" :timestamp="record.date" hide-timestamp>
  244. <div>
  245. <div style="
  246. padding: 0 0 8px 0;
  247. display: flex;
  248. justify-content: space-between;
  249. ">
  250. <span>{{
  251. dictValueLabel(record.createUser, userList)
  252. }}</span>
  253. <span>{{ record.date }}</span>
  254. </div>
  255. <div v-if="record.type == '30'">
  256. <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
  257. <div v-else>跟进记录:</div>
  258. </div>
  259. <div v-else>
  260. <div style="word-wrap: break-word; margin: 8px 0">
  261. {{ getContent(record) }}
  262. </div>
  263. </div>
  264. <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
  265. <div style="width: 36px">附件:</div>
  266. <div style="width: calc(100% - 36px)">
  267. <div v-for="(file, index) in record.fileList" :key="index">
  268. <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </el-timeline-item>
  274. </el-timeline>
  275. </div>
  276. </div>
  277. </div>
  278. <template #footer>
  279. <el-button @click="openRecordMore = false" size="default">关 闭</el-button>
  280. </template>
  281. </el-dialog>
  282. <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
  283. <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
  284. <template #address>
  285. <el-row style="width: 100%">
  286. <el-col :span="8">
  287. <el-form-item prop="countryId">
  288. <el-select v-model="sourceList.pagination.countryId" placeholder="国家" clearable filterable
  289. @change="(val) => getCitySearchData(val, '20', true)">
  290. <el-option v-for="item in countrySearchData" :label="item.name" :value="item.id">
  291. </el-option>
  292. </el-select>
  293. </el-form-item>
  294. </el-col>
  295. <el-col :span="8">
  296. <el-form-item prop="provinceName">
  297. <selectCity placeholder="省/洲" @change="(val) => getCitySearchData(val, '30', true)" addressId="provinceId" addressName="provinceName"
  298. v-model="sourceList.pagination" :data="provinceSearchData">
  299. </selectCity>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="8">
  303. <el-form-item prop="cityName">
  304. <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="sourceList.pagination" :data="citySearchData">
  305. </selectCity>
  306. </el-form-item>
  307. </el-col>
  308. </el-row>
  309. </template>
  310. <template #tags>
  311. <div style="width: 100%">
  312. <el-tag style="margin-right: 8px" type="info" v-for="(tag, index) in sourceList.pagination.tags" closable :key="index"
  313. @close="tagSearchClose(tag)">
  314. {{ dictValueLabel(tag, customerTag) }}
  315. </el-tag>
  316. <template v-if="sourceList.pagination.tags.length !== customerTag.length">
  317. <el-select v-if="addTagSearchShow" v-model="addSearchTag" style="margin-top: 8px" @change="changeSearchTag">
  318. <el-option v-for="tag in customerTag" :key="tag.value" :label="tag.label" :value="tag.value" :disabled="
  319. judgeTagSelect(sourceList.pagination.tags, tag.value)
  320. " />
  321. </el-select>
  322. <el-tag style="cursor: pointer" type="info" @click="addTagSearchShow = true" v-else>
  323. +
  324. </el-tag>
  325. </template>
  326. </div>
  327. </template>
  328. </byForm>
  329. <template #footer>
  330. <el-button @click="cancelSearch()" size="default">取 消</el-button>
  331. <el-button type="primary" @click="submitSearch()" size="default">确 定</el-button>
  332. </template>
  333. </el-dialog>
  334. </div>
  335. </template>
  336. <script setup>
  337. import { ElMessage, ElMessageBox } from "element-plus";
  338. import byTable from "@/components/byTable/index";
  339. import byForm from "@/components/byForm/index";
  340. import { computed, ref } from "vue";
  341. import useUserStore from "@/store/modules/user";
  342. import selectCity from "@/components/selectCity/index.vue";
  343. import TitleInfo from "@/components/TitleInfo/index.vue";
  344. import AddCustomer from "@/views/customer/addCustomer.vue";
  345. const AddCustomerDom = ref(null);
  346. const customerId = ref("");
  347. const { proxy } = getCurrentInstance();
  348. const activeNames = ref(["1", "2", "3", "4"]);
  349. const loading = ref(false);
  350. const loadingOperation = ref(false);
  351. const submitLoading = ref(false);
  352. const openPerson = ref(false);
  353. const customerTag = ref([]);
  354. const customerSource = ref([]);
  355. const customerStatus = ref([]);
  356. const contactType = ref([]);
  357. const userList = ref([]);
  358. const fileList = ref([]);
  359. const uploadData = ref({});
  360. const statisticsType = ref([
  361. {
  362. label: "客户来源统计",
  363. value: 1,
  364. },
  365. {
  366. label: "客户类型统计",
  367. value: 2,
  368. },
  369. ]);
  370. const sourceList = ref({
  371. data: [],
  372. pagination: {
  373. total: 0,
  374. pageNum: 1,
  375. pageSize: 10,
  376. keyword: "",
  377. type: 0,
  378. source: "",
  379. status: "",
  380. name: "",
  381. countryId: "",
  382. provinceId: "",
  383. cityId: "",
  384. customerCode: "",
  385. tag: "",
  386. tags: [],
  387. },
  388. paginationTwo: {
  389. statisticsType: 1,
  390. type: 0,
  391. },
  392. });
  393. const statConfig = computed(() => [
  394. {
  395. label: "客户来源统计",
  396. data: [
  397. {
  398. label: "合计",
  399. num: statisticalData.value.countAmount,
  400. type: 2,
  401. },
  402. ...customerSource.value
  403. .filter((a) => getNum(a.value) > 0)
  404. .map((b) => {
  405. let num = getNum(b.value);
  406. return {
  407. label: b.label,
  408. num,
  409. type: 1,
  410. };
  411. }),
  412. ],
  413. },
  414. {
  415. label: "客户类型统计",
  416. data: [
  417. {
  418. label: "合计",
  419. num: statisticalData.value.countAmount,
  420. type: 2,
  421. },
  422. ...customerStatus.value
  423. .filter((a) => getNum(a.value) > 0)
  424. .map((b) => {
  425. let num = getNum(b.value);
  426. return {
  427. label: b.label,
  428. num,
  429. type: 1,
  430. };
  431. }),
  432. ],
  433. },
  434. ]);
  435. const selectConfig = computed(() => {
  436. return [
  437. {
  438. label: "客户来源",
  439. prop: "source",
  440. data: customerSource.value,
  441. },
  442. {
  443. label: "客户类型",
  444. prop: "status",
  445. data: customerStatus.value,
  446. },
  447. ];
  448. });
  449. const config = computed(() => {
  450. return [
  451. {
  452. attrs: {
  453. label: "",
  454. slot: "isTop",
  455. fixed: "left",
  456. width: 60,
  457. align: "center",
  458. },
  459. },
  460. {
  461. attrs: {
  462. label: "客户名称",
  463. slot: "name",
  464. fixed: "left",
  465. width: 160,
  466. },
  467. },
  468. {
  469. attrs: {
  470. label: "所在城市",
  471. slot: "address",
  472. width: 160,
  473. },
  474. },
  475. {
  476. attrs: {
  477. label: "客户来源",
  478. prop: "source",
  479. width: 120,
  480. },
  481. render(type) {
  482. return proxy.dictValueLabel(type, customerSource.value);
  483. },
  484. },
  485. {
  486. attrs: {
  487. label: "客户类型",
  488. prop: "status",
  489. width: 120,
  490. },
  491. render(type) {
  492. return proxy.dictValueLabel(type, customerStatus.value);
  493. },
  494. },
  495. {
  496. attrs: {
  497. label: "客户标签",
  498. slot: "tags",
  499. width: 180,
  500. },
  501. },
  502. {
  503. attrs: {
  504. label: "业务员",
  505. prop: "userId",
  506. width: 140,
  507. },
  508. render(type) {
  509. let data = userList.value.filter((item) => item.value == type);
  510. if (data && data.length > 0) {
  511. return data[0].label;
  512. } else {
  513. return "";
  514. }
  515. },
  516. },
  517. {
  518. attrs: {
  519. label: "跟进",
  520. slot: "follow",
  521. "min-width": 440,
  522. },
  523. },
  524. {
  525. attrs: {
  526. label: "操作",
  527. width: 180,
  528. align: "center",
  529. fixed: "right",
  530. },
  531. renderHTML(row) {
  532. return [
  533. {
  534. attrs: {
  535. label: "跟进",
  536. type: "primary",
  537. text: true,
  538. },
  539. el: "button",
  540. click() {
  541. clickFollowUp(row);
  542. },
  543. },
  544. {
  545. attrs: {
  546. label: "修改",
  547. type: "primary",
  548. text: true,
  549. },
  550. el: "button",
  551. click() {
  552. update(row);
  553. },
  554. },
  555. {
  556. attrs: {
  557. label: "认领客户",
  558. type: "primary",
  559. text: true,
  560. },
  561. el: "button",
  562. click() {
  563. ElMessageBox.confirm("是否确定认领该客户?", "提示", {
  564. confirmButtonText: "确定",
  565. cancelButtonText: "取消",
  566. type: "warning",
  567. }).then(() => {
  568. proxy
  569. .post("/customer/CustomerAllocation", {
  570. id: row.id,
  571. userId: useUserStore().user.userId,
  572. })
  573. .then(() => {
  574. ElMessage({
  575. message: "认领成功",
  576. type: "success",
  577. });
  578. getList();
  579. obtainStatisticalData();
  580. });
  581. });
  582. },
  583. },
  584. ];
  585. },
  586. },
  587. ];
  588. });
  589. let modalType = ref("add");
  590. let dialogVisible = ref(false);
  591. let openFollow = ref(false);
  592. let formData = reactive({
  593. data: {
  594. countryId: "44",
  595. },
  596. });
  597. let formPerson = reactive({
  598. data: {},
  599. });
  600. let formFollow = reactive({
  601. data: {},
  602. });
  603. const formOption = reactive({
  604. inline: true,
  605. labelWidth: 100,
  606. itemWidth: 100,
  607. rules: [],
  608. });
  609. const formConfig = computed(() => {
  610. return [
  611. {
  612. type: "input",
  613. prop: "name",
  614. label: "客户名称",
  615. required: true,
  616. itemWidth: 100,
  617. itemType: "text",
  618. },
  619. {
  620. type: "slot",
  621. slotName: "address",
  622. prop: "countryId",
  623. label: "详细地址",
  624. },
  625. {
  626. type: "select",
  627. label: "客户来源",
  628. prop: "source",
  629. itemWidth: 50,
  630. data: customerSource.value,
  631. },
  632. {
  633. type: "select",
  634. label: "客户类型",
  635. prop: "status",
  636. itemWidth: 50,
  637. data: customerStatus.value,
  638. },
  639. {
  640. type: "select",
  641. label: "业务员",
  642. prop: "userId",
  643. itemWidth: 100,
  644. data: userList.value,
  645. clearable: true,
  646. disabled: modalType.value == "edit",
  647. },
  648. {
  649. type: "select",
  650. label: "客户标签",
  651. prop: "tags",
  652. itemWidth: 100,
  653. multiple: true,
  654. data: customerTag.value,
  655. style: {
  656. width: "100%",
  657. },
  658. },
  659. {
  660. type: "input",
  661. prop: "beneficiaryName",
  662. label: "Beneficiary Name",
  663. required: true,
  664. itemWidth: 50,
  665. itemType: "text",
  666. },
  667. {
  668. type: "input",
  669. prop: "beneficiaryAccountNumber",
  670. label: "Beneficiary Account Number",
  671. required: true,
  672. itemWidth: 50,
  673. itemType: "text",
  674. },
  675. {
  676. type: "input",
  677. prop: "beneficiaryBank",
  678. label: "Beneficiary Bank",
  679. required: true,
  680. itemWidth: 50,
  681. itemType: "text",
  682. },
  683. {
  684. type: "input",
  685. prop: "swiftCode",
  686. label: "Swift Code",
  687. required: true,
  688. itemWidth: 50,
  689. itemType: "text",
  690. },
  691. {
  692. type: "input",
  693. prop: "beneficiaryBankAddress",
  694. label: "Beneficiary Bank Address",
  695. required: true,
  696. itemWidth: 50,
  697. itemType: "text",
  698. },
  699. {
  700. type: "input",
  701. prop: "beneficiaryAddress",
  702. label: "Beneficiary Address",
  703. required: true,
  704. itemWidth: 50,
  705. itemType: "text",
  706. },
  707. {
  708. type: "slot",
  709. slotName: "person",
  710. label: "客户联系人",
  711. },
  712. ];
  713. });
  714. let rules = ref({
  715. name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
  716. name2: [{ required: true, message: "请输入联系人", trigger: "blur" }],
  717. email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
  718. countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
  719. provinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
  720. cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
  721. source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
  722. status: [{ required: true, message: "请选择类型", trigger: "change" }],
  723. });
  724. const formConfigAFollow = computed(() => {
  725. return [
  726. {
  727. type: "date",
  728. itemType: "datetime",
  729. label: "跟进时间",
  730. prop: "date",
  731. itemWidth: 100,
  732. },
  733. {
  734. type: "input",
  735. itemType: "textarea",
  736. label: "跟进内容",
  737. prop: "content",
  738. itemWidth: 100,
  739. },
  740. {
  741. type: "slot",
  742. label: "上传附件",
  743. prop: "fileList",
  744. slotName: "fileSlot",
  745. },
  746. ];
  747. });
  748. let rulesPerson = ref({
  749. name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
  750. email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
  751. type: [{ required: true, message: "请选择类型", trigger: "change" }],
  752. contactNo: [{ required: true, message: "请输入联系号码", trigger: "blur" }],
  753. });
  754. let rulesFollow = ref({
  755. date: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
  756. content: [{ required: true, message: "请输入跟进内容", trigger: "blur" }],
  757. });
  758. const submit = ref(null);
  759. const person = ref(null);
  760. const allocation = ref(null);
  761. const follow = ref(null);
  762. const getList = async (req) => {
  763. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  764. loading.value = true;
  765. proxy.post("/customer/page", sourceList.value.pagination).then((res) => {
  766. res.rows.forEach((x) => {
  767. x.addTagShow = false;
  768. if (x.tag) {
  769. x.tag = x.tag.split(",");
  770. } else {
  771. x.tag = [];
  772. }
  773. });
  774. sourceList.value.data = res.rows;
  775. sourceList.value.pagination.total = res.total;
  776. setTimeout(() => {
  777. loading.value = false;
  778. }, 200);
  779. });
  780. };
  781. const openModal = () => {
  782. modalType.value = "add";
  783. dialogVisible.value = true;
  784. };
  785. const submitFollow = () => {
  786. follow.value.handleSubmit(() => {
  787. if (fileList.value && fileList.value.length > 0) {
  788. formFollow.data.fileList = fileList.value.map((item) => {
  789. return {
  790. id: item.raw.id,
  791. fileName: item.raw.fileName,
  792. fileUrl: item.raw.fileUrl,
  793. };
  794. });
  795. } else {
  796. formFollow.data.fileList = [];
  797. }
  798. proxy
  799. .post("/customerFollowRecords/" + modalType.value, formFollow.data)
  800. .then(
  801. () => {
  802. ElMessage({
  803. message: modalType.value == "add" ? "添加成功" : "编辑成功",
  804. type: "success",
  805. });
  806. openFollow.value = false;
  807. getList();
  808. },
  809. (err) => {
  810. console.log(err);
  811. }
  812. );
  813. });
  814. };
  815. const submitForm = () => {
  816. AddCustomerDom.value.handleSubmit();
  817. };
  818. const getDict = () => {
  819. proxy
  820. .getDictOne([
  821. "customer_tag",
  822. "customer_source",
  823. "customer_status",
  824. "contact_type",
  825. ])
  826. .then((res) => {
  827. customerTag.value = res["customer_tag"].map((x) => ({
  828. label: x.dictValue,
  829. value: x.dictKey,
  830. }));
  831. customerSource.value = res["customer_source"].map((x) => ({
  832. label: x.dictValue,
  833. value: x.dictKey,
  834. }));
  835. customerStatus.value = res["customer_status"].map((x) => ({
  836. label: x.dictValue,
  837. value: x.dictKey,
  838. }));
  839. contactType.value = res["contact_type"].map((x) => ({
  840. label: x.dictValue,
  841. value: x.dictKey,
  842. }));
  843. });
  844. proxy
  845. .get("/tenantUser/list", {
  846. pageNum: 1,
  847. pageSize: 10000,
  848. tenantId: useUserStore().user.tenantId,
  849. })
  850. .then((res) => {
  851. userList.value = res.rows.map((item) => {
  852. return {
  853. label: item.nickName,
  854. value: item.userId,
  855. };
  856. });
  857. });
  858. };
  859. getDict();
  860. getList();
  861. const handleClickName = (row) => {
  862. customerId.value = row.id;
  863. modalType.value = "detail";
  864. dialogVisible.value = true;
  865. // proxy.$router.push({
  866. // path: "Portrait",
  867. // query: {
  868. // id: row.id,
  869. // },
  870. // });
  871. };
  872. const deleteFollow = (data) => {
  873. ElMessageBox.confirm("是否确认删除该跟进?", "提示", {
  874. confirmButtonText: "确定",
  875. cancelButtonText: "取消",
  876. type: "warning",
  877. }).then(() => {
  878. proxy
  879. .post("/customerFollowRecords/delete", {
  880. id: data.id,
  881. })
  882. .then(() => {
  883. ElMessage({
  884. message: "删除成功",
  885. type: "success",
  886. });
  887. getList();
  888. });
  889. });
  890. };
  891. const addTag = ref("");
  892. const judgeTagSelect = (data, val) => {
  893. if (data && data.length > 0) {
  894. if (data.includes(val)) {
  895. return true;
  896. }
  897. }
  898. return false;
  899. };
  900. const changeTag = (val, item) => {
  901. let data = {
  902. id: item.id,
  903. tag: JSON.parse(JSON.stringify(item.tag)),
  904. };
  905. data.tag.push(val);
  906. data.tag = data.tag.join(",");
  907. proxy.post("/customer/editTag", data).then(() => {
  908. ElMessage({
  909. message: "添加成功",
  910. type: "success",
  911. });
  912. item.addTagShow = false;
  913. addTag.value = "";
  914. getList();
  915. });
  916. };
  917. const tagClose = (val, item) => {
  918. let data = {
  919. id: item.id,
  920. tag: JSON.parse(JSON.stringify(item.tag)),
  921. };
  922. data.tag = data.tag.filter((row) => row !== val);
  923. if (data.tag && data.tag.length > 0) {
  924. data.tag = data.tag.join(",");
  925. } else {
  926. data.tag = "";
  927. }
  928. proxy.post("/customer/editTag", data).then(() => {
  929. ElMessage({
  930. message: "添加成功",
  931. type: "success",
  932. });
  933. item.addTagShow = false;
  934. addTag.value = "";
  935. getList();
  936. });
  937. };
  938. const showSelect = (item) => {
  939. item.addTagShow = true;
  940. };
  941. const clickFollowUp = (item) => {
  942. formFollow.data = {
  943. customerId: item.id,
  944. fileList: [],
  945. };
  946. fileList.value = [];
  947. modalType.value = "add";
  948. openFollow.value = true;
  949. openRecordMore.value = false;
  950. };
  951. const uploadFile = async (file) => {
  952. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  953. uploadData.value = res.uploadBody;
  954. file.id = res.id;
  955. file.fileName = res.fileName;
  956. file.fileUrl = res.fileUrl;
  957. return true;
  958. };
  959. const onPreviewFile = (file) => {
  960. window.open(file.raw.fileUrl, "_blank");
  961. };
  962. const getStyle = (val) => {
  963. if (val) {
  964. return "跟进记录: " + val.replace(/\n|\r\n/g, "<br>");
  965. } else {
  966. return "";
  967. }
  968. };
  969. const getContent = (item) => {
  970. if (item.type === "10") {
  971. return "跟进记录: " + "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
  972. } else if (item.type === "20") {
  973. return (
  974. "跟进记录: " +
  975. "合同总金额 " +
  976. proxy.moneyFormat(item.amount, 2) +
  977. ` (${item.contractCode}) `
  978. );
  979. }
  980. };
  981. const recordShow = (item) => {
  982. if (
  983. !(item.fileList && item.fileList.length > 0) &&
  984. JSON.stringify(item.fileList) !== "[]"
  985. ) {
  986. proxy
  987. .post("/fileInfo/getList", { businessIdList: [item.id] })
  988. .then((fileObj) => {
  989. item.fileList = fileObj[item.id] || [];
  990. });
  991. }
  992. };
  993. const openFile = (path) => {
  994. window.open(path, "_blank");
  995. };
  996. const recordList = ref([]);
  997. const rowData = ref({});
  998. const openRecordMore = ref(false);
  999. const queryParams = ref({
  1000. total: 0,
  1001. pageNum: 1,
  1002. pageSize: 10,
  1003. customerId: "",
  1004. });
  1005. const clickMore = (item) => {
  1006. if (openRecordMore.value === false) {
  1007. queryParams.value.pageNum = 1;
  1008. recordList.value = [];
  1009. rowData.value = item;
  1010. queryParams.value.customerId = item.id;
  1011. }
  1012. proxy.post("/customerFollowRecords/page", queryParams.value).then((res) => {
  1013. recordList.value = recordList.value.concat(res.rows);
  1014. queryParams.value.total = res.total;
  1015. proxy
  1016. .post("/fileInfo/getList", {
  1017. businessIdList: res.rows.map((rows) => rows.id),
  1018. })
  1019. .then((fileObj) => {
  1020. for (let i = 0; i < res.rows.length; i++) {
  1021. recordList.value[
  1022. parseInt(
  1023. i + (queryParams.value.pageNum - 1) * queryParams.value.pageSize
  1024. )
  1025. ].fileList =
  1026. fileObj[
  1027. recordList.value[
  1028. parseInt(
  1029. i +
  1030. (queryParams.value.pageNum - 1) * queryParams.value.pageSize
  1031. )
  1032. ].id
  1033. ] || [];
  1034. }
  1035. });
  1036. });
  1037. openRecordMore.value = true;
  1038. };
  1039. const infiniteScroll = () => {
  1040. queryParams.value.pageNum++;
  1041. clickMore();
  1042. };
  1043. const judgeTotal = () => {
  1044. if (
  1045. queryParams.value.pageNum * queryParams.value.pageSize >=
  1046. queryParams.value.total
  1047. ) {
  1048. return true;
  1049. }
  1050. return false;
  1051. };
  1052. const deleteTop = (item) => {
  1053. proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
  1054. item.isTop = 0;
  1055. });
  1056. };
  1057. const addTop = (item) => {
  1058. proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
  1059. item.isTop = 1;
  1060. });
  1061. };
  1062. const statisticalData = ref({
  1063. countAmount: 0,
  1064. customerList: [],
  1065. });
  1066. const leftData = ref({});
  1067. const leftDataFour = ref({
  1068. 0: 0,
  1069. 7: 0,
  1070. 30: 0,
  1071. 180: 0,
  1072. });
  1073. const obtainStatisticalData = () => {
  1074. proxy
  1075. .post("/customer/sourceStatistics", { statisticsType: 1, type: "0" })
  1076. .then((res) => {
  1077. leftData.value.source = res;
  1078. });
  1079. proxy
  1080. .post("/customer/sourceStatistics", { statisticsType: 2, type: "0" })
  1081. .then((res) => {
  1082. leftData.value.status = res;
  1083. });
  1084. proxy.post("/customer/tagStatistics", { type: "0" }).then((res) => {
  1085. leftData.value.tag = res;
  1086. });
  1087. proxy.post("/customer/followStatistics", { type: "0" }).then((res) => {
  1088. leftDataFour.value = res;
  1089. });
  1090. };
  1091. obtainStatisticalData();
  1092. const showLeftData = (dictKey, att) => {
  1093. const data = leftData.value[att];
  1094. if (data && data.customerList.length > 0) {
  1095. const current = data.customerList.find((x) => x[att] == dictKey);
  1096. if (current && current.count) {
  1097. return current.count;
  1098. } else {
  1099. return 0;
  1100. }
  1101. }
  1102. };
  1103. const activeSearch = ref("");
  1104. const handleSearch = (value, att) => {
  1105. activeSearch.value = value + att;
  1106. sourceList.value.pagination = {
  1107. total: 0,
  1108. pageNum: 1,
  1109. pageSize: 10,
  1110. keyword: "",
  1111. type: "",
  1112. source: "",
  1113. status: "",
  1114. name: "",
  1115. countryId: "",
  1116. provinceId: "",
  1117. cityId: "",
  1118. customerCode: "",
  1119. userId: "",
  1120. tag: "",
  1121. tags: [],
  1122. };
  1123. if (value || att) {
  1124. sourceList.value.pagination[att] = value;
  1125. }
  1126. getList();
  1127. };
  1128. const handleSearchOne = (type, att = "follow") => {
  1129. activeSearch.value = type + att;
  1130. sourceList.value.pagination = {
  1131. total: 0,
  1132. pageNum: 1,
  1133. pageSize: 10,
  1134. keyword: "",
  1135. type: "",
  1136. source: "",
  1137. status: "",
  1138. name: "",
  1139. countryId: "",
  1140. provinceId: "",
  1141. cityId: "",
  1142. customerCode: "",
  1143. userId: "",
  1144. tag: "",
  1145. tags: [],
  1146. };
  1147. if (type == 4) {
  1148. sourceList.value.pagination.beginDay = -1;
  1149. sourceList.value.pagination.endDay = 7;
  1150. } else if (type == 1) {
  1151. sourceList.value.pagination.beginDay = 7;
  1152. sourceList.value.pagination.endDay = 30;
  1153. } else if (type == 2) {
  1154. sourceList.value.pagination.beginDay = 30;
  1155. sourceList.value.pagination.endDay = 180;
  1156. } else {
  1157. sourceList.value.pagination.beginDay = 180;
  1158. sourceList.value.pagination.endDay = "";
  1159. }
  1160. getList();
  1161. };
  1162. const getNum = (val) => {
  1163. let num = 0;
  1164. if (
  1165. statisticalData.value.customerList &&
  1166. statisticalData.value.customerList.length > 0
  1167. ) {
  1168. statisticalData.value.customerList.map((item) => {
  1169. if (sourceList.value.paginationTwo.statisticsType === 1) {
  1170. if (item.source === val) {
  1171. num = item.count;
  1172. }
  1173. } else if (sourceList.value.paginationTwo.statisticsType === 2) {
  1174. if (item.status === val) {
  1175. num = item.count;
  1176. }
  1177. } else if (sourceList.value.paginationTwo.statisticsType === 3) {
  1178. if (item.userId === val) {
  1179. num = item.count;
  1180. }
  1181. }
  1182. });
  1183. }
  1184. return num;
  1185. };
  1186. const countrySearchData = ref([]);
  1187. const provinceSearchData = ref([]);
  1188. const citySearchData = ref([]);
  1189. const getCitySearchData = (id, type, isChange) => {
  1190. proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
  1191. if (type === "20") {
  1192. provinceSearchData.value = res;
  1193. if (isChange) {
  1194. sourceList.value.pagination.provinceId = "";
  1195. sourceList.value.pagination.provinceName = "";
  1196. sourceList.value.pagination.cityId = "";
  1197. sourceList.value.pagination.cityName = "";
  1198. }
  1199. } else if (type === "30") {
  1200. citySearchData.value = res;
  1201. if (isChange) {
  1202. sourceList.value.pagination.cityId = "";
  1203. sourceList.value.pagination.cityName = "";
  1204. }
  1205. } else {
  1206. countrySearchData.value = res;
  1207. }
  1208. });
  1209. };
  1210. getCitySearchData("0");
  1211. const openSearch = ref(false);
  1212. const formSearchConfig = computed(() => {
  1213. return [
  1214. {
  1215. type: "input",
  1216. prop: "name",
  1217. label: "客户名称",
  1218. itemType: "text",
  1219. },
  1220. {
  1221. type: "input",
  1222. prop: "contactName",
  1223. label: "客户联系人",
  1224. itemType: "text",
  1225. itemWidth: 50,
  1226. },
  1227. {
  1228. type: "input",
  1229. prop: "contactEmail",
  1230. label: "联系人邮箱",
  1231. itemType: "text",
  1232. itemWidth: 50,
  1233. },
  1234. {
  1235. type: "slot",
  1236. slotName: "address",
  1237. label: "所在城市",
  1238. },
  1239. {
  1240. type: "select",
  1241. label: "客户来源",
  1242. prop: "source",
  1243. itemWidth: 50,
  1244. data: customerSource.value,
  1245. clearable: true,
  1246. },
  1247. {
  1248. type: "select",
  1249. label: "客户类型",
  1250. prop: "status",
  1251. itemWidth: 50,
  1252. data: customerStatus.value,
  1253. clearable: true,
  1254. },
  1255. {
  1256. type: "slot",
  1257. slotName: "tags",
  1258. label: "客户标签",
  1259. },
  1260. ];
  1261. });
  1262. const addSearchTag = ref("");
  1263. const addTagSearchShow = ref(false);
  1264. let copySearch = ref({});
  1265. const moreSearch = () => {
  1266. if (sourceList.value.pagination.tag) {
  1267. sourceList.value.pagination.tags =
  1268. sourceList.value.pagination.tag.split(",");
  1269. } else {
  1270. sourceList.value.pagination.tags = [];
  1271. }
  1272. addTagSearchShow.value = false;
  1273. // copySearch.value = proxy.deepClone(sourceList.value.pagination);
  1274. openSearch.value = true;
  1275. };
  1276. const cancelSearch = () => {
  1277. // sourceList.value.pagination = copySearch.value;
  1278. openSearch.value = false;
  1279. };
  1280. const submitSearch = () => {
  1281. if (
  1282. sourceList.value.pagination.tags &&
  1283. sourceList.value.pagination.tags.length > 0
  1284. ) {
  1285. sourceList.value.pagination.tag =
  1286. sourceList.value.pagination.tags.join(",");
  1287. } else {
  1288. sourceList.value.pagination.tag = "";
  1289. }
  1290. openSearch.value = false;
  1291. sourceList.value.pagination.keyword = "";
  1292. sourceList.value.pagination.pageNum = 1;
  1293. getList();
  1294. };
  1295. const tagSearchClose = (val) => {
  1296. sourceList.value.pagination.tags = sourceList.value.pagination.tags.filter(
  1297. (item) => item !== val
  1298. );
  1299. };
  1300. const changeSearchTag = (val) => {
  1301. sourceList.value.pagination.tags.push(val);
  1302. addTagSearchShow.value = false;
  1303. addSearchTag.value = "";
  1304. };
  1305. const update = (row) => {
  1306. modalType.value = "edit";
  1307. customerId.value = row.id;
  1308. dialogVisible.value = true;
  1309. };
  1310. const table = ref(null);
  1311. onMounted(() => {
  1312. watch(
  1313. () => table.value.statSelectVal,
  1314. (val) => {
  1315. sourceList.value.paginationTwo.statisticsType = val + 1;
  1316. obtainStatisticalData();
  1317. }
  1318. );
  1319. });
  1320. const refreshList = () => {
  1321. dialogVisible.value = false;
  1322. getList();
  1323. };
  1324. const exportExcel = () => {
  1325. proxy.msgTip("正在导出,请稍后", 2);
  1326. proxy
  1327. .postTwo("/customer/exportExcel", sourceList.value.pagination)
  1328. .then((res) => {
  1329. proxy.downloadFile(res, "公海客户.xlsx");
  1330. });
  1331. };
  1332. </script>
  1333. <style lang="scss" scoped>
  1334. .tenant {
  1335. padding: 20px;
  1336. }
  1337. .infinite-scroll {
  1338. max-height: calc(89vh - 94px - 70px - 58px - 16px);
  1339. overflow-y: auto;
  1340. &::-webkit-scrollbar {
  1341. width: 0px;
  1342. }
  1343. }
  1344. .by-dropdown {
  1345. position: relative;
  1346. text-align: left;
  1347. height: 32px;
  1348. z-index: 1010;
  1349. padding: 0 10px;
  1350. transition: all 0.5s ease;
  1351. cursor: pointer;
  1352. line-height: 32px;
  1353. .by-dropdown-title {
  1354. font-size: 14px;
  1355. background-color: #fff;
  1356. }
  1357. ul {
  1358. position: absolute;
  1359. left: 0;
  1360. top: 32px;
  1361. padding: 0;
  1362. margin: 0;
  1363. z-index: 1200;
  1364. display: none;
  1365. white-space: nowrap;
  1366. background-color: #fff;
  1367. li {
  1368. list-style: none;
  1369. z-index: 1200;
  1370. font-size: 12px;
  1371. height: 30px;
  1372. padding: 0 10px;
  1373. }
  1374. li:hover {
  1375. background-color: #eff6ff;
  1376. color: #0084ff;
  1377. }
  1378. }
  1379. }
  1380. .by-dropdown::before {
  1381. display: block;
  1382. width: 1px;
  1383. content: " ";
  1384. position: absolute;
  1385. height: 14px;
  1386. top: 8px;
  1387. background-color: #ddd;
  1388. right: 0;
  1389. z-index: 1011;
  1390. }
  1391. .by-dropdown:hover {
  1392. background: #ffffff;
  1393. border-radius: 2px 2px 2px 2px;
  1394. opacity: 1;
  1395. ul {
  1396. background: #ffffff;
  1397. box-shadow: 0px 2px 16px 1px rgba(0, 0, 0, 0.06);
  1398. border-radius: 2px 2px 2px 2px;
  1399. opacity: 1;
  1400. display: block;
  1401. text-align: left;
  1402. }
  1403. }
  1404. .by-dropdown-lists {
  1405. max-height: 50vh;
  1406. overflow-y: auto;
  1407. line-height: 1;
  1408. }
  1409. .statistics-text {
  1410. padding-left: 8px;
  1411. width: 152px;
  1412. overflow: hidden;
  1413. text-overflow: ellipsis;
  1414. white-space: nowrap;
  1415. }
  1416. .activeSearch {
  1417. background: #409eff;
  1418. color: #fff;
  1419. border-radius: 2px;
  1420. padding: 0 5px;
  1421. }
  1422. </style>