index.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  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: "input",
  685. prop: "dutyParagraph",
  686. label: "客户税号",
  687. required: true,
  688. itemWidth: 100,
  689. itemType: "text",
  690. },
  691. {
  692. type: "select",
  693. label: "客户来源",
  694. prop: "source",
  695. itemWidth: 50,
  696. data: customerSource.value,
  697. },
  698. {
  699. type: "select",
  700. label: "客户类型",
  701. prop: "status",
  702. itemWidth: 50,
  703. data: customerStatus.value,
  704. },
  705. {
  706. type: "select",
  707. label: "业务员",
  708. prop: "userId",
  709. itemWidth: 100,
  710. data: userList.value,
  711. clearable: true,
  712. },
  713. {
  714. type: "select",
  715. label: "客户标签",
  716. prop: "tags",
  717. itemWidth: 100,
  718. multiple: true,
  719. data: customerTag.value,
  720. style: {
  721. width: "100%",
  722. },
  723. },
  724. {
  725. type: "slot",
  726. slotName: "person",
  727. label: "客户联系人",
  728. },
  729. ];
  730. });
  731. let rules = ref({
  732. name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
  733. name2: [{ required: true, message: "请输入联系人", trigger: "blur" }],
  734. email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
  735. countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
  736. provinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
  737. cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
  738. source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
  739. status: [{ required: true, message: "请选择类型", trigger: "change" }],
  740. });
  741. const formConfigAFollow = computed(() => {
  742. return [
  743. {
  744. type: "date",
  745. itemType: "datetime",
  746. label: "跟进时间",
  747. prop: "date",
  748. itemWidth: 100,
  749. },
  750. {
  751. type: "input",
  752. itemType: "textarea",
  753. label: "跟进内容",
  754. prop: "content",
  755. itemWidth: 100,
  756. },
  757. {
  758. type: "slot",
  759. label: "上传附件",
  760. prop: "fileList",
  761. slotName: "fileSlot",
  762. },
  763. ];
  764. });
  765. let rulesPerson = ref({
  766. name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
  767. email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
  768. type: [{ required: true, message: "请选择类型", trigger: "change" }],
  769. contactNo: [{ required: true, message: "请输入联系号码", trigger: "blur" }],
  770. });
  771. let rulesFollow = ref({
  772. date: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
  773. content: [{ required: true, message: "请输入跟进内容", trigger: "blur" }],
  774. });
  775. const submit = ref(null);
  776. const person = ref(null);
  777. const allocation = ref(null);
  778. const follow = ref(null);
  779. const getList = async (req) => {
  780. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  781. loading.value = true;
  782. proxy.post("/customer/page", sourceList.value.pagination).then((res) => {
  783. res.rows.forEach((x) => {
  784. x.addTagShow = false;
  785. if (x.tag) {
  786. x.tag = x.tag.split(",");
  787. } else {
  788. x.tag = [];
  789. }
  790. });
  791. sourceList.value.data = res.rows;
  792. sourceList.value.pagination.total = res.total;
  793. setTimeout(() => {
  794. loading.value = false;
  795. }, 200);
  796. });
  797. };
  798. const openModal = () => {
  799. modalType.value = "add";
  800. formData.data = {
  801. countryId: "44",
  802. tags: [],
  803. customerUserList: [
  804. {
  805. name: "",
  806. email: "",
  807. },
  808. ],
  809. };
  810. getCityData(formData.data.countryId, "20");
  811. loadingOperation.value = false;
  812. dialogVisible.value = true;
  813. };
  814. const countryData = ref([]);
  815. const provinceData = ref([]);
  816. const cityData = ref([]);
  817. const getCityData = (id, type, isChange) => {
  818. proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
  819. if (type === "20") {
  820. provinceData.value = res;
  821. if (isChange) {
  822. formData.data.provinceId = "";
  823. formData.data.provinceName = "";
  824. formData.data.cityId = "";
  825. formData.data.cityName = "";
  826. }
  827. } else if (type === "30") {
  828. cityData.value = res;
  829. if (isChange) {
  830. formData.data.cityId = "";
  831. formData.data.cityName = "";
  832. }
  833. } else {
  834. countryData.value = res;
  835. }
  836. });
  837. };
  838. getCityData("0");
  839. const clickAddPerson = () => {
  840. if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
  841. formData.data.customerUserList.push({
  842. name: "",
  843. email: "",
  844. });
  845. } else {
  846. formData.data.customerUserList = [
  847. {
  848. name: "",
  849. email: "",
  850. },
  851. ];
  852. }
  853. };
  854. const submitFollow = () => {
  855. follow.value.handleSubmit(() => {
  856. if (fileList.value && fileList.value.length > 0) {
  857. formFollow.data.fileList = fileList.value.map((item) => {
  858. return {
  859. id: item.raw.id,
  860. fileName: item.raw.fileName,
  861. fileUrl: item.raw.fileUrl,
  862. };
  863. });
  864. } else {
  865. formFollow.data.fileList = [];
  866. }
  867. proxy.post("/customerFollowRecords/" + modalType.value, formFollow.data).then(
  868. () => {
  869. ElMessage({
  870. message: modalType.value == "add" ? "添加成功" : "编辑成功",
  871. type: "success",
  872. });
  873. openFollow.value = false;
  874. getList();
  875. },
  876. (err) => {
  877. console.log(err);
  878. }
  879. );
  880. });
  881. };
  882. const submitForm = () => {
  883. submit.value.handleSubmit(() => {
  884. if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
  885. formData.data.tag = formData.data.tags.join(",");
  886. submitLoading.value = true;
  887. proxy.post("/customer/" + modalType.value, formData.data).then(
  888. () => {
  889. ElMessage({
  890. message: modalType.value == "add" ? "添加成功" : "编辑成功",
  891. type: "success",
  892. });
  893. dialogVisible.value = false;
  894. submitLoading.value = false;
  895. getList();
  896. obtainStatisticalData();
  897. },
  898. (err) => {
  899. console.log(err);
  900. submitLoading.value = false;
  901. }
  902. );
  903. } else {
  904. ElMessage("请添加客户联系人");
  905. }
  906. });
  907. };
  908. const getDict = () => {
  909. proxy.getDictOne(["customer_tag", "customer_source", "customer_status", "contact_type"]).then((res) => {
  910. customerTag.value = res["customer_tag"].map((x) => ({
  911. label: x.dictValue,
  912. value: x.dictKey,
  913. }));
  914. customerSource.value = res["customer_source"].map((x) => ({
  915. label: x.dictValue,
  916. value: x.dictKey,
  917. }));
  918. customerStatus.value = res["customer_status"].map((x) => ({
  919. label: x.dictValue,
  920. value: x.dictKey,
  921. }));
  922. contactType.value = res["contact_type"].map((x) => ({
  923. label: x.dictValue,
  924. value: x.dictKey,
  925. }));
  926. });
  927. proxy
  928. .get("/tenantUser/list", {
  929. pageNum: 1,
  930. pageSize: 10000,
  931. tenantId: useUserStore().user.tenantId,
  932. })
  933. .then((res) => {
  934. userList.value = res.rows.map((item) => {
  935. return {
  936. label: item.nickName,
  937. value: item.userId,
  938. };
  939. });
  940. });
  941. };
  942. getDict();
  943. getList();
  944. const handleClickName = (row) => {
  945. proxy.$router.push({
  946. path: "/ERP/customer/portrait",
  947. query: {
  948. id: row.id,
  949. },
  950. });
  951. };
  952. const deleteFollow = (data) => {
  953. ElMessageBox.confirm("是否确认删除该跟进?", "提示", {
  954. confirmButtonText: "确定",
  955. cancelButtonText: "取消",
  956. type: "warning",
  957. }).then(() => {
  958. proxy
  959. .post("/customerFollowRecords/delete", {
  960. id: data.id,
  961. })
  962. .then(() => {
  963. ElMessage({
  964. message: "删除成功",
  965. type: "success",
  966. });
  967. getList();
  968. });
  969. });
  970. };
  971. const addTag = ref("");
  972. const judgeTagSelect = (data, val) => {
  973. if (data && data.length > 0) {
  974. if (data.includes(val)) {
  975. return true;
  976. }
  977. }
  978. return false;
  979. };
  980. const changeTag = (val, item) => {
  981. let data = {
  982. id: item.id,
  983. tag: JSON.parse(JSON.stringify(item.tag)),
  984. };
  985. data.tag.push(val);
  986. data.tag = data.tag.join(",");
  987. proxy.post("/customer/editTag", data).then(() => {
  988. ElMessage({
  989. message: "添加成功",
  990. type: "success",
  991. });
  992. item.addTagShow = false;
  993. addTag.value = "";
  994. getList();
  995. });
  996. };
  997. const tagClose = (val, item) => {
  998. let data = {
  999. id: item.id,
  1000. tag: JSON.parse(JSON.stringify(item.tag)),
  1001. };
  1002. data.tag = data.tag.filter((row) => row !== val);
  1003. if (data.tag && data.tag.length > 0) {
  1004. data.tag = data.tag.join(",");
  1005. } else {
  1006. data.tag = "";
  1007. }
  1008. proxy.post("/customer/editTag", data).then(() => {
  1009. ElMessage({
  1010. message: "添加成功",
  1011. type: "success",
  1012. });
  1013. item.addTagShow = false;
  1014. addTag.value = "";
  1015. getList();
  1016. });
  1017. };
  1018. const showSelect = (item) => {
  1019. item.addTagShow = true;
  1020. };
  1021. const clickFollowUp = (item) => {
  1022. formFollow.data = {
  1023. customerId: item.id,
  1024. fileList: [],
  1025. };
  1026. fileList.value = [];
  1027. modalType.value = "add";
  1028. openFollow.value = true;
  1029. openRecordMore.value = false;
  1030. };
  1031. const uploadFile = async (file) => {
  1032. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  1033. uploadData.value = res.uploadBody;
  1034. file.id = res.id;
  1035. file.fileName = res.fileName;
  1036. file.fileUrl = res.fileUrl;
  1037. return true;
  1038. };
  1039. const onPreviewFile = (file) => {
  1040. window.open(file.raw.fileUrl, "_blank");
  1041. };
  1042. const getStyle = (val) => {
  1043. if (val) {
  1044. return "跟进记录: " + val.replace(/\n|\r\n/g, "<br>");
  1045. } else {
  1046. return "";
  1047. }
  1048. };
  1049. const getContent = (item) => {
  1050. if (item.type === "10") {
  1051. return "跟进记录: " + "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
  1052. } else if (item.type === "20") {
  1053. return "跟进记录: " + "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
  1054. }
  1055. };
  1056. const recordShow = (item) => {
  1057. if (!(item.fileList && item.fileList.length > 0) && JSON.stringify(item.fileList) !== "[]") {
  1058. proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((fileObj) => {
  1059. item.fileList = fileObj[item.id] || [];
  1060. });
  1061. }
  1062. };
  1063. const openFile = (path) => {
  1064. window.open(path, "_blank");
  1065. };
  1066. const recordList = ref([]);
  1067. const rowData = ref({});
  1068. const openRecordMore = ref(false);
  1069. const queryParams = ref({
  1070. total: 0,
  1071. pageNum: 1,
  1072. pageSize: 10,
  1073. customerId: "",
  1074. });
  1075. const clickMore = (item) => {
  1076. if (openRecordMore.value === false) {
  1077. queryParams.value.pageNum = 1;
  1078. recordList.value = [];
  1079. rowData.value = item;
  1080. queryParams.value.customerId = item.id;
  1081. }
  1082. proxy.post("/customerFollowRecords/page", queryParams.value).then((res) => {
  1083. recordList.value = recordList.value.concat(res.rows);
  1084. queryParams.value.total = res.total;
  1085. proxy.post("/fileInfo/getList", { businessIdList: res.rows.map((rows) => rows.id) }).then((fileObj) => {
  1086. for (let i = 0; i < res.rows.length; i++) {
  1087. recordList.value[parseInt(i + (queryParams.value.pageNum - 1) * queryParams.value.pageSize)].fileList =
  1088. fileObj[recordList.value[parseInt(i + (queryParams.value.pageNum - 1) * queryParams.value.pageSize)].id] || [];
  1089. }
  1090. });
  1091. });
  1092. openRecordMore.value = true;
  1093. };
  1094. const infiniteScroll = () => {
  1095. queryParams.value.pageNum++;
  1096. clickMore();
  1097. };
  1098. const judgeTotal = () => {
  1099. if (queryParams.value.pageNum * queryParams.value.pageSize >= queryParams.value.total) {
  1100. return true;
  1101. }
  1102. return false;
  1103. };
  1104. const moreIndex = ref(0);
  1105. const clickInformationMore = (item, index) => {
  1106. moreIndex.value = index;
  1107. if (item.contactJson) {
  1108. item.contact = JSON.parse(item.contactJson);
  1109. } else {
  1110. item.contact = [];
  1111. }
  1112. formPerson.data = proxy.deepClone(item);
  1113. openPerson.value = true;
  1114. };
  1115. const clickDelete = (index) => {
  1116. formData.data.customerUserList.splice(index, 1);
  1117. };
  1118. const clickAddMoreInformation = () => {
  1119. if (formPerson.data.contact && formPerson.data.contact.length > 0) {
  1120. formPerson.data.contact.push({
  1121. type: "",
  1122. contactNo: "",
  1123. });
  1124. } else {
  1125. formPerson.data.contact = [
  1126. {
  1127. type: "",
  1128. contactNo: "",
  1129. },
  1130. ];
  1131. }
  1132. };
  1133. const clickInformationDelete = (index) => {
  1134. formPerson.data.contact.splice(index, 1);
  1135. };
  1136. const submitPerson = () => {
  1137. person.value.validate((valid) => {
  1138. if (valid) {
  1139. formPerson.data.contactJson = JSON.stringify(formPerson.data.contact);
  1140. formData.data.customerUserList[moreIndex.value] = formPerson.data;
  1141. openPerson.value = false;
  1142. }
  1143. });
  1144. };
  1145. const deleteTop = (item) => {
  1146. proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
  1147. item.isTop = 0;
  1148. });
  1149. };
  1150. const addTop = (item) => {
  1151. proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
  1152. item.isTop = 1;
  1153. });
  1154. };
  1155. const searchItemSelect = (val) => {
  1156. sourceList.value.paginationTwo.statisticsType = val;
  1157. obtainStatisticalData();
  1158. };
  1159. const statisticalData = ref({
  1160. countAmount: 0,
  1161. customerList: [],
  1162. });
  1163. const obtainStatisticalData = () => {
  1164. proxy.post("/customer/sourceStatistics", sourceList.value.paginationTwo).then((res) => {
  1165. statisticalData.value = res;
  1166. });
  1167. };
  1168. obtainStatisticalData();
  1169. const getNum = (val) => {
  1170. let num = 0;
  1171. if (statisticalData.value.customerList && statisticalData.value.customerList.length > 0) {
  1172. statisticalData.value.customerList.map((item) => {
  1173. if (sourceList.value.paginationTwo.statisticsType === 1) {
  1174. if (item.source === val) {
  1175. num = item.count;
  1176. }
  1177. } else if (sourceList.value.paginationTwo.statisticsType === 2) {
  1178. if (item.status === val) {
  1179. num = item.count;
  1180. }
  1181. } else if (sourceList.value.paginationTwo.statisticsType === 3) {
  1182. if (item.userId === val) {
  1183. num = item.count;
  1184. }
  1185. }
  1186. });
  1187. }
  1188. return num;
  1189. };
  1190. const countrySearchData = ref([]);
  1191. const provinceSearchData = ref([]);
  1192. const citySearchData = ref([]);
  1193. const getCitySearchData = (id, type, isChange) => {
  1194. proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
  1195. if (type === "20") {
  1196. provinceSearchData.value = res;
  1197. if (isChange) {
  1198. sourceList.value.pagination.provinceId = "";
  1199. sourceList.value.pagination.provinceName = "";
  1200. sourceList.value.pagination.cityId = "";
  1201. sourceList.value.pagination.cityName = "";
  1202. }
  1203. } else if (type === "30") {
  1204. citySearchData.value = res;
  1205. if (isChange) {
  1206. sourceList.value.pagination.cityId = "";
  1207. sourceList.value.pagination.cityName = "";
  1208. }
  1209. } else {
  1210. countrySearchData.value = res;
  1211. }
  1212. });
  1213. };
  1214. getCitySearchData("0");
  1215. const openSearch = ref(false);
  1216. const formSearchConfig = computed(() => {
  1217. return [
  1218. {
  1219. type: "input",
  1220. prop: "name",
  1221. label: "客户名称",
  1222. itemType: "text",
  1223. },
  1224. {
  1225. type: "slot",
  1226. slotName: "address",
  1227. label: "所在城市",
  1228. },
  1229. {
  1230. type: "input",
  1231. prop: "customerCode",
  1232. label: "客户代码",
  1233. itemType: "text",
  1234. },
  1235. {
  1236. type: "select",
  1237. label: "客户来源",
  1238. prop: "source",
  1239. itemWidth: 50,
  1240. data: customerSource.value,
  1241. clearable: true,
  1242. },
  1243. {
  1244. type: "select",
  1245. label: "客户类型",
  1246. prop: "status",
  1247. itemWidth: 50,
  1248. data: customerStatus.value,
  1249. clearable: true,
  1250. },
  1251. {
  1252. type: "slot",
  1253. slotName: "tags",
  1254. label: "客户标签",
  1255. },
  1256. ];
  1257. });
  1258. const addSearchTag = ref("");
  1259. const addTagSearchShow = ref(false);
  1260. let copySearch = ref({});
  1261. const moreSearch = () => {
  1262. if (sourceList.value.pagination.tag) {
  1263. sourceList.value.pagination.tags = sourceList.value.pagination.tag.split(",");
  1264. } else {
  1265. sourceList.value.pagination.tags = [];
  1266. }
  1267. addTagSearchShow.value = false;
  1268. copySearch.value = proxy.deepClone(sourceList.value.pagination);
  1269. openSearch.value = true;
  1270. };
  1271. const cancelSearch = () => {
  1272. sourceList.value.pagination = copySearch.value;
  1273. openSearch.value = false;
  1274. };
  1275. const submitSearch = () => {
  1276. if (sourceList.value.pagination.tags && sourceList.value.pagination.tags.length > 0) {
  1277. sourceList.value.pagination.tag = sourceList.value.pagination.tags.join(",");
  1278. } else {
  1279. sourceList.value.pagination.tag = "";
  1280. }
  1281. openSearch.value = false;
  1282. sourceList.value.pagination.keyword = '';
  1283. sourceList.value.pagination.pageNum = 1;
  1284. getList();
  1285. };
  1286. const tagSearchClose = (val) => {
  1287. sourceList.value.pagination.tags = sourceList.value.pagination.tags.filter((item) => item !== val);
  1288. };
  1289. const changeSearchTag = (val) => {
  1290. sourceList.value.pagination.tags.push(val);
  1291. addTagSearchShow.value = false;
  1292. addSearchTag.value = "";
  1293. };
  1294. </script>
  1295. <style lang="scss" scoped>
  1296. .tenant {
  1297. padding: 20px;
  1298. }
  1299. .infinite-scroll {
  1300. max-height: calc(89vh - 94px - 70px - 58px - 16px);
  1301. overflow-y: auto;
  1302. &::-webkit-scrollbar {
  1303. width: 0px;
  1304. }
  1305. }
  1306. .by-dropdown {
  1307. position: relative;
  1308. text-align: left;
  1309. height: 32px;
  1310. z-index: 1010;
  1311. padding: 0 10px;
  1312. transition: all 0.5s ease;
  1313. cursor: pointer;
  1314. line-height: 32px;
  1315. .by-dropdown-title {
  1316. font-size: 14px;
  1317. background-color: #fff;
  1318. }
  1319. ul {
  1320. position: absolute;
  1321. left: 0;
  1322. top: 32px;
  1323. padding: 0;
  1324. margin: 0;
  1325. z-index: 1200;
  1326. display: none;
  1327. white-space: nowrap;
  1328. background-color: #fff;
  1329. li {
  1330. list-style: none;
  1331. z-index: 1200;
  1332. font-size: 12px;
  1333. height: 30px;
  1334. padding: 0 10px;
  1335. }
  1336. li:hover {
  1337. background-color: #eff6ff;
  1338. color: #0084ff;
  1339. }
  1340. }
  1341. }
  1342. .by-dropdown::before {
  1343. display: block;
  1344. width: 1px;
  1345. content: " ";
  1346. position: absolute;
  1347. height: 14px;
  1348. top: 8px;
  1349. background-color: #ddd;
  1350. right: 0;
  1351. z-index: 1011;
  1352. }
  1353. .by-dropdown:hover {
  1354. background: #ffffff;
  1355. border-radius: 2px 2px 2px 2px;
  1356. opacity: 1;
  1357. ul {
  1358. background: #ffffff;
  1359. box-shadow: 0px 2px 16px 1px rgba(0, 0, 0, 0.06);
  1360. border-radius: 2px 2px 2px 2px;
  1361. opacity: 1;
  1362. display: block;
  1363. text-align: left;
  1364. }
  1365. }
  1366. .by-dropdown-lists {
  1367. max-height: 50vh;
  1368. overflow-y: auto;
  1369. line-height: 1;
  1370. }
  1371. .statistics-text {
  1372. padding-left: 8px;
  1373. width: 152px;
  1374. overflow: hidden;
  1375. text-overflow: ellipsis;
  1376. white-space: nowrap;
  1377. }
  1378. </style>