wholeOrganization.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <div class="container-whole-organization">
  3. <el-card>
  4. <div class="introduce">注:机构的互动详情,是截止至昨天24点的数据,非当前实时数据</div>
  5. <div class="department-tabs">
  6. <span :class="['item', activeTypeName == item.value && 'active']" v-for="item in typeList" :key="item.value" @click="typeHandleClick(item)">{{ item.label }}</span>
  7. </div>
  8. <div class="tabs">
  9. <span :class="['item', activeName == item.Source && 'active']" v-for="item in list" :key="item.Source" @click="handleTabsClick(item)">{{ item.PermissionName }} ({{ item.TotalNum }})</span>
  10. </div>
  11. <div class="son-box">
  12. <div style="display: flex; align-items: center" v-if="activeName == 2">
  13. <el-checkbox-group v-model="checkActiveList" @change="dataChangeHandler">
  14. <el-checkbox :label="item.key" v-for="item in screenList" :key="item.key">{{ item.name }}</el-checkbox>
  15. </el-checkbox-group>
  16. <el-checkbox-group style="margin-left: 25px" v-model="checkMeetingList" @change="dataChangeHandler">
  17. <el-checkbox :label="item.key" v-for="item in meetingList" :key="item.key">{{ item.name }}</el-checkbox>
  18. </el-checkbox-group>
  19. <el-tooltip class="tooltip-item" effect="dark" content="线上活动设置预约外呼/会议提醒/预约纪要,线下活动报名/预约纪要,但实际未参会的活动" placement="top-start">
  20. <i class="el-icon-info"></i>
  21. </el-tooltip>
  22. </div>
  23. <div class="dataReport-top" v-if="showSelectBox">
  24. <template>
  25. <date-picker
  26. v-model="filterObj.date"
  27. type="date"
  28. range
  29. value-type="format"
  30. :placeholder="activeName == 2 ? '活动时间' : '阅读时间'"
  31. :editable="false"
  32. @change="dateChange"
  33. style="width: 200px; margin-right: 20px"
  34. />
  35. </template>
  36. <el-cascader
  37. v-model="sales"
  38. placeholder="所属销售"
  39. style="width: 200px; margin-right: 20px"
  40. :options="salesArr"
  41. :props="defaultSalesProps"
  42. :show-all-levels="false"
  43. collapse-tags
  44. clearable
  45. filterable
  46. @change="handleSearchActivity"
  47. >
  48. </el-cascader>
  49. <el-input placeholder="手机号/邮箱/姓名/公司名" v-model="searchVal" style="width: 220px; margin-right: 20px" @input="handleSearchActivity" clearable>
  50. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  51. </el-input>
  52. <el-input v-if="activeName == 2" placeholder="活动名称" v-model="activityName" style="width: 200px" @input="handleSearchActivity" clearable>
  53. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  54. </el-input>
  55. <a :href="exportExcel" download>
  56. <button class="button-sty act">下载EXCEL</button>
  57. </a>
  58. </div>
  59. </div>
  60. <template v-if="activeName != 4">
  61. <el-table style="margin-top: 20px" :data="tableData" v-loading="tableLoading" element-loading-text="数据加载中..." border>
  62. <el-table-column v-for="item in tableColumsList" :key="item.label" :label="item.label" :width="item.widthsty" :min-width="item.minwidthsty" align="center">
  63. <template slot-scope="{ row }">
  64. <span v-if="item.key !== 'LabelKeyWord'" @click="handleRowClick(row, item.key)" :style="handleRowStyle(item.key)">{{ handleRowContent(row, item.key) }}</span>
  65. <div v-else>
  66. <template v-if="row.LabelKeyWord">
  67. <el-tag style="margin: 5px" type="info" size="small" v-for="tag in row.LabelKeyWord.split(',')" :key="tag">{{ tag }}</el-tag>
  68. </template>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <div slot="empty" style="padding: 20px 0">
  73. <img src="~@/assets/img/data_m/table_no.png" alt="" style="display: block; width: 135px; height: 90px; margin: 0 auto" />
  74. <span>暂无数据</span>
  75. </div>
  76. </el-table>
  77. <el-col :span="24" class="toolbar">
  78. <m-page :total="total" :page_no="page_no" :pageSize="10" @handleCurrentChange="handleCurrentChange" />
  79. </el-col>
  80. </template>
  81. <template v-else>
  82. <template v-if="publicHaveMoveCompany">
  83. <div v-for="item in chartList" :key="item.UserId">
  84. <template v-if="item.ListChart">
  85. <ChartItem :chartData="item" :companyName="item.CompanyName" :activeTypeName="activeTypeName" />
  86. </template>
  87. </div>
  88. <el-col :span="24" class="toolbar">
  89. <m-page :total="total" :page_no="page_no" :pageSize="10" @handleCurrentChange="handleChartChange" />
  90. </el-col>
  91. </template>
  92. <template v-else>
  93. <img src="~@/assets/img/data_m/table_no.png" alt="" style="display: block; width: 135px; height: 90px; margin: 30px auto" />
  94. <p class="chart-no-data">暂无收藏的图表</p>
  95. </template>
  96. </template>
  97. </el-card>
  98. <special-research-dlg :specialDetailId="specialDetailId" :dialogVisibleActivity.sync="dialogVisibleActivity" :dialogTitle="dialogTitle" :tabsActive="1" />
  99. </div>
  100. </template>
  101. <script>
  102. import { wholeOrganizationTableColums, screenList, meetingList } from "./compontents/contactsColums";
  103. import { customInterence, equityContacts } from "@/api/api.js";
  104. import mPage from "@/components/mPage.vue";
  105. import ChartItem from "./compontents/chartItem.vue";
  106. import SpecialResearchDlg from "../../rai_manage/components/special/specialResearchDlg.vue";
  107. import { mutualMixin } from "./mixins/mutualAssistance";
  108. var moment = require("moment");
  109. moment().format();
  110. export default {
  111. name: "",
  112. components: { mPage, ChartItem, SpecialResearchDlg },
  113. props: {},
  114. data() {
  115. return {
  116. activityName: "",
  117. publicHaveMoveCompany: true,
  118. };
  119. },
  120. mixins: [mutualMixin],
  121. computed: {
  122. exportExcel() {
  123. let baseUrl = process.env.API_ROOT + "/cygx/user/companyList/export/interaction";
  124. let token = localStorage.getItem("auth") || "";
  125. let salesArr = [];
  126. if (this.sales.length) {
  127. salesArr = this.sales.map((item) => {
  128. return item[item.length - 1];
  129. });
  130. }
  131. let paramStr = "";
  132. let params = {
  133. Source: this.activeName,
  134. IsMeeting: this.checkMeetingList.join(","),
  135. MeetType: this.checkActiveList.join(","),
  136. EndDate: this.end_date,
  137. StartDate: this.start_date,
  138. KeyWord: this.searchVal,
  139. ActivityName: this.activityName,
  140. AdminId: salesArr.join(","),
  141. ClassType: this.activeTypeName,
  142. };
  143. for (let key in params) {
  144. paramStr = `${paramStr}&${key}=${params[key]}`;
  145. }
  146. return `${baseUrl}?${token}${paramStr}`;
  147. },
  148. },
  149. watch: {},
  150. created() {},
  151. mounted() {
  152. this.tableColums = wholeOrganizationTableColums(1);
  153. this.getCygxMutualList();
  154. this.getSale();
  155. },
  156. methods: {
  157. // 类型的点击事件
  158. typeHandleClick(item) {
  159. if (this.activeTypeName == item.value) return;
  160. this.activeTypeName = item.value;
  161. this.activeName = 1;
  162. this.tableColums = wholeOrganizationTableColums(this.activeName);
  163. this.getCygxMutualList();
  164. },
  165. //获取基础数据
  166. async getCygxMutualList() {
  167. const res = await equityContacts.getUserTableCompanyList({ ClassType: this.activeTypeName });
  168. if (res.Ret === 200) {
  169. this.list = res.Data.List || [];
  170. this.userForm = res.Data;
  171. this.getTableData();
  172. }
  173. },
  174. //一级的点击事件
  175. handleTabsClick(item) {
  176. if (this.activeName != item.Source) {
  177. this.activeName = item.Source;
  178. this.tableColums = wholeOrganizationTableColums(this.activeName);
  179. }
  180. this.checkActiveList = [1, 2]; //活动的方式
  181. this.checkMeetingList = [1, 2]; //是否到会
  182. this.filterObj = {
  183. month: "",
  184. date: [],
  185. };
  186. this.searchVal = "";
  187. this.activityName = "";
  188. this.end_date = "";
  189. this.start_date = "";
  190. this.sales = [];
  191. this.page_no = 1;
  192. if (this.activeName !== 4) {
  193. this.getTableData();
  194. } else {
  195. this.getChartData();
  196. }
  197. },
  198. //获取表格数据
  199. async getTableData() {
  200. let salesArr = [];
  201. if (this.sales.length) {
  202. salesArr = this.sales.map((item) => {
  203. return item[item.length - 1];
  204. });
  205. }
  206. this.tableLoading = true;
  207. const res = await equityContacts.getUserCompanyList({
  208. Source: this.activeName,
  209. PageSize: this.pageSize,
  210. CurrentIndex: this.page_no,
  211. IsMeeting: this.checkMeetingList.join(","),
  212. MeetType: this.checkActiveList.join(","),
  213. EndDate: this.end_date,
  214. StartDate: this.start_date,
  215. KeyWord: this.searchVal,
  216. ActivityName: this.activityName,
  217. AdminId: salesArr.join(","),
  218. ClassType: this.activeTypeName,
  219. });
  220. if (res.Ret === 200) {
  221. this.total = res.Data.Paging.Totals;
  222. this.tableLoading = false;
  223. this.tableData = res.Data.List || [];
  224. }
  225. },
  226. //获取图表
  227. async getChartData() {
  228. let salesArr = [];
  229. if (this.sales.length) {
  230. salesArr = this.sales.map((item) => {
  231. return item[item.length - 1];
  232. });
  233. }
  234. const res = await equityContacts.getUserCompanyList({
  235. Source: this.activeName,
  236. CurrentIndex: this.page_no,
  237. IdentityType: 2,
  238. KeyWord: this.searchVal,
  239. PageSize: this.pageSize,
  240. CurrentIndex: this.page_no,
  241. AdminId: salesArr.join(","),
  242. ClassType: this.activeTypeName,
  243. });
  244. if (res.Ret === 200) {
  245. this.chartList = res.Data.List || [];
  246. console.log(this.chartList);
  247. this.publicHaveMove = res.Data ? this.page_no < res.Data.Paging.Pages : false;
  248. this.publicHaveMoveCompany = res.Data.List.length > 0;
  249. this.total = res.Data.Paging.Totals;
  250. }
  251. },
  252. handleChartChange(page) {
  253. this.chartList = [];
  254. this.page_no = page;
  255. this.getChartData();
  256. },
  257. handleSearchActivity() {
  258. this.page_no = 1;
  259. if (this.activeName !== 4) {
  260. this.getTableData();
  261. } else {
  262. this.chartList = [];
  263. this.getChartData();
  264. }
  265. },
  266. },
  267. };
  268. </script>
  269. <style scoped lang="scss">
  270. .container-whole-organization {
  271. .introduce {
  272. font-size: 14px;
  273. color: #999999;
  274. }
  275. @import "./compontents/details.scss";
  276. }
  277. </style>
  278. <style>
  279. .el-tabs__nav-wrap::after {
  280. background-color: rgba(255, 255, 255, 0.5);
  281. }
  282. </style>