index.vue 43 KB

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