index.vue 44 KB

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