shareRecord.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="container share-record-container">
  3. <el-card>
  4. <div class="share-record-top">
  5. <div>
  6. <el-date-picker
  7. v-model="selectTime"
  8. style="width: 260px"
  9. type="daterange"
  10. value-format="yyyy-MM-dd"
  11. range-separator="至"
  12. start-placeholder="开始日期"
  13. end-placeholder="结束日期"
  14. @change="handleListChange"
  15. >
  16. </el-date-picker>
  17. <el-cascader
  18. v-model="sales"
  19. placeholder="请选择分享人"
  20. style="width: 200px; margin: 0 20px"
  21. :options="salesArr"
  22. :props="defaultSalesProps"
  23. :show-all-levels="false"
  24. collapse-tags
  25. clearable
  26. filterable
  27. @change="handleListChange"
  28. >
  29. </el-cascader>
  30. <el-select v-model="actionVal" placeholder="用户行为" @change="handleListChange" clearable>
  31. <el-option v-for="item in actionOptions" :key="item" :label="item" :value="item"> </el-option>
  32. </el-select>
  33. </div>
  34. <div>
  35. <el-input placeholder="请输入姓名/手机号" v-model="keyword" style="width: 300px" @input="handleListChange" clearable>
  36. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  37. </el-input>
  38. </div>
  39. </div>
  40. </el-card>
  41. <el-card style="margin-top: 20px">
  42. <el-table ref="userTable" :data="tableData" border>
  43. <el-table-column prop="Action" label="用户行为" align="center" width="150"> </el-table-column>
  44. <el-table-column prop="CreateTime" label="行为时间" align="center" width="180"> </el-table-column>
  45. <el-table-column prop="RegisterPlatformText" label="分享平台" align="center" width="150"> </el-table-column>
  46. <el-table-column prop="RealName" label="姓名" align="center" width="130"> </el-table-column>
  47. <el-table-column prop="Mobile" label="手机号" align="center" width="150"> </el-table-column>
  48. <el-table-column prop="CompanyName" label="公司名称" align="center">
  49. <template slot-scope="{ row }">
  50. <span v-if="row.CompanyId == 1">{{ row.CompanyName }}</span>
  51. <span class="editsty" @click="customDetail(row)" v-else>{{ row.CompanyName }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="ShareName" label="分享人" align="center" width="100"> </el-table-column>
  55. <el-table-column prop="SourceTitle" label="内容标题" align="center">
  56. <template slot-scope="{ row }">
  57. <span class="editsty" @click="titleDetail(row)">{{ row.SourceTitle }}</span>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <el-col :span="24" class="toolbar">
  62. <m-page :total="total" :page_no="page_no" @handleCurrentChange="handleCurrentChange" />
  63. </el-col>
  64. </el-card>
  65. </div>
  66. </template>
  67. <script>
  68. import { customInterence, raiInterface } from "@/api/api.js";
  69. import mPage from "@/components/mPage.vue";
  70. export default {
  71. name: "",
  72. components: { mPage },
  73. props: {},
  74. data() {
  75. return {
  76. total: 0, //条数
  77. pageSize: 10, //每页显示几条
  78. page_no: 1,
  79. keyword: "",
  80. sales: [],
  81. salesArr: [], //销售
  82. defaultSalesProps: {
  83. multiple: true,
  84. label: "RealName",
  85. children: "ChildrenList",
  86. value: "AdminId",
  87. }, //销售级联配置
  88. selectTime: [],
  89. tableData: [],
  90. actionVal: "",
  91. actionOptions: ["注册", "查看专栏", "查看报告", "查看活动", "查看音视频"],
  92. };
  93. },
  94. computed: {},
  95. watch: {},
  96. created() {},
  97. mounted() {
  98. this.getSale();
  99. this.getDataList();
  100. },
  101. methods: {
  102. /* 获取销售 */
  103. getSale() {
  104. customInterence.getSalesRaiData().then((res) => {
  105. if (res.Ret === 200) {
  106. this.salesArr = res.Data.List;
  107. }
  108. });
  109. },
  110. /* 筛选了重新变动 */
  111. handleListChange() {
  112. this.page_no = 1;
  113. this.getDataList();
  114. },
  115. handleCurrentChange(page) {
  116. this.page_no = page;
  117. this.getDataList();
  118. },
  119. /* 查看客户详情 */
  120. customDetail(row) {
  121. if (row.CompanyId == 1) return;
  122. const { href } = this.$router.resolve({
  123. path: "/customDetail",
  124. query: {
  125. id: row.CompanyId,
  126. },
  127. });
  128. window.open(href, "_blank");
  129. },
  130. /* 查看报告/活动标题详情 */
  131. titleDetail(row) {
  132. window.open(row.HttpUrl, "_blank");
  133. },
  134. /* 获取数据 */
  135. async getDataList() {
  136. let salesArr = [];
  137. if (this.sales.length) {
  138. salesArr = this.sales.map((item) => {
  139. return item[item.length - 1];
  140. });
  141. }
  142. const res = await raiInterface.getShareRecordList({
  143. PageSize: this.pageSize,
  144. CurrentIndex: this.page_no,
  145. AdminId: salesArr.join(","),
  146. KeyWord: this.keyword,
  147. StartDate: this.selectTime && this.selectTime[0] ? this.selectTime[0] : "",
  148. EndDate: this.selectTime && this.selectTime[1] ? this.selectTime[1] : "",
  149. Action: this.actionVal,
  150. });
  151. if (res.Ret === 200) {
  152. this.tableData = res.Data.List || [];
  153. this.total = res.Data.Paging.Totals;
  154. }
  155. },
  156. },
  157. };
  158. </script>
  159. <style scoped lang="scss">
  160. .share-record-container {
  161. .share-record-top {
  162. display: flex;
  163. justify-content: space-between;
  164. }
  165. }
  166. </style>