list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div class="app-container">
  3. <!-- 顶部操作区域 -->
  4. <div class="filter-container">
  5. <div class="filter-control">
  6. <span>机构ID:</span>
  7. <el-input
  8. v-model="listQuery.clubId"
  9. style="width: 120px"
  10. placeholder="机构ID"
  11. clearable
  12. maxlength="10"
  13. @keyup.enter.native="getList"
  14. @clear="getList"
  15. />
  16. </div>
  17. <div class="filter-control">
  18. <span>机构名称:</span>
  19. <el-input
  20. v-model="listQuery.name"
  21. placeholder="机构名称"
  22. clearable
  23. @keyup.enter.native="getList"
  24. @clear="getList"
  25. />
  26. </div>
  27. <div class="filter-control">
  28. <span>手机号:</span>
  29. <el-input
  30. v-model="listQuery.contractMobile"
  31. placeholder="手机号"
  32. maxlength="11"
  33. clearable
  34. @keyup.enter.native="getList"
  35. @clear="getList"
  36. />
  37. </div>
  38. <div class="filter-control">
  39. <span>联系人:</span>
  40. <el-input
  41. v-model="listQuery.linkMan"
  42. placeholder="联系人名称"
  43. clearable
  44. @keyup.enter.native="getList"
  45. @clear="getList"
  46. />
  47. </div>
  48. <div class="filter-control">
  49. <span>机构状态:</span>
  50. <el-select v-model="listQuery.status" style="width: 150px" clearable @change="getList">
  51. <el-option value="" label="请选择" />
  52. <el-option :value="90" label="已上线" />
  53. <el-option :value="91" label="已下线" />
  54. <el-option :value="1" label="待审核" />
  55. <el-option :value="92" label="审核未通过" />
  56. <el-option :value="93" label="已确认" />
  57. <el-option :value="94" label="已冻结" />
  58. </el-select>
  59. </div>
  60. <div class="filter-control">
  61. <span>机构级别:</span>
  62. <el-select v-model="listQuery.userIdentity" style="width: 150px" clearable @change="getList">
  63. <el-option value="" label="请选择" />
  64. <el-option :value="4" label="个人机构" />
  65. <el-option :value="2" label="资质机构" />
  66. <el-option :value="8" label="超级会员" />
  67. </el-select>
  68. </div>
  69. <div class="filter-control">
  70. <span>协销:</span>
  71. <el-select v-model="listQuery.spId" style="width: 150px" filterable @change="getList">
  72. <el-option value="" label="请选择" />
  73. <el-option
  74. v-for="item in sellerOption"
  75. :key="item.serviceProviderId"
  76. :label="item.linkMan"
  77. :value="item.serviceProviderId"
  78. />
  79. </el-select>
  80. </div>
  81. <div class="filter-control">
  82. <span>动态标签:</span>
  83. <el-select v-model="listQuery.trendsLabel" filterable @change="getList">
  84. <el-option value="" label="请选择" />
  85. <el-option
  86. v-for="(item,index) in trendsLabelOption"
  87. :key="index"
  88. :label="item.label"
  89. :value="item.label"
  90. />
  91. </el-select>
  92. </div>
  93. <div class="filter-control">
  94. <span>静态标签:</span>
  95. <el-select v-model="listQuery.stateLabel" filterable @change="getList">
  96. <el-option value="" label="请选择" />
  97. <el-option
  98. v-for="(item,index) in stateLabelOption"
  99. :key="index"
  100. :label="item.label"
  101. :value="item.label"
  102. />
  103. </el-select>
  104. </div>
  105. <div class="filter-control">
  106. <span>注册时间:</span>
  107. <el-date-picker
  108. v-model="time"
  109. type="daterange"
  110. unlink-panels
  111. value-format="yyyy-MM-dd"
  112. range-separator="至"
  113. start-placeholder="开始日期"
  114. end-placeholder="结束日期"
  115. :picker-options="pickerOptions"
  116. @change="getList"
  117. />
  118. </div>
  119. <div class="filter-control">
  120. <span>分配时间:</span>
  121. <el-date-picker
  122. v-model="time1"
  123. type="daterange"
  124. unlink-panels
  125. value-format="yyyy-MM-dd"
  126. range-separator="至"
  127. start-placeholder="开始日期"
  128. end-placeholder="结束日期"
  129. :picker-options="pickerOptions"
  130. @change="getList"
  131. />
  132. </div>
  133. <div class="filter-control">
  134. <el-button type="primary" @click="getList"> 查询 </el-button>
  135. </div>
  136. </div>
  137. <!-- 列表 -->
  138. <el-table v-loading="isLoading" :data="list" border style="width: 100%" height="660">
  139. <el-table-column prop="clubId" fixed label="机构ID" align="center" width="80" />
  140. <el-table-column prop="name" fixed label="机构名称" align="center" />
  141. <el-table-column prop="linkMan" label="联系人" align="center" width="100" />
  142. <el-table-column prop="spName" label="协销人员" align="center" width="120" />
  143. <el-table-column prop="contractMobile" label="手机号" align="center" width="150">
  144. <template slot-scope="{ row }">
  145. {{ row.contractMobile ? row.contractMobile : '---' }}
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="status" label="机构状态" align="center" width="100">
  149. <template slot-scope="{ row }">
  150. <el-tag v-if="row.status === 1" type="warning" size="small">待审核</el-tag>
  151. <el-tag v-if="row.status === 90" type="success" size="small">已上线</el-tag>
  152. <el-tag v-if="row.status === 91" type="info" size="small">已下线</el-tag>
  153. <el-tag v-if="row.status === 92" type="danger" size="small">审核未通过</el-tag>
  154. <el-tag v-if="row.status === 93" type="warning" size="small">已确认</el-tag>
  155. <el-tag v-if="row.status === 94" type="danger" size="small">已冻结</el-tag>
  156. </template>
  157. </el-table-column>
  158. <el-table-column prop="userIdentity" label="机构级别" align="center" width="150">
  159. <template slot-scope="{ row }">
  160. <template v-if="row.userIdentity === '4'">
  161. <el-tag v-if="row.userIdentity === '4' && row.svipUserFlag === 1" type="success" size="small">个人机构(超级会员)</el-tag>
  162. <el-tag v-else type="info" size="small">个人机构(普通会员)</el-tag>
  163. </template>
  164. <template v-if="row.userIdentity === '2'">
  165. <el-tag v-if="row.userIdentity === '2' && row.svipUserFlag ===1" type="success" size="small">资质机构(超级会员)</el-tag>
  166. <el-tag v-if="row.userIdentity === '2' && row.svipUserFlag !==1 && !row.medicalPracticeLicenseImg" type="warning" size="small">资质机构(高级会员)</el-tag>
  167. <el-tag v-if="row.userIdentity === '2' && row.svipUserFlag !==1 && row.medicalPracticeLicenseImg" type="danger" size="small">资质机构(医美会员)</el-tag>
  168. </template>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="source" label="注册IP" align="center" width="180">
  172. <template slot-scope="{ row }">
  173. <el-tag v-if="row.source === '0'" effect="plain" type="warning" size="small">{{ row.registerIP }}(网站)</el-tag>
  174. <el-tag v-if="row.source === '1'" effect="plain" type="warning" size="small">{{ row.registerIP }}(小程序)</el-tag>
  175. </template>
  176. </el-table-column>
  177. <el-table-column prop="addTime" label="注册时间" align="center" width="100">
  178. <template slot-scope="{ row }">
  179. {{ row.addTime ? row.addTime : '---' }}
  180. </template>
  181. </el-table-column>
  182. <el-table-column fixed="right" label="操作" align="center">
  183. <template slot-scope="{ row }">
  184. <el-button type="success" size="mini" style="margin: 4px" @click="handleRecordDetail(3, row)">
  185. 机构画像
  186. </el-button>
  187. <el-button type="primary" size="mini" style="margin: 4px" @click="handleRecordDetail(2, row)">
  188. 行为记录
  189. </el-button>
  190. <el-button type="primary" size="mini" style="margin: 4px" @click="handleRecordDetail(1, row)">
  191. 咨询记录
  192. </el-button>
  193. </template>
  194. </el-table-column>
  195. </el-table>
  196. <!-- 页码 -->
  197. <pagination
  198. :total="total"
  199. :page-sizes="[10, 20, 30, 100]"
  200. :page-size="20"
  201. :page.sync="listQuery.pageNum"
  202. :limit.sync="listQuery.pageSize"
  203. @pagination="getClubList"
  204. />
  205. </div>
  206. </template>
  207. <script>
  208. import { getClubList, getClubLabel } from '@/api/user/club/club'
  209. import { getServiceList } from '@/api/library/keyword'
  210. import pickerOptions from '@/utils/time-picker.js'
  211. export default {
  212. name: 'CustomerList',
  213. filters: {},
  214. data() {
  215. return {
  216. isLoading: true,
  217. pickerOptions,
  218. time: [],
  219. time1: [],
  220. listQuery: {
  221. clubId: '',
  222. name: '',
  223. contractMobile: '',
  224. userIdentity: '',
  225. startTime: '',
  226. endTime: '',
  227. allocationStartTime: '',
  228. allocationEndTime: '',
  229. newDeal: '',
  230. spId: '',
  231. trendsLabel: '',
  232. stateLabel: '',
  233. status: '',
  234. pageNum: 1,
  235. pageSize: 20
  236. },
  237. list: [],
  238. total: 0,
  239. sellerOption: [],
  240. trendsLabelOption: [],
  241. stateLabelOption: [],
  242. shopDialogVisible: false,
  243. dialogFormVisible: false,
  244. renewCustome: {
  245. id: '',
  246. status: ''
  247. },
  248. rules: {
  249. status: [{ required: true, message: '请设置统计状态', trigger: 'blur' }]
  250. }
  251. }
  252. },
  253. computed: {},
  254. created() {
  255. this.getTrendsLabel()
  256. this.getStateLabel()
  257. this.getServiceList()
  258. this.getList()
  259. },
  260. mounted() {},
  261. methods: {
  262. // 获取行为记录列表
  263. getList() {
  264. this.list = []
  265. this.isLoading = true
  266. this.listQuery.pageNum = 1
  267. if (this.time && this.time.length > 0) {
  268. this.listQuery.startTime = this.time[0]
  269. this.listQuery.endTime = this.time[1]
  270. } else {
  271. this.listQuery.startTime = ''
  272. this.listQuery.endTime = ''
  273. }
  274. if (this.time1 && this.time1.length > 0) {
  275. this.listQuery.allocationStartTime = this.time1[0]
  276. this.listQuery.allocationEndTime = this.time1[1]
  277. } else {
  278. this.listQuery.allocationStartTime = ''
  279. this.listQuery.allocationEndTime = ''
  280. }
  281. this.getClubList()
  282. },
  283. // 获取机构列表
  284. async getClubList() {
  285. try {
  286. const res = await getClubList(this.listQuery)
  287. this.list = res.data.results
  288. this.total = res.data.totalRecord
  289. this.isLoading = false
  290. } catch (error) {
  291. console.log(error)
  292. }
  293. },
  294. // 获取协销列表选项
  295. async getServiceList() {
  296. try {
  297. const res = await getServiceList()
  298. this.sellerOption = res.data
  299. } catch (error) {
  300. console.log(error)
  301. }
  302. },
  303. // 获取动态标签
  304. async getTrendsLabel() {
  305. try {
  306. const res = await getClubLabel({ dynamicStatus: 0 })
  307. const data = res.data
  308. this.trendsLabelOption = data
  309. } catch (error) {
  310. console.log(error)
  311. }
  312. },
  313. // 获取静态标签
  314. async getStateLabel() {
  315. try {
  316. const res = await getClubLabel({ dynamicStatus: 1 })
  317. const data = res.data
  318. this.stateLabelOption = data
  319. } catch (error) {
  320. console.log(error)
  321. }
  322. },
  323. // 操作
  324. handleRecordDetail(type, row) {
  325. switch (type) {
  326. case 1: // 咨询记录
  327. this.$router.push({
  328. path: '/user/consult/list',
  329. query: { clubName: row.name, clubId: row.clubId }
  330. })
  331. break
  332. case 2: // 行为记录
  333. this.$router.push({
  334. path: '/user/record-list',
  335. query: { type: 'first', corporateName: row.name, clubId: row.clubId }
  336. })
  337. break
  338. case 3: // 机构画像
  339. this.$router.push({
  340. path: '/user/club-portrait',
  341. query: { clubName: row.name, clubId: row.clubId }
  342. })
  343. break
  344. }
  345. }
  346. }
  347. }
  348. </script>
  349. <style>
  350. .avatar-uploader .el-upload {
  351. border: 1px dashed #d9d9d9;
  352. border-radius: 6px;
  353. cursor: pointer;
  354. position: relative;
  355. overflow: hidden;
  356. float: left;
  357. }
  358. .uploader-tips {
  359. position: absolute;
  360. bottom: 0;
  361. left: 160px;
  362. line-height: 28px;
  363. color: red;
  364. margin: 0;
  365. }
  366. </style>