list.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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-input size="small" style="width: 200px" v-model="search.keyword" placeholder="请输入会员昵称、id、手机号"></el-input>
  21. </div>
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">发放时间:</div>
  24. <el-date-picker
  25. size="small"
  26. v-model="time"
  27. type="datetimerange"
  28. value-format="yyyy-MM-dd HH:mm:ss"
  29. range-separator="至"
  30. start-placeholder="开始日期"
  31. end-placeholder="结束日期">
  32. </el-date-picker>
  33. </div>
  34. <div class="item-box" flex="dir:left cross:center">
  35. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  36. </el-button>
  37. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="exportHandle">导出
  38. </el-button>
  39. </div>
  40. </el-form>
  41. <el-tabs v-model="activeName" @tab-click="handleClick">
  42. <el-table :data="list" v-loading="loading" size="small" style="margin-bottom: 15px;"
  43. @selection-change="handleSelectionChange">
  44. <el-table-column label="周期ID" prop="grant_id" align="center"></el-table-column>
  45. <!-- <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column> -->
  46. <!-- <el-table-column-->
  47. <!-- prop="avatar_url,nickname"-->
  48. <!-- label="会员"-->
  49. <!-- min-width="200">-->
  50. <!-- <template slot-scope="scope">-->
  51. <!-- <div flex="box:first">-->
  52. <!-- <div style="padding-right: 10px;">-->
  53. <!-- <com-image mode="aspectFill" :src="scope.row.avatar_url"></com-image>-->
  54. <!-- </div>-->
  55. <!-- <div flex="cross:top cross:center">-->
  56. <!-- {{scope.row.nickname}}&nbsp;&nbsp;&nbsp;:{{scope.row.user_id}}-->
  57. <!-- </div>-->
  58. <!-- </div>-->
  59. <!-- </template>-->
  60. <!-- </el-table-column>-->
  61. <el-table-column label="基本信息" width="200px">
  62. <template slot-scope="scope">
  63. <div class="user_img" flex="cross:center">
  64. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  65. <div slot="error" class="image-slot">
  66. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  67. </div>
  68. </el-image>
  69. <div class="table-info-text" style="margin-left:5px;">
  70. <div class="uer-nickname over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  71. <div>ID:{{scope.row.user_id}}</div>
  72. </div>
  73. <!-- <div class="uer-nickname over1" >ID:{{scope.row.user_id}}</div> -->
  74. </div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="手机号" prop="mobile" align="center" >
  78. <template slot-scope="scope">
  79. <div>{{scope.row.user.mobile}}</div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="发放时间" prop="created_at" min-width="160" align="center">
  83. <template slot-scope="scope">
  84. <div >{{scope.row.grantLog.settlement_time|dateTimeFormat('Y-m-d H:i:s')}}</div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="总业绩(元)" prop="achievement_sum" align="center">
  88. <template slot-scope="scope">
  89. <div>{{scope.row.achievement_sum?scope.row.achievement_sum:'0.00'}}</div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="团队业绩(元)" prop="team_achievement" align="center">
  93. <template slot-scope="scope">
  94. <div>{{scope.row.team_achievement?scope.row.team_achievement:'0.00'}}</div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="个人业绩(元)" prop="personal_achievement" align="center">
  98. <template slot-scope="scope">
  99. <div v-if="scope.row.grantLog.is_team_achievement != 1">{{scope.row.personal_achievement?scope.row.personal_achievement:'0.00'}}</div>
  100. <div v-else>0.00</div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="奖励比例" prop="award_proportion" align="center">
  104. <template slot-scope="scope">
  105. <div>{{scope.row.award_proportion?scope.row.award_proportion:'0.00'}}%</div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="平级奖励" prop="equal_money" align="center">
  109. <template slot-scope="scope">
  110. <div class="award-money" v-if="scope.row.equal_money*1>0">+{{scope.row.equal_money}}</div>
  111. <div class="award-money" v-if="scope.row.equal_money*1<0">-{{scope.row.equal_money}}</div>
  112. <div class="award-money" v-if="scope.row.equal_money*1==0">{{'0.00'}}</div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="结算金额" prop="edit_award_money" align="center">
  116. <template slot-scope="scope">
  117. <div class="award-money" v-if="scope.row.edit_award_money*1>0">+{{scope.row.edit_award_money}}</div>
  118. <div class="award-money" v-if="scope.row.edit_award_money*1<0">-{{scope.row.edit_award_money}}</div>
  119. <div class="award-money" v-if="scope.row.edit_award_money*1==0">{{'0.00'}}</div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="现结算金额" prop="award_money" align="center">
  123. <template slot-scope="scope">
  124. <div class="award-money" v-if="scope.row.award_money*1>0">+{{scope.row.award_money}}</div>
  125. <div class="award-money" v-if="scope.row.award_money*1<0">-{{scope.row.award_money}}</div>
  126. <div class="award-money" v-if="scope.row.award_money*1==0">{{'0.00'}}</div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="结算状态" prop="is_settlement" align="center">
  130. <template slot-scope="scope">
  131. <div>
  132. {{
  133. scope.row.is_skip_settlement === 1
  134. ? '不结算'
  135. : scope.row.is_settlement === 1
  136. ? '已结算'
  137. : '未结算'
  138. }}
  139. </div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column
  143. fixed="right"
  144. label="操作"
  145. align="center"
  146. min-width="120">
  147. <template slot-scope="scope">
  148. <el-button
  149. v-if="scope.row.grantLog.is_wait == 1
  150. && scope.row.grantLog.is_settlement == 0
  151. && !scope.row.updateLog
  152. && scope.row.is_skip_settlement == 0
  153. && scope.row.grantLog.is_award_need_confirm == 1
  154. && scope.row.grantLog.is_leader_first_month_no_award == 1"
  155. @click="toUpdateAwardMoney(scope.row)"
  156. type="text"
  157. size="small"
  158. >
  159. 修改结算金额
  160. </el-button>
  161. <span v-else>-</span>
  162. </template>
  163. </el-table-column>
  164. <!-- <el-table-column label="总计" prop="award_sum" align="center">-->
  165. <!-- <template slot-scope="scope">-->
  166. <!-- <div>{{scope.row.award_sum?scope.row.award_sum:'0.00'}}</div>-->
  167. <!-- </template>-->
  168. <!-- </el-table-column>-->
  169. </el-table>
  170. </el-tabs>
  171. <!-- 分页器 -->
  172. <div flex="box:last cross:center">
  173. <div></div>
  174. <div>
  175. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  176. style="display: inline-block;float: right;" background @current-change="pageChange"
  177. layout="prev, pager, next" :total="pagination.totalCount">
  178. </el-pagination>
  179. </div>
  180. </div>
  181. </div>
  182. <!-- 修改结算金额 -->
  183. <el-dialog :visible.sync="editDialogVisible" title="修改业绩结算金额" @close="editDialogVisible = false" width="30%">
  184. <div style="text-align: center">
  185. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" size="small">
  186. <el-form-item label="" prop="custom_name">
  187. <el-input placeholder="请输入奖励金额" size="small" style="width:300px;"
  188. v-model="ruleForm.award_money"
  189. type="text"
  190. onInput="value=toNumber(value,2)"
  191. autocomplete="off">
  192. <template slot="append">元</template>
  193. </el-input>
  194. </el-form-item>
  195. </el-form>
  196. </div>
  197. <span slot="footer" class="dialog-footer">
  198. <el-button @click="editDialogVisible = false">取消</el-button>
  199. <el-button type="primary" @click="sendUpdateAwardMoney">确定</el-button>
  200. </span>
  201. </el-dialog>
  202. </el-card>
  203. </div>
  204. <script>
  205. const app = new Vue({
  206. el: '#app',
  207. data: {
  208. page:1,
  209. time:[], //本地存时间,请求时不发送
  210. search: {
  211. grant_id : '',
  212. keyword:'',
  213. date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
  214. date_start : '',
  215. },
  216. loading: false,
  217. activeName: '-1',
  218. list: [], //列表数据
  219. pagination: null,
  220. editDialogVisible: false,
  221. ruleForm: {
  222. 'id': null,
  223. 'award_money': null
  224. },
  225. rules: {
  226. },
  227. },
  228. mounted() {
  229. this.search.grant_id = getQuery('id');
  230. // 获取列表首页数据
  231. this.loadData(this.page,this.search); //获取列表数据
  232. },
  233. methods: {
  234. // 1.0 获取视频列表
  235. loadData(page,others) {
  236. this.loading = true;
  237. console.log(this.search);
  238. if(!this.time){
  239. this.search.date_start = '';
  240. this.search.date_end = '';
  241. }else{
  242. this.search.date_start = this.time[0];
  243. this.search.date_end = this.time[1];
  244. }
  245. request({
  246. method: 'get',
  247. params: {
  248. r: 'achievement/default/list',
  249. page: page,
  250. ...others, //其他搜索字段
  251. },
  252. }).then(e => {
  253. this.loading = false;
  254. if (e.data.code === 0) {
  255. this.list = e.data.data.list;
  256. this.pagination = e.data.data.pagination;
  257. } else {
  258. this.$message.error(e.data.msg);
  259. }
  260. }).catch(e => {
  261. });
  262. },
  263. pageChange(page) {
  264. this.page = page;
  265. this.loadData(this.page,this.search);
  266. },
  267. handleClick(tab, event) {
  268. this.page = 1;
  269. this.search.status = this.activeName;
  270. this.loadData(this.page,this.search)
  271. },
  272. handleSelectionChange(val) {
  273. let self = this;
  274. self.choose_list = [];
  275. val.forEach(function (item) {
  276. self.choose_list.push(item.id);
  277. })
  278. },
  279. searchs() {
  280. this.page = 1;
  281. this.loadData(this.page,this.search);
  282. },
  283. toUpdateAwardMoney(data){
  284. this.editDialogVisible = true;
  285. this.ruleForm.id = data.id;
  286. this.ruleForm.award_money = data.award_money;
  287. },
  288. sendUpdateAwardMoney(){
  289. this.detaillLoading = true;
  290. request({
  291. params: {
  292. r: 'achievement/default/update-grant-award',
  293. },
  294. method: 'post',
  295. data: {
  296. id: this.ruleForm.id,
  297. award_money: this.ruleForm.award_money,
  298. },
  299. }).then(e => {
  300. this.detaillLoading = false;
  301. if (e.data.code == 0) {
  302. this.$message.success(e.data.msg);
  303. this.editDialogVisible = false;
  304. this.searchs();
  305. } else {
  306. this.$message.error(e.data.msg);
  307. }
  308. })
  309. },
  310. exportHandle(){
  311. request({
  312. method: 'post',
  313. params: {
  314. r: 'achievement/default/list',
  315. },
  316. data: {
  317. flag: 'EXPORT',
  318. ...this.search, //其他搜索字段
  319. },
  320. }).then(e => {
  321. this.loading = false;
  322. if (e.data.code === 0) {
  323. this.$message.success(e.data.msg);
  324. } else {
  325. this.$message.error(e.data.msg);
  326. }
  327. }).catch(e => {
  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. .form-nickname{
  390. width: 180px;
  391. white-space:nowrap;
  392. overflow:hidden;
  393. text-overflow:ellipsis;
  394. }
  395. .index-video-url{
  396. width: 300px;
  397. }
  398. .index-video-url video{
  399. width: 100%;
  400. }
  401. .index-related-info{
  402. width: 500px;
  403. }
  404. .video-top{
  405. width: 100%;
  406. display: flex;
  407. align-items: flex-start;
  408. box-sizing: border-box;
  409. padding: 20px;
  410. /* opacity: .5; */
  411. background-color: #FFFFFF;
  412. }
  413. .video-top .top-right{
  414. line-height: 26px;
  415. }
  416. .video-top .top-right .top-title{
  417. font-size: 18px;
  418. white-space:nowrap;
  419. overflow:hidden;
  420. text-overflow:ellipsis;
  421. width: 360px;
  422. }
  423. .video-top .top-right .wrapper{
  424. display: flex;
  425. /* align-items: flex-start; */
  426. }
  427. .video-top .top-right .wrapper .to-copy{
  428. /* color: #03C5FF; */
  429. margin-left: 20px;
  430. }
  431. .video-top .top-right .detail-price{
  432. color: #BC0100;
  433. font-size: 18px;
  434. font-family: Microsoft YaHei;
  435. font-weight: bold;
  436. }
  437. /* .atooltip {
  438. background: #FFFFFF !important;
  439. border: none !important;
  440. } */
  441. .el-table th>.cell{
  442. color: #333;
  443. font-weight: bold;
  444. font-size: 14px;
  445. }
  446. .el-table__footer-wrapper, .el-table__header-wrapper{
  447. border-bottom: 1.4px solid #D6D6D6;
  448. }
  449. .award-money{
  450. color: #BC0100;
  451. }
  452. .table-info-img{
  453. width:50px;
  454. }
  455. </style>