log.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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. use common\helpers\ComponentHelper;
  11. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  12. ?>
  13. <style>
  14. .order_stat{
  15. background: #FFF;
  16. padding: 10px 10px 0;
  17. margin-bottom: 10px;
  18. }
  19. .title{
  20. font-size: 18px;
  21. font-weight: bold;
  22. display: flex;
  23. align-items: center;
  24. height: 40px;
  25. display: flex;
  26. justify-content: space-between;
  27. }
  28. .order_stat > .title > .time{
  29. font-size: 13px;
  30. font-weight: 400;
  31. color: #BFBFBF;
  32. margin-left: 20px;
  33. flex: 1;
  34. }
  35. .order_stat .stat_details{
  36. padding: 30px 0;
  37. display: flex;
  38. }
  39. .default-avatar{
  40. width: 50px;
  41. height: 50px;
  42. border-radius: 50%;
  43. margin-right: 8px;
  44. }
  45. .uer-nickname {
  46. flex: 1;
  47. }
  48. .user_img{
  49. position: relative;
  50. margin-right: 8px;
  51. /* height: 50px;
  52. width: 50px; */
  53. }
  54. </style>
  55. <div id="app" v-cloak>
  56. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  57. <div slot="header" class="title">
  58. <span>核销统计</span>
  59. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="search" @selected="exportConfirm"></com-export-dialog>
  60. </div>
  61. <div class="table-body">
  62. <el-form size="small" :inline="true" flex="dir:left cross:center">
  63. <div class="item-box" flex="dir:left cross:center">
  64. <el-input size="small" style="width: 200px;margin-right: 10px;" type="text" v-model="search.user_keyward" placeholder="请输入核销员id/昵称/手机号"></el-input>
  65. <el-input size="small" style="width: 200px;margin-right: 10px;" type="text" v-model="search.w_user_keyward" placeholder="请输入核销用户id/昵称/手机号"></el-input>
  66. <el-input size="small" style="width: 200px;margin-right: 10px;" type="text" v-model="search.order_no" placeholder="请输入订单号"></el-input>
  67. <el-select clearable size="small" v-model="search.capital_type" class="select" placeholder="请选择奖励类型" style="margin-right: 10px;"><!-- @change='toSearch' -->
  68. <el-option :key="index" :label="item" :value="index" v-for="(item, index) in capital_type_list"></el-option>
  69. </el-select>
  70. <el-date-picker
  71. style="margin-right: 10px;"
  72. size="small"
  73. v-model="selectData2"
  74. type="daterange"
  75. value-format="yyyy-MM-dd"
  76. range-separator="至"
  77. start-placeholder="开始日期"
  78. end-placeholder="结束日期">
  79. </el-date-picker>
  80. </div>
  81. <div class="item-box" flex="dir:left cross:center">
  82. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  83. </el-button>
  84. </div>
  85. </el-form>
  86. <el-tabs v-model="activeName" @tab-click="handleClick">
  87. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  88. @selection-change="handleSelectionChange">
  89. <el-table-column label="核销员ID" prop="user_id" align="center">
  90. <template slot-scope="scope">
  91. <div>{{scope.row.user.id}}</div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. label="核销员"
  96. min-width="150"
  97. >
  98. <template slot-scope="scope">
  99. <div class="table-info-img-text">
  100. <el-image class="table-info-img circle" v-if="scope.row.user.avatar_url" :src="scope.row.user.avatar_url">
  101. <div slot="error" class="image-slot">
  102. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  103. </div>
  104. </el-image>
  105. <div class="table-info-text">
  106. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  107. <div>{{scope.row.user.mobile}}</div>
  108. </div>
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <!-- <el-table-column label="等级" prop="goods_id" align="center">
  113. <template slot-scope="scope">
  114. <div>{{scope.row.user.level_name}}</div>
  115. </template>
  116. </el-table-column> -->
  117. <el-table-column label="核销/下单用户ID" prop="user_id" align="center">
  118. <template slot-scope="scope">
  119. <div v-if="scope.row.w_user">{{scope.row.w_user.id}}</div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. label="核销/下单用户"
  124. min-width="150"
  125. >
  126. <template slot-scope="scope">
  127. <div class="table-info-img-text" v-if="scope.row.w_user">
  128. <el-image class="table-info-img circle" v-if="scope.row.w_user.avatar_url" :src="scope.row.w_user.avatar_url">
  129. <div slot="error" class="image-slot">
  130. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  131. </div>
  132. </el-image>
  133. <div class="table-info-text">
  134. <div v-if="scope.row.w_user.nickname">{{scope.row.w_user.nickname}}</div>
  135. <div>{{scope.row.w_user.mobile}}</div>
  136. </div>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="所属门店" prop="store_name" align="center">
  141. <template slot-scope="scope">
  142. <div>{{scope.row.store_name}}</div>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="奖励类型" prop="capital_type" align="center">
  146. <template slot-scope="scope">
  147. <div>{{scope.row.capital_type}}</div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="佣金" prop="change_num" align="center">
  151. <template slot-scope="scope">
  152. <div>{{scope.row.change_num}}</div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="订单号" prop="order_no" align="center">
  156. <template slot-scope="scope">
  157. <div>{{scope.row.order_no}}</div>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="创建时间" prop="created_at" min-width="160" align="center">
  161. <template slot-scope="scope">
  162. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  163. </template>
  164. </el-table-column>
  165. </el-table>
  166. </el-tabs>
  167. <!-- 分页器 -->
  168. <div flex="box:last cross:center">
  169. <div></div>
  170. <div>
  171. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  172. style="display: inline-block;float: right;" background @current-change="pageChange"
  173. layout="prev, pager, next" :total="pagination.totalCount">
  174. </el-pagination>
  175. </div>
  176. </div>
  177. </div>
  178. <!-- 这个是复制用的容器,已隐藏 -->
  179. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  180. </el-card>
  181. </div>
  182. <script>
  183. const app = new Vue({
  184. el: '#app',
  185. data: {
  186. page:1,
  187. avatar: '',
  188. nickname: '',
  189. time:[], //本地存时间,请求时不发送
  190. search: {
  191. w_user_keyword : '',
  192. user_keyward : '',
  193. capital_type: '',
  194. order_no: '',
  195. start:'',
  196. end:'',
  197. status:1,
  198. },
  199. loading: false,
  200. activeName: '-1',
  201. list: [], //列表数据
  202. pagination: null,
  203. selectData2:'',
  204. capital_type_list:[],
  205. status:1,
  206. export_url: 'write-off/default/log',
  207. exportList:{},
  208. },
  209. mounted() {
  210. // 获取列表首页数据
  211. this.loadData(this.page,this.search); //获取列表数据
  212. },
  213. methods: {
  214. loadData(page,others) {
  215. this.loading = true;
  216. console.log(this.search);
  217. if(this.selectData2 && this.selectData2[0]){
  218. this.search.start = this.selectData2[0];
  219. this.search.end = this.selectData2[1];
  220. }else{
  221. this.search.start = '';
  222. this.search.end = '';
  223. }
  224. request({
  225. method: 'get',
  226. params: {
  227. r: 'write-off/default/log',
  228. page: page,
  229. ...others, //其他搜索字段
  230. },
  231. }).then(e => {
  232. this.loading = false;
  233. if (e.data.code === 0) {
  234. this.list = e.data.data.list;
  235. this.capital_type_list = e.data.data.capital_type_list;
  236. this.exportList = e.data.data.export_list;
  237. this.pagination = e.data.data.pagination;
  238. } else {
  239. this.$message.error(e.data.msg);
  240. }
  241. }).catch(e => {
  242. });
  243. },
  244. toDetail(id){
  245. console.log(id)
  246. this.$navigate({
  247. r: 'mall/order/detail',
  248. order_id: id
  249. })
  250. },
  251. pageChange(page) {
  252. this.page = page;
  253. this.loadData(this.page,this.search);
  254. },
  255. handleClick(tab, event) {
  256. this.page = 1;
  257. this.search.status = this.activeName;
  258. this.loadData(this.page,this.search)
  259. },
  260. handleSelectionChange(val) {
  261. let self = this;
  262. self.choose_list = [];
  263. val.forEach(function (item) {
  264. self.choose_list.push(item.id);
  265. })
  266. },
  267. searchs() {
  268. this.page = 1;
  269. this.loadData(this.page,this.search);
  270. },
  271. exportConfirm() {
  272. if(this.selectData2 && this.selectData2[0]){
  273. this.search.start = this.selectData2[0];
  274. this.search.end = this.selectData2[1];
  275. }else{
  276. this.search.start = '';
  277. this.search.end = '';
  278. }
  279. this.search.status = this.status
  280. },
  281. }
  282. });
  283. </script>
  284. <style>
  285. .el-tabs__header {
  286. font-size: 16px;
  287. }
  288. .table-body {
  289. padding: 20px;
  290. background-color: #fff;
  291. }
  292. .table-body .el-button {
  293. padding: 0 !important;
  294. border: 0;
  295. margin: 0 5px;
  296. }
  297. .input-item {
  298. width: 250px;
  299. margin: 0 0 20px;
  300. display: inline-block;
  301. }
  302. .input-item .el-input__inner {
  303. border-right: 0;
  304. }
  305. .input-item .el-input__inner:hover {
  306. border: 1px solid #dcdfe6;
  307. border-right: 0;
  308. outline: 0;
  309. }
  310. .input-item .el-input__inner:focus {
  311. border: 1px solid #dcdfe6;
  312. border-right: 0;
  313. outline: 0;
  314. }
  315. .input-item .el-input-group__append {
  316. background-color: #fff;
  317. border-left: 0;
  318. width: 10%;
  319. padding: 0;
  320. }
  321. .input-item .el-input-group__append .el-button {
  322. padding: 0;
  323. }
  324. .input-item .el-input-group__append .el-button {
  325. margin: 0;
  326. }
  327. .batch {
  328. margin: 0 0 20px;
  329. display: inline-block;
  330. }
  331. .batch .el-button {
  332. padding: 9px 15px !important;
  333. }
  334. .item-box{
  335. margin-right: 20px;
  336. }
  337. .item-box .label{
  338. margin-right: 8px;
  339. }
  340. .item-box .symbol{
  341. margin: 0 6px;
  342. }
  343. .form-nickname{
  344. width: 180px;
  345. white-space:nowrap;
  346. overflow:hidden;
  347. text-overflow:ellipsis;
  348. }
  349. .index-video-url{
  350. width: 300px;
  351. }
  352. .index-video-url video{
  353. width: 100%;
  354. }
  355. .index-related-info{
  356. width: 500px;
  357. }
  358. .video-top{
  359. width: 100%;
  360. display: flex;
  361. align-items: flex-start;
  362. box-sizing: border-box;
  363. padding: 20px;
  364. /* opacity: .5; */
  365. background-color: #FFFFFF;
  366. }
  367. .video-top .top-right{
  368. line-height: 26px;
  369. }
  370. .video-top .top-right .top-title{
  371. font-size: 18px;
  372. white-space:nowrap;
  373. overflow:hidden;
  374. text-overflow:ellipsis;
  375. width: 360px;
  376. }
  377. .video-top .top-right .wrapper{
  378. display: flex;
  379. /* align-items: flex-start; */
  380. }
  381. .video-top .top-right .wrapper .to-copy{
  382. /* color: #03C5FF; */
  383. margin-left: 20px;
  384. }
  385. .video-top .top-right .detail-price{
  386. color: #BC0100;
  387. font-size: 18px;
  388. font-family: Microsoft YaHei;
  389. font-weight: bold;
  390. }
  391. /* .atooltip {
  392. background: #FFFFFF !important;
  393. border: none !important;
  394. } */
  395. .el-table th>.cell{
  396. color: #333;
  397. font-weight: bold;
  398. font-size: 14px;
  399. }
  400. .el-table__footer-wrapper, .el-table__header-wrapper{
  401. border-bottom: 1.4px solid #D6D6D6;
  402. }
  403. .price_col{
  404. color: #FF5D05;
  405. }
  406. </style>