index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 2021十一会员活动
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. @reset="onReSet"
  14. >
  15. <el-form-item prop="organId">
  16. <el-select
  17. class="multiple"
  18. style="width: 180px !important"
  19. v-model.trim="searchForm.organId"
  20. filterable
  21. clearable
  22. placeholder="请选择分部"
  23. >
  24. <el-option
  25. v-for="(item, index) in selects.branchs"
  26. :key="index"
  27. :label="item.name"
  28. :value="item.id"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button native-type="submit" type="primary">搜索</el-button>
  34. <el-button native-type="reset" type="danger">重置</el-button>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button type="primary" @click="onCreateQRCode"
  38. >H5统计链接</el-button
  39. >
  40. </el-form-item>
  41. <el-form-item>
  42. <auth auths="export/countCloudTeacherActive">
  43. <el-button type="primary" @click="onExport">导出</el-button>
  44. </auth>
  45. </el-form-item>
  46. </save-form>
  47. <div style="font-size: 14px; color: #f85043; padding-bottom: 10px">
  48. <!-- 应收总金额:{{ totalExpectAmount }}元 &nbsp;&nbsp;&nbsp;&nbsp;
  49. 现金实收总额:{{ totalActualAmount }}元 &nbsp;&nbsp;&nbsp;&nbsp;
  50. 余额实收总额:{{ Number((totalExpectAmount - totalActualAmount).toFixed(2)) }}元 -->
  51. <!-- 营收金额=2-3
  52. 实收金额=应收总额(包含余额支付)
  53. 预收金额=充值总额(发生消费,记负数)
  54. 预收余额=充值总余额 -->
  55. 人均购买金额:{{ head.avgBuyAmount | moneyFormat }}元<i
  56. style="width: 10px; display: inline-block"
  57. ></i>
  58. 购买总金额:{{ head.buyAmount | moneyFormat }}元<i
  59. style="width: 10px; display: inline-block"
  60. ></i>
  61. 购买人数:{{ head.buyNum | moneyFormat }}元<i
  62. style="width: 10px; display: inline-block"
  63. ></i>
  64. <!-- 购买率:{{ head.buyScale }}%
  65. <i style="width: 10px; display: inline-block"></i> -->
  66. 目标总金额:{{ head.targetAmount | moneyFormat }}元<i
  67. style="width: 10px; display: inline-block"
  68. ></i>
  69. 目标完成率:{{ head.targetFinishScale }}%<i
  70. style="width: 10px; display: inline-block"
  71. ></i>
  72. 目标金额完成率:{{ head.targetAmountFinishScale }}%<i
  73. style="width: 10px; display: inline-block"
  74. ></i>
  75. 目标购买人数:{{ head.targetNum }}人<i
  76. style="width: 10px; display: inline-block"
  77. ></i>
  78. <!-- 总人数:{{ head.totalNum }}元<i
  79. style="width: 10px; display: inline-block"
  80. ></i> -->
  81. </div>
  82. <div class="tableWrap">
  83. <el-table
  84. style="width: 100%"
  85. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  86. :data="tableList"
  87. @sort-change="sortChang"
  88. :default-sort="{
  89. prop: 'targetFinishScale',
  90. order: 'descending',
  91. }"
  92. >
  93. <!-- <el-table-column
  94. align="center"
  95. prop="targetNum"
  96. label="排名"
  97. ></el-table-column> -->
  98. <el-table-column align="center" label="排名" type="index" width="50">
  99. </el-table-column>
  100. <el-table-column
  101. align="center"
  102. prop="organName"
  103. label="分部" width="170px"
  104. ></el-table-column>
  105. <el-table-column align="center" prop="buyNum" sortable="custom" width="150px">
  106. <template slot="header" slot-scope="slot">
  107. <div class="titleCell">
  108. <span>购买人数</span>
  109. <el-tooltip placement="top" popper-class="mTooltip">
  110. <div slot="content">本次活动交易成功总人数(去重)</div>
  111. <i
  112. class="el-icon-question micon el-tooltip"
  113. style="
  114. font-size: 18px;
  115. color: #f56c6c;
  116. top: 2px;
  117. position: relative;
  118. "
  119. ></i>
  120. </el-tooltip>
  121. </div>
  122. </template>
  123. <template slot-scope="scope">
  124. <div>{{ scope.row.buyNum }}人</div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="center" prop="avgBuyAmount" sortable="custom" width="150px">
  128. <template slot="header" slot-scope="slot">
  129. <div class="titleCell">
  130. <span>人均购买金额</span>
  131. <el-tooltip placement="top" popper-class="mTooltip">
  132. <div slot="content">总金额 / 购买人数</div>
  133. <i
  134. class="el-icon-question micon el-tooltip"
  135. style="
  136. font-size: 18px;
  137. color: #f56c6c;
  138. top: 2px;
  139. position: relative;
  140. "
  141. ></i>
  142. </el-tooltip>
  143. </div>
  144. </template>
  145. <template slot-scope="scope">
  146. <div>{{ scope.row.avgBuyAmount }}元</div>
  147. </template>
  148. </el-table-column>
  149. <!-- <el-table-column
  150. align="center"
  151. prop="totalNum"
  152. sortable="custom"
  153. width="140px"
  154. >
  155. <template slot="header" slot-scope="slot">
  156. <div class="titleCell">
  157. <span>总人数</span>
  158. <el-tooltip placement="top" popper-class="mTooltip">
  159. <div slot="content">
  160. 进行中乐团在读学员+VIP、网管有课学员总数(除弦乐声部、去重)
  161. </div>
  162. <i
  163. class="el-icon-question micon el-tooltip"
  164. style="
  165. font-size: 18px;
  166. color: #f56c6c;
  167. top: 2px;
  168. position: relative;
  169. "
  170. ></i>
  171. </el-tooltip>
  172. </div>
  173. </template>
  174. <template slot-scope="scope">
  175. <div>{{ scope.row.totalNum }}人</div>
  176. </template>
  177. </el-table-column> -->
  178. <!-- <el-table-column
  179. align="center"
  180. prop="buyScale"
  181. sortable="custom"
  182. width="150px"
  183. >
  184. <template slot="header" slot-scope="slot">
  185. <div class="titleCell">
  186. <span>购买率</span>
  187. <el-tooltip placement="top" popper-class="mTooltip">
  188. <div slot="content">实际交易成功人数 / 目标购买人数*100%</div>
  189. <i
  190. class="el-icon-question micon el-tooltip"
  191. style="
  192. font-size: 18px;
  193. color: #f56c6c;
  194. top: 2px;
  195. position: relative;
  196. "
  197. ></i>
  198. </el-tooltip>
  199. </div>
  200. </template>
  201. <template slot-scope="scope">
  202. <div>{{ scope.row.buyScale }}%</div>
  203. </template>
  204. </el-table-column> -->
  205. <el-table-column align="center" prop="targetNum" sortable="custom" width="150px">
  206. <template slot="header" slot-scope="slot">
  207. <div class="titleCell">
  208. <span>目标人数</span>
  209. <el-tooltip placement="top" popper-class="mTooltip">
  210. <div slot="content">
  211. 进行中非会员乐团-已上乐团课小于等于4节学员-非本活动购买会员-弦乐声部学员
  212. </div>
  213. <i
  214. class="el-icon-question micon el-tooltip"
  215. style="
  216. font-size: 18px;
  217. color: #f56c6c;
  218. top: 2px;
  219. position: relative;
  220. "
  221. ></i>
  222. </el-tooltip>
  223. </div>
  224. </template>
  225. <template slot-scope="scope">
  226. <div>{{ scope.row.targetNum }}人</div>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. align="center"
  231. prop="targetFinishScale"
  232. sortable="custom"
  233. width="150px"
  234. >
  235. <template slot="header" slot-scope="slot">
  236. <div class="titleCell">
  237. <span>目标达成率</span>
  238. <el-tooltip placement="top" popper-class="mTooltip">
  239. <div slot="content">
  240. 该分部实际交易成功人数 / 目标人数*100%
  241. </div>
  242. <i
  243. class="el-icon-question micon el-tooltip"
  244. style="
  245. font-size: 18px;
  246. color: #f56c6c;
  247. top: 2px;
  248. position: relative;
  249. "
  250. ></i>
  251. </el-tooltip>
  252. </div>
  253. </template>
  254. <template slot-scope="scope">
  255. <div>{{ scope.row.targetFinishScale }}%</div>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. align="center"
  260. prop="targetAmount"
  261. sortable="custom"
  262. label='目标金额'
  263. width="150px"
  264. >
  265. <template slot-scope="scope">
  266. <div>{{ scope.row.targetAmount | moneyFormat}}元</div>
  267. </template>
  268. </el-table-column>
  269. <el-table-column
  270. align="center"
  271. prop="targetAmountFinishScale"
  272. sortable="custom"
  273. width="170px"
  274. >
  275. <template slot="header" slot-scope="slot">
  276. <div class="titleCell">
  277. <span>目标达金额成率</span>
  278. <el-tooltip placement="top" popper-class="mTooltip">
  279. <div slot="content">总成交额/目标总额*100%</div>
  280. <i
  281. class="el-icon-question micon el-tooltip"
  282. style="
  283. font-size: 18px;
  284. color: #f56c6c;
  285. top: 2px;
  286. position: relative;
  287. "
  288. ></i>
  289. </el-tooltip>
  290. </div>
  291. </template>
  292. <template slot-scope="scope">
  293. <div>{{ scope.row.targetAmountFinishScale }}%</div>
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="详情" align="left">
  297. <template slot-scope="scope">
  298. <div>
  299. <el-button type="text" @click="gotoDetail(scope.row)"
  300. >详情</el-button
  301. >
  302. </div>
  303. </template>
  304. </el-table-column>
  305. </el-table>
  306. <!-- <pagination
  307. sync
  308. :total.sync="rules.total"
  309. :page.sync="rules.page"
  310. :limit.sync="rules.limit"
  311. :page-sizes="rules.page_size"
  312. @pagination="getList"
  313. /> -->
  314. </div>
  315. </div>
  316. <qr-code v-model="qrcodeStatus" title="统计二维码" :codeUrl="codeUrl" />
  317. </div>
  318. </template>
  319. <script>
  320. import axios from "axios";
  321. import { getToken } from "@/utils/auth";
  322. import pagination from "@/components/Pagination/index";
  323. import QrCode from "@/components/QrCode/index";
  324. import { vaildTeachingUrl } from "@/utils/validate";
  325. import { getCountCloudTeacherList } from "./api";
  326. import { Export } from "@/utils/downLoadFile";
  327. import cleanDeep from "clean-deep";
  328. import qs from "qs";
  329. export default {
  330. components: { pagination, QrCode },
  331. data() {
  332. return {
  333. searchForm: {
  334. organId: null,
  335. },
  336. searchList: { sort: "targetFinishScale", order: "DESC" },
  337. head: {
  338. avgBuyAmount: null,
  339. buyAmount: null,
  340. buyNum: null,
  341. buyScale: null,
  342. targetAmount: null,
  343. targetFinishScale: null,
  344. targetNum: null,
  345. totalNum: null,
  346. },
  347. tableList: [],
  348. organList: [],
  349. rules: {
  350. // 分页规则
  351. limit: 10, // 限制显示条数
  352. page: 1, // 当前页
  353. total: 0, // 总条数
  354. page_size: [10, 20, 40, 50], // 选择限制显示条数
  355. },
  356. qrcodeStatus: false,
  357. codeUrl: "",
  358. };
  359. },
  360. //生命周期 - 创建完成(可以访问当前this实例)
  361. created() {},
  362. //生命周期 - 挂载完成(可以访问DOM元素)
  363. async mounted() {
  364. // 获取分部
  365. await this.$store.dispatch("setBranchs");
  366. this.init();
  367. },
  368. methods: {
  369. init() {
  370. this.getList();
  371. },
  372. async getList() {
  373. try {
  374. const res = await getCountCloudTeacherList({
  375. organIds: this.searchForm.organId,
  376. ...this.searchList,
  377. });
  378. this.tableList = res.data.resultList;
  379. this.head = res.data.head;
  380. } catch (e) {
  381. console.log(e);
  382. }
  383. },
  384. search() {
  385. this.rules.page = 1;
  386. this.getList();
  387. },
  388. onReSet() {
  389. this.searchForm.organId = null;
  390. this.searchList = { sort: "targetFinishScale", order: "DESC" };
  391. this.search();
  392. },
  393. sortChang(val) {
  394. const dates = {
  395. ascending: "ASC",
  396. descending: "DESC",
  397. };
  398. this.searchList = {};
  399. if (val.prop && val.order) {
  400. this.searchList = { sort: val.prop, order: dates[val.order] };
  401. // this.searchList[val.prop] = dates[val.order];
  402. }
  403. this.rules.page = 1;
  404. this.getList();
  405. },
  406. onCreateQRCode(row) {
  407. // 生成报名二维码
  408. this.qrcodeStatus = true;
  409. this.codeUrl = vaildTeachingUrl() + "/#/statisticOctober1st";
  410. },
  411. gotoDetail(row) {
  412. // console.log('跳转详情')
  413. this.$router.push({
  414. path: "/operateManager/memberActiveDetail",
  415. query: { organId: row.organId, organName: row.organName },
  416. });
  417. },
  418. async onExport() {
  419. let obj = {
  420. organIds: this.searchForm.organId,
  421. ...this.searchList,
  422. };
  423. await Export(
  424. this,
  425. {
  426. url: "/api-web/export/countCloudTeacherActive",
  427. fileName: "2021十一会员活动.xls",
  428. method: "post",
  429. params: qs.stringify(cleanDeep(obj)),
  430. },
  431. "您确定导出会员活动列表?"
  432. );
  433. },
  434. },
  435. };
  436. </script>
  437. <style lang='scss' scoped>
  438. .titleCell {
  439. display: inline-block;
  440. }
  441. .tableWrap {
  442. margin-top: 20px;
  443. }
  444. .qrcode {
  445. display: flex;
  446. flex-direction: column;
  447. align-items: center;
  448. img {
  449. width: 200px;
  450. height: 200px;
  451. margin: 0 auto;
  452. }
  453. }
  454. .code-url {
  455. font-size: 18px;
  456. text-align: center;
  457. padding: 15px 15px 0 15px;
  458. }
  459. </style>