index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>奖励总计</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="item-box" flex="dir:left cross:center">
  19. <div class="label">发放时间:</div>
  20. <el-date-picker
  21. size="small"
  22. v-model="time"
  23. type="datetimerange"
  24. value-format="yyyy-MM-dd HH:mm:ss"
  25. range-separator="至"
  26. start-placeholder="开始日期"
  27. end-placeholder="结束日期">
  28. </el-date-picker>
  29. </div>
  30. <div class="item-box" flex="dir:left cross:center">
  31. <div class="label">奖励金额:</div>
  32. <el-input size="small" style="width: 200px" type="number" v-model="search.min_money" placeholder="请输入最小奖励金额"></el-input>
  33. <div class="symbol"> - </div>
  34. <el-input size="small" style="width: 200px" type="number" v-model="search.max_money" placeholder="请输入最大奖励金额"></el-input>
  35. </div>
  36. <div class="item-box" flex="dir:left cross:center">
  37. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  38. </el-button>
  39. </div>
  40. </el-form>
  41. <div style="display: flex;margin: 20px 0">
  42. 共奖励金额:<div class="price_col">¥{{sum.award_money}}</div>,发放次数:<div class="price_col">{{sum.grant_num}}</div>,奖励人数:<div class="price_col">{{sum.award_user}}</div>
  43. </div>
  44. <el-tabs v-model="activeName" @tab-click="handleClick">
  45. <el-table :data="list" v-loading="loading" size="small" style="margin-bottom: 15px;"
  46. @selection-change="handleSelectionChange">
  47. <el-table-column label="周期ID" prop="id" align="center"></el-table-column>
  48. <el-table-column label="计算方式" prop="settlement_mode" align="center">
  49. <template slot-scope="scope">
  50. <div v-if="scope.row.settlement_mode == 0">不含极差</div>
  51. <div v-if="scope.row.settlement_mode == 1">含极差</div>
  52. <div v-if="scope.row.settlement_mode == 2">业绩极差</div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="统计方式" prop="statistical_methods" align="center">
  56. <template slot-scope="scope">
  57. <div v-if="scope.row.statistical_methods == 0">订单完成</div>
  58. <div v-else>支付完成</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="添加时间" prop="created_at" min-width="160" align="center">
  62. <template slot-scope="scope">
  63. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="发放时间" prop="created_at" min-width="160" align="center">
  67. <template slot-scope="scope">
  68. <div>{{scope.row.settlement_time|dateTimeFormat('Y-m-d H:i:s')}}</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="总业绩(元)" prop="total_performance" align="center">
  72. <template slot-scope="scope">
  73. <div>{{scope.row.total_performance}}</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="会员数量" prop="user_num" align="center">
  77. <template slot-scope="scope">
  78. <div>{{scope.row.user_num}}</div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="奖励金额(元)" prop="award_money" align="center">
  82. <template slot-scope="scope">
  83. <div>{{scope.row.award_money}}</div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="奖励比例" prop="award_proportion" align="center" >
  87. <template slot-scope="scope">
  88. <el-button type="text" @click="dialogOpen(scope.row)">比例</el-button>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. fixed="right"
  93. label="操作"
  94. align="center"
  95. width="300">
  96. <template slot-scope="scope">
  97. <el-button @click="toDetails(scope.row.id,scope.$index)" type="text" size="small">查看详情
  98. </el-button>
  99. <el-button
  100. v-if="scope.row.is_wait == 1
  101. && scope.row.is_settlement == 0
  102. && scope.row.is_award_need_confirm == 1
  103. && scope.row.settlement_time <= new Date().getTime()"
  104. @click="toGrantAchievement(scope.row)"
  105. type="text"
  106. size="small">待审核
  107. </el-button>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. </el-tabs>
  112. <!-- 分页器 -->
  113. <div flex="box:last cross:center">
  114. <div></div>
  115. <div>
  116. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  117. style="display: inline-block;float: right;" background @current-change="pageChange"
  118. layout="prev, pager, next" :total="pagination.totalCount">
  119. </el-pagination>
  120. </div>
  121. </div>
  122. </div>
  123. <!-- 这个是复制用的容器,已隐藏 -->
  124. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  125. <el-dialog
  126. :title="title"
  127. :visible.sync="dialogVisible"
  128. width="30%"
  129. >
  130. <div v-for="(item,index) in award_proportion">团队业绩达到{{item.money}}元 奖励 {{item.proportion}}%</div>
  131. <div style="margin-top: 20px;margin-bottom:10px;">商品订单奖励比例</div>
  132. <div v-loading='detaillLoading'>
  133. <el-table :data="tableData" ref="multipleTable" key='user' border
  134. style="width: 100%">
  135. <el-table-column prop="order_no" label="订单编号" width="300" align='center'>
  136. </el-table-column>
  137. <el-table-column prop="price" label="订单金额" align='center'>
  138. </el-table-column>
  139. <el-table-column prop="alone_bonus" label="奖励金额" align='center'>
  140. </el-table-column>
  141. </el-table>
  142. <div class="check_pagination flex">
  143. <el-pagination @current-change="detailPagination" background layout="prev, pager, next"
  144. :page-count="detailPageCount"></el-pagination>
  145. </div>
  146. </div>
  147. </el-dialog>
  148. <el-dialog :visible.sync="confirmDialogVisible" title="业绩审核" @close="confirmDialogVisible = false" width="50%">
  149. <div style="text-align: center">
  150. <h2>确认发放待结算金额</h2>
  151. <h4>{{awardMoney}}元</h4>
  152. </div>
  153. <span slot="footer" class="dialog-footer">
  154. <el-button @click="confirmDialogVisible = false">取消</el-button>
  155. <el-button type="primary" @click="sendGrantAchievement">确定</el-button>
  156. </span>
  157. </el-dialog>
  158. </el-card>
  159. </div>
  160. <script>
  161. const app = new Vue({
  162. el: '#app',
  163. data: {
  164. page:1,
  165. avatar: '',
  166. nickname: '',
  167. time:[], //本地存时间,请求时不发送
  168. search: {
  169. // id : '',
  170. // keyword:0,
  171. // user_id : '',
  172. // goods_id : '',
  173. // related_type : '', //否 int 关联类型1:关联商品 2:关联店铺 3:关联地址
  174. // nickname : '',
  175. // title : '',
  176. date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
  177. date_start : '',
  178. min_money : '', //最小金额
  179. max_money : '', //最大金额
  180. },
  181. loading: false,
  182. activeName: '-1',
  183. list: [], //列表数据
  184. sum: {
  185. award_money:0,
  186. award_user:0,
  187. grant_num:0,
  188. },
  189. pagination: null,
  190. dialogVisible: false,
  191. award_proportion: [],
  192. title: '',
  193. tableData:null,
  194. detailPage: 1,
  195. detailPageCount: 0,
  196. detaillLoading:false,
  197. grant_id:0,
  198. confirmDialogVisible: false,
  199. awardMoney: 0,
  200. achievement_grant_id: null,
  201. },
  202. watch: {
  203. dialogVisible: function (newVal) {
  204. if (newVal) {
  205. this.getDetail();
  206. }
  207. },
  208. },
  209. mounted() {
  210. // 获取列表首页数据
  211. this.loadData(this.page,this.search); //获取列表数据
  212. },
  213. methods: {
  214. dialogOpen(row){
  215. this.award_proportion = row.award_proportion;
  216. this.title = '周期id:'+row.id+'奖励比例';
  217. this.grant_id = row.id;
  218. this.dialogVisible = true;
  219. },
  220. //1.0 跳转详情
  221. toDetails(id,index){
  222. this.$navigate({
  223. r: 'achievement/default/list',
  224. id: id
  225. })
  226. },
  227. // 1.0 获取视频列表
  228. loadData(page,others) {
  229. this.loading = true;
  230. console.log(this.search);
  231. if(!this.time){
  232. this.search.date_start = '';
  233. this.search.date_end = '';
  234. }else{
  235. this.search.date_start = this.time[0];
  236. this.search.date_end = this.time[1];
  237. }
  238. request({
  239. method: 'get',
  240. params: {
  241. r: 'achievement/default/index',
  242. page: page,
  243. ...others, //其他搜索字段
  244. },
  245. }).then(e => {
  246. this.loading = false;
  247. console.log(e.data.data.list)
  248. if (e.data.code === 0) {
  249. this.list = e.data.data.list.list;
  250. this.sum = e.data.data.sum;
  251. this.pagination = e.data.data.list.pagination;
  252. } else {
  253. this.$message.error(e.data.msg);
  254. }
  255. }).catch(e => {
  256. });
  257. },
  258. pageChange(page) {
  259. this.page = page;
  260. this.loadData(this.page,this.search);
  261. },
  262. handleClick(tab, event) {
  263. this.page = 1;
  264. this.search.status = this.activeName;
  265. this.loadData(this.page,this.search)
  266. },
  267. handleSelectionChange(val) {
  268. let self = this;
  269. self.choose_list = [];
  270. val.forEach(function (item) {
  271. self.choose_list.push(item.id);
  272. })
  273. },
  274. searchs() {
  275. this.page = 1;
  276. this.loadData(this.page,this.search);
  277. },
  278. getDetail() {
  279. this.detaillLoading = true;
  280. this.tableData = null;
  281. request({
  282. params: {
  283. r: 'achievement/default/order-list',
  284. page: this.detailPage,
  285. limit: 10,
  286. grant_id: this.grant_id,
  287. },
  288. method: 'get',
  289. }).then(e => {
  290. this.detaillLoading = false;
  291. if (e.data.code == 0) {
  292. this.tableData = e.data.data.list;
  293. this.detailPageCount = e.data.data.page_count;
  294. } else {
  295. this.$message.error(e.data.msg);
  296. }
  297. })
  298. },
  299. detailPagination(currentPage) {
  300. let self = this;
  301. self.detailPage = currentPage;
  302. self.getDetail();
  303. },
  304. toGrantAchievement(data) {
  305. this.confirmDialogVisible = true;
  306. this.awardMoney = data.award_money;
  307. this.achievement_grant_id = data.id;
  308. },
  309. sendGrantAchievement() {
  310. this.detaillLoading = true;
  311. request({
  312. params: {
  313. r: 'achievement/default/to-grant-achievement',
  314. },
  315. method: 'post',
  316. data: {
  317. id: this.achievement_grant_id,
  318. },
  319. }).then(e => {
  320. this.detaillLoading = false;
  321. if (e.data.code == 0) {
  322. this.$message.success(e.data.msg);
  323. this.confirmDialogVisible = false;
  324. this.searchs();
  325. } else {
  326. this.$message.error(e.data.msg);
  327. }
  328. })
  329. },
  330. }
  331. });
  332. </script>
  333. <style>
  334. .el-tabs__header {
  335. font-size: 16px;
  336. }
  337. .table-body {
  338. padding: 20px;
  339. background-color: #fff;
  340. }
  341. .table-body .el-button {
  342. padding: 0 !important;
  343. border: 0;
  344. margin: 0 5px;
  345. }
  346. .input-item {
  347. width: 250px;
  348. margin: 0 0 20px;
  349. display: inline-block;
  350. }
  351. .input-item .el-input__inner {
  352. border-right: 0;
  353. }
  354. .input-item .el-input__inner:hover {
  355. border: 1px solid #dcdfe6;
  356. border-right: 0;
  357. outline: 0;
  358. }
  359. .input-item .el-input__inner:focus {
  360. border: 1px solid #dcdfe6;
  361. border-right: 0;
  362. outline: 0;
  363. }
  364. .input-item .el-input-group__append {
  365. background-color: #fff;
  366. border-left: 0;
  367. width: 10%;
  368. padding: 0;
  369. }
  370. .input-item .el-input-group__append .el-button {
  371. padding: 0;
  372. }
  373. .input-item .el-input-group__append .el-button {
  374. margin: 0;
  375. }
  376. .batch {
  377. margin: 0 0 20px;
  378. display: inline-block;
  379. }
  380. .batch .el-button {
  381. padding: 9px 15px !important;
  382. }
  383. .item-box{
  384. margin-right: 20px;
  385. }
  386. .item-box .label{
  387. margin-right: 8px;
  388. }
  389. .item-box .symbol{
  390. margin: 0 6px;
  391. }
  392. .form-nickname{
  393. width: 180px;
  394. white-space:nowrap;
  395. overflow:hidden;
  396. text-overflow:ellipsis;
  397. }
  398. .index-video-url{
  399. width: 300px;
  400. }
  401. .index-video-url video{
  402. width: 100%;
  403. }
  404. .index-related-info{
  405. width: 500px;
  406. }
  407. .video-top{
  408. width: 100%;
  409. display: flex;
  410. align-items: flex-start;
  411. box-sizing: border-box;
  412. padding: 20px;
  413. /* opacity: .5; */
  414. background-color: #FFFFFF;
  415. }
  416. .video-top .top-right{
  417. line-height: 26px;
  418. }
  419. .video-top .top-right .top-title{
  420. font-size: 18px;
  421. white-space:nowrap;
  422. overflow:hidden;
  423. text-overflow:ellipsis;
  424. width: 360px;
  425. }
  426. .video-top .top-right .wrapper{
  427. display: flex;
  428. /* align-items: flex-start; */
  429. }
  430. .video-top .top-right .wrapper .to-copy{
  431. /* color: #03C5FF; */
  432. margin-left: 20px;
  433. }
  434. .video-top .top-right .detail-price{
  435. color: #BC0100;
  436. font-size: 18px;
  437. font-family: Microsoft YaHei;
  438. font-weight: bold;
  439. }
  440. /* .atooltip {
  441. background: #FFFFFF !important;
  442. border: none !important;
  443. } */
  444. .el-table th>.cell{
  445. color: #333;
  446. font-weight: bold;
  447. font-size: 14px;
  448. }
  449. .el-table__footer-wrapper, .el-table__header-wrapper{
  450. border-bottom: 1.4px solid #D6D6D6;
  451. }
  452. .price_col{
  453. color: #FF5D05;
  454. }
  455. </style>