index.vue 43 KB

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